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

From: Borislav Petkov
Date: Wed Nov 02 2022 - 07:27:40 EST


On Tue, Nov 01, 2022 at 10:12:35PM -0500, Kalra, Ashish wrote:
> Following up on this, now, set_memory_present() is a static interface,
> so will need do add a new external API like set_memory_p() similar
> to set_memory_np().

It is called set_memory_p() now and you can "un-static" it. :)

> So currently there is no interface defined for changing the attribute of a
> range to present or restoring the range in the direct map.

No?

static int set_memory_p(unsigned long *addr, int numpages)
{
return change_page_attr_set(addr, numpages, __pgprot(_PAGE_PRESENT), 0);
}

:-)

--
Regards/Gruss,
Boris.

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