lkml.org 
[lkml]   [2021]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 2/5] KVM: X86: Expose PKS to guest
From
Date
On 05/02/21 09:37, Chenyi Qiang wrote:
>
> diff --git a/arch/x86/mm/pkeys.c b/arch/x86/mm/pkeys.c
> index 57718716cc70..8027f854c600 100644
> --- a/arch/x86/mm/pkeys.c
> +++ b/arch/x86/mm/pkeys.c
> @@ -390,3 +390,9 @@ void pks_key_free(int pkey)
> __clear_bit(pkey, &pks_key_allocation_map);
> }
> EXPORT_SYMBOL_GPL(pks_key_free);
> +
> +u32 get_current_pkrs(void)
> +{
> + return this_cpu_read(pkrs_cache);
> +}
> +EXPORT_SYMBOL_GPL(get_current_pkrs);
> diff --git a/include/linux/pkeys.h b/include/linux/pkeys.h
> index bed0e293f13b..480429020f4c 100644
> --- a/include/linux/pkeys.h
> +++ b/include/linux/pkeys.h
> @@ -72,6 +72,10 @@ static inline void pks_mk_readwrite(int pkey)
> {
> pr_err("%s is not valid without PKS support\n", __func__);
> }
> +static inline u32 get_current_pkrs(void)
> +{
> + return 0;
> +}
> #endif /* ! CONFIG_ARCH_HAS_SUPERVISOR_PKEYS */
>

This would need an ack from the x86 people. Andy, Boris?

Paolo

\
 
 \ /
  Last update: 2021-02-05 10:32    [W:0.231 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site