From: Jason Gunthorpe <jgg@nvidia.com>
To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
"cohuck@redhat.com" <cohuck@redhat.com>,
"mgurtovoy@nvidia.com" <mgurtovoy@nvidia.com>,
"yishaih@nvidia.com" <yishaih@nvidia.com>,
Linuxarm <linuxarm@huawei.com>,
liulongfang <liulongfang@huawei.com>,
"Zengtao (B)" <prime.zeng@hisilicon.com>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
"Wangzhou (B)" <wangzhou1@hisilicon.com>
Subject: Re: [RFC v4 5/8] hisi_acc_vfio_pci: Restrict access to VF dev BAR2 migration region
Date: Thu, 10 Feb 2022 11:19:40 -0400 [thread overview]
Message-ID: <20220210151940.GA446748@nvidia.com> (raw)
In-Reply-To: <5269a28bf55f4a44b23e6f59d0d5b86b@huawei.com>
On Thu, Feb 10, 2022 at 03:01:50PM +0000, Shameerali Kolothum Thodi wrote:
> > > + unsigned int index = VFIO_PCI_OFFSET_TO_INDEX(*ppos);
> > > + struct vfio_pci_core_device *vdev =
> > > + container_of(core_vdev, struct vfio_pci_core_device, vdev);
> > > +
> > > + if (index == VFIO_PCI_BAR2_REGION_INDEX) {
> > > + loff_t pos = *ppos & VFIO_PCI_OFFSET_MASK;
> > > + resource_size_t end = pci_resource_len(vdev->pdev, index) / 2;
> >
> > Be careful here, there are nested assignment use cases. This can only
> > survive one level of assignment before we've restricted more than we
> > intended. If migration support is dependent on PF access, can we use
> > that to determine when to when to expose only half the BAR and when to
> > expose the full BAR?
>
> Ok. I will add a check here.
You might be better to just install a different ops when migration is
not supported, none of this stuff should be actived in that case.
Jason
next prev parent reply other threads:[~2022-02-10 15:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-08 13:34 [RFC v4 0/8] vfio/hisilicon: add ACC live migration driver Shameer Kolothum
2022-02-08 13:34 ` [RFC v4 1/8] crypto: hisilicon/qm: Move the QM header to include/linux Shameer Kolothum
2022-02-08 13:34 ` [RFC v4 2/8] crypto: hisilicon/qm: Move few definitions to common header Shameer Kolothum
2022-02-08 13:34 ` [RFC v4 3/8] hisi_acc_qm: Move PCI device IDs " Shameer Kolothum
2022-02-08 13:34 ` [RFC v4 4/8] hisi_acc_vfio_pci: add new vfio_pci driver for HiSilicon ACC devices Shameer Kolothum
2022-02-08 14:34 ` Jason Gunthorpe
2022-02-08 13:34 ` [RFC v4 5/8] hisi_acc_vfio_pci: Restrict access to VF dev BAR2 migration region Shameer Kolothum
2022-02-09 21:41 ` Alex Williamson
2022-02-10 15:01 ` Shameerali Kolothum Thodi
2022-02-10 15:19 ` Jason Gunthorpe [this message]
2022-02-08 13:34 ` [RFC v4 6/8] crypto: hisilicon/qm: Add helper to retrieve the PF qm data Shameer Kolothum
2022-02-08 14:25 ` Jason Gunthorpe
2022-02-08 14:49 ` Shameerali Kolothum Thodi
2022-02-08 14:54 ` Jason Gunthorpe
2022-02-08 13:34 ` [RFC v4 7/8] hisi_acc_vfio_pci: Add support for VFIO live migration Shameer Kolothum
2022-02-08 15:22 ` Jason Gunthorpe
2022-02-08 15:48 ` Shameerali Kolothum Thodi
2022-02-08 16:01 ` Jason Gunthorpe
2022-02-09 23:44 ` Alex Williamson
2022-02-10 15:07 ` Shameerali Kolothum Thodi
2022-02-08 13:34 ` [RFC v4 8/8] hisi_acc_vfio_pci: Use its own PCI reset_done error handler Shameer Kolothum
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=20220210151940.GA446748@nvidia.com \
--to=jgg@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=cohuck@redhat.com \
--cc=jonathan.cameron@huawei.com \
--cc=kvm@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=liulongfang@huawei.com \
--cc=mgurtovoy@nvidia.com \
--cc=prime.zeng@hisilicon.com \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=wangzhou1@hisilicon.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.