|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH V3 (resend) 06/19] x86: Add a boot option to enable and disable the direct map
On 13.05.2024 15:40, Elias El Yandouzi wrote:
> --- a/xen/common/Kconfig
> +++ b/xen/common/Kconfig
> @@ -80,12 +80,29 @@ config HAS_PMAP
> config HAS_SCHED_GRANULARITY
> bool
>
> +config HAS_SECRET_HIDING
> + bool
> +
> config HAS_UBSAN
> bool
>
> config MEM_ACCESS_ALWAYS_ON
> bool
>
> +config SECRET_HIDING
> + bool "Secret hiding"
> + depends on HAS_SECRET_HIDING
> + help
> + The directmap contains mapping for most of the RAM which makes
> domain
> + memory easily accessible. While making the performance better,
> it also makes
> + the hypervisor more vulnerable to speculation attacks.
> +
> + Enabling this feature will allow the user to decide whether the
> memory
> + is always mapped at boot or mapped only on demand (see the
> command line
> + option "directmap").
> +
> + If unsure, say N.
> +
> config MEM_ACCESS
> def_bool MEM_ACCESS_ALWAYS_ON
> prompt "Memory Access and VM events" if !MEM_ACCESS_ALWAYS_ON
Surely there's a better place to add this new setting than between two
dependent options (MEM_ACCESS_ALWAYS_ON and MEM_ACCESS).
> --- a/xen/include/xen/mm.h
> +++ b/xen/include/xen/mm.h
> @@ -167,6 +167,13 @@ extern unsigned long max_page;
> extern unsigned long total_pages;
> extern paddr_t mem_hotplug;
>
> +extern bool opt_directmap;
> +
> +static inline bool has_directmap(void)
> +{
> + return opt_directmap;
> +}
As indicated before, with the Kconfig setting off I think we want to
have an alternative
#define opt_directmap true
There's no need to impact generated code by needing to look at a "variable"
which is never going to change value.
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |