linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] virtio: remove deprecated VIRTIO_PCI_CONFIG()
@ 2018-12-07  7:34 Dongli Zhang
  2018-12-07 18:01 ` Michael S. Tsirkin
  0 siblings, 1 reply; 3+ messages in thread
From: Dongli Zhang @ 2018-12-07  7:34 UTC (permalink / raw)
  To: virtualization, linux-kernel; +Cc: mst, jasowang

VIRTIO_PCI_CONFIG() is deprecated. Use VIRTIO_PCI_CONFIG_OFF() instead.

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
---
 drivers/virtio/virtio_pci_legacy.c | 6 ++++--
 include/uapi/linux/virtio_pci.h    | 2 --
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/virtio/virtio_pci_legacy.c b/drivers/virtio/virtio_pci_legacy.c
index de062fb..eff9ddc 100644
--- a/drivers/virtio/virtio_pci_legacy.c
+++ b/drivers/virtio/virtio_pci_legacy.c
@@ -52,7 +52,8 @@ static void vp_get(struct virtio_device *vdev, unsigned offset,
 {
 	struct virtio_pci_device *vp_dev = to_vp_device(vdev);
 	void __iomem *ioaddr = vp_dev->ioaddr +
-				VIRTIO_PCI_CONFIG(vp_dev) + offset;
+			VIRTIO_PCI_CONFIG_OFF(vp_dev->msix_enabled) +
+			offset;
 	u8 *ptr = buf;
 	int i;
 
@@ -67,7 +68,8 @@ static void vp_set(struct virtio_device *vdev, unsigned offset,
 {
 	struct virtio_pci_device *vp_dev = to_vp_device(vdev);
 	void __iomem *ioaddr = vp_dev->ioaddr +
-				VIRTIO_PCI_CONFIG(vp_dev) + offset;
+			VIRTIO_PCI_CONFIG_OFF(vp_dev->msix_enabled) +
+			offset;
 	const u8 *ptr = buf;
 	int i;
 
diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
index 90007a1..2070232 100644
--- a/include/uapi/linux/virtio_pci.h
+++ b/include/uapi/linux/virtio_pci.h
@@ -78,8 +78,6 @@
 /* The remaining space is defined by each driver as the per-driver
  * configuration space */
 #define VIRTIO_PCI_CONFIG_OFF(msix_enabled)	((msix_enabled) ? 24 : 20)
-/* Deprecated: please use VIRTIO_PCI_CONFIG_OFF instead */
-#define VIRTIO_PCI_CONFIG(dev)	VIRTIO_PCI_CONFIG_OFF((dev)->msix_enabled)
 
 /* Virtio ABI version, this must match exactly */
 #define VIRTIO_PCI_ABI_VERSION		0
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] virtio: remove deprecated VIRTIO_PCI_CONFIG()
  2018-12-07  7:34 [PATCH 1/1] virtio: remove deprecated VIRTIO_PCI_CONFIG() Dongli Zhang
@ 2018-12-07 18:01 ` Michael S. Tsirkin
  2018-12-08  0:56   ` Dongli Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Michael S. Tsirkin @ 2018-12-07 18:01 UTC (permalink / raw)
  To: Dongli Zhang; +Cc: virtualization, linux-kernel, jasowang

On Fri, Dec 07, 2018 at 03:34:41PM +0800, Dongli Zhang wrote:
> VIRTIO_PCI_CONFIG() is deprecated. Use VIRTIO_PCI_CONFIG_OFF() instead.
> 
> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
> ---
>  drivers/virtio/virtio_pci_legacy.c | 6 ++++--
>  include/uapi/linux/virtio_pci.h    | 2 --
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/virtio/virtio_pci_legacy.c b/drivers/virtio/virtio_pci_legacy.c
> index de062fb..eff9ddc 100644
> --- a/drivers/virtio/virtio_pci_legacy.c
> +++ b/drivers/virtio/virtio_pci_legacy.c
> @@ -52,7 +52,8 @@ static void vp_get(struct virtio_device *vdev, unsigned offset,
>  {
>  	struct virtio_pci_device *vp_dev = to_vp_device(vdev);
>  	void __iomem *ioaddr = vp_dev->ioaddr +
> -				VIRTIO_PCI_CONFIG(vp_dev) + offset;
> +			VIRTIO_PCI_CONFIG_OFF(vp_dev->msix_enabled) +
> +			offset;
>  	u8 *ptr = buf;
>  	int i;
>  
> @@ -67,7 +68,8 @@ static void vp_set(struct virtio_device *vdev, unsigned offset,
>  {
>  	struct virtio_pci_device *vp_dev = to_vp_device(vdev);
>  	void __iomem *ioaddr = vp_dev->ioaddr +
> -				VIRTIO_PCI_CONFIG(vp_dev) + offset;
> +			VIRTIO_PCI_CONFIG_OFF(vp_dev->msix_enabled) +
> +			offset;
>  	const u8 *ptr = buf;
>  	int i;
>

I agree that VIRTIO_PCI_CONFIG_OFF is a better interface. So above looks
fine.
  
> diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
> index 90007a1..2070232 100644
> --- a/include/uapi/linux/virtio_pci.h
> +++ b/include/uapi/linux/virtio_pci.h
> @@ -78,8 +78,6 @@
>  /* The remaining space is defined by each driver as the per-driver
>   * configuration space */
>  #define VIRTIO_PCI_CONFIG_OFF(msix_enabled)	((msix_enabled) ? 24 : 20)
> -/* Deprecated: please use VIRTIO_PCI_CONFIG_OFF instead */
> -#define VIRTIO_PCI_CONFIG(dev)	VIRTIO_PCI_CONFIG_OFF((dev)->msix_enabled)
>  
>  /* Virtio ABI version, this must match exactly */
>  #define VIRTIO_PCI_ABI_VERSION		0

This might break some userspace builds, I don't see why we should bother
removing it. Any reason?


> -- 
> 2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] virtio: remove deprecated VIRTIO_PCI_CONFIG()
  2018-12-07 18:01 ` Michael S. Tsirkin
@ 2018-12-08  0:56   ` Dongli Zhang
  0 siblings, 0 replies; 3+ messages in thread
From: Dongli Zhang @ 2018-12-08  0:56 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: virtualization, linux-kernel, jasowang



On 12/08/2018 02:01 AM, Michael S. Tsirkin wrote:
> On Fri, Dec 07, 2018 at 03:34:41PM +0800, Dongli Zhang wrote:
>> VIRTIO_PCI_CONFIG() is deprecated. Use VIRTIO_PCI_CONFIG_OFF() instead.
>>
>> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
>> ---
>>  drivers/virtio/virtio_pci_legacy.c | 6 ++++--
>>  include/uapi/linux/virtio_pci.h    | 2 --
>>  2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/virtio/virtio_pci_legacy.c b/drivers/virtio/virtio_pci_legacy.c
>> index de062fb..eff9ddc 100644
>> --- a/drivers/virtio/virtio_pci_legacy.c
>> +++ b/drivers/virtio/virtio_pci_legacy.c
>> @@ -52,7 +52,8 @@ static void vp_get(struct virtio_device *vdev, unsigned offset,
>>  {
>>  	struct virtio_pci_device *vp_dev = to_vp_device(vdev);
>>  	void __iomem *ioaddr = vp_dev->ioaddr +
>> -				VIRTIO_PCI_CONFIG(vp_dev) + offset;
>> +			VIRTIO_PCI_CONFIG_OFF(vp_dev->msix_enabled) +
>> +			offset;
>>  	u8 *ptr = buf;
>>  	int i;
>>  
>> @@ -67,7 +68,8 @@ static void vp_set(struct virtio_device *vdev, unsigned offset,
>>  {
>>  	struct virtio_pci_device *vp_dev = to_vp_device(vdev);
>>  	void __iomem *ioaddr = vp_dev->ioaddr +
>> -				VIRTIO_PCI_CONFIG(vp_dev) + offset;
>> +			VIRTIO_PCI_CONFIG_OFF(vp_dev->msix_enabled) +
>> +			offset;
>>  	const u8 *ptr = buf;
>>  	int i;
>>
> 
> I agree that VIRTIO_PCI_CONFIG_OFF is a better interface. So above looks
> fine.
>   
>> diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
>> index 90007a1..2070232 100644
>> --- a/include/uapi/linux/virtio_pci.h
>> +++ b/include/uapi/linux/virtio_pci.h
>> @@ -78,8 +78,6 @@
>>  /* The remaining space is defined by each driver as the per-driver
>>   * configuration space */
>>  #define VIRTIO_PCI_CONFIG_OFF(msix_enabled)	((msix_enabled) ? 24 : 20)
>> -/* Deprecated: please use VIRTIO_PCI_CONFIG_OFF instead */
>> -#define VIRTIO_PCI_CONFIG(dev)	VIRTIO_PCI_CONFIG_OFF((dev)->msix_enabled)
>>  
>>  /* Virtio ABI version, this must match exactly */
>>  #define VIRTIO_PCI_ABI_VERSION		0
> 
> This might break some userspace builds, I don't see why we should bother
> removing it. Any reason?

Apologies.

I thought about some compatibility issue for building third-party kernel module
at userspace, but did not realize it will break other userspace software builds.

I will keep the definition of VIRTIO_PCI_CONFIG() and resend again.

Thank you very much!

Dongli Zhang

> 
> 
>> -- 
>> 2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-08  0:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-07  7:34 [PATCH 1/1] virtio: remove deprecated VIRTIO_PCI_CONFIG() Dongli Zhang
2018-12-07 18:01 ` Michael S. Tsirkin
2018-12-08  0:56   ` Dongli Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).