Re: [tip:x86/urgent] x86/apic: Fix signedness bug in APIC ID validity checks

2018-04-11 Thread Thomas Gleixner
On Wed, 11 Apr 2018, Dou Liyang wrote:

> Hi Thomas,
> 
> At 04/10/2018 10:51 PM, tip-bot for Li RongQing wrote:
> [...]
> 
> > x86/apic: Fix signedness bug in APIC ID validity checks
> > 
> > The APIC ID as parsed from ACPI MADT is validity checked with the
> > apic->apic_id_valid() callback, which depends on the selected APIC type.
> > 
> > For non X2APIC types APIC IDs >= 0xFF are invalid, but values > 0x7FFF
> 
> Today when I am reading "Intel® 64 Architecture x2APIC Specification", I
> find that below in chapter 2.4.1:
> 
>   The APIC ID value of _H and the highest value corresponding to
>   the imple-mented bit-width of the local APIC ID register in the system
>   are reserved and cannot be assigned to any logical processor.
> 
> Seems, _H is also invalid for X2APIC types, Shall we also do the
> validity check for X2APIC ID?
> 
> acpi_parse_x2apic()
>   ...
>   /* Ignore invalid ID */
>   if (apic_id == 0x)
>   return 0;

Yes. I noticed that as well and just did not come around to write the
patch.

Thanks,

tglx

Re: [tip:x86/urgent] x86/apic: Fix signedness bug in APIC ID validity checks

2018-04-11 Thread Thomas Gleixner
On Wed, 11 Apr 2018, Dou Liyang wrote:

> Hi Thomas,
> 
> At 04/10/2018 10:51 PM, tip-bot for Li RongQing wrote:
> [...]
> 
> > x86/apic: Fix signedness bug in APIC ID validity checks
> > 
> > The APIC ID as parsed from ACPI MADT is validity checked with the
> > apic->apic_id_valid() callback, which depends on the selected APIC type.
> > 
> > For non X2APIC types APIC IDs >= 0xFF are invalid, but values > 0x7FFF
> 
> Today when I am reading "Intel® 64 Architecture x2APIC Specification", I
> find that below in chapter 2.4.1:
> 
>   The APIC ID value of _H and the highest value corresponding to
>   the imple-mented bit-width of the local APIC ID register in the system
>   are reserved and cannot be assigned to any logical processor.
> 
> Seems, _H is also invalid for X2APIC types, Shall we also do the
> validity check for X2APIC ID?
> 
> acpi_parse_x2apic()
>   ...
>   /* Ignore invalid ID */
>   if (apic_id == 0x)
>   return 0;

Yes. I noticed that as well and just did not come around to write the
patch.

Thanks,

tglx

Re: [tip:x86/urgent] x86/apic: Fix signedness bug in APIC ID validity checks

2018-04-11 Thread Dou Liyang

Hi Thomas,

At 04/10/2018 10:51 PM, tip-bot for Li RongQing wrote:
[...]


x86/apic: Fix signedness bug in APIC ID validity checks

The APIC ID as parsed from ACPI MADT is validity checked with the
apic->apic_id_valid() callback, which depends on the selected APIC type.

For non X2APIC types APIC IDs >= 0xFF are invalid, but values > 0x7FFF


Today when I am reading "Intel® 64 Architecture x2APIC Specification", I
find that below in chapter 2.4.1:

  The APIC ID value of _H and the highest value corresponding to
  the imple-mented bit-width of the local APIC ID register in the system
  are reserved and cannot be assigned to any logical processor.

Seems, _H is also invalid for X2APIC types, Shall we also do the
validity check for X2APIC ID?

acpi_parse_x2apic()
...
/* Ignore invalid ID */
if (apic_id == 0x)
return 0;
...

Thanks,
dou





Re: [tip:x86/urgent] x86/apic: Fix signedness bug in APIC ID validity checks

2018-04-11 Thread Dou Liyang

Hi Thomas,

At 04/10/2018 10:51 PM, tip-bot for Li RongQing wrote:
[...]


x86/apic: Fix signedness bug in APIC ID validity checks

The APIC ID as parsed from ACPI MADT is validity checked with the
apic->apic_id_valid() callback, which depends on the selected APIC type.

For non X2APIC types APIC IDs >= 0xFF are invalid, but values > 0x7FFF


Today when I am reading "Intel® 64 Architecture x2APIC Specification", I
find that below in chapter 2.4.1:

  The APIC ID value of _H and the highest value corresponding to
  the imple-mented bit-width of the local APIC ID register in the system
  are reserved and cannot be assigned to any logical processor.

Seems, _H is also invalid for X2APIC types, Shall we also do the
validity check for X2APIC ID?

acpi_parse_x2apic()
...
/* Ignore invalid ID */
if (apic_id == 0x)
return 0;
...

Thanks,
dou