pci/msi: constify the pci_dev parameter of pci_msi_conf_write_intercept
PATCH 1/1 pci/msi: constify the pci_dev parameter of pci_msi_conf_write_intercept
And the one for find_msi_entry.
---
Jan Beulich <[email protected]>
Andrew Cooper <[email protected]>
--- xen/arch/x86/msi.c | 4 ++-- xen/include/asm-x86/pci.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
xen/arch/x86/msi.c +2 -2
@@ -657,7 +657,7 @@ int msi_free_irq(struct msi_desc *entry)return 0 ; } -static struct msi_desc *find_msi_entry (struct pci_dev *dev, +static struct msi_desc *find_msi_entry (const struct pci_dev *dev,int irq,int cap_id) {struct msi_desc *entry;
@@ -1274,7 +1274,7 @@ void pci_cleanup_msi(struct pci_dev *pdev)msi_free_irqs (pdev); } -int pci_msi_conf_write_intercept (struct pci_dev *pdev,unsigned int reg, +int pci_msi_conf_write_intercept (const struct pci_dev *pdev,unsigned int reg,unsigned int size,uint32_t *data) {u16 seg = pdev->seg;
xen/include/asm-x86/pci.h +1 -1
@@ -18,7 +18,7 @@ struct arch_pci_dev {int pci_conf_write_intercept (unsigned int seg,unsigned int bdf,unsigned int reg,unsigned int size,uint32_t *data); -int pci_msi_conf_write_intercept (struct pci_dev *,unsigned int reg, +int pci_msi_conf_write_intercept (const struct pci_dev *,unsigned int reg,unsigned int size,uint32_t *data);bool_t pci_mmcfg_decode (unsigned long mfn,unsigned int *seg,unsigned int *bdf);
Signature · 7 lines
2.11.0 (Apple Git-81) _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 1 line
Quoted 1 line
Quoted 1 line · On 11.09.17 at 11:16, <[email protected]> wrote:
This being an x86 only change, the subject prefix would presumably better be "x86/msi".
xen/arch/x86/msi.c int msi_free_irq(struct msi_desc *entry) · line 662
Quoted 10 lines
xen/arch/x86/msi.c +1
-1@@ -657,7 +657,7 @@ int msi_free_irq(struct msi_desc *entry)return 0 ; } -static struct msi_desc *find_msi_entry (struct pci_dev *dev, +static struct msi_desc *find_msi_entry (const struct pci_dev *dev,int irq,int cap_id) {
I certainly agree with this part, but ...
xen/arch/x86/msi.c void pci_cleanup_msi(struct pci_dev *pdev) · line 1279
Quoted 8 lines
xen/arch/x86/msi.c +1
-1@@ -1274,7 +1274,7 @@ void pci_cleanup_msi(struct pci_dev *pdev)msi_free_irqs (pdev); } -int pci_msi_conf_write_intercept (struct pci_dev *pdev,unsigned int reg, +int pci_msi_conf_write_intercept (const struct pci_dev *pdev,unsigned int reg,unsigned int size,uint32_t *data) {
... I'm not so sure about this one. The function changes data associated with the device, and it just so happens that right now all such changes are confined to the separately allocated msix structure. Do other changes of yours depend on the parameter becoming const here? I'm trying to understand what scope an undo of this change would be, should it turn out necessary down the road.
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 4 lines · Jan Beulich
Quoted 1 line
Quoted 1 line
Quoted 1 line · On 11.09.17 at 11:16, <[email protected]> wrote:
This being an x86 only change, the subject prefix would presumably better be "x86/msi".
Right. I guess you don't mind changing this upon commit if it gets accepted.
Quoted 17 lines
xen/arch/x86/msi.c int msi_free_irq(struct msi_desc *entry) · line 662
Quoted 10 lines
xen/arch/x86/msi.c +1
-1@@ -657,7 +657,7 @@ int msi_free_irq(struct msi_desc *entry)return 0 ; } -static struct msi_desc *find_msi_entry (struct pci_dev *dev, +static struct msi_desc *find_msi_entry (const struct pci_dev *dev,int irq,int cap_id) {I certainly agree with this part, but ...
Quoted 4 lines
xen/arch/x86/msi.c +0
-0@@ -1274,7 +1274,7 @@ void pci_cleanup_msi(struct pci_dev *pdev)msi_free_irqs (pdev); }
Quoted 12 lines
xen/arch/x86/msi.c void pci_cleanup_msi(struct pci_dev *pdev) · line 1279
Quoted 4 lines
xen/arch/x86/msi.c +1
-1-int pci_msi_conf_write_intercept (struct pci_dev *pdev,unsigned int reg, +int pci_msi_conf_write_intercept (const struct pci_dev *pdev,unsigned int reg,unsigned int size,uint32_t *data) {... I'm not so sure about this one. The function changes data associated with the device, and it just so happens that right now all such changes are confined to the separately allocated msix structure. Do other changes of yours depend on the parameter becoming const here? I'm trying to understand what scope an undo of this change would be, should it turn out necessary down the road.
This is used at:
https://lists.xenproject.org/archives/html/xen-devel/2017-08/msg01511.html
In the vpci_msix_control_write handler. We have spoken about constifying the pci_dev of the handlers, and here the pci_dev argument is being used to call into pci_msi_conf_write_intercept.
Now that I look again at the code, I think I can leave pci_msi_conf_write_intercept alone, since in vpci_msix_control_write I can also get the pci_dev from msix->pdev, and that's not constified. I will send the find_msi_entry chunk separately, which I still think it's worth.
Thanks, Roger.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel