[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a53cd108-8758-e153-7ae6-c508fce02003@linux.intel.com>
Date: Wed, 26 May 2021 14:37:39 -0700
From: "Kuppuswamy, Sathyanarayanan"
<sathyanarayanan.kuppuswamy@...ux.intel.com>
To: Tom Lendacky <thomas.lendacky@....com>,
Borislav Petkov <bp@...en8.de>
Cc: Sean Christopherson <seanjc@...gle.com>,
Dave Hansen <dave.hansen@...el.com>,
Andi Kleen <ak@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...nel.org>,
Dan Williams <dan.j.williams@...el.com>,
Tony Luck <tony.luck@...el.com>,
Kirill Shutemov <kirill.shutemov@...ux.intel.com>,
Kuppuswamy Sathyanarayanan <knsathya@...nel.org>,
Raj Ashok <ashok.raj@...el.com>, linux-kernel@...r.kernel.org,
Brijesh Singh <brijesh.singh@....com>
Subject: Re: [RFC v2 28/32] x86/tdx: Make pages shared in ioremap()
On 5/21/21 9:19 AM, Tom Lendacky wrote:
> In arch/x86/mm/mem_encrypt.c, sme_early_init() (should have renamed that
> when SEV support was added), we do:
> if (sev_active())
> swiotlb_force = SWIOTLB_FORCE;
>
> TDX should be able to do a similar thing without having to touch
> arch/x86/kernel/pci-swiotlb.c.
>
> That would remove any confusion over SME being part of a
> protected_guest_has() call.
You mean sme_active() check in arch/x86/kernel/pci-swiotlb.c is redundant?
41 int __init pci_swiotlb_detect_4gb(void)
42 {
43 /* don't initialize swiotlb if iommu=off (no_iommu=1) */
44 if (!no_iommu && max_possible_pfn > MAX_DMA32_PFN)
45 swiotlb = 1;
46
47 /*
48 * If SME is active then swiotlb will be set to 1 so that bounce
49 * buffers are allocated and used for devices that do not support
50 * the addressing range required for the encryption mask.
51 */
52 if (sme_active() || is_tdx_guest())
53 swiotlb = 1;
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
Powered by blists - more mailing lists