[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/vpci: fix memory type in guest_mem_bar_read()


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Tue, 10 Dec 2024 12:10:52 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=citrix.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 (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Gu6eYOa3khxPcVYL956PzomvkQ877K0g6poQ1WpNxyA=; b=plMC6o98c49jT8QGvGRBG8/Y3T6ow8sdLf9akz1LorglBukVfQy2Eo/3FSqnI3dW+LdmAEGmIcbPMw5RhflKfIapXhznfLxdrl56e0QBXW7JXESPdBNKV4P6M2CVzKh6rtmp0zwWuOBAJ4p85HTmES82+xvoVIKc6it/7+XXhDC+vii8uMDgc1WRtOxBFWJaldK5XZWqQO8hdMXoawC3TeSgJ1NFFxtPTG/WUb3HpVH5/8Co2XuE5pH2geF0Z6aw1azMe7n/XOqG/57qC1vUBNcj8On6JTLzP0vh4BK/9++pmLRjShplAShWEWa0ZjTc96iIewzmqQOX4aQHFJ8f8g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=O1WLPk6NHYqlM5b2VqmA4xxiXY/QhTwTEjuAMvrBchAb8EyBIQhEXev3aBanNOo+YH9rNCKkKo3p8OpyPk6kCJjZ2LllGHHSUPe5hRscek5AxHUHcLEfg3oE1YANzIwxFT8Ph19qIreqrRn7jZ2umWNJ6gDLN3xFWgHX95M3d19XRWUa+i6JhN9PIaogrtSq/K98Xf1ZpnBiVG2kZzGUwEwyZAwJlQ4+1997KdIagndYr6Y4sj1EyHndWuGqSWY9BXqZbj711MDg1D688KlyAZe1wH57k5kjUJNCR/kvGdlIN3jAzUSFy4xh/XqsY/SFcS1uIqhH+Tc8P4jr2tTv1A==
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 10 Dec 2024 17:11:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12/10/24 11:37, Roger Pau Monné wrote:
> On Tue, Dec 10, 2024 at 11:25:44AM -0500, Stewart Hildebrand wrote:
>> Currently, if bar->type is anything other than VPCI_BAR_MEM32, the
>> memory type bits get set to PCI_BASE_ADDRESS_MEM_TYPE_64 in the returned
>> value. This leads to the wrong memory type for, e.g. VPCI_BAR_EMPTY.
>> Only set PCI_BASE_ADDRESS_MEM_TYPE_64 when the bar type is
>> VPCI_BAR_MEM64_LO.
> 
> I'm confused, VPCI_BAR_EMPTY shouldn't use guest_mem_bar_read() in the
> first place, as its read handler should be vpci_read_val() instead.
> 
> Is there something I'm missing from init_header()?
> 
>         if ( size == 0 )
>         {
>             bars[i].type = VPCI_BAR_EMPTY;
> 
>             if ( !is_hwdom )
>             {
>                 rc = vpci_add_register(pdev->vpci, vpci_read_val, NULL,
>                                        reg, 4, (void *)0);
>                 if ( rc )
>                     goto fail;
>             }
> 
>             continue;
>         }
> 
> AFAICT guest_mem_bar_read() should only handle BAR types that are
> either VPCI_BAR_MEM32, VPCI_BAR_MEM64_HI or VPCI_BAR_MEM64_LO, and
> that seems to be correctly handled?

Ah, you're right, sorry. I pulled this patch out of another series that
I'm working on, but failed to realize that guest_mem_bar_read shouldn't
be used for VPCI_BAR_EMPTY. Please disregard.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.