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

[xen master] x86/HVM: adjust pIRQ calculation in hvm_inject_msi()



commit 62252f58d0c6dda82838e0d5c51c6ba63adddca6
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Jul 18 12:39:00 2023 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Jul 18 12:39:00 2023 +0200

    x86/HVM: adjust pIRQ calculation in hvm_inject_msi()
    
    While the referenced commit came without any update to the public header
    (which doesn't clarify how the upper address bits are used), the
    intention looks to have been that bits 12..19 and 40..63 form the pIRQ.
    Negative values simply make no sense, and pirq_info() also generally
    wants invoking with an unsigned (and not just positive) value.
    
    Since the line was pointed out by Eclair, address Misra rule 7.2 at the
    same time, by adding the missing U suffix.
    
    Fixes: 88fccdd11ca0 ("xen: event channel remapping for emulated MSIs")
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/hvm/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index 1258371eb0..98cb28f366 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -383,7 +383,7 @@ int hvm_inject_msi(struct domain *d, uint64_t addr, 
uint32_t data)
 
     if ( !vector )
     {
-        int pirq = ((addr >> 32) & 0xffffff00) | dest;
+        unsigned int pirq = ((addr >> 32) & 0xffffff00U) | dest;
 
         if ( pirq > 0 )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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