lkml.org 
[lkml]   [2021]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 19/42] x86/mm: Add support to validate memory when changing C-bit
On Wed, Nov 10, 2021 at 08:21:21AM -0600, Brijesh Singh wrote:
> I am assuming you mean add some compile time check to ensure that desc will
> fit in the shared buffer ?

No:

struct ghcb {

...

u8 shared_buffer[2032];

so that memcpy needs to do:

memcpy(ghcb->shared_buffer, desc, min_t(int, 2032, sizeof(*desc)));

with that 2032 behind a proper define, ofc.

> I can drop the overlap comment to avoid the confusion, as you pointed it
> more of the future thing. Basically overlap is the below condition
>
> set_memory_private(gfn=0, page_size=2m)
> set_memory_private(gfn=10, page_size=4k)
>
> The RMPUPDATE instruction will detect overlap on the second call and return
> an error to the guest. After we add the support to track the page validation
> state (either in bitmap or page flag), the second call will not be issued
> and thus avoid an overlap errors. For now, we use the page_size=4k for all
> the page state changes from the kernel.

Yah, sounds like the comment is not needed now. You could put this in
the commit message, though.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette

\
 
 \ /
  Last update: 2021-11-10 19:45    [W:0.227 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site