lkml.org 
[lkml]   [2023]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRE: [PATCH v6 7/8] x86/hyperv: Add smp support for SEV-SNP guest
Date
> From: Tianyu Lan <ltykernel@gmail.com>
> Sent: Wednesday, August 16, 2023 8:59 AM
> [...]
> --- a/arch/x86/kernel/cpu/mshyperv.c
> +++ b/arch/x86/kernel/cpu/mshyperv.c
> @@ -295,6 +295,16 @@ static void __init hv_smp_prepare_cpus(unsigned
> int max_cpus)
>
> native_smp_prepare_cpus(max_cpus);
> [...]
> + if (hv_isolation_type_en_snp())
> + apic->wakeup_secondary_cpu_64 = hv_snp_boot_ap;
> +
> + if (!hv_root_partition)
> + return;

Can the above be changed to:

if (hv_isolation_type_en_snp()) {
apic->wakeup_secondary_cpu_64 = hv_snp_boot_ap;
return;
}

(please also see the below)

> +
> #ifdef CONFIG_X86_64
> for_each_present_cpu(i) {
> if (i == 0)
> @@ -502,8 +512,7 @@ static void __init ms_hyperv_init_platform(void)
>
> # ifdef CONFIG_SMP
> smp_ops.smp_prepare_boot_cpu = hv_smp_prepare_boot_cpu;
> - if (hv_root_partition)
> - smp_ops.smp_prepare_cpus = hv_smp_prepare_cpus;
> + smp_ops.smp_prepare_cpus = hv_smp_prepare_cpus;

IMO it's better if we don't unconditionally change smp_ops.smp_prepare_cpus.

How about this:
if (hv_root_partition || hv_isolation_type_en_snp())
smp_ops.smp_prepare_cpus = hv_smp_prepare_cpus;

\
 
 \ /
  Last update: 2023-08-16 23:44    [W:0.097 / U:0.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site