[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 24 Jul 2023 15:42:39 +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=pt0PHpuTnjqwbpU3YSkhKGRJ00J7NkyVGF+Cp4quThs=; b=iGic8dmBb+FiHnsS3RPRczoFftxToJdKL/gilBCwyitWDhCAL/md8fMzYlS0Itv48bh6n+zEyS73V1AWZg+bZxetPeZFDpsaUEr+HJ15NmMAMZzSzvfuPDvkV1nmaEICTC1LvtNVDSfow+tfROPuF1fcOdjKB2q2cS1JBa+vuxlUc6+V7u8eKsCSVREASWqKuZ38PRsnLqSuvzDXZPaXcFgUNPcbhLVuy+w4M+hCdbwLD28fYQmlCSq3ng3gkRKIFwJG55OVQYJqR4aXtTQ8660x3KN8KgEUJjsJn+JjUjbHpXjl5nqdDkWlt27CB2hKw8b9mjfFucn3DMPn+kJIhw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jLVerEAlObNAR8L0MQAYu+CV2cBrLUz6jF3Tno3dq1CfqxQQp5jdsptSAc90lLkzB6p7wP0RSM4EHD8RmGfADni/iCuq1259xguD5WfDtCMDnZ4Gb+8/tGA/Tts1BziFsWzXt8QzvlxjRNHqr+HfI/3oQYGwCBY6FpUckRWdJq93OEXZaZo1hLjzOST7kf7UrLc+Redq/igVBaae3cRQ7L57sYCcHcuUkBofBMa5tPen8kjbtvyiRXuN1yKwdFuPRxC/kHKBjOFgPVhzWPjC0EXp+C1cnijIjocmeEFPMshPV9yaHyuSOxPkK7Z/ecieBDMB5RFhFOoXcsrOKI0yGw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.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:43:07 +0000
  • Ironport-data: A9a23:8gy7x6JqLY/E24C4FE+RAZQlxSXFcZb7ZxGr2PjKsXjdYENShWdRy DEfXTuDPa2Oazb2f4x0O9i2/BxTsZeDndMyQVFlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws Jb5rta31GWNglaYCUpKrfrawP9TlK6q4mhA4QZlPasjUGL2zBH5MrpOfcldEFOgKmVkNrbSb /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/ jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5bPSYT+ fhbCQo8VT+vmsWbypOCd8Rz05FLwMnDZOvzu1lG5BSAV7MMZ8CGRK/Ho9hFwD03m8ZCW+7EY NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/dqpTGMl2Sd05C0WDbRUsaNSshP2F6Ru 0rN/njjAwFcP9uaodaA2iv12LKVxnqjAOr+EpWd6qBIjFezmlU/L0YKBGqEn9a/i0exDoc3x 0s8v3BGQbIJ3E6hQ8T5Xha4iGWZpRNaUN1Ve8UE7wWKxrvR8hyuLGEORT5ca/QrrMYzAzct0 zehuNfkBidmtrGPflub+q2JtjO5OSUTLmgqaDcNSE0O5NyLiJE+iFfDQ8huFIaxj8bpAnfgz jaSti88ir4Py8kR2M2GEUvvhjutot3DSF4z7wCOBGa9tFomP8iiepCi7kXd4bBYNoGFQ1Kdv X8C3c+D8OQJCpLLnyuIKAkQIIyUCz++GGW0qTZS81MJrlxBJ1bLkVhs3QxD
  • Ironport-hdrordr: A9a23:izt7gqzfKFFReWl48bSaKrPw6L1zdoMgy1knxilNoHxuH/Bw9v re+cjzsCWftN9/Yh4dcLy7VpVoIkmsl6Kdg7NwAV7KZmCP1FdARLsI0WKI+UyCJ8SRzI9gPa cLSdkFNDXzZ2IK8PoTNmODYqodKNrsytHWuQ/HpU0dKT2D88tbnn9E4gDwKDwQeCB2QaAXOb C7/cR9qz+paR0sH7+G7ilsZZmkmzXT/qiWGCI7Ow==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Jul 24, 2023 at 03:31:56PM +0200, Jan Beulich wrote:
> 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).

Indeed.  But for consistency we need to match the same checks that are
done in XEN_DOMCTL_memory_mapping.

> The latter would of course be more
> "interesting", as XSM could in principle interject.

Yes, we need both.  In fact I'm just writing a patch to add them
straight away.

Thanks, Roger.



 


Rackspace

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