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

[PATCH] x86/hvm: Trivial style cleanup in vlapic.c


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 21 Nov 2023 17:40:54 +0000
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 21 Nov 2023 17:41:22 +0000
  • Ironport-data: A9a23:v5t0lK+maK2e2BeYeKfNDrUDyX6TJUtcMsCJ2f8bNWPcYEJGY0x3x mIcXzuHOKyKN2qnKY11b9y+8xwFvpXRzNY1QQRrrHg8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjVAOK6UKidYnwZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ird7ksz1BjOkGlA5AdnPKoS5AW2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklV3 NxALSkJbyu+uMOc0uu1dMJimvgaeZyD0IM34hmMzBncBPciB5vCX7/L9ZlT2zJYasJmRKiEI ZBDMHw2MUWGPEUn1lQ/UfrSmM+BgHXlfiIeg1WSvactuEDYzRBr0airO93QEjCPbZwPzhzE/ TKcrwwVBDkgbMeYkheX90ixn8rwmDPnYbotFoe3o6sCbFq7mTVIVUx+uUGAiem0jAuyVsxSL 2QQ+zEytu4i+UqzVN7/Uhak5nmesXY0efBdDuk74wGl0bfP7kCSAW1sZiFFQMwrsokxXzNC6 7OSt4q3X3o16uTTEC/MsOjMxd+vBcQLBXQrRXcBVA8E2OTcgash1xzxZdh/LJfg27UZBgrML yC2QDkW3upL1ZNbjfjkrTj6bySQSo8lpzPZBzk7vUr/t2uVnKb/O+SVBaHztJ6s1rqxQFibp 2QjkMOD9u0IBpzlvHXSGL1QROzzu6/cb2O0bbtT838JrWzFF5mLJ9g43d2DDB0xbpZslcHBP Cc/Rj+9FLcMZSD3PMebkqq6CtgwzLiIKDgWfqm8Uza6WbAoLFXv1Hg3NSatM5XFzBBEfVcXZ c3KLq5BzB8yVcxa8dZBb75GjedzmHFumT+7qFKS503P7IdyrUW9Ed8tWGZipMhjhE9YiG05K +piCvY=
  • Ironport-hdrordr: A9a23:uBnM+qgDDL3bNFrElqCifuP8Y3BQXtYji2hC6mlwRA09TySZ// rBoB19726StN9xYgBFpTnuAsm9qB/nmaKdgrNhWItKPjOW21dARbsKheCJrgEIcxeOkNK1vp 0AT0ERMrLN5CBB/KTH3DU=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>

Another patch I've found hidden away in my pile of unfinished branches...
This one collided with the bool_t cleanup.
---
 xen/arch/x86/hvm/vlapic.c | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index a54010d71ea1..5cb87f864908 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -191,8 +191,7 @@ uint32_t vlapic_set_ppr(struct vlapic *vlapic)
    return ppr;
 }
 
-static bool vlapic_match_logical_addr(const struct vlapic *vlapic,
-                                      uint32_t mda)
+static bool vlapic_match_logical_addr(const struct vlapic *vlapic, uint32_t 
mda)
 {
     bool result = false;
     uint32_t logical_id = vlapic_get_reg(vlapic, APIC_LDR);
@@ -208,11 +207,11 @@ static bool vlapic_match_logical_addr(const struct vlapic 
*vlapic,
     {
     case APIC_DFR_FLAT:
         if ( logical_id & mda )
-            result = 1;
+            result = true;
         break;
     case APIC_DFR_CLUSTER:
         if ( ((logical_id >> 4) == (mda >> 0x4)) && (logical_id & mda & 0xf) )
-            result = 1;
+            result = true;
         break;
     default:
         printk(XENLOG_G_WARNING "%pv: bad LAPIC DFR value %08x\n",
@@ -244,7 +243,7 @@ bool vlapic_match_dest(
         return (target == source);
 
     case APIC_DEST_ALLINC:
-        return 1;
+        return true;
 
     case APIC_DEST_ALLBUT:
         return (target != source);
@@ -254,7 +253,7 @@ bool vlapic_match_dest(
         break;
     }
 
-    return 0;
+    return false;
 }
 
 static void vlapic_init_sipi_one(struct vcpu *target, uint32_t icr)
@@ -462,7 +461,7 @@ static bool is_multicast_dest(struct vlapic *vlapic, 
unsigned int short_hand,
                               uint32_t dest, bool dest_mode)
 {
     if ( vlapic_domain(vlapic)->max_vcpus <= 2 )
-        return 0;
+        return false;
 
     if ( short_hand )
         return short_hand != APIC_DEST_SELF;
@@ -837,7 +836,7 @@ void vlapic_reg_write(struct vcpu *v, unsigned int reg, 
uint32_t val)
 
     case APIC_LVTT:         /* LVT Timer Reg */
         if ( vlapic_lvtt_tdt(vlapic) !=
-             ((val & APIC_TIMER_MODE_MASK) == APIC_TIMER_MODE_TSC_DEADLINE))
+             ((val & APIC_TIMER_MODE_MASK) == APIC_TIMER_MODE_TSC_DEADLINE) )
         {
             vlapic_set_reg(vlapic, APIC_TMICT, 0);
             vlapic->hw.tdt_msr = 0;
@@ -1163,7 +1162,7 @@ int guest_wrmsr_apic_base(struct vcpu *v, uint64_t val)
     return X86EMUL_OKAY;
 }
 
-uint64_t  vlapic_tdt_msr_get(struct vlapic *vlapic)
+uint64_t vlapic_tdt_msr_get(struct vlapic *vlapic)
 {
     if ( !vlapic_lvtt_tdt(vlapic) )
         return 0;
@@ -1184,7 +1183,7 @@ void vlapic_tdt_msr_set(struct vlapic *vlapic, uint64_t 
value)
         HVM_DBG_LOG(DBG_LEVEL_VLAPIC_TIMER, "ignore tsc deadline msr write");
         return;
     }
-    
+
     /* new_value = 0, >0 && <= now, > now */
     guest_tsc = hvm_get_guest_tsc(v);
     if ( value > guest_tsc )
@@ -1539,8 +1538,8 @@ static int cf_check lapic_load_hidden(struct domain *d, 
hvm_domain_context_t *h)
         return -EINVAL;
     }
     s = vcpu_vlapic(v);
-    
-    if ( hvm_load_entry_zeroextend(LAPIC, h, &s->hw) != 0 ) 
+
+    if ( hvm_load_entry_zeroextend(LAPIC, h, &s->hw) != 0 )
         return -EINVAL;
 
     s->loaded.hw = 1;
@@ -1573,8 +1572,8 @@ static int cf_check lapic_load_regs(struct domain *d, 
hvm_domain_context_t *h)
         return -EINVAL;
     }
     s = vcpu_vlapic(v);
-    
-    if ( hvm_load_entry(LAPIC_REGS, h, s->regs) != 0 ) 
+
+    if ( hvm_load_entry(LAPIC_REGS, h, s->regs) != 0 )
         return -EINVAL;
 
     s->loaded.id = vlapic_get_reg(s, APIC_ID);

base-commit: 10081c2dc571775b538bb00982606a39832ad7e3
-- 
2.30.2




 


Rackspace

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