lkml.org 
[lkml]   [2019]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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
>

\
 
 \ /
  Last update: 2019-06-14 14:04    [W:0.354 / U:16.988 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site