Re: [RFC PATCH] x86/cpu/hygon: Fix phys_proc_id calculation logic for multi-die processor

2019-03-23 Thread Pu Wen
On 2019/3/23 19:08, Borislav Petkov wrote: On Sat, Mar 23, 2019 at 06:56:52PM +0800, Pu Wen wrote: Because AMD doesn't have 2-Socket system with 1-Die/2-Die processors(see reference [2]). So it will return the right result when getting physical ID in AMD system. There it is! Now add that to th

Re: [RFC PATCH] x86/cpu/hygon: Fix phys_proc_id calculation logic for multi-die processor

2019-03-23 Thread Borislav Petkov
On Sat, Mar 23, 2019 at 06:56:52PM +0800, Pu Wen wrote: > Because AMD doesn't have 2-Socket system with 1-Die/2-Die processors(see > reference [2]). So it will return the right result when getting physical > ID in AMD system. There it is! Now add that to the commit message please. -- Regards/Gru

Re: [RFC PATCH] x86/cpu/hygon: Fix phys_proc_id calculation logic for multi-die processor

2019-03-23 Thread Pu Wen
On 2019/3/23 16:59, Borislav Petkov wrote: > On Sat, Mar 23, 2019 at 10:13:39AM +0800, Pu Wen wrote: >> Current physical id is computed via "phys_proc_id = initial_apicid >> >> bits". >> >> For 4-Die 2 socket system, the physical id of socket 2 is: >> initial_apicid >> bits = 0b1xx >> 6 = 1. >>

Re: [RFC PATCH] x86/cpu/hygon: Fix phys_proc_id calculation logic for multi-die processor

2019-03-23 Thread Borislav Petkov
On Sat, Mar 23, 2019 at 10:13:39AM +0800, Pu Wen wrote: > Current physical id is computed via "phys_proc_id = initial_apicid >> > bits". > > For 4-Die 2 socket system, the physical id of socket 2 is: > initial_apicid >> bits = 0b1xx >> 6 = 1. > The result is true. > > But for 2-Die 2 socket

Re: [RFC PATCH] x86/cpu/hygon: Fix phys_proc_id calculation logic for multi-die processor

2019-03-23 Thread Borislav Petkov
On Sat, Mar 23, 2019 at 09:48:52AM +0800, Pu Wen wrote: > So maybe define it as: > #define APICID_SOCKET_ID BIT(6) Sure, if you define it locally in hygon.c. Otherwise, it needs to have "HYGON" in the name or so. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and

Re: [RFC PATCH] x86/cpu/hygon: Fix phys_proc_id calculation logic for multi-die processor

2019-03-22 Thread Pu Wen
On 2019/3/23 0:52, Peter Zijlstra wrote: > On Fri, Mar 22, 2019 at 05:44:45PM +0100, Borislav Petkov wrote: >> On Sat, Mar 23, 2019 at 12:19:01AM +0800, Pu Wen wrote: >>> That 6 is not a magic number. >> >> Well, if I see a naked 6, then it is only magic to me. Now if it were a >> proper define wit

Re: [RFC PATCH] x86/cpu/hygon: Fix phys_proc_id calculation logic for multi-die processor

2019-03-22 Thread Pu Wen
On 2019/3/23 1:16, Borislav Petkov wrote: > On Sat, Mar 23, 2019 at 12:19:01AM +0800, Pu Wen wrote: >>> Sounds to me like you're programming the initial APIC ID not >>> the same way as AMD do... >> >> In the same way. > > So why do you need to do something different than what AMD does? Current ph

Re: [RFC PATCH] x86/cpu/hygon: Fix phys_proc_id calculation logic for multi-die processor

2019-03-22 Thread Pu Wen
On 2019/3/23 0:44, Borislav Petkov wrote: On Sat, Mar 23, 2019 at 12:19:01AM +0800, Pu Wen wrote: That 6 is not a magic number. Well, if I see a naked 6, then it is only magic to me. Now if it were a proper define with a descriptive name... So maybe define it as: #define APICID_SOCKET_ID BIT

Re: [RFC PATCH] x86/cpu/hygon: Fix phys_proc_id calculation logic for multi-die processor

2019-03-22 Thread Borislav Petkov
On Sat, Mar 23, 2019 at 12:19:01AM +0800, Pu Wen wrote: > > Sounds to me like you're programming the initial APIC ID not > > the same way as AMD do... > > In the same way. So why do you need to do something different than what AMD does? -- Regards/Gruss, Boris. Good mailing practices for 4

Re: [RFC PATCH] x86/cpu/hygon: Fix phys_proc_id calculation logic for multi-die processor

2019-03-22 Thread Peter Zijlstra
On Fri, Mar 22, 2019 at 05:44:45PM +0100, Borislav Petkov wrote: > On Sat, Mar 23, 2019 at 12:19:01AM +0800, Pu Wen wrote: > > That 6 is not a magic number. > > Well, if I see a naked 6, then it is only magic to me. Now if it were a > proper define with a descriptive name... Does AMD/Hygon not ha

Re: [RFC PATCH] x86/cpu/hygon: Fix phys_proc_id calculation logic for multi-die processor

2019-03-22 Thread Borislav Petkov
On Sat, Mar 23, 2019 at 12:19:01AM +0800, Pu Wen wrote: > That 6 is not a magic number. Well, if I see a naked 6, then it is only magic to me. Now if it were a proper define with a descriptive name... -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the re

Re: [RFC PATCH] x86/cpu/hygon: Fix phys_proc_id calculation logic for multi-die processor

2019-03-22 Thread Pu Wen
On 2019/3/22 23:55, Borislav Petkov wrote: > On Fri, Mar 22, 2019 at 06:43:00PM +0800, Pu Wen wrote: >> Current codes direct use "phys_proc_id = initial_apicid >> bits", which > > Use proper english please - there's no "codes" > >> calc phys_proc_id from initial_apicid by shifting *bits*, will ge

Re: [RFC PATCH] x86/cpu/hygon: Fix phys_proc_id calculation logic for multi-die processor

2019-03-22 Thread Borislav Petkov
On Fri, Mar 22, 2019 at 06:43:00PM +0800, Pu Wen wrote: > For Hygon family 18h multi-die processor platform, which support 1-Die/ > 2-Die/4-Die per socket, the system view is shown in the following system > topology. > > System View (with 1-Die 2-Socket): >|| > ---

[RFC PATCH] x86/cpu/hygon: Fix phys_proc_id calculation logic for multi-die processor

2019-03-22 Thread Pu Wen
For Hygon family 18h multi-die processor platform, which support 1-Die/ 2-Die/4-Die per socket, the system view is shown in the following system topology. System View (with 1-Die 2-Socket): || -- - SOCKET0 | D0 | | D1 | SOCKET1 --