From: Andrew Cooper Subject: Re: [PATCH v2 1/3] x86/hvm: Don't raise #GP behind the emulators back for MSR accesses Date: Tue, 21 Feb 2017 13:50:46 +0000 Message-ID: <2d29e446-03a4-3dd8-92c2-6ff00cc37c41@citrix.com> References: <1487586529-27092-1-git-send-email-andrew.cooper3@citrix.com> <1487586529-27092-2-git-send-email-andrew.cooper3@citrix.com> <6259e70f-8c2a-a1be-c018-d36b286e779e@oracle.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5938209846689773731==" Return-path: In-Reply-To: <6259e70f-8c2a-a1be-c018-d36b286e779e@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Boris Ostrovsky , Xen-devel Cc: Paul Durrant , Suravee Suthikulpanit List-Id: xen-devel@lists.xenproject.org --===============5938209846689773731== Content-Type: multipart/alternative; boundary="------------F846220A70658709D9627EF5" --------------F846220A70658709D9627EF5 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit On 21/02/17 13:46, Boris Ostrovsky wrote: >> diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c >> index 894c457..b864535 100644 >> --- a/xen/arch/x86/hvm/svm/svm.c >> +++ b/xen/arch/x86/hvm/svm/svm.c >> @@ -1744,7 +1744,6 @@ static int svm_msr_read_intercept(unsigned int msr, uint64_t *msr_content) >> return X86EMUL_OKAY; >> >> gpf: >> - hvm_inject_hw_exception(TRAP_gp_fault, 0); >> return X86EMUL_EXCEPTION; >> } >> >> @@ -1897,7 +1896,6 @@ static int svm_msr_write_intercept(unsigned int msr, uint64_t msr_content) >> return result; >> >> gpf: >> - hvm_inject_hw_exception(TRAP_gp_fault, 0); >> return X86EMUL_EXCEPTION; >> } > The label can be dropped with a direct return instead of a 'goto'. > Either way I will do cleanup like that into the start of the MSR levelling work, which will be bringing other changes to the functions as well. ~Andrew --------------F846220A70658709D9627EF5 Content-Type: text/html; charset="windows-1252" Content-Transfer-Encoding: 7bit
On 21/02/17 13:46, Boris Ostrovsky wrote:
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 894c457..b864535 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1744,7 +1744,6 @@ static int svm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
     return X86EMUL_OKAY;
 
  gpf:
-    hvm_inject_hw_exception(TRAP_gp_fault, 0);
     return X86EMUL_EXCEPTION;
 }
 
@@ -1897,7 +1896,6 @@ static int svm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
     return result;
 
  gpf:
-    hvm_inject_hw_exception(TRAP_gp_fault, 0);
     return X86EMUL_EXCEPTION;
 }
The label can be dropped with a direct return instead of a 'goto'.
Either way

I will do cleanup like that into the start of the MSR levelling work, which will be bringing other changes to the functions as well.

~Andrew
--------------F846220A70658709D9627EF5-- --===============5938209846689773731== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============5938209846689773731==--