Re: [PATCH] x86, cpuinfo fix cpu_data(0) x86_model_id field truncation

2015-05-18 Thread Prarit Bhargava
On 05/18/2015 04:53 PM, H. Peter Anvin wrote: > On 05/18/2015 01:36 PM, Borislav Petkov wrote: >> On Mon, May 18, 2015 at 04:27:02PM -0400, Brian Gerst wrote: >>> The problem here is that strim() modifies the string in place, >>> replacing the first trailing space with a null. I think the best

Re: [PATCH] x86, cpuinfo fix cpu_data(0) x86_model_id field truncation

2015-05-18 Thread H. Peter Anvin
On 05/18/2015 01:36 PM, Borislav Petkov wrote: > On Mon, May 18, 2015 at 04:27:02PM -0400, Brian Gerst wrote: >> The problem here is that strim() modifies the string in place, >> replacing the first trailing space with a null. I think the best >> solution is to do the trimming in

Re: [PATCH] x86, cpuinfo fix cpu_data(0) x86_model_id field truncation

2015-05-18 Thread Borislav Petkov
On Mon, May 18, 2015 at 04:27:02PM -0400, Brian Gerst wrote: > The problem here is that strim() modifies the string in place, > replacing the first trailing space with a null. I think the best > solution is to do the trimming in get_model_name(). It already trims > leading spaces for Intel.

Re: [PATCH] x86, cpuinfo fix cpu_data(0) x86_model_id field truncation

2015-05-18 Thread Brian Gerst
On Mon, May 18, 2015 at 3:45 PM, Borislav Petkov wrote: > On Mon, May 18, 2015 at 02:21:00PM -0400, Prarit Bhargava wrote: >> When comparing 'model name' fields in /proc/cpuinfo it was noticed that >> a simple test comparing the model name fields was failing. After some >> simple investigation

Re: [PATCH] x86, cpuinfo fix cpu_data(0) x86_model_id field truncation

2015-05-18 Thread Borislav Petkov
On Mon, May 18, 2015 at 02:21:00PM -0400, Prarit Bhargava wrote: > When comparing 'model name' fields in /proc/cpuinfo it was noticed that > a simple test comparing the model name fields was failing. After some > simple investigation it was noticed that, in fact, the model name fields > are

[PATCH] x86, cpuinfo fix cpu_data(0) x86_model_id field truncation

2015-05-18 Thread Prarit Bhargava
When comparing 'model name' fields in /proc/cpuinfo it was noticed that a simple test comparing the model name fields was failing. After some simple investigation it was noticed that, in fact, the model name fields are different for each processor. Processor 0's model name field had white space

[PATCH] x86, cpuinfo fix cpu_data(0) x86_model_id field truncation

2015-05-18 Thread Prarit Bhargava
When comparing 'model name' fields in /proc/cpuinfo it was noticed that a simple test comparing the model name fields was failing. After some simple investigation it was noticed that, in fact, the model name fields are different for each processor. Processor 0's model name field had white space

Re: [PATCH] x86, cpuinfo fix cpu_data(0) x86_model_id field truncation

2015-05-18 Thread Borislav Petkov
On Mon, May 18, 2015 at 02:21:00PM -0400, Prarit Bhargava wrote: When comparing 'model name' fields in /proc/cpuinfo it was noticed that a simple test comparing the model name fields was failing. After some simple investigation it was noticed that, in fact, the model name fields are different

Re: [PATCH] x86, cpuinfo fix cpu_data(0) x86_model_id field truncation

2015-05-18 Thread H. Peter Anvin
On 05/18/2015 01:36 PM, Borislav Petkov wrote: On Mon, May 18, 2015 at 04:27:02PM -0400, Brian Gerst wrote: The problem here is that strim() modifies the string in place, replacing the first trailing space with a null. I think the best solution is to do the trimming in get_model_name(). It

Re: [PATCH] x86, cpuinfo fix cpu_data(0) x86_model_id field truncation

2015-05-18 Thread Brian Gerst
On Mon, May 18, 2015 at 3:45 PM, Borislav Petkov b...@alien8.de wrote: On Mon, May 18, 2015 at 02:21:00PM -0400, Prarit Bhargava wrote: When comparing 'model name' fields in /proc/cpuinfo it was noticed that a simple test comparing the model name fields was failing. After some simple

Re: [PATCH] x86, cpuinfo fix cpu_data(0) x86_model_id field truncation

2015-05-18 Thread Prarit Bhargava
On 05/18/2015 04:53 PM, H. Peter Anvin wrote: On 05/18/2015 01:36 PM, Borislav Petkov wrote: On Mon, May 18, 2015 at 04:27:02PM -0400, Brian Gerst wrote: The problem here is that strim() modifies the string in place, replacing the first trailing space with a null. I think the best solution

Re: [PATCH] x86, cpuinfo fix cpu_data(0) x86_model_id field truncation

2015-05-18 Thread Borislav Petkov
On Mon, May 18, 2015 at 04:27:02PM -0400, Brian Gerst wrote: The problem here is that strim() modifies the string in place, replacing the first trailing space with a null. I think the best solution is to do the trimming in get_model_name(). It already trims leading spaces for Intel. Sounds