[RFC] x86/cpu: fix vendor string for Shanghai CPU
diff mbox series

Message ID 20190404141132.1417-1-wei.liu2@citrix.com
State New, archived
Headers show
Series
  • [RFC] x86/cpu: fix vendor string for Shanghai CPU
Related show

Commit Message

Wei Liu April 4, 2019, 2:11 p.m. UTC
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: DavidWang <davidwang@zhaoxin.com>

Or perhaps it should have been Zhaoxin?
---
 xen/arch/x86/cpu/shanghai.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrew Cooper April 4, 2019, 2:18 p.m. UTC | #1
On 04/04/2019 15:11, Wei Liu wrote:
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>

Sadly not.  This is a char[8] field (so loses the \0 terminator), which
then gets passed to %s

I've got an overhaul to this area of code in the works, and am planning
to remove this field entirely,

~Andrew
Wei Liu April 4, 2019, 2:19 p.m. UTC | #2
On Thu, Apr 04, 2019 at 03:18:49PM +0100, Andrew Cooper wrote:
> On 04/04/2019 15:11, Wei Liu wrote:
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> 
> Sadly not.  This is a char[8] field (so loses the \0 terminator), which
> then gets passed to %s
> 
> I've got an overhaul to this area of code in the works, and am planning
> to remove this field entirely,

Good. I will leave this to you and cross it off my list. :p

Wei.

> 
> ~Andrew
Andrew Cooper April 4, 2019, 2:20 p.m. UTC | #3
On 04/04/2019 15:19, Wei Liu wrote:
> On Thu, Apr 04, 2019 at 03:18:49PM +0100, Andrew Cooper wrote:
>> On 04/04/2019 15:11, Wei Liu wrote:
>>> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
>> Sadly not.  This is a char[8] field (so loses the \0 terminator), which
>> then gets passed to %s
>>
>> I've got an overhaul to this area of code in the works, and am planning
>> to remove this field entirely,
> Good. I will leave this to you and cross it off my list. :p

That said, I would like the answer to your original question to David,
because whatever the answer is, it clearly isn't "  Shang".

~Andrew
Jan Beulich April 4, 2019, 2:21 p.m. UTC | #4
>>> On 04.04.19 at 16:11, <wei.liu2@citrix.com> wrote:
> --- a/xen/arch/x86/cpu/shanghai.c
> +++ b/xen/arch/x86/cpu/shanghai.c
> @@ -16,7 +16,7 @@ static void init_shanghai(struct cpuinfo_x86 *c)
>  }
>  
>  static const struct cpu_dev shanghai_cpu_dev = {
> -    .c_vendor   = "  Shang",
> +    .c_vendor   = "Shanghai",

But this makes it a non-nul terminated string: The structure
member is an array of just 8 characters. 

Jan

Patch
diff mbox series

diff --git a/xen/arch/x86/cpu/shanghai.c b/xen/arch/x86/cpu/shanghai.c
index 24af5c8259..36c1763c81 100644
--- a/xen/arch/x86/cpu/shanghai.c
+++ b/xen/arch/x86/cpu/shanghai.c
@@ -16,7 +16,7 @@  static void init_shanghai(struct cpuinfo_x86 *c)
 }
 
 static const struct cpu_dev shanghai_cpu_dev = {
-    .c_vendor   = "  Shang",
+    .c_vendor   = "Shanghai",
     .c_init     = init_shanghai,
 };