diff mbox

[2/2] x86/svm: Correct event injection check in svm_vmcb_restore()

Message ID 1491580247-25837-2-git-send-email-andrew.cooper3@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andrew Cooper April 7, 2017, 3:50 p.m. UTC
SVM's maximum valid event type is 4.  This appears to be a straigth copy and
paste error in c/s e94e3f210a62, as VT-x's maximum is 6.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
CC: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
 xen/arch/x86/hvm/svm/svm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Boris Ostrovsky April 7, 2017, 3:53 p.m. UTC | #1
On 04/07/2017 11:50 AM, Andrew Cooper wrote:
> SVM's maximum valid event type is 4.  This appears to be a straigth copy and
> paste error in c/s e94e3f210a62, as VT-x's maximum is 6.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> CC: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> ---

I was just about to send this exact patch ;-)

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
diff mbox

Patch

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 1f8aca6..531c64f 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -271,7 +271,7 @@  static int svm_vmcb_restore(struct vcpu *v, struct hvm_hw_cpu *c)
 
     if ( c->pending_valid )
     {
-        if ( (c->pending_type == 1) || (c->pending_type > 6) ||
+        if ( (c->pending_type == 1) || (c->pending_type > 4) ||
              (c->pending_reserved != 0) )
         {
             dprintk(XENLOG_ERR, "%pv: Invalid pending event %#"PRIx32"\n",