[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC XEN PATCH 2/6] vpci: accept BAR writes if dom0 is PVH
- To: "Koenig, Christian" <Christian.Koenig@xxxxxxx>
- From: Huang Rui <ray.huang@xxxxxxx>
- Date: Mon, 13 Mar 2023 16:55:05 +0800
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.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=1+PExcv0EutWr4XZN0JdtyuBhcCY2NsQB8QJGRL96/k=; b=fhLeeg7csr5mjvGxpbtLhIEN5NXq8F3oZUlRKy1jq3ex+uLPsX6p3miVSgbWzi2sDrUFKwRJEADU/yIaeeWm9xF+St54BY8VW3StQDnItIHo39dHIureBUjvpdONoj6MD5e0VjzX9A2iW4GQvtgXPdZit38hz0MPzw/L4dKrUi4Na5VR4sZpxCbA2jZ9jnPZ8lcrYzFabbwkcWf0qzJP9uEHUx2mcvbb34Op06WhebVoNwAAWB6Z1cCdbIPbD12A70lYoaUqBUD3RFQ8zx4q4suaF9clCNrXRx++V8EwPV6ivJ1Fv0XyumTceN81KuERInuIFTSD8yWokE2l227cbg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LdKHhOivOZ/P5PHM22t3YFh3nPDmzeRX0aAn1giEGUSozOickO+5HQnQYSzMC/S3NkJhXzEbqCB7lMlkLqMDj+IOvLPW+38qSbbfaJ2k+t9XywwZAc7fWkP0jU/CFPPkPB2T4YEJvNA348AQq6ErHOLgNCliXVjwwLOe34Q6MpuTLMD8wmA6xtm5oBG4gMjx8XP30VnkjVHxJsudwZkKkSQDFOERHzHWSrWWN+DmIDjO357fuAIF7cGaNEHVnfz49uuij0L6hann3B3E2hRLVF3FKHnv0CyMQC1BFcuPg2lEeGW/hstH+f11gcIXu1c2bVEeAVPbM2ZAWbppRHfN8A==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Deucher, Alexander" <Alexander.Deucher@xxxxxxx>, "Hildebrand, Stewart" <Stewart.Hildebrand@xxxxxxx>, Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, "Huang, Honglei1" <Honglei1.Huang@xxxxxxx>, "Zhang, Julia" <Julia.Zhang@xxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
- Delivery-date: Mon, 13 Mar 2023 08:55:42 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Mon, Mar 13, 2023 at 03:26:09PM +0800, Koenig, Christian wrote:
> Am 13.03.23 um 08:23 schrieb Christian König:
> >
> >
> > Am 12.03.23 um 08:54 schrieb Huang Rui:
> >> From: Chen Jiqian <Jiqian.Chen@xxxxxxx>
> >>
> >> When dom0 is PVH and we want to passthrough gpu to guest,
> >> we should allow BAR writes even through BAR is mapped. If
> >> not, the value of BARs are not initialized when guest firstly
> >> start.
> >>
> >> Signed-off-by: Chen Jiqian <Jiqian.Chen@xxxxxxx>
> >> Signed-off-by: Huang Rui <ray.huang@xxxxxxx>
> >> ---
> >> xen/drivers/vpci/header.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
> >> index ec2e978a4e..918d11fbce 100644
> >> --- a/xen/drivers/vpci/header.c
> >> +++ b/xen/drivers/vpci/header.c
> >> @@ -392,7 +392,7 @@ static void cf_check bar_write(
> >> * Xen only cares whether the BAR is mapped into the p2m, so
> >> allow BAR
> >> * writes as long as the BAR is not mapped into the p2m.
> >> */
> >> - if ( bar->enabled )
> >> + if ( pci_conf_read16(pdev->sbdf, PCI_COMMAND) &
> >> PCI_COMMAND_MEMORY )
> >
> > Checkpath.pl gives here:
> >
> > ERROR: space prohibited after that open parenthesis '('
> > #115: FILE: xen/drivers/vpci/header.c:395:
> > + if ( pci_conf_read16(pdev->sbdf, PCI_COMMAND) & PCI_COMMAND_MEMORY )
>
> But I should probably mention that I'm not 100% sure if this code base
> uses kernel coding style!
>
I noticed that actully Xen's coding style was different with Linux kernel.
Thanks,
Ray
|