linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Adrian Huang <ahuang12@lenovo.com>,
	Joerg Roedel <jroedel@suse.de>, Sasha Levin <sashal@kernel.org>,
	iommu@lists.linux-foundation.org
Subject: [PATCH AUTOSEL 4.9 21/21] iommu/amd: Fix the configuration of GCR3 table root pointer
Date: Wed, 15 Apr 2020 07:47:48 -0400	[thread overview]
Message-ID: <20200415114748.15713-21-sashal@kernel.org> (raw)
In-Reply-To: <20200415114748.15713-1-sashal@kernel.org>

From: Adrian Huang <ahuang12@lenovo.com>

[ Upstream commit c20f36534666e37858a14e591114d93cc1be0d34 ]

The SPA of the GCR3 table root pointer[51:31] masks 20 bits. However,
this requires 21 bits (Please see the AMD IOMMU specification).
This leads to the potential failure when the bit 51 of SPA of
the GCR3 table root pointer is 1'.

Signed-off-by: Adrian Huang <ahuang12@lenovo.com>
Fixes: 52815b75682e2 ("iommu/amd: Add support for IOMMUv2 domain mode")
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/iommu/amd_iommu_types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h
index 0d91785ebdc34..da3fbf82d1cf4 100644
--- a/drivers/iommu/amd_iommu_types.h
+++ b/drivers/iommu/amd_iommu_types.h
@@ -329,7 +329,7 @@
 
 #define DTE_GCR3_VAL_A(x)	(((x) >> 12) & 0x00007ULL)
 #define DTE_GCR3_VAL_B(x)	(((x) >> 15) & 0x0ffffULL)
-#define DTE_GCR3_VAL_C(x)	(((x) >> 31) & 0xfffffULL)
+#define DTE_GCR3_VAL_C(x)	(((x) >> 31) & 0x1fffffULL)
 
 #define DTE_GCR3_INDEX_A	0
 #define DTE_GCR3_INDEX_B	1
-- 
2.20.1


      parent reply	other threads:[~2020-04-15 12:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15 11:47 [PATCH AUTOSEL 4.9 01/21] clk: at91: usb: continue if clk_hw_round_rate() return zero Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 02/21] power: supply: bq27xxx_battery: Silence deferred-probe error Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 03/21] clk: tegra: Fix Tegra PMC clock out parents Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 04/21] NFS: direct.c: Fix memory leak of dreq when nfs_get_lock_context fails Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 05/21] s390/cpuinfo: fix wrong output when CPU0 is offline Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 06/21] powerpc/maple: Fix declaration made after definition Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 07/21] ext4: do not commit super on read-only bdev Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 08/21] ext4: fix incorrect group count in ext4_fill_super error message Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 09/21] ext4: fix incorrect inodes per group in " Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 10/21] slcan: Don't transmit uninitialized stack data in padding Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 11/21] net: stmmac: dwmac1000: fix out-of-bounds mac address reg setting Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 12/21] percpu_counter: fix a data race at vm_committed_as Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 13/21] compiler.h: fix error in BUILD_BUG_ON() reporting Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 14/21] KVM: s390: vsie: Fix possible race when shadowing region 3 tables Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 15/21] net: dsa: bcm_sf2: Ensure correct sub-node is parsed Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 16/21] NFS: Fix memory leaks in nfs_pageio_stop_mirroring() Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 17/21] mfd: dln2: Fix sanity checking for endpoints Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 18/21] ext2: fix empty body warnings when -Wextra is used Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 19/21] ext2: fix debug reference to ext2_xattr_cache Sasha Levin
2020-04-15 11:47 ` [PATCH AUTOSEL 4.9 20/21] libnvdimm: Out of bounds read in __nd_ioctl() Sasha Levin
2020-04-15 11:47 ` Sasha Levin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200415114748.15713-21-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=ahuang12@lenovo.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).