lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <52e41530-f93a-4fed-8229-ead4e806a5ec@amd.com>
Date: Wed, 7 May 2025 09:26:53 +0530
From: Neeraj Upadhyay <Neeraj.Upadhyay@....com>
To: Tianyu Lan <ltykernel@...il.com>, kys@...rosoft.com,
 haiyangz@...rosoft.com, wei.liu@...nel.org, decui@...rosoft.com,
 tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
 dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
 yuehaibing@...wei.com, kvijayab@....com, jacob.jun.pan@...ux.intel.com,
 jpoimboe@...nel.org, tiala@...rosoft.com
Cc: linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 2/6] x86/x2apic-savic: Expose
 x2apic_savic_update_vector()



On 5/6/2025 6:37 PM, Tianyu Lan wrote:
> From: Tianyu Lan <tiala@...rosoft.com>
> 
> Expose x2apic_savic_update_vector() and device driver
> arch code may update AVIC backing page to allow Hyper-V
> inject associated vector.
> 
> Signed-off-by: Tianyu Lan <tiala@...rosoft.com>

I think this new interface is not required. Device driver arch code can call
apic_update_vector() to invoke APIC driver's update_vector() callback. 
Or is it that I am missing something? So, can you explain why this new interface
is needed?



- Neeraj

> ---
>  arch/x86/include/asm/apic.h         | 9 +++++++++
>  arch/x86/kernel/apic/x2apic_savic.c | 8 ++++++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
> index 6aa4b8ff08a9..949389e05dd7 100644
> --- a/arch/x86/include/asm/apic.h
> +++ b/arch/x86/include/asm/apic.h
> @@ -241,6 +241,15 @@ static inline u64 native_x2apic_icr_read(void)
>  	return val;
>  }
>  
> +#if defined(CONFIG_AMD_SECURE_AVIC)
> +extern void x2apic_savic_update_vector(unsigned int cpu,
> +				unsigned int vector,
> +				bool set);
> +#else
> +static inline void x2apic_savic_update_vector(unsigned int cpu,
> +					      unsigned int vector,								      bool set) { }
> +#endif
> +
>  extern int x2apic_mode;
>  extern int x2apic_phys;
>  extern void __init x2apic_set_max_apicid(u32 apicid);
> diff --git a/arch/x86/kernel/apic/x2apic_savic.c b/arch/x86/kernel/apic/x2apic_savic.c
> index 6284d1f8dac9..0dd7e39931b0 100644
> --- a/arch/x86/kernel/apic/x2apic_savic.c
> +++ b/arch/x86/kernel/apic/x2apic_savic.c
> @@ -321,6 +321,14 @@ static void savic_update_vector(unsigned int cpu, unsigned int vector, bool set)
>  	update_vector(cpu, SAVIC_ALLOWED_IRR, vector, set);
>  }
>  
> +void x2apic_savic_update_vector(unsigned int cpu, unsigned int vector, bool set)
> +{
> +	if (!cc_platform_has(CC_ATTR_SNP_SECURE_AVIC))
> +		return;
> +
> +	savic_update_vector(cpu, vector, set);
> +}
> +
>  static void init_apic_page(void)
>  {
>  	u32 apic_id;


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ