[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v9 06/16] vpci/header: implement guest BAR register handlers
- To: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
- Date: Fri, 1 Sep 2023 01:25:15 -0400
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=epam.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=YKgwnuMdzxkVoV7dgB9Q9D7fvP477lcuMC/7ewiTwRk=; b=cu2ptjgAC3jY+5P3hcDRYsVcTNXXREifQwkca6/+WcBE1seVf7FRGXyjT871QBObOu4pPezsm6GNYDTVwLiO2JwsHnCblpsPc58e/uKVgf9vo0XkGwYUAjzgE3Kh+4FsPpTGUzPJekOIytej2u33JE2yarjaWV4syUXJRbtK66EE2bZstuQzj3MKxfmFGGZfW+ymHaZJZJk5wPUxBh7EG0fTeIe6oBdE5RkGPYwIlIwDaQ5t7v88N0Xc/16IaFVaPHCvNtv3VWkFi23WhUW+uV8ubf1q887RJaoiv2AGAbViiM99hKF2IFJKCCTHQiK4STe2rwDkHyDMi2ApLDXQqg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bz/puZT0YvupLpmbPHHQ6d4pvNgC1EYDNtCiV3NxJ/HlqMj3nnY7adwL98ywk0MmsUO5Wpj2LH7U/V9CtRg62/h2GV78KIGxEzF41wK57vvF7Rqyp3aNgRo9zboUhw/Cff0hmDCKOtb6Anh+hpACE0cjTW+VrNlFQfOARFolCjI6Usd54KCpIYSyqCsGuUkctemDL2zCzMENSJ/zGBL6njXVtr9HDZUuIxD3iOhF0omlE+l2pay2SzRXSIPLVAEcekXZSDhUsvuqHgKhM2fJgM6nLsrno6AqyPxLZ7mwUx8Kq+wJp5c0m8POW7e7K8Zt9eavs29nr0x4X4MPWyrKmw==
- Cc: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Fri, 01 Sep 2023 05:25:34 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 8/29/23 19:19, Volodymyr Babchuk wrote:
> diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
> index e58bbdf68d..e96d7b2b37 100644
> --- a/xen/drivers/vpci/header.c
> +++ b/xen/drivers/vpci/header.c
> @@ -477,6 +477,72 @@ static void cf_check bar_write(
> pci_conf_write32(pdev->sbdf, reg, val);
> }
>
> +static void cf_check guest_bar_write(const struct pci_dev *pdev,
> + unsigned int reg, uint32_t val, void
> *data)
> +{
> + struct vpci_bar *bar = data;
> + bool hi = false;
> + uint64_t guest_addr = bar->guest_addr;
> +
> + if ( bar->type == VPCI_BAR_MEM64_HI )
> + {
> + ASSERT(reg > PCI_BASE_ADDRESS_0);
> + bar--;
> + hi = true;
> + }
> + else
> + {
> + val &= PCI_BASE_ADDRESS_MEM_MASK;
> + }
> +
> + guest_addr &= ~(0xffffffffull << (hi ? 32 : 0));
Uppercase ULL on the constant to avoid a MISRA violation
|