Message ID | 20190404141132.1417-1-wei.liu2@citrix.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [RFC] x86/cpu: fix vendor string for Shanghai CPU | expand |
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
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
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
>>> 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
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, };
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(-)