Skip to contentSkip to conversation

x86/svm: Fix indentation in svm_vmcb_restore()

PATCH In review Andrew Cooper 3 participants 4 messages Apr 7, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 x86/svm: Fix indentation in svm_vmcb_restore()

Inroduced by c/s b706e1c6af274, spotted by Coverity.

---
CC: Jan Beulich <[email protected]>
CC: Boris Ostrovsky <[email protected]>
CC: Suravee Suthikulpanit <[email protected]>

---
 xen/arch/x86/hvm/svm/svm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
xen/arch/x86/hvm/svm/svm.c +2 -2
index a088fd7..1f8aca6 100644
@@ -271,8 +271,8 @@ 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) ||
-            (c->pending_reserved != 0) )
+        if ( (c->pending_type == 1) || (c->pending_type > 6) ||
+             (c->pending_reserved != 0) )
         {
             dprintk(XENLOG_ERR, "%pv: Invalid pending event %#"PRIx32"\n",
                     v, c->pending_event);
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw

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

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.

---
CC: Jan Beulich <[email protected]>
CC: Boris Ostrovsky <[email protected]>
CC: Suravee Suthikulpanit <[email protected]>

---
 xen/arch/x86/hvm/svm/svm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/hvm/svm/svm.c +1 -1
index 1f8aca6..531c64f 100644
@@ -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",
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 2/2
#2 lore raw

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

Quoted 9 lines · Andrew Cooper

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.

---
CC: Jan Beulich <[email protected]>
CC: Boris Ostrovsky <[email protected]>
CC: Suravee Suthikulpanit <[email protected]>
---

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

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#3 lore raw
In reply to Andrew Cooper
Quoted 2 lines
Quoted 1 line
Quoted 1 line · On 07.04.17 at 17:50, <[email protected]> wrote:

Inroduced by c/s b706e1c6af274, spotted by Coverity.

Oops, I'm sorry. This is the kind of change which I would generally think ought to be fine to go in without any acks.

Jan

Quoted 26 lines

---
CC: Jan Beulich <[email protected]>
CC: Boris Ostrovsky <[email protected]>
CC: Suravee Suthikulpanit <[email protected]>

---
 xen/arch/x86/hvm/svm/svm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
xen/arch/x86/hvm/svm/svm.c +2 -2
index a088fd7..1f8aca6 100644
@@ -271,8 +271,8 @@ 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) ||
-            (c->pending_reserved != 0) )
+        if ( (c->pending_type == 1) || (c->pending_type > 6) ||
+             (c->pending_reserved != 0) )
         {
             dprintk(XENLOG_ERR, "%pv: Invalid pending event %#"PRIx32"\n",
                     v, c->pending_event);
Signature · 1 line
2.1.4

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel