Thread (305 messages) 305 messages, 22 authors, 2023-01-05

Re: [PATCH Part2 v6 07/49] x86/sev: Invalid pages from direct map when adding it to RMP table

From: "Kalra, Ashish" <ashish.kalra@amd.com>
Date: 2023-01-05 21:46:45
Also in: kvm, linux-crypto, linux-mm, lkml

Hello Boris,

On 12/29/2022 11:09 AM, Borislav Petkov wrote:
On Tue, Dec 27, 2022 at 03:49:39PM -0600, Kalra, Ashish wrote:
quoted
Milan onward,
And before ML there's no SNP, right?
Yes, that's correct.
quoted
there is H/W support for coherency between mappings of the
same physical page with different encryption keys, so AFAIK, there should be
no need to flush during page state transitions, where we invoke these direct
map interface functions for re-mapping/invalidating pages.
Yah, that rings a bell.

In any case, the fact that flushing is not needed should be stated
somewhere in text so that it is clear why.
quoted
I don't know if there is any other reason to flush after modifying
the direct map ?
There's

         /*
          * No need to flush, when we did not set any of the caching
          * attributes:
          */
         cache = !!pgprot2cachemode(mask_set);


Does the above HW cover this case too?
Actually, as both set_memory_p() and set_memory_np() are only 
setting/clearing the _PAGE_PRESENT flag and not changing any of the page 
caching attributes so this flush won't be required anyway.

Thanks,
Ashish
Thx.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help