tools/libxc: Properly increment ApicIdCoreSize field on AMD
PATCH 1/1 tools/libxc: Properly increment ApicIdCoreSize field on AMD
Current code incorrectly adds 1 to full register instead of incrementing the field in bits 15:12.
--- tools/libxc/xc_cpuid_x86.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/libxc/xc_cpuid_x86.c +2 -1
@@ -331,7 +331,8 @@ static void amd_xc_cpuid_policy(xc_interface *xch,* ECX[15:12] is ApicIdCoreSize: ECX[7:0] is NumberOfCores (minus one). * Update to reflect vLAPIC_ID = vCPU_ID * 2. */ - regs[2 ] = ((regs[2 ] &0xf000u ) +1 ) | ((regs[2 ] &0xffu ) <<1 ) |1u ; + regs[2 ] = ((regs[2 ] + (1u <<12 )) &0xf000u ) | + ((regs[2 ] &0xffu ) <<1 ) |1u ;break ;case 0x8000000a : {
Signature · 7 lines
1.8.3.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 4 lines · Boris Ostrovsky
Current code incorrectly adds 1 to full register instead of incrementing the field in bits 15:12.
Signed-off-by Boris Ostrovsky <[email protected]>
I trust your expertise in this field. :-)
Quoted 21 lines
--- tools/libxc/xc_cpuid_x86.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)tools/libxc/xc_cpuid_x86.c +2
-1@@ -331,7 +331,8 @@ static void amd_xc_cpuid_policy(xc_interface *xch,* ECX[15:12] is ApicIdCoreSize: ECX[7:0] is NumberOfCores (minus one). * Update to reflect vLAPIC_ID = vCPU_ID * 2. */ - regs[2 ] = ((regs[2 ] &0xf000u ) +1 ) | ((regs[2 ] &0xffu ) <<1 ) |1u ; + regs[2 ] = ((regs[2 ] + (1u <<12 )) &0xf000u ) | + ((regs[2 ] &0xffu ) <<1 ) |1u ;break ;case 0x8000000a : {Signature · 1 line
1.8.3.1
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 8 lines · Wei Liu
Quoted 4 lines · Boris Ostrovsky
Current code incorrectly adds 1 to full register instead of incrementing the field in bits 15:12.
Signed-off-by Boris Ostrovsky <[email protected]>Acked-by Wei Liu <[email protected]>I trust your expertise in this field. :-)
Just in this field? The field is only 4 bits! ;-)
But this actually fixes a regression that was triggered by recent hvmloader change on one particular processor that we have in the test farm.
-boris
Quoted 18 lines
Quoted 18 lines
--- tools/libxc/xc_cpuid_x86.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)tools/libxc/xc_cpuid_x86.c +2
-1@@ -331,7 +331,8 @@ static void amd_xc_cpuid_policy(xc_interface *xch,* ECX[15:12] is ApicIdCoreSize: ECX[7:0] is NumberOfCores (minus one). * Update to reflect vLAPIC_ID = vCPU_ID * 2. */ - regs[2 ] = ((regs[2 ] &0xf000u ) +1 ) | ((regs[2 ] &0xffu ) <<1 ) |1u ; + regs[2 ] = ((regs[2 ] + (1u <<12 )) &0xf000u ) | + ((regs[2 ] &0xffu ) <<1 ) |1u ;break ;
Quoted 4 lines
Quoted 4 lines
tools/libxc/xc_cpuid_x86.c +0
-0case 0x8000000a : {Signature · 1 line
1.8.3.1
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 5 lines · Boris Ostrovsky
Quoted 4 lines · Wei Liu
Quoted 3 lines · Boris Ostrovsky
Current code incorrectly adds 1 to full register instead of incrementing the field in bits 15:12.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Boris Ostrovsky <[email protected]>Acked-by Wei Liu <[email protected]>I trust your expertise in this field. :-)
Just in this field? The field is only 4 bits! ;-)
No, it's only one bit! :-P
Quoted 2 lines
But this actually fixes a regression that was triggered by recent hvmloader change on one particular processor that we have in the test farm.
Ian, this is a backport candidate and needs to go back as far as possible. The bogus calculation was introduced in 2008 (!).
Wei.
Quoted 21 lines
-boris
Quoted 18 lines
Quoted 18 lines
--- tools/libxc/xc_cpuid_x86.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)tools/libxc/xc_cpuid_x86.c +2
-1@@ -331,7 +331,8 @@ static void amd_xc_cpuid_policy(xc_interface *xch,* ECX[15:12] is ApicIdCoreSize: ECX[7:0] is NumberOfCores (minus one). * Update to reflect vLAPIC_ID = vCPU_ID * 2. */ - regs[2 ] = ((regs[2 ] &0xf000u ) +1 ) | ((regs[2 ] &0xffu ) <<1 ) |1u ; + regs[2 ] = ((regs[2 ] + (1u <<12 )) &0xf000u ) | + ((regs[2 ] &0xffu ) <<1 ) |1u ;break ;
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
tools/libxc/xc_cpuid_x86.c +0
-0case 0x8000000a : {Signature · 1 line
1.8.3.1
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Wei Liu writes ("Re: [PATCH] tools/libxc: Properly increment ApicIdCoreSize field on AMD"):
Quoted 7 lines · Boris Ostrovsky
Quoted 3 lines · Wei Liu
But this actually fixes a regression that was triggered by recent hvmloader change on one particular processor that we have in the test farm.
Ian, this is a backport candidate and needs to go back as far as possible. The bogus calculation was introduced in 2008 (!).
Thanks, but:
Not queued for backport because the patch is not in staging.
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Wei Liu
AppliedQuoted 6 lines · Ian Jackson
Wei Liu writes ("Re: [PATCH]
tools/libxc: Properly increment ApicIdCoreSize field on AMD"):Quoted 5 lines · Boris Ostrovsky
Quoted 3 lines · Wei Liu
But this actually fixes a regression that was triggered by recent hvmloader change on one particular processor that we have in the test farm.
Quoted 7 lines
Quoted 2 lines
Ian, this is a backport candidate and needs to go back as far as possible. The bogus calculation was introduced in 2008 (!).
Thanks, but:
Not queued for backport because the patch is not in staging.
Pushed to staging.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Wei Liu writes ("Re: [PATCH] tools/libxc: Properly increment ApicIdCoreSize field on AMD"):
Quoted 6 lines · Ian Jackson
Quoted 3 lines
Wei Liu writes ("Re: [PATCH]
tools/libxc: Properly increment ApicIdCoreSize field on AMD"):Quoted 2 lines
Ian, this is a backport candidate and needs to go back as far as possible. The bogus calculation was introduced in 2008 (!).
Pushed to staging.
Thanks, queued.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel