public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Yunxiang Li <Yunxiang.Li@amd.com>
Cc: <kvm@vger.kernel.org>, <kevin.tian@intel.com>,
	<yishaih@nvidia.com>, <ankita@nvidia.com>, <jgg@ziepe.ca>
Subject: Re: [PATCH 1/3] vfio/pci: Remove shadow rom specific code paths
Date: Thu, 12 Dec 2024 16:00:24 -0700	[thread overview]
Message-ID: <20241212160024.38f6cd1b.alex.williamson@redhat.com> (raw)
In-Reply-To: <20241212205050.5737-1-Yunxiang.Li@amd.com>


Please us a cover letter for any multi-part series to describe your
overall goal with the series.

On Thu, 12 Dec 2024 15:50:48 -0500
Yunxiang Li <Yunxiang.Li@amd.com> wrote:

> After 0c0e0736acad, the shadow rom works the same as regular ROM BARs so
> these code paths are no longer needed.

Commit references should be in the form of:

  After commit 0c0e0736acad ("PCI: Set ROM shadow location in arch
  code, not in PCI core"), the shadow...

Thanks,
Alex

> Signed-off-by: Yunxiang Li <Yunxiang.Li@amd.com>
> ---
>  drivers/vfio/pci/vfio_pci_config.c |  8 ++------
>  drivers/vfio/pci/vfio_pci_core.c   | 10 ++--------
>  drivers/vfio/pci/vfio_pci_rdwr.c   |  3 ---
>  3 files changed, 4 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c
> index ea2745c1ac5e6..e41c3a965663e 100644
> --- a/drivers/vfio/pci/vfio_pci_config.c
> +++ b/drivers/vfio/pci/vfio_pci_config.c
> @@ -511,13 +511,9 @@ static void vfio_bar_fixup(struct vfio_pci_core_device *vdev)
>  		mask = ~(pci_resource_len(pdev, PCI_ROM_RESOURCE) - 1);
>  		mask |= PCI_ROM_ADDRESS_ENABLE;
>  		*vbar &= cpu_to_le32((u32)mask);
> -	} else if (pdev->resource[PCI_ROM_RESOURCE].flags &
> -					IORESOURCE_ROM_SHADOW) {
> -		mask = ~(0x20000 - 1);
> -		mask |= PCI_ROM_ADDRESS_ENABLE;
> -		*vbar &= cpu_to_le32((u32)mask);
> -	} else
> +	} else {
>  		*vbar = 0;
> +	}
>  
>  	vdev->bardirty = false;
>  }
> diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c
> index 1ab58da9f38a6..b49dd9cdc072a 100644
> --- a/drivers/vfio/pci/vfio_pci_core.c
> +++ b/drivers/vfio/pci/vfio_pci_core.c
> @@ -1057,14 +1057,8 @@ static int vfio_pci_ioctl_get_region_info(struct vfio_pci_core_device *vdev,
>  
>  		/* Report the BAR size, not the ROM size */
>  		info.size = pci_resource_len(pdev, info.index);
> -		if (!info.size) {
> -			/* Shadow ROMs appear as PCI option ROMs */
> -			if (pdev->resource[PCI_ROM_RESOURCE].flags &
> -			    IORESOURCE_ROM_SHADOW)
> -				info.size = 0x20000;
> -			else
> -				break;
> -		}
> +		if (!info.size)
> +			break;
>  
>  		/*
>  		 * Is it really there?  Enable memory decode for implicit access
> diff --git a/drivers/vfio/pci/vfio_pci_rdwr.c b/drivers/vfio/pci/vfio_pci_rdwr.c
> index 66b72c2892841..a1eeacad82120 100644
> --- a/drivers/vfio/pci/vfio_pci_rdwr.c
> +++ b/drivers/vfio/pci/vfio_pci_rdwr.c
> @@ -244,9 +244,6 @@ ssize_t vfio_pci_bar_rw(struct vfio_pci_core_device *vdev, char __user *buf,
>  
>  	if (pci_resource_start(pdev, bar))
>  		end = pci_resource_len(pdev, bar);
> -	else if (bar == PCI_ROM_RESOURCE &&
> -		 pdev->resource[bar].flags & IORESOURCE_ROM_SHADOW)
> -		end = 0x20000;
>  	else
>  		return -EINVAL;
>  


      parent reply	other threads:[~2024-12-12 23:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-12 20:50 [PATCH 1/3] vfio/pci: Remove shadow rom specific code paths Yunxiang Li
2024-12-12 20:50 ` [PATCH 2/3] vfio/pci: refactor vfio_pci_bar_rw Yunxiang Li
2024-12-12 23:00   ` Alex Williamson
2024-12-16 13:48     ` Li, Yunxiang (Teddy)
2024-12-20 12:36   ` kernel test robot
2024-12-20 20:22   ` kernel test robot
2024-12-12 20:50 ` [PATCH 3/3] vfio/pci: Expose setup ROM at ROM bar when needed Yunxiang Li
2024-12-12 23:00   ` Alex Williamson
2024-12-12 23:00 ` Alex Williamson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241212160024.38f6cd1b.alex.williamson@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=Yunxiang.Li@amd.com \
    --cc=ankita@nvidia.com \
    --cc=jgg@ziepe.ca \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=yishaih@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox