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: <CAMvTesDWSUxj+KtdLnymu6HEATEPW2525KswZyP07PpjK+hD1g@mail.gmail.com>
Date: Tue, 15 Jul 2025 16:16:57 +0800
From: Tianyu Lan <ltykernel@...il.com>
To: Neeraj Upadhyay <Neeraj.Upadhyay@....com>
Cc: linux-kernel@...r.kernel.org, bp@...en8.de, tglx@...utronix.de, 
	mingo@...hat.com, dave.hansen@...ux.intel.com, Thomas.Lendacky@....com, 
	nikunj@....com, Santosh.Shukla@....com, Vasant.Hegde@....com, 
	Suravee.Suthikulpanit@....com, David.Kaplan@....com, x86@...nel.org, 
	hpa@...or.com, peterz@...radead.org, seanjc@...gle.com, pbonzini@...hat.com, 
	kvm@...r.kernel.org, kirill.shutemov@...ux.intel.com, huibo.wang@....com, 
	naveen.rao@....com, kai.huang@...el.com
Subject: Re: [RFC PATCH v8 21/35] x86/apic: Initialize APIC ID for Secure AVIC

On Wed, Jul 9, 2025 at 11:40 AM Neeraj Upadhyay <Neeraj.Upadhyay@....com> wrote:
>
> Initialize the APIC ID in the Secure AVIC APIC backing page with
> the APIC_ID msr value read from Hypervisor. CPU topology evaluation
> later during boot would catch and report any duplicate APIC ID for
> two CPUs.
>
> Signed-off-by: Neeraj Upadhyay <Neeraj.Upadhyay@....com>
> ---
> Changes since v7:
>  - No change.
>

Reviewed-by: Tianyu Lan <tiala@...rosoft.com>

>  arch/x86/kernel/apic/x2apic_savic.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/arch/x86/kernel/apic/x2apic_savic.c b/arch/x86/kernel/apic/x2apic_savic.c
> index 186e69a5e169..618643e7242f 100644
> --- a/arch/x86/kernel/apic/x2apic_savic.c
> +++ b/arch/x86/kernel/apic/x2apic_savic.c
> @@ -131,6 +131,18 @@ static void savic_write(u32 reg, u32 data)
>         }
>  }
>
> +static void init_apic_page(struct apic_page *ap)
> +{
> +       u32 apic_id;
> +
> +       /*
> +        * Before Secure AVIC is enabled, APIC msr reads are intercepted.
> +        * APIC_ID msr read returns the value from the Hypervisor.
> +        */
> +       apic_id = native_apic_msr_read(APIC_ID);
> +       apic_set_reg(ap, APIC_ID, apic_id);
> +}
> +
>  static void savic_setup(void)
>  {
>         void *backing_page;
> @@ -138,6 +150,7 @@ static void savic_setup(void)
>         unsigned long gpa;
>
>         backing_page = this_cpu_ptr(apic_page);
> +       init_apic_page(backing_page);
>         gpa = __pa(backing_page);
>
>         /*
> --
> 2.34.1
>
>


-- 
Thanks
Tianyu Lan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ