From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: alex@alex.org.uk, agraf@suse.de, sergio.g.delreal@gmail.com
Subject: [Qemu-devel] [PATCH 06/10] i386: hvf: abort on decoding error
Date: Tue, 3 Oct 2017 15:45:36 +0200 [thread overview]
Message-ID: <20171003134540.21625-7-pbonzini@redhat.com> (raw)
In-Reply-To: <20171003134540.21625-1-pbonzini@redhat.com>
Rather than unsupported situations, some VM_PANIC calls actually
are caused by internal errors. Convert them to just abort.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/hvf/hvf.c | 2 +-
target/i386/hvf/x86_emu.c | 10 ++++------
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
index ae3ecad2a4..f2dc37d826 100644
--- a/target/i386/hvf/hvf.c
+++ b/target/i386/hvf/hvf.c
@@ -767,7 +767,7 @@ int hvf_vcpu_exec(CPUState *cpu)
env->hvf_emul->fetch_rip = rip;
decode_instruction(env, &decode);
- VM_PANIC_ON(ins_len != decode.len);
+ assert(ins_len == decode.len);
exec_instruction(env, &decode);
store_regs(cpu);
diff --git a/target/i386/hvf/x86_emu.c b/target/i386/hvf/x86_emu.c
index 3a995fe687..63c2b5a54d 100644
--- a/target/i386/hvf/x86_emu.c
+++ b/target/i386/hvf/x86_emu.c
@@ -146,7 +146,7 @@ addr_t read_reg(CPUX86State *env, int reg, int size)
case 8:
return env->hvf_emul->regs[reg].rrx;
default:
- VM_PANIC_ON("read_reg size");
+ abort();
}
return 0;
}
@@ -167,7 +167,7 @@ void write_reg(CPUX86State *env, int reg, addr_t val, int size)
env->hvf_emul->regs[reg].rrx = val;
break;
default:
- VM_PANIC_ON("write_reg size");
+ abort();
}
}
@@ -189,8 +189,7 @@ addr_t read_val_from_reg(addr_t reg_ptr, int size)
val = *(uint64_t *)reg_ptr;
break;
default:
- VM_PANIC_ON_EX(1, "read_val: Unknown size %d\n", size);
- break;
+ abort();
}
return val;
}
@@ -211,8 +210,7 @@ void write_val_to_reg(addr_t reg_ptr, addr_t val, int size)
*(uint64_t *)reg_ptr = val;
break;
default:
- VM_PANIC("write_val: Unknown size\n");
- break;
+ abort();
}
}
--
2.13.6
next prev parent reply other threads:[~2017-10-03 13:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-03 13:45 [Qemu-devel] [RFH PATCH 00/10] i386: hvf: miscellaneous cleanups Paolo Bonzini
2017-10-03 13:45 ` [Qemu-devel] [PATCH 01/10] i386: hvf: move all hvf files in the same directory Paolo Bonzini
2017-10-03 13:45 ` [Qemu-devel] [PATCH 02/10] i386: hvf: header cleanup Paolo Bonzini
2017-10-03 13:45 ` [Qemu-devel] [PATCH 03/10] i386: hvf: unify register enums between HVF and the rest Paolo Bonzini
2017-10-03 13:45 ` [Qemu-devel] [PATCH 04/10] i386: hvf: remove more dead emulator code Paolo Bonzini
2017-10-03 13:45 ` [Qemu-devel] [PATCH 05/10] i386: hvf: remove ZERO_INIT macro Paolo Bonzini
2017-10-03 13:45 ` Paolo Bonzini [this message]
2017-10-03 13:45 ` [Qemu-devel] [PATCH 09/10] i386: hvf: simplify and fix in/out handling Paolo Bonzini
2017-10-03 13:45 ` [Qemu-devel] [PATCH 10/10] i386: hvf: cleanup x86_gen.h Paolo Bonzini
2017-10-03 18:01 ` [Qemu-devel] [RFH PATCH 00/10] i386: hvf: miscellaneous cleanups Alex Bligh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171003134540.21625-7-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=agraf@suse.de \
--cc=alex@alex.org.uk \
--cc=qemu-devel@nongnu.org \
--cc=sergio.g.delreal@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).