[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] AMD/IOMMU: don't increase perms when splitting superpage
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Thu, 19 Aug 2021 10:04:12 +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-SenderADCheck; bh=3qHfb5KJ+gqoZnXo/WTxBUAAv7PLQTTe/68/DQABjjw=; b=kUELKvvrFoQxqhou8wCY+/gFwrqVDr/NbWDtxILnNBtlhTVjtvuYYop6mJthagLjSw0NuiXwKf5IcohysPM9VfcUvM0erzwGd9snp9VWyjaBAUIXD64VBubhaswvifQUPvLMobKKYu5qLRrLv3jyFm6oRJ5lvtW+gfzVgblxuEpyBeANlwuBxj953kzN+Q3bAKZ1QRcDoQKuPFgv1yqRG6J2TO/LlAPhbTjQPcB811tsGnbfJeL6aAUccP0Stf9WzsA9WLqR/5e+tEu7aInTw+q7+SzgTtgBUCK8yrdktp8hDTmcWS+F0fXQHFCGyqIAgk6ud8ZgSv8yVlXRCF43Dw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I/iZvSkYOSu0VEOByEKRjtigLEip5w6Toxlakxaeybq5wNeQrKMlEk8oW3zzDFACFH2nW0snBGNy4g3zXTOYezlM8zYCx3I7WpTms6krwKNR+cPoFjLUmSz4No2daPn6OEBH8x67SExPwsg0Iu42UMnGGIwK/wWguqj5ipOghHZ8pJqIWhttpBz9UaSG9C02Xo8ZzkkADvzqu9jwrYKSRS7ebhfIZWTlvFeJVZWXAgc8FMpN4TaY7eVKML95vEsAY9vT//GyUOicPvJv4NtTeksgAeAUB4N+ConZM8QRlWK1rfG0I43FZ/Bx42rmBI9RbeUNfFywUwUkh1J0maw4bw==
- Authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=suse.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>
- Delivery-date: Thu, 19 Aug 2021 08:04:20 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
The old (super)page's permissions ought to be propagated, rather than
blindly allowing both reads and writes.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -231,7 +231,7 @@ static int iommu_pde_from_dfn(struct dom
next_table_mfn = mfn_x(page_to_mfn(table));
set_iommu_ptes_present(next_table_mfn, pfn, mfn,
PTE_PER_TABLE_SIZE,
- next_level, true, true);
+ next_level, pde->iw, pde->ir);
smp_wmb();
set_iommu_pde_present(pde, next_table_mfn, next_level, true,
true);
|