[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190614120424.GJ3436@hirez.programming.kicks-ass.net>
Date: Fri, 14 Jun 2019 14:04:24 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, x86@...nel.org,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, Borislav Petkov <bp@...en8.de>,
Andy Lutomirski <luto@...capital.net>,
David Howells <dhowells@...hat.com>,
Kees Cook <keescook@...omium.org>,
Dave Hansen <dave.hansen@...el.com>,
Kai Huang <kai.huang@...ux.intel.com>,
Jacob Pan <jacob.jun.pan@...ux.intel.com>,
Alison Schofield <alison.schofield@...el.com>,
linux-mm@...ck.org, kvm@...r.kernel.org, keyrings@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH, RFC 51/62] iommu/vt-d: Support MKTME in DMA remapping
On Wed, May 08, 2019 at 05:44:11PM +0300, Kirill A. Shutemov wrote:
> @@ -603,7 +605,12 @@ static inline void dma_clear_pte(struct dma_pte *pte)
> static inline u64 dma_pte_addr(struct dma_pte *pte)
> {
> #ifdef CONFIG_64BIT
> - return pte->val & VTD_PAGE_MASK;
I don't know this code, but going by the below cmpxchg64, this wants to
be READ_ONCE().
> + u64 addr = pte->val;
> + addr &= VTD_PAGE_MASK;
> +#ifdef CONFIG_X86_INTEL_MKTME
> + addr &= ~mktme_keyid_mask;
> +#endif
> + return addr;
> #else
> /* Must have a full atomic 64-bit read */
> return __cmpxchg64(&pte->val, 0ULL, 0ULL) & VTD_PAGE_MASK;
> --
> 2.20.1
>
Powered by blists - more mailing lists