summaryrefslogtreecommitdiff
path: root/target-i386
diff options
context:
space:
mode:
authorHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>2010-10-21 17:46:49 +0900
committerMarcelo Tosatti <mtosatti@redhat.com>2010-10-21 13:09:06 -0200
commitf8502cfbbf0bdd30603159a23d86cd19ad202a25 (patch)
tree181a374d7704eb3928f8ecd33b308bbf087af3ae /target-i386
parent633aa0acfe2c4d3e56acfe28c912796bf54de6d3 (diff)
downloadqemu-f8502cfbbf0bdd30603159a23d86cd19ad202a25.tar.gz
x86, mce: ignore SRAO only when MCG_SER_P is available
And restruct this block to call kvm_mce_in_exception() only when it is required. Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/kvm.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 512d533970..b813953028 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -239,12 +239,16 @@ static void kvm_do_inject_x86_mce(void *_data)
struct kvm_x86_mce_data *data = _data;
int r;
- /* If there is an MCE excpetion being processed, ignore this SRAO MCE */
- r = kvm_mce_in_exception(data->env);
- if (r == -1)
- fprintf(stderr, "Failed to get MCE status\n");
- else if (r && !(data->mce->status & MCI_STATUS_AR))
- return;
+ /* If there is an MCE exception being processed, ignore this SRAO MCE */
+ if ((data->env->mcg_cap & MCG_SER_P) &&
+ !(data->mce->status & MCI_STATUS_AR)) {
+ r = kvm_mce_in_exception(data->env);
+ if (r == -1) {
+ fprintf(stderr, "Failed to get MCE status\n");
+ } else if (r) {
+ return;
+ }
+ }
r = kvm_set_mce(data->env, data->mce);
if (r < 0) {