2015-07-01 10:14:21

by Michael S. Tsirkin

[permalink] [raw]
Subject: [PATCH] pci_regs: reintroduce PCI_MSIX_FLAGS_BIRMASK

This partially reverts commit 09a2c73ddfc7f173237fc7209a65b34dd5bcb5ed.
PCI: Remove unused PCI_MSIX_FLAGS_BIRMASK definition

That commit dropped a symbol from an exported header claiming "no one
uses it". This isn't how Linux normally approaches userspace API though,
and in fact QEMU build fails if trying to use updated headers from linux
3.12 and up.

Sure, userspace can be fixed to use the new symbol, but the cost
of keeping the old one around is fairly low, too.

Signed-off-by: Michael S. Tsirkin <[email protected]>
---
include/uapi/linux/pci_regs.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index efe3443..66644ac 100644
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -319,6 +319,7 @@
#define PCI_MSIX_PBA 8 /* Pending Bit Array offset */
#define PCI_MSIX_PBA_BIR 0x00000007 /* BAR index */
#define PCI_MSIX_PBA_OFFSET 0xfffffff8 /* Offset into specified BAR */
+#define PCI_MSIX_FLAGS_BIRMASK PCI_MSIX_PBA_BIR /* deprecated */
#define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */

/* MSI-X Table entry format */
--
MST


2015-07-13 15:11:45

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: [PATCH] pci_regs: reintroduce PCI_MSIX_FLAGS_BIRMASK

On Wed, Jul 01, 2015 at 12:14:10PM +0200, Michael S. Tsirkin wrote:
> This partially reverts commit 09a2c73ddfc7f173237fc7209a65b34dd5bcb5ed.
> PCI: Remove unused PCI_MSIX_FLAGS_BIRMASK definition
>
> That commit dropped a symbol from an exported header claiming "no one
> uses it". This isn't how Linux normally approaches userspace API though,
> and in fact QEMU build fails if trying to use updated headers from linux
> 3.12 and up.
>
> Sure, userspace can be fixed to use the new symbol, but the cost
> of keeping the old one around is fairly low, too.
>
> Signed-off-by: Michael S. Tsirkin <[email protected]>

Ping. Can this be included upstream please?

> ---
> include/uapi/linux/pci_regs.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
> index efe3443..66644ac 100644
> --- a/include/uapi/linux/pci_regs.h
> +++ b/include/uapi/linux/pci_regs.h
> @@ -319,6 +319,7 @@
> #define PCI_MSIX_PBA 8 /* Pending Bit Array offset */
> #define PCI_MSIX_PBA_BIR 0x00000007 /* BAR index */
> #define PCI_MSIX_PBA_OFFSET 0xfffffff8 /* Offset into specified BAR */
> +#define PCI_MSIX_FLAGS_BIRMASK PCI_MSIX_PBA_BIR /* deprecated */
> #define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */
>
> /* MSI-X Table entry format */
> --
> MST

2015-07-13 15:49:25

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH] pci_regs: reintroduce PCI_MSIX_FLAGS_BIRMASK

On Mon, Jul 13, 2015 at 10:11 AM, Michael S. Tsirkin <[email protected]> wrote:
> On Wed, Jul 01, 2015 at 12:14:10PM +0200, Michael S. Tsirkin wrote:
>> This partially reverts commit 09a2c73ddfc7f173237fc7209a65b34dd5bcb5ed.
>> PCI: Remove unused PCI_MSIX_FLAGS_BIRMASK definition
>>
>> That commit dropped a symbol from an exported header claiming "no one
>> uses it". This isn't how Linux normally approaches userspace API though,
>> and in fact QEMU build fails if trying to use updated headers from linux
>> 3.12 and up.
>>
>> Sure, userspace can be fixed to use the new symbol, but the cost
>> of keeping the old one around is fairly low, too.
>>
>> Signed-off-by: Michael S. Tsirkin <[email protected]>
>
> Ping. Can this be included upstream please?

Yes, I plan to merge it, and I'll mark it for stable. This looks like
a complete revert of 09a2c73ddfc7, not a partial revert. Am I missing
something?

09a2c73ddfc7 appeared in v3.13 (not v3.12), so it wouldn't ordinarily
be post-merge window material. But it seems pretty safe, so I might
put it in for v4.2 instead of waiting for v4.3.

>> ---
>> include/uapi/linux/pci_regs.h | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
>> index efe3443..66644ac 100644
>> --- a/include/uapi/linux/pci_regs.h
>> +++ b/include/uapi/linux/pci_regs.h
>> @@ -319,6 +319,7 @@
>> #define PCI_MSIX_PBA 8 /* Pending Bit Array offset */
>> #define PCI_MSIX_PBA_BIR 0x00000007 /* BAR index */
>> #define PCI_MSIX_PBA_OFFSET 0xfffffff8 /* Offset into specified BAR */
>> +#define PCI_MSIX_FLAGS_BIRMASK PCI_MSIX_PBA_BIR /* deprecated */
>> #define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */
>>
>> /* MSI-X Table entry format */
>> --
>> MST

2015-07-13 16:32:34

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: [PATCH] pci_regs: reintroduce PCI_MSIX_FLAGS_BIRMASK

On Mon, Jul 13, 2015 at 10:49:02AM -0500, Bjorn Helgaas wrote:
> On Mon, Jul 13, 2015 at 10:11 AM, Michael S. Tsirkin <[email protected]> wrote:
> > On Wed, Jul 01, 2015 at 12:14:10PM +0200, Michael S. Tsirkin wrote:
> >> This partially reverts commit 09a2c73ddfc7f173237fc7209a65b34dd5bcb5ed.
> >> PCI: Remove unused PCI_MSIX_FLAGS_BIRMASK definition
> >>
> >> That commit dropped a symbol from an exported header claiming "no one
> >> uses it". This isn't how Linux normally approaches userspace API though,
> >> and in fact QEMU build fails if trying to use updated headers from linux
> >> 3.12 and up.
> >>
> >> Sure, userspace can be fixed to use the new symbol, but the cost
> >> of keeping the old one around is fairly low, too.
> >>
> >> Signed-off-by: Michael S. Tsirkin <[email protected]>
> >
> > Ping. Can this be included upstream please?
>
> Yes, I plan to merge it, and I'll mark it for stable. This looks like
> a complete revert of 09a2c73ddfc7, not a partial revert. Am I missing
> something?

Only that I redefine PCI_MSIX_FLAGS_BIRMASK in terms of PCI_MSIX_PBA_BIR
so that there's no duplication.

> 09a2c73ddfc7 appeared in v3.13 (not v3.12), so it wouldn't ordinarily
> be post-merge window material. But it seems pretty safe, so I might
> put it in for v4.2 instead of waiting for v4.3.
>
> >> ---
> >> include/uapi/linux/pci_regs.h | 1 +
> >> 1 file changed, 1 insertion(+)
> >>
> >> diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
> >> index efe3443..66644ac 100644
> >> --- a/include/uapi/linux/pci_regs.h
> >> +++ b/include/uapi/linux/pci_regs.h
> >> @@ -319,6 +319,7 @@
> >> #define PCI_MSIX_PBA 8 /* Pending Bit Array offset */
> >> #define PCI_MSIX_PBA_BIR 0x00000007 /* BAR index */
> >> #define PCI_MSIX_PBA_OFFSET 0xfffffff8 /* Offset into specified BAR */
> >> +#define PCI_MSIX_FLAGS_BIRMASK PCI_MSIX_PBA_BIR /* deprecated */
> >> #define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */
> >>
> >> /* MSI-X Table entry format */
> >> --
> >> MST

2015-07-14 23:29:32

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH] pci_regs: reintroduce PCI_MSIX_FLAGS_BIRMASK

On Mon, Jul 13, 2015 at 06:11:38PM +0300, Michael S. Tsirkin wrote:
> On Wed, Jul 01, 2015 at 12:14:10PM +0200, Michael S. Tsirkin wrote:
> > This partially reverts commit 09a2c73ddfc7f173237fc7209a65b34dd5bcb5ed.
> > PCI: Remove unused PCI_MSIX_FLAGS_BIRMASK definition
> >
> > That commit dropped a symbol from an exported header claiming "no one
> > uses it". This isn't how Linux normally approaches userspace API though,
> > and in fact QEMU build fails if trying to use updated headers from linux
> > 3.12 and up.
> >
> > Sure, userspace can be fixed to use the new symbol, but the cost
> > of keeping the old one around is fairly low, too.
> >
> > Signed-off-by: Michael S. Tsirkin <[email protected]>

Sorry, I lost the original message somehow, so I can't reply to it. I
applied this by hand to my for-linus branch for v4.2, thanks!


commit c9ddbac9c89110f77cb0fa07e634aaf1194899aa
Author: Michael S. Tsirkin <[email protected]>
Date: Tue Jul 14 18:27:46 2015 -0500

PCI: Restore PCI_MSIX_FLAGS_BIRMASK definition

09a2c73ddfc7 ("PCI: Remove unused PCI_MSIX_FLAGS_BIRMASK definition")
removed PCI_MSIX_FLAGS_BIRMASK from an exported header because it was
unused in the kernel. But that breaks user programs that were using it
(QEMU in particular).

Restore the PCI_MSIX_FLAGS_BIRMASK definition.

[bhelgaas: changelog]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
CC: [email protected] # v3.13+

diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index efe3443..413417f 100644
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -319,6 +319,7 @@
#define PCI_MSIX_PBA 8 /* Pending Bit Array offset */
#define PCI_MSIX_PBA_BIR 0x00000007 /* BAR index */
#define PCI_MSIX_PBA_OFFSET 0xfffffff8 /* Offset into specified BAR */
+#define PCI_MSIX_FLAGS_BIRMASK PCI_MSIX_PBA_BIR /* deprecated */
#define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */

/* MSI-X Table entry format */

2015-07-27 14:55:21

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: [PATCH] pci_regs: reintroduce PCI_MSIX_FLAGS_BIRMASK

On Tue, Jul 14, 2015 at 06:29:24PM -0500, Bjorn Helgaas wrote:
> On Mon, Jul 13, 2015 at 06:11:38PM +0300, Michael S. Tsirkin wrote:
> > On Wed, Jul 01, 2015 at 12:14:10PM +0200, Michael S. Tsirkin wrote:
> > > This partially reverts commit 09a2c73ddfc7f173237fc7209a65b34dd5bcb5ed.
> > > PCI: Remove unused PCI_MSIX_FLAGS_BIRMASK definition
> > >
> > > That commit dropped a symbol from an exported header claiming "no one
> > > uses it". This isn't how Linux normally approaches userspace API though,
> > > and in fact QEMU build fails if trying to use updated headers from linux
> > > 3.12 and up.
> > >
> > > Sure, userspace can be fixed to use the new symbol, but the cost
> > > of keeping the old one around is fairly low, too.
> > >
> > > Signed-off-by: Michael S. Tsirkin <[email protected]>
>
> Sorry, I lost the original message somehow, so I can't reply to it. I
> applied this by hand to my for-linus branch for v4.2, thanks!



Did you mean 4.2? time's running out on this one ...
Just making sure - it's still not upstream, right?


>
> commit c9ddbac9c89110f77cb0fa07e634aaf1194899aa
> Author: Michael S. Tsirkin <[email protected]>
> Date: Tue Jul 14 18:27:46 2015 -0500
>
> PCI: Restore PCI_MSIX_FLAGS_BIRMASK definition
>
> 09a2c73ddfc7 ("PCI: Remove unused PCI_MSIX_FLAGS_BIRMASK definition")
> removed PCI_MSIX_FLAGS_BIRMASK from an exported header because it was
> unused in the kernel. But that breaks user programs that were using it
> (QEMU in particular).
>
> Restore the PCI_MSIX_FLAGS_BIRMASK definition.
>
> [bhelgaas: changelog]
> Signed-off-by: Michael S. Tsirkin <[email protected]>
> Signed-off-by: Bjorn Helgaas <[email protected]>
> CC: [email protected] # v3.13+
>
> diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
> index efe3443..413417f 100644
> --- a/include/uapi/linux/pci_regs.h
> +++ b/include/uapi/linux/pci_regs.h
> @@ -319,6 +319,7 @@
> #define PCI_MSIX_PBA 8 /* Pending Bit Array offset */
> #define PCI_MSIX_PBA_BIR 0x00000007 /* BAR index */
> #define PCI_MSIX_PBA_OFFSET 0xfffffff8 /* Offset into specified BAR */
> +#define PCI_MSIX_FLAGS_BIRMASK PCI_MSIX_PBA_BIR /* deprecated */
> #define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */
>
> /* MSI-X Table entry format */

2015-07-27 16:14:10

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH] pci_regs: reintroduce PCI_MSIX_FLAGS_BIRMASK

On Mon, Jul 27, 2015 at 9:55 AM, Michael S. Tsirkin <[email protected]> wrote:
> On Tue, Jul 14, 2015 at 06:29:24PM -0500, Bjorn Helgaas wrote:
>> On Mon, Jul 13, 2015 at 06:11:38PM +0300, Michael S. Tsirkin wrote:
>> > On Wed, Jul 01, 2015 at 12:14:10PM +0200, Michael S. Tsirkin wrote:
>> > > This partially reverts commit 09a2c73ddfc7f173237fc7209a65b34dd5bcb5ed.
>> > > PCI: Remove unused PCI_MSIX_FLAGS_BIRMASK definition
>> > >
>> > > That commit dropped a symbol from an exported header claiming "no one
>> > > uses it". This isn't how Linux normally approaches userspace API though,
>> > > and in fact QEMU build fails if trying to use updated headers from linux
>> > > 3.12 and up.
>> > >
>> > > Sure, userspace can be fixed to use the new symbol, but the cost
>> > > of keeping the old one around is fairly low, too.
>> > >
>> > > Signed-off-by: Michael S. Tsirkin <[email protected]>
>>
>> Sorry, I lost the original message somehow, so I can't reply to it. I
>> applied this by hand to my for-linus branch for v4.2, thanks!
>
>
>
> Did you mean 4.2? time's running out on this one ...
> Just making sure - it's still not upstream, right?

It's on my for-linus branch and it's been in -next for a couple weeks.
We're at -rc4, and I will send a pull request to Linus before v4.2
releases. This is a really minor fix, so I'm holding it in case there
are other fixes that I can include in the same request.

>> commit c9ddbac9c89110f77cb0fa07e634aaf1194899aa
>> Author: Michael S. Tsirkin <[email protected]>
>> Date: Tue Jul 14 18:27:46 2015 -0500
>>
>> PCI: Restore PCI_MSIX_FLAGS_BIRMASK definition
>>
>> 09a2c73ddfc7 ("PCI: Remove unused PCI_MSIX_FLAGS_BIRMASK definition")
>> removed PCI_MSIX_FLAGS_BIRMASK from an exported header because it was
>> unused in the kernel. But that breaks user programs that were using it
>> (QEMU in particular).
>>
>> Restore the PCI_MSIX_FLAGS_BIRMASK definition.
>>
>> [bhelgaas: changelog]
>> Signed-off-by: Michael S. Tsirkin <[email protected]>
>> Signed-off-by: Bjorn Helgaas <[email protected]>
>> CC: [email protected] # v3.13+
>>
>> diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
>> index efe3443..413417f 100644
>> --- a/include/uapi/linux/pci_regs.h
>> +++ b/include/uapi/linux/pci_regs.h
>> @@ -319,6 +319,7 @@
>> #define PCI_MSIX_PBA 8 /* Pending Bit Array offset */
>> #define PCI_MSIX_PBA_BIR 0x00000007 /* BAR index */
>> #define PCI_MSIX_PBA_OFFSET 0xfffffff8 /* Offset into specified BAR */
>> +#define PCI_MSIX_FLAGS_BIRMASK PCI_MSIX_PBA_BIR /* deprecated */
>> #define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */
>>
>> /* MSI-X Table entry format */