[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH V2] Use #defines instead of magic constants in vmx_vmcs_save()


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
  • Date: Tue, 5 Aug 2014 15:24:49 +0300
  • Cc: kevin.tian@xxxxxxxxx, keir@xxxxxxx, jbeulich@xxxxxxxx, Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>, eddie.dong@xxxxxxxxx, jun.nakajima@xxxxxxxxx
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Tue, 05 Aug 2014 12:25:12 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=T+kelmCSFrPTgBlw/GoTVd8jXl1vpW7TwmBVKmzLOKKppO/8zS3zttjBFbzD2tmPd2TtK+Sh7I6v7KxzGkmn8ZPhA6p3A0lr3TcJwB66Tfk0Ps0Ss3mTREO8aQcWRUCmF9YLaMg3X+TNeL0oMZS0l1G1i0ZgTS5K4AQ3KMX6SBrgr5KudgL7Q5mLi9/0eU8bCi6P/AHpK8v6QuCIGA1n8nBwKi457rrIgYR/LzPlO0F/vSIql+6S+hifVB3ibQq6lQgW5AYcGZwskw6Ud1WjxxE+XoCW2eQWzRAkSLtL0944LnqEVYkk3rC6ArCODtu36xXZqQxMHtv4DVz+nfx90w==; h=Received:Received:Received:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:X-BitDefender-Scanner:X-BitDefender-Spam:X-BitDefender-SpamStamp:X-BitDefender-CF-Stamp;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

Now using a combination of INTR_INFO_VECTOR_MASK,
INTR_INFO_INTR_TYPE_MASK and MASK_EXTR() to replace the old
"(ev >> 8) & 7, ev & 0xff" magic constant code in vmx.c.

Changes since V1:
 - Fixed indentation.

Signed-off-by: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmx.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 2caa04a..2d1974e 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -434,7 +434,8 @@ static void vmx_vmcs_save(struct vcpu *v, struct hvm_hw_cpu 
*c)
     c->error_code = 0;
     __vmread(VM_ENTRY_INTR_INFO, &ev);
     if ( (ev & INTR_INFO_VALID_MASK) &&
-         hvm_event_needs_reinjection((ev >> 8) & 7, ev & 0xff) )
+         hvm_event_needs_reinjection(MASK_EXTR(ev, INTR_INFO_INTR_TYPE_MASK),
+                                     ev & INTR_INFO_VECTOR_MASK) )
     {
         c->pending_event = ev;
         __vmread(VM_ENTRY_EXCEPTION_ERROR_CODE, &ev);
-- 
1.7.9.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.