* [PATCH] x86/hyperv: LP creation with lp_index on same CPU-id
@ 2021-05-31 7:40 Praveen Kumar
2021-05-31 10:57 ` Wei Liu
0 siblings, 1 reply; 4+ messages in thread
From: Praveen Kumar @ 2021-05-31 7:40 UTC (permalink / raw)
To: linux-hyperv, linux-kernel
Cc: kys, haiyangz, sthemmin, wei.liu, decui, tglx, mingo, bp
The hypervisor expects the lp_index to be same as cpu-id during LP creation
This fix correct the same, as cpu_physical_id can give different cpu-id.
Signed-off-by: Praveen Kumar <kumarpraveen@linux.microsoft.com>
---
arch/x86/kernel/cpu/mshyperv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 22f13343b5da..4fa0a4280895 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -236,7 +236,7 @@ static void __init hv_smp_prepare_cpus(unsigned int max_cpus)
for_each_present_cpu(i) {
if (i == 0)
continue;
- ret = hv_call_add_logical_proc(numa_cpu_node(i), i, cpu_physical_id(i));
+ ret = hv_call_add_logical_proc(numa_cpu_node(i), i, i);
BUG_ON(ret);
}
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/hyperv: LP creation with lp_index on same CPU-id
2021-05-31 7:40 [PATCH] x86/hyperv: LP creation with lp_index on same CPU-id Praveen Kumar
@ 2021-05-31 10:57 ` Wei Liu
2021-05-31 11:01 ` Praveen Kumar
0 siblings, 1 reply; 4+ messages in thread
From: Wei Liu @ 2021-05-31 10:57 UTC (permalink / raw)
To: Praveen Kumar
Cc: linux-hyperv, linux-kernel, kys, haiyangz, sthemmin, wei.liu,
decui, tglx, mingo, bp, nunodasneves, viremana, sunilmut,
Michael Kelley
On Mon, May 31, 2021 at 01:10:46PM +0530, Praveen Kumar wrote:
> The hypervisor expects the lp_index to be same as cpu-id during LP creation
> This fix correct the same, as cpu_physical_id can give different cpu-id.
Code looks fine to me, but the commit message can be made clearer.
"""
The hypervisor expects the logical processor index to be the same as
CPU's id during logical processor creation. Using cpu_physical_id
confuses Microsoft Hypervisor's scheduler. That causes the root
partition not boot when core scheduler is used.
This patch removes the call to cpu_physical_id and uses the CPU index
directly for bringing up logical processor. This scheme works for both
classic scheduler and core scheduler.
Fixes: 333abaf5abb3 (x86/hyperv: implement and use hv_smp_prepare_cpus)
"""
No action is required from you. If you are fine with this commit message
I can incorporate it and update the subject line when committing this
patch.
>
> Signed-off-by: Praveen Kumar <kumarpraveen@linux.microsoft.com>
> ---
> arch/x86/kernel/cpu/mshyperv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
> index 22f13343b5da..4fa0a4280895 100644
> --- a/arch/x86/kernel/cpu/mshyperv.c
> +++ b/arch/x86/kernel/cpu/mshyperv.c
> @@ -236,7 +236,7 @@ static void __init hv_smp_prepare_cpus(unsigned int max_cpus)
> for_each_present_cpu(i) {
> if (i == 0)
> continue;
> - ret = hv_call_add_logical_proc(numa_cpu_node(i), i, cpu_physical_id(i));
> + ret = hv_call_add_logical_proc(numa_cpu_node(i), i, i);
> BUG_ON(ret);
> }
>
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/hyperv: LP creation with lp_index on same CPU-id
2021-05-31 10:57 ` Wei Liu
@ 2021-05-31 11:01 ` Praveen Kumar
2021-06-02 15:16 ` Wei Liu
0 siblings, 1 reply; 4+ messages in thread
From: Praveen Kumar @ 2021-05-31 11:01 UTC (permalink / raw)
To: Wei Liu
Cc: linux-hyperv, linux-kernel, kys, haiyangz, sthemmin, decui, tglx,
mingo, bp, nunodasneves, viremana, sunilmut, Michael Kelley
On 5/31/2021 4:27 PM, Wei Liu wrote:
> On Mon, May 31, 2021 at 01:10:46PM +0530, Praveen Kumar wrote:
>> The hypervisor expects the lp_index to be same as cpu-id during LP creation
>> This fix correct the same, as cpu_physical_id can give different cpu-id.
>
> Code looks fine to me, but the commit message can be made clearer.
>
> """
> The hypervisor expects the logical processor index to be the same as
> CPU's id during logical processor creation. Using cpu_physical_id
> confuses Microsoft Hypervisor's scheduler. That causes the root
> partition not boot when core scheduler is used.
>
> This patch removes the call to cpu_physical_id and uses the CPU index
> directly for bringing up logical processor. This scheme works for both
> classic scheduler and core scheduler.
>
> Fixes: 333abaf5abb3 (x86/hyperv: implement and use hv_smp_prepare_cpus)
> """
>
> No action is required from you. If you are fine with this commit message
> I can incorporate it and update the subject line when committing this
> patch.
>
Thanks Wei for your comments. I'm fine with your inputs. Please go ahead. Thanks.
Regards,
~Praveen.
>>
>> Signed-off-by: Praveen Kumar <kumarpraveen@linux.microsoft.com>
>> ---
>> arch/x86/kernel/cpu/mshyperv.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
>> index 22f13343b5da..4fa0a4280895 100644
>> --- a/arch/x86/kernel/cpu/mshyperv.c
>> +++ b/arch/x86/kernel/cpu/mshyperv.c
>> @@ -236,7 +236,7 @@ static void __init hv_smp_prepare_cpus(unsigned int max_cpus)
>> for_each_present_cpu(i) {
>> if (i == 0)
>> continue;
>> - ret = hv_call_add_logical_proc(numa_cpu_node(i), i, cpu_physical_id(i));
>> + ret = hv_call_add_logical_proc(numa_cpu_node(i), i, i);
>> BUG_ON(ret);
>> }
>>
>> --
>> 2.25.1
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/hyperv: LP creation with lp_index on same CPU-id
2021-05-31 11:01 ` Praveen Kumar
@ 2021-06-02 15:16 ` Wei Liu
0 siblings, 0 replies; 4+ messages in thread
From: Wei Liu @ 2021-06-02 15:16 UTC (permalink / raw)
To: Praveen Kumar
Cc: Wei Liu, linux-hyperv, linux-kernel, kys, haiyangz, sthemmin,
decui, tglx, mingo, bp, nunodasneves, viremana, sunilmut,
Michael Kelley
On Mon, May 31, 2021 at 04:31:04PM +0530, Praveen Kumar wrote:
>
>
> On 5/31/2021 4:27 PM, Wei Liu wrote:
> > On Mon, May 31, 2021 at 01:10:46PM +0530, Praveen Kumar wrote:
> >> The hypervisor expects the lp_index to be same as cpu-id during LP creation
> >> This fix correct the same, as cpu_physical_id can give different cpu-id.
> >
> > Code looks fine to me, but the commit message can be made clearer.
> >
> > """
> > The hypervisor expects the logical processor index to be the same as
> > CPU's id during logical processor creation. Using cpu_physical_id
> > confuses Microsoft Hypervisor's scheduler. That causes the root
> > partition not boot when core scheduler is used.
> >
> > This patch removes the call to cpu_physical_id and uses the CPU index
> > directly for bringing up logical processor. This scheme works for both
> > classic scheduler and core scheduler.
> >
> > Fixes: 333abaf5abb3 (x86/hyperv: implement and use hv_smp_prepare_cpus)
> > """
> >
> > No action is required from you. If you are fine with this commit message
> > I can incorporate it and update the subject line when committing this
> > patch.
> >
>
> Thanks Wei for your comments. I'm fine with your inputs. Please go ahead. Thanks.
Pushed to hyperv-next. Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-06-02 15:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-31 7:40 [PATCH] x86/hyperv: LP creation with lp_index on same CPU-id Praveen Kumar
2021-05-31 10:57 ` Wei Liu
2021-05-31 11:01 ` Praveen Kumar
2021-06-02 15:16 ` Wei Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).