x86/vPCI: MSI/MSI-X related adjustments
cover x86/vPCI: MSI/MSI-X related adjustments
1: tolerate (un)masking a disabled MSI-X entry 2: check address in vpci_msi_update()
3: vPCI/MSI-X: fold clearing of entry->updated 4: vPCI/MSI-X: make use of xzalloc_flex_struct() 5: vPCI/MSI-X: tidy init_msix()
Jan
PATCH 1/5 x86/vPCI: tolerate (un)masking a disabled MSI-X entry
None of the four reasons causing vpci_msix_arch_mask_entry() to get called (there's just a single call site) are impossible or illegal prior to an entry actually having got set up:
- the entry may remain masked (in this case, however, a prior masked -> unmasked transition would already not have worked),
- MSI-X may not be enabled,
- the global mask bit may be set,
- the entry may not otherwise have been updated.
Hence the function asserting that the entry was previously set up was simply wrong. Since the caller tracks the masked state (and setting up of an entry would only be effected when that software bit is clear), it's okay to skip both masking and unmasking requests in this case.
---
This is a presumed alternative to Roger's "vpci/msix: exit early if MSI-X is disabled or globally masked".
xen/arch/x86/hvm/vmsi.c +2 -2
@@ -840,8 +840,8 @@ void vpci_msi_arch_print(const struct vpvoid vpci_msix_arch_mask_entry (struct vpci_msix_entry *entry,const struct pci_dev *pdev,bool mask) { -ASSERT (entry->arch.pirq !=INVALID_PIRQ ); -vpci_mask_pirq (pdev->domain, entry->arch.pirq, mask); +if ( entry->arch.pirq !=INVALID_PIRQ ) +vpci_mask_pirq (pdev->domain, entry->arch.pirq, mask); } int vpci_msix_arch_enable_entry(struct vpci_msix_entry *entry,
Re: [PATCH 1/5] x86/vPCI: tolerate (un)masking a disabled MSI-X entry
Quoted 4 lines · Jan Beulich
None of the four reasons causing
vpci_msix_arch_mask_entry()to get called (there's just a single call site) are impossible or illegal prior to an entry actually having got set up:
- the entry may remain masked (in this case, however, a prior masked ->
Quoted 8 lines
unmasked transition would already not have worked),
- MSI-X may not be enabled,
- the global mask bit may be set,
- the entry may not otherwise have been updated.
Hence the function asserting that the entry was previously set up was simply wrong. Since the caller tracks the masked state (and setting up of an entry would only be effected when that software bit is clear), it's okay to skip both masking and unmasking requests in this case.
On the original approach I just added this because I convinced myself that scenario was impossible. I think we could also do:
xen/drivers/vpci/msix.c +6 -1
@@ -357,7 +357,11 @@ static int msix_write(struct vcpu *v, unsigned long addr, unsigned int len,* so that it picks the new state. */ entry->masked = new_masked; -if ( !new_masked && msix->enabled && !msix->masked && entry->updated ) + +if ( !msix->enabled ) +break ; + +if ( !new_masked && !msix->masked && entry->updated ) {/* * If MSI-X is enabled, the function mask is not active, the entry
@@ -470,6 +474,7 @@ static int init_msix(struct pci_dev *pdev)for ( i =0 ; i < pdev->vpci->msix->max_entries; i++) { pdev->vpci->msix->entries[i].masked = true; + pdev->vpci->msix->entries[i].updated = true;vpci_msix_arch_init_entry (&pdev->vpci->msix->entries[i]); }
In order to solve the issue.
As pointed out in another patch, regardless of what we end up doing with the issue at hand we might have to consider setting updated to true in init_msix in case we want to somehow support enabling an entry that has it's address and data fields set to 0.
Quoted 4 lines
Fixes d6281be9d0145 ('vpci/msix: add MSI-X handlers')Reported-by Manuel Bouyer <[email protected]>Signed-off-by Jan Beulich <[email protected]>
Manuel, can we get confirmation that this fixes your issue?
Thanks, Roger.
Re: [PATCH 1/5] x86/vPCI: tolerate (un)masking a disabled MSI-X entry
Quoted 44 lines · Roger Pau Monné
Quoted 4 lines · Jan Beulich
None of the four reasons causing
vpci_msix_arch_mask_entry()to get called (there's just a single call site) are impossible or illegal prior to an entry actually having got set up:
- the entry may remain masked (in this case, however, a prior masked ->Quoted 8 lines
unmasked transition would already not have worked),
- MSI-X may not be enabled,
- the global mask bit may be set,
- the entry may not otherwise have been updated.
Hence the function asserting that the entry was previously set up was simply wrong. Since the caller tracks the masked state (and setting up of an entry would only be effected when that software bit is clear), it's okay to skip both masking and unmasking requests in this case.On the original approach I just added this because I convinced myself that scenario was impossible. I think we could also do:
xen/drivers/vpci/msix.c +6
-1@@ -357,7 +357,11 @@ static int msix_write(struct vcpu *v, unsigned long addr, unsigned int len,* so that it picks the new state. */ entry->masked = new_masked; -if ( !new_masked && msix->enabled && !msix->masked && entry->updated ) + +if ( !msix->enabled ) +break ; + +if ( !new_masked && !msix->masked && entry->updated ) {/* * If MSI-X is enabled, the function mask is not active, the entry @@ -470,6 +474,7 @@ static int init_msix(struct pci_dev *pdev)for ( i =0 ; i < pdev->vpci->msix->max_entries; i++) { pdev->vpci->msix->entries[i].masked = true; + pdev->vpci->msix->entries[i].updated = true;vpci_msix_arch_init_entry (&pdev->vpci->msix->entries[i]); }In order to solve the issue.
Quoted 4 lines
As pointed out in another patch, regardless of what we end up doing with the issue at hand we might have to consider setting updated to true in
init_msixin case we want to somehow support enabling an entry that has it's address and data fields set to 0.
Yes, but I view this as an orthogonal aspect to consider (down the road).
Quoted 5 lines
Quoted 3 lines
Fixes d6281be9d0145 ('vpci/msix: add MSI-X handlers')Reported-by Manuel Bouyer <[email protected]>Signed-off-by Jan Beulich <[email protected]>Reviewed-by Roger Pau Monné <[email protected]>
Thanks.
Quoted 1 line
Manuel, can we get confirmation that this fixes your issue?
I'll give it some time before committing for him to confirm, but I guess I'd like to time out by the end of the week.
Jan
Re: [PATCH 1/5] x86/vPCI: tolerate (un)masking a disabled MSI-X entry
Quoted 6 lines · Jan Beulich
Thanks.
Quoted 1 line
Manuel, can we get confirmation that this fixes your issue?
I'll give it some time before committing for him to confirm, but I guess I'd like to time out by the end of the week.
Yes, it works for me
Signature · 3 lines
Manuel Bouyer <[email protected]> NetBSD: 26 ans d'experience feront toujours la difference --
PATCH 2/5 x86/vPCI: check address in vpci_msi_update()
In reply to Jan BeulichIf the upper address bits don't match the interrupt delivery address space window, entirely different behavior would need to be implemented. Refuse such requests for the time being.
Replace adjacent hard tabs while introducing MSI_ADDR_BASE_MASK.
xen/arch/x86/hvm/vmsi.c +7 -0
@@ -682,6 +682,13 @@ static int vpci_msi_update(const structASSERT (pcidevs_locked ()); +if ( (address &MSI_ADDR_BASE_MASK ) !=MSI_ADDR_HEADER ) + { +gdprintk (XENLOG_ERR ,"%pp: PIRQ %u: unsupported address %lx\n" , + &pdev->sbdf, pirq, address); +return -EOPNOTSUPP ; + } +for ( i =0 ; i < vectors; i++ ) {uint8_t vector =MASK_EXTR (data,MSI_DATA_VECTOR_MASK );
xen/include/asm-x86/msi.h +3 -2
@@ -36,8 +36,9 @@* Shift/mask fields for msi address */ -#define MSI_ADDR_BASE_HI 0 -#define MSI_ADDR_BASE_LO 0xfee00000 +#define MSI_ADDR_BASE_HI 0 +#define MSI_ADDR_BASE_LO 0xfee00000 +#define MSI_ADDR_BASE_MASK (~0xfffff)#define MSI_ADDR_HEADER MSI_ADDR_BASE_LO#define MSI_ADDR_DESTMODE_SHIFT 2
Re: [PATCH 2/5] x86/vPCI: check address in vpci_msi_update()
Quoted 7 lines · Jan Beulich
If the upper address bits don't match the interrupt delivery address space window, entirely different behavior would need to be implemented. Refuse such requests for the time being.
Replace adjacent hard tabs while introducing
MSI_ADDR_BASE_MASK.Signed-off-by Jan Beulich <[email protected]>
Thanks, Roger.
PATCH 3/5 vPCI/MSI-X: fold clearing of entry->updated
In reply to Jan BeulichBoth call sites clear the flag after a successfull call to update_entry(). This can be simplified by moving the clearing into the function, onto its success path.
---
As a result it becomes clear that the return value of the function is of no interest to either of the callers. I'm not sure whether ditching it is the right thing to do, or whether this rather hints at some problem.
xen/drivers/vpci/msix.c +5 -11
@@ -64,6 +64,8 @@ static int update_entry(struct vpci_msixreturn rc; } + entry->updated = false; +return 0 ; }
@@ -92,13 +94,8 @@ static void control_write(const struct pif ( new_enabled && !new_masked && (!msix->enabled || msix->masked) ) {for ( i =0 ; i < msix->max_entries; i++ ) - { -if ( msix->entries[i].masked || !msix->entries[i].updated || -update_entry (&msix->entries[i], pdev, i) ) -continue ; - - msix->entries[i].updated = false; - } +if ( !msix->entries[i].masked && msix->entries[i].updated ) +update_entry (&msix->entries[i], pdev, i); }else if ( !new_enabled && msix->enabled ) {
@@ -365,10 +362,7 @@ static int msix_write(struct vcpu *v, un* data fields Xen needs to disable and enable the entry in order * to pick up the changes. */ -if (update_entry (entry, pdev,vmsix_entry_nr (msix, entry)) ) -break ; - - entry->updated = false; +update_entry (entry, pdev,vmsix_entry_nr (msix, entry)); }else vpci_msix_arch_mask_entry (entry, pdev, entry->masked);
Re: [PATCH 3/5] vPCI/MSI-X: fold clearing of entry->updated
Quoted 3 lines · Jan Beulich
Both call sites clear the flag after a successfull call to
update_entry(). This can be simplified by moving the clearing into the function, onto its success path.
The point of returning a value was to set the updated field, as there was no failure log message printed by the callers.
Quoted 5 lines
Signed-off-by Jan Beulich <[email protected]>---
As a result it becomes clear that the return value of the function is of no interest to either of the callers. I'm not sure whether ditching it is the right thing to do, or whether this rather hints at some problem.
I think you should make the function void as part of this change, there's a log message printed by update_entry in the failure case which IMO should be enough.
There's not much else callers can do AFAICT.
Quoted 28 lines
xen/drivers/vpci/msix.c +4
-7@@ -64,6 +64,8 @@ static int update_entry(struct vpci_msixreturn rc; } + entry->updated = false; +return 0 ; }@@ -92,13 +94,8 @@ static void control_write(const struct pif ( new_enabled && !new_masked && (!msix->enabled || msix->masked) ) {for ( i =0 ; i < msix->max_entries; i++ ) - { -if ( msix->entries[i].masked || !msix->entries[i].updated || -update_entry (&msix->entries[i], pdev, i) ) -continue ; - - msix->entries[i].updated = false; - } +if ( !msix->entries[i].masked && msix->entries[i].updated ) +update_entry (&msix->entries[i], pdev, i); }else if ( !new_enabled && msix->enabled ) {
xen/drivers/vpci/msix.c static int msix_write(struct vcpu *v, un · line 366
Quoted 9 lines
xen/drivers/vpci/msix.c +1
-4@@ -365,10 +362,7 @@ static int msix_write(struct vcpu *v, un* data fields Xen needs to disable and enable the entry in order * to pick up the changes. */ -if (update_entry (entry, pdev,vmsix_entry_nr (msix, entry)) ) -break ; - - entry->updated = false; +update_entry (entry, pdev,vmsix_entry_nr (msix, entry)); }
You can also drop this braces now if you feel like.
Thanks, Roger.
PATCH 4/5 vPCI/MSI-X: make use of xzalloc_flex_struct()
In reply to Jan Beulich... instead of effectively open-coding it in a type-unsafe way.
xen/drivers/vpci/msix.c +2 -3
@@ -23,8 +23,6 @@#include <asm/msi.h> #include <asm/p2m.h> -#define VMSIX_SIZE (num) offsetof(struct vpci_msix, entries[num]) -#define VMSIX_ADDR_IN_RANGE (addr, vpci, nr) \ ((addr) >= vmsix_table_addr(vpci, nr) && \ (addr) < vmsix_table_addr(vpci, nr) + vmsix_table_size(vpci, nr))
@@ -449,7 +447,8 @@ static int init_msix(struct pci_dev *pde max_entries =msix_table_size (control); - pdev->vpci->msix =xzalloc_bytes (VMSIX_SIZE (max_entries)); + pdev->vpci->msix = xzalloc_flex_struct(struct vpci_msix, entries, + max_entries);if ( !pdev->vpci->msix )return -ENOMEM ;
Re: [PATCH 4/5] vPCI/MSI-X: make use of xzalloc_flex_struct()
Quoted 3 lines · Jan Beulich
... instead of effectively open-coding it in a type-unsafe way.
Signed-off-by Jan Beulich <[email protected]>
Thanks.
PATCH 5/5 vPCI/MSI-X: tidy init_msix()
In reply to Jan BeulichFirst of all introduce a local variable for the to be allocated struct. The compiler can't CSE all the occurrences (I'm observing 80 bytes of code saved with gcc 10). Additionally, while the caller can cope and there was no memory leak, globally "announce" the struct only once done initializing it. This also removes the dependency of the function on the caller cleaning up after it in case of an error.
---
I was heavily tempted to also move up the call to vpci_add_register(), such that there would be no pointless init done in case of an error coming back from there.
xen/drivers/vpci/msix.c +16 -12
@@ -436,6 +436,7 @@ static int init_msix(struct pci_dev *pdeuint8_t slot =PCI_SLOT (pdev->devfn), func =PCI_FUNC (pdev->devfn);unsigned int msix_offset, i, max_entries;uint16_t control; +struct vpci_msix *msix;int rc; msix_offset = pci_find_cap_offset(pdev->seg, pdev->bus, slot, func,
@@ -447,34 +448,37 @@ static int init_msix(struct pci_dev *pde max_entries =msix_table_size (control); - pdev->vpci->msix = xzalloc_flex_struct(struct vpci_msix, entries, - max_entries); -if ( !pdev->vpci->msix ) + msix = xzalloc_flex_struct(struct vpci_msix, entries, max_entries); +if ( !msix )return -ENOMEM ; - pdev->vpci->msix->max_entries = max_entries; - pdev->vpci->msix->pdev = pdev; + msix->max_entries = max_entries; + msix->pdev = pdev; - pdev->vpci->msix->tables[VPCI_MSIX_TABLE ] = + msix->tables[VPCI_MSIX_TABLE ] =pci_conf_read32 (pdev->sbdf,msix_table_offset_reg (msix_offset)); - pdev->vpci->msix->tables[VPCI_MSIX_PBA ] = + msix->tables[VPCI_MSIX_PBA ] =pci_conf_read32 (pdev->sbdf,msix_pba_offset_reg (msix_offset)); -for ( i =0 ; i < pdev->vpci->msix->max_entries; i++) +for ( i =0 ; i < msix->max_entries; i++) { - pdev->vpci->msix->entries[i].masked = true; -vpci_msix_arch_init_entry (&pdev->vpci->msix->entries[i]); + msix->entries[i].masked = true; +vpci_msix_arch_init_entry (&msix->entries[i]); } rc =vpci_add_register (pdev->vpci, control_read, control_write, -msix_control_reg (msix_offset),2 , pdev->vpci->msix); +msix_control_reg (msix_offset),2 , msix);if ( rc ) + { +xfree (msix);return rc; + }if (list_empty (&d->arch.hvm.msix_tables) )register_mmio_handler (d, &vpci_msix_table_ops); -list_add (&pdev->vpci->msix->next, &d->arch.hvm.msix_tables); + pdev->vpci->msix = msix; +list_add (&msix->next, &d->arch.hvm.msix_tables);return 0 ; }
Re: [PATCH 5/5] vPCI/MSI-X: tidy init_msix()
Quoted 8 lines · Jan Beulich
First of all introduce a local variable for the to be allocated struct. The compiler can't CSE all the occurrences (I'm observing 80 bytes of code saved with gcc 10). Additionally, while the caller can cope and there was no memory leak, globally "announce" the struct only once done initializing it. This also removes the dependency of the function on the caller cleaning up after it in case of an error.
Signed-off-by Jan Beulich <[email protected]>
Just a couple of comments.
Quoted 4 lines
---
I was heavily tempted to also move up the call tovpci_add_register(), such that there would be no pointless init done in case of an error coming back from there.
Feel free to do so.
Quoted 26 lines
xen/drivers/vpci/msix.c +5
-5@@ -436,6 +436,7 @@ static int init_msix(struct pci_dev *pdeuint8_t slot =PCI_SLOT (pdev->devfn), func =PCI_FUNC (pdev->devfn);unsigned int msix_offset, i, max_entries;uint16_t control; +struct vpci_msix *msix;int rc; msix_offset = pci_find_cap_offset(pdev->seg, pdev->bus, slot, func,@@ -447,34 +448,37 @@ static int init_msix(struct pci_dev *pde max_entries =msix_table_size (control); - pdev->vpci->msix = xzalloc_flex_struct(struct vpci_msix, entries, - max_entries); -if ( !pdev->vpci->msix ) + msix = xzalloc_flex_struct(struct vpci_msix, entries, max_entries); +if ( !msix )return -ENOMEM ; - pdev->vpci->msix->max_entries = max_entries; - pdev->vpci->msix->pdev = pdev; + msix->max_entries = max_entries; + msix->pdev = pdev;
xen/drivers/vpci/msix.c static int init_msix(struct pci_dev *pde · line 463
Quoted 10 lines
xen/drivers/vpci/msix.c +3
-3- pdev->vpci->msix->tables[VPCI_MSIX_TABLE ] = + msix->tables[VPCI_MSIX_TABLE ] =pci_conf_read32 (pdev->sbdf,msix_table_offset_reg (msix_offset)); - pdev->vpci->msix->tables[VPCI_MSIX_PBA ] = + msix->tables[VPCI_MSIX_PBA ] =pci_conf_read32 (pdev->sbdf,msix_pba_offset_reg (msix_offset)); -for ( i =0 ; i < pdev->vpci->msix->max_entries; i++) +for ( i =0 ; i < msix->max_entries; i++)
Feel free to just use max_entries directly here.
xen/drivers/vpci/msix.c static int init_msix(struct pci_dev *pde · line 465
Quoted 4 lines
xen/drivers/vpci/msix.c +1
-2{ - pdev->vpci->msix->entries[i].masked = true; -vpci_msix_arch_init_entry (&pdev->vpci->msix->entries[i]); + msix->entries[i].masked = true;
I think we should also set msix->entries[i].updated = true; for correctness? Albeit this will never lead to a working configuration, as the address field will be 0 and thus cause and error to trigger if enabled without prior setup.
Maybe on a different patch anyway.
Thanks, Roger.
Re: [PATCH 5/5] vPCI/MSI-X: tidy init_msix()
Quoted 11 lines · Roger Pau Monné
Quoted 8 lines · Jan Beulich
First of all introduce a local variable for the to be allocated struct. The compiler can't CSE all the occurrences (I'm observing 80 bytes of code saved with gcc 10). Additionally, while the caller can cope and there was no memory leak, globally "announce" the struct only once done initializing it. This also removes the dependency of the function on the caller cleaning up after it in case of an error.
Signed-off-by Jan Beulich <[email protected]>Reviewed-by Roger Pau Monné <[email protected]>
Thanks.
Quoted 53 lines
Just a couple of comments.
Quoted 4 lines
---
I was heavily tempted to also move up the call tovpci_add_register(), such that there would be no pointless init done in case of an error coming back from there.Feel free to do so.
Quoted 26 lines
xen/drivers/vpci/msix.c +5
-5@@ -436,6 +436,7 @@ static int init_msix(struct pci_dev *pdeuint8_t slot =PCI_SLOT (pdev->devfn), func =PCI_FUNC (pdev->devfn);unsigned int msix_offset, i, max_entries;uint16_t control; +struct vpci_msix *msix;int rc; msix_offset = pci_find_cap_offset(pdev->seg, pdev->bus, slot, func,@@ -447,34 +448,37 @@ static int init_msix(struct pci_dev *pde max_entries =msix_table_size (control); - pdev->vpci->msix = xzalloc_flex_struct(struct vpci_msix, entries, - max_entries); -if ( !pdev->vpci->msix ) + msix = xzalloc_flex_struct(struct vpci_msix, entries, max_entries); +if ( !msix )return -ENOMEM ; - pdev->vpci->msix->max_entries = max_entries; - pdev->vpci->msix->pdev = pdev; + msix->max_entries = max_entries; + msix->pdev = pdev;xen/drivers/vpci/msix.c static int init_msix(struct pci_dev *pde · line 463
Quoted 10 lines
xen/drivers/vpci/msix.c +3
-3- pdev->vpci->msix->tables[VPCI_MSIX_TABLE ] = + msix->tables[VPCI_MSIX_TABLE ] =pci_conf_read32 (pdev->sbdf,msix_table_offset_reg (msix_offset)); - pdev->vpci->msix->tables[VPCI_MSIX_PBA ] = + msix->tables[VPCI_MSIX_PBA ] =pci_conf_read32 (pdev->sbdf,msix_pba_offset_reg (msix_offset)); -for ( i =0 ; i < pdev->vpci->msix->max_entries; i++) +for ( i =0 ; i < msix->max_entries; i++)Feel free to just use
max_entriesdirectly here.xen/drivers/vpci/msix.c static int init_msix(struct pci_dev *pde · line 465
Quoted 4 lines
xen/drivers/vpci/msix.c +1
-2{ - pdev->vpci->msix->entries[i].masked = true; -vpci_msix_arch_init_entry (&pdev->vpci->msix->entries[i]); + msix->entries[i].masked = true;
Quoted 6 lines
I think we should also set msix->entries[i].updated = true; for correctness? Albeit this will never lead to a working configuration, as the address field will be 0 and thus cause and error to trigger if enabled without prior setup.
Maybe on a different patch anyway.
Indeed, I'd prefer to not make such a change right here.
Jan
PATCH v2 1/1 vPCI/MSI-X: fold clearing of entry->updated
In reply to Jan BeulichBoth call sites clear the flag after a successfull call to update_entry(). This can be simplified by moving the clearing into the function, onto its success path.
As a result of neither caller caring about update_entry()'s return value anymore, the function gets switched to return void.
---
v2: Make update_entry() return void.
xen/drivers/vpci/msix.c +8 -16
@@ -37,8 +37,8 @@ static uint32_t control_read(const struc (msix->masked ?PCI_MSIX_FLAGS_MASKALL :0 ); } -static int update_entry (struct vpci_msix_entry *entry, -const struct pci_dev *pdev,unsigned int nr) +static void update_entry (struct vpci_msix_entry *entry, +const struct pci_dev *pdev,unsigned int nr) {int rc =vpci_msix_arch_disable_entry (entry, pdev);
@@ -48,7 +48,7 @@ static int update_entry(struct vpci_msixgprintk (XENLOG_WARNING ,"%pp: unable to disable entry %u for update: %d\n" , &pdev->sbdf, nr, rc); -return rc; +return ; } rc = vpci_msix_arch_enable_entry(entry, pdev,
@@ -59,10 +59,10 @@ static int update_entry(struct vpci_msixgprintk (XENLOG_WARNING ,"%pp: unable to enable entry %u: %d\n" , &pdev->sbdf, nr, rc);/* Entry is likely not properly configured. */ -return rc; +return ; } -return 0 ; + entry->updated = false; } static void control_write(const struct pci_dev *pdev, unsigned int reg,
@@ -90,13 +90,8 @@ static void control_write(const struct pif ( new_enabled && !new_masked && (!msix->enabled || msix->masked) ) {for ( i =0 ; i < msix->max_entries; i++ ) - { -if ( msix->entries[i].masked || !msix->entries[i].updated || -update_entry (&msix->entries[i], pdev, i) ) -continue ; - - msix->entries[i].updated = false; - } +if ( !msix->entries[i].masked && msix->entries[i].updated ) +update_entry (&msix->entries[i], pdev, i); }else if ( !new_enabled && msix->enabled ) {
@@ -363,10 +358,7 @@ static int msix_write(struct vcpu *v, un* data fields Xen needs to disable and enable the entry in order * to pick up the changes. */ -if (update_entry (entry, pdev,vmsix_entry_nr (msix, entry)) ) -break ; - - entry->updated = false; +update_entry (entry, pdev,vmsix_entry_nr (msix, entry)); }else vpci_msix_arch_mask_entry (entry, pdev, entry->masked);
Re: [PATCH v2] vPCI/MSI-X: fold clearing of entry->updated
Quoted 8 lines · Jan Beulich
Both call sites clear the flag after a successfull call to
update_entry(). This can be simplified by moving the clearing into the function, onto its success path.As a result of neither caller caring about update_entry()'s return value anymore, the function gets switched to return void.
Signed-off-by Jan Beulich <[email protected]>
Thanks, Roger.