[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v9 15/16] xen/arm: vpci: check guest range
- To: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Fri, 22 Sep 2023 10:44:34 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Rm2K6mwwlFjE8Ke+CWTxB2i5nH8w8q2XvV6lAJdIbPg=; b=F6XGbIUSqPyCpJrQQV4fTaHLjOjmkXF6Ohi7cdyXvGhr+TEwI2etrmHYYWpsK47VC+1BF3SWrND34WWRXiDb3JhokBUd221MkO2qKkAAgYrxsJI5Jf8q2/3DWJnUMClo+pcj2ASjtVP6rhTQEImyVTEwxflXTHzmqUOit6bZaIDFmODPzJZUWcqBz1QwZdvGPS3ZkD4rlVBt4B6/b7HfaNQfrSSD0CBP7I1wofqnfb5pz8hrrnKzKTIzKcJ8PdF3TkueIj2bKThae7Zc/NiT3sOngSB7V4HeW47pO8x/uoykuHZwxBdbnrLZ8mXBs9VDpnBFA7E+JXdZh7Y33yPCcw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c/MdO+znmlC34vmjsbL4SCm8SQ+cFTNKkrvN6NXFwn8FAc82jV1OGmZKNmsxUwzqQLTVHAsyRli42BX7n1Tailqp6NKKmjyz1+D5FlGxg7/hyH/m3ZfIsP3GkmB6kmEk3R1PEQQe5N0lojPz2TMwdgN6yL+JjwS9ks3qXxFnR9WW7M1YXDrANetPbwcJ+b47BJu89ytXR6Gu/k+Wvf1bqHEzmqpBsS9NQ5eBtvWGGWJePq0X63bnhwTYjqgCgXVWU6lnwCk2IAzQAUGi21Z7VJu5LeXz/6qDXKBJWUCw2bNskIjvMtf9CnD3QV/H+DaT58Ck9nEEXhv4AciwSiT8ag==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
- Delivery-date: Fri, 22 Sep 2023 08:45:09 +0000
- Ironport-data: A9a23:K0wy96uCJq3KEZ67JrIxtdcmHefnVG9fMUV32f8akzHdYApBsoF/q tZmKWqOOquCYWv8edF+bYjnoU4BsZHTxoViSVBl+yg9Q3sU+JbJXdiXEBz9bniYRiHhoOCLz O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVaicfHg3HFc4IMsYoUoLs/YjhYJ1isSODQqIu Nfjy+XSI1bg0DNvWo4uw/vrRChH4rKq41v0gnRkPaoQ5A6EzSFMZH4iDfrZw0XQE9E88tGSH 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG fMwMw4CLSyo3byK3aPla9BQn8I5E5XsM9ZK0p1g5Wmx4fcOZ7nmGvyPz/kImTA6i4ZJAOrUY NcfZXx3dhPcbhZTO1ARTpUjgOOvgXq5eDpdwL6XjfNvvy6Pk0osgP60boq9lt+iHK25mm6Co W3L5SLhCwwyP92D0zuVtHmrg4cjmAuiAtxIT+TpqaECbFu74TRPNhonaXuBj7qEjFS5eugDI mUv5X97xUQ13AnxJjXnZDWGp3qDsg8ZSsBnOeQw4wGQyYLZ+w+cQGMDS1ZpeNEg8cM7WzEu/ luIhM/yQyxitqWPTnCQ/avSqim9UQAOMWIdbDUYCwsE59Xuqps6iB7nR9NvVqWyi7XI9SrYx jmLqG00geUVhMtSjqGjpwmZ03Sru4TDSRMz6kPPRGW54whlZYmjIYu19Vzc6vUGJ4GcJrWcg EU5dwGlxLhmJfmweOalGo3hwJnBCy65DQDh
- Ironport-hdrordr: A9a23:gWZA4a0/PZzwAch0dRk6bAqjBIUkLtp133Aq2lEZdPU1SL3gqy nKpp9w6faaskdrZJhNo7690YO7IU80jKQFhrX5ZI3SOjUO21HIEGgB1/qb/9SIIUSXygc679 YFT0EUMrHN5DZB4PoTi2KDYrQdKLHtytHKuQ6n9RhQpPZRGsRd0zs=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Tue, Aug 29, 2023 at 11:19:47PM +0000, Volodymyr Babchuk wrote:
> From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
>
> Skip mapping the BAR if it is not in a valid range.
>
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
> ---
> xen/drivers/vpci/header.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
> index 1d243eeaf9..dbabdcbed2 100644
> --- a/xen/drivers/vpci/header.c
> +++ b/xen/drivers/vpci/header.c
> @@ -345,6 +345,15 @@ static int modify_bars(const struct pci_dev *pdev,
> uint16_t cmd, bool rom_only)
> bar->enabled == !!(cmd & PCI_COMMAND_MEMORY) )
> continue;
>
> +#ifdef CONFIG_ARM
> + if ( !is_hardware_domain(pdev->domain) )
> + {
> + if ( (start_guest < PFN_DOWN(GUEST_VPCI_MEM_ADDR)) ||
> + (end_guest >= PFN_DOWN(GUEST_VPCI_MEM_ADDR +
> GUEST_VPCI_MEM_SIZE)) )
> + continue;
> + }
> +#endif
Hm, I think this should be in a hook similar to pci_check_bar() that
can be implemented per-arch.
IIRC at least on x86 we allow the guest to place the BARs whenever it
wants, would such placement cause issues to the hypervisor on Arm?
Thanks, Roger.
|