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

Re: [Xen-devel] [PATCH] x86/p2m: fix non-translated handling of iommu mappings


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Tue, 23 Jul 2019 10:32:41 +0000
  • Accept-language: en-US
  • 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-SenderADCheck; bh=cdQAJpp88jHjSvv1oi3OtFPryh2h2/M7alVhgqXR3s4=; b=mHg73PV1oNT+I7BOl5F9eP+3w9GEmlA4zkmv9ZzT/cusDgm466cpAVF0henm3oAgO2LJqWmgXhiGBoEs0giWfmsGS0QUHJOQ2yCvRE95O+9d3w5LSkSrvPxwzrz0xTAJ182owgYUT0R4mTa2ChouFuDltE03/3CPgdU344hj2CSe2UMXKiPsHChrZQCV4gS80fFA2spvEbmu2AUgAJJ4dwW2CHTjpjS3sZRhey0zoIVYbhiflBXlMRHqNPCGdNJQnEsShkqmh7AzymrPKPqhdykCZYI7969hko5ZEoZZDN1R6JGPEyW5hBDND86d7+JcuPjprNL8DfoC9dZXMEUpUA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bSbFTCT3aAJZauD0sSZkKa1YoNeHzRp9VEDX9s3GYMoA/oNlvoH3KpxRRLtEdIHQ/JaCk9DahnRzlhM9uCJjJKUcmd28MF1Km11vqbYwH51A8f3umrwQuzrSm3p3VbTbOf9Yj1qoPEQE0or6r5zuxGPc1+Z7iWenXXR7d3aTjd1Yq6rX336JmEs6mN9nJZTYRHgIIXUBdaFv9nzLefVT+jFtc2bxCOTkrpXKtauuSb0dRVZwblHLxv7kjC+nY1vht5FWNAKsiLwEqkDFz19KlMCdWvKbDgWuGBrptJ94yT0IzqeFy4T2723wMCNXQVMgYkzdrET12/3+KFYy/oipHQ==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: George Dunlap <george.dunlap@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Paul Durrant <Paul.Durrant@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Tue, 23 Jul 2019 10:34:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVQKK+PBtG5JCnKkORtVT7Y+EqTqbYApyA
  • Thread-topic: [PATCH] x86/p2m: fix non-translated handling of iommu mappings

On 22.07.2019 17:32, Roger Pau Monne wrote:
> The current usage of need_iommu_pt_sync in p2m for non-translated
> guests is wrong because it doesn't correctly handle a relaxed PV
> hardware domain, that has need_sync set to false, but still need
> entries to be added from calls to {set/clear}_identity_p2m_entry.
> 
> Adjust the code in guest_physmap_add_page to also check whether the
> domain has an iommu instead of whether it needs syncing or not in
> order to take a reference to a page to be mapped.

Why this seemingly unrelated change? I ask because ...

> --- a/xen/arch/x86/mm/p2m.c
> +++ b/xen/arch/x86/mm/p2m.c
> @@ -836,7 +836,7 @@ guest_physmap_add_page(struct domain *d, gfn_t gfn, mfn_t 
> mfn,
>            */
>           for ( i = 0; i < (1UL << page_order); ++i, ++page )
>           {
> -            if ( !need_iommu_pt_sync(d) )
> +            if ( !has_iommu_pt(d) )
>                   /* nothing */;
>               else if ( get_page_and_type(page, d, PGT_writable_page) )
>                   put_page_and_type(page);

... this parallels the code in iommu_hwdom_init(), which similarly
uses need_iommu_pt_sync() (and during the prior discussion you did
agree with Paul that it shouldn't be changed). IOW the patch for
now can have my R-b only with this change and the respective part
of the description dropped.

Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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