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

Re: [PATCH v8 08/13] vpci/header: program p2m with guest BAR view


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 24 Jul 2023 15:31:56 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=4bStPEJpe5jiTrOHHetxFmq274agqPmssi/OYDxvWC4=; b=f4BnbaquPIO2/6pWNbde9RYj2P6ZoDWwvarbOaMdKoT1IqI/O1MVsr0jn/99puS7WjfjtIR5mhEfjwBdLTk/o/63toVqkdPJkBpoTKd8ynHO3L+pNwlOrzOKI8jRaiO2cl+M9O2SjU0/2z9J7SwWr3QleECreN/L1B9DrA6UV7zw8Jf2wP3MYPR9LeNvR6fJ2QGa6TIxWp4BXF5z+DJeSSNQV13xiNnmR4viVTSAzpJwyxxrC7kRGmfXPpiP3ib37+9kPznkbX81EeXf/d3GewyE9wWp+oyw6K+3bVKrUGOKZI49oLc+9nDE2kpCy+Cd67xA3RwRtX9JcRbedSI2Ng==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HwtINDcE8lMeryoyHFPtHZPI9LdpiEFLfyrUHaiNmZM9fDnfz/bne/oTlQEvPa5wTBERvc2F9cS7WXGs5l+3TBvl6DK2Om1C+eQqUxWZ4UPlr7OTcQau3IRKYIIeCziyONvvxlc4FkiLUR3z6AEvL7fFOFfJmnuCxgeaN4J5cG/h84SmL4MniywEZCm9CeayX4lqZTg+a8tCNtyxBxOTz0qctGLEHci4h4QpcqZT6vfDfjIfdawy1G5ZRfqzXr9WR2ZgftLHsYJAv5zRDjTM2b4EvFZI2HaNJ/PsWhCpK36AIrcrzm0L35LGp+q8+qeHVPc0KMBmLYaaNVqEvWei8A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 24 Jul 2023 13:32:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24.07.2023 15:16, Roger Pau Monné wrote:
> On Mon, Jul 24, 2023 at 12:43:26PM +0200, Jan Beulich wrote:
>> On 20.07.2023 02:32, Volodymyr Babchuk wrote:
>>> @@ -52,8 +66,8 @@ static int cf_check map_range(
>>>           * - {un}map_mmio_regions doesn't support preemption.
>>>           */
>>>  
>>> -        rc = map->map ? map_mmio_regions(map->d, _gfn(s), size, _mfn(s))
>>> -                      : unmap_mmio_regions(map->d, _gfn(s), size, _mfn(s));
>>> +        rc = map->map ? map_mmio_regions(map->d, start_gfn, size, _mfn(s))
>>> +                      : unmap_mmio_regions(map->d, start_gfn, size, 
>>> _mfn(s));
>>
>> Aiui this is the first direct exposure of these functions to DomU-s;
> 
> I guess it depends on how direct you consider exposure from
> XEN_DOMCTL_memory_mapping hypercall, as that's what gets called by
> QEMU also in order to set up BAR mappings.

Fair point - it is one of the few domctls not covered by XSA-77.

>> so far all calls were Xen-internal or from a domctl. There are a
>> couple of Arm TODOs listed in the comment ahead, but I'm not sure
>> that's all what is lacking here, and it's unclear whether this can
>> sensibly be left as a follow-on activity (at the very least known
>> open issues need mentioning as TODOs).
>>
>> For example the x86 function truncates an unsigned long local
>> variable to (signed) int in its main return statement. This may for
>> the moment still be only a theoretical issue, but will need dealing
>> with sooner or later, I think.
> 
> One bit that we need to add is the iomem_access_permitted() plus the
> xsm_iomem_mapping() checks to map_range().

The former would just be reassurance, wouldn't it? Assigning a PCI
device surely implies granting access to all its BARs (minus the
MSI-X page(s), if any). The latter would of course be more
"interesting", as XSM could in principle interject.

Jan



 


Rackspace

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