linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] amd/iommu: Fix Guest Virtual APIC Log Tail Address Register
@ 2018-11-12 12:26 Suthikulpanit, Suravee
  2018-11-12 14:08 ` joro
  0 siblings, 1 reply; 2+ messages in thread
From: Suthikulpanit, Suravee @ 2018-11-12 12:26 UTC (permalink / raw)
  To: linux-kernel, iommu
  Cc: joro, Filippo Sironi, Wei Wang, Suthikulpanit, Suravee

From: Filippo Sironi <sironi@amazon.de>

This register should have been programmed with the physical address
of the memory location containing the shadow tail pointer for
the guest virtual APIC log instead of the base address.

Fixes: 8bda0cfbdc1a  ('iommu/amd: Detect and initialize guest vAPIC log')
Signed-off-by: Filippo Sironi <sironi@amazon.de>
Signed-off-by: Wei Wang <wawei@amazon.de>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
 drivers/iommu/amd_iommu_init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 9c3d610e1e19..e777fa90b2c2 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -797,7 +797,8 @@ static int iommu_init_ga_log(struct amd_iommu *iommu)
 	entry = iommu_virt_to_phys(iommu->ga_log) | GA_LOG_SIZE_512;
 	memcpy_toio(iommu->mmio_base + MMIO_GA_LOG_BASE_OFFSET,
 		    &entry, sizeof(entry));
-	entry = (iommu_virt_to_phys(iommu->ga_log) & 0xFFFFFFFFFFFFFULL) & ~7ULL;
+	entry = (iommu_virt_to_phys(iommu->ga_log_tail) &
+		 (BIT_ULL(52)-1)) & ~7ULL;
 	memcpy_toio(iommu->mmio_base + MMIO_GA_LOG_TAIL_OFFSET,
 		    &entry, sizeof(entry));
 	writel(0x00, iommu->mmio_base + MMIO_GA_HEAD_OFFSET);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] amd/iommu: Fix Guest Virtual APIC Log Tail Address Register
  2018-11-12 12:26 [PATCH] amd/iommu: Fix Guest Virtual APIC Log Tail Address Register Suthikulpanit, Suravee
@ 2018-11-12 14:08 ` joro
  0 siblings, 0 replies; 2+ messages in thread
From: joro @ 2018-11-12 14:08 UTC (permalink / raw)
  To: Suthikulpanit, Suravee; +Cc: linux-kernel, iommu, Filippo Sironi, Wei Wang

On Mon, Nov 12, 2018 at 12:26:30PM +0000, Suthikulpanit, Suravee wrote:
> From: Filippo Sironi <sironi@amazon.de>
> 
> This register should have been programmed with the physical address
> of the memory location containing the shadow tail pointer for
> the guest virtual APIC log instead of the base address.
> 
> Fixes: 8bda0cfbdc1a  ('iommu/amd: Detect and initialize guest vAPIC log')
> Signed-off-by: Filippo Sironi <sironi@amazon.de>
> Signed-off-by: Wei Wang <wawei@amazon.de>
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> ---
>  drivers/iommu/amd_iommu_init.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied to iommu/fixes, thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-12 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-12 12:26 [PATCH] amd/iommu: Fix Guest Virtual APIC Log Tail Address Register Suthikulpanit, Suravee
2018-11-12 14:08 ` joro

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).