linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] acpi: x2apic entry with uid < 255 could use processor statement
@ 2010-07-31  6:51 Yinghai Lu
  2010-08-02 19:06 ` Suresh Siddha
  0 siblings, 1 reply; 5+ messages in thread
From: Yinghai Lu @ 2010-07-31  6:51 UTC (permalink / raw)
  To: Len Brown, Suresh Siddha, Andrew Morton, H. Peter Anvin
  Cc: linux-acpi, linux-kernel, Ingo Molnar


According to Intel x2apic spec page 46

" The hand-off to
OSPM will have processor IDs in the range of 0 to 254 for xAPIC/x2APIC and 0 to 255
for SAPIC declared as either Processor() or Device() objects, but not both. Processor
IDs outside these ranges must be declared as Device() objects."

So only check if Device is used when acpi_id >=255.

that will help system with less 255 cpus, but some cpus apic id > 255,
still can use Processor statement instead of Device() objects.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 drivers/acpi/processor_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/drivers/acpi/processor_core.c
===================================================================
--- linux-2.6.orig/drivers/acpi/processor_core.c
+++ linux-2.6/drivers/acpi/processor_core.c
@@ -69,7 +69,7 @@ static int map_x2apic_id(struct acpi_sub
 	if (!(apic->lapic_flags & ACPI_MADT_ENABLED))
 		return 0;
 
-	if (device_declaration && (apic->uid == acpi_id)) {
+	if ((device_declaration || (acpi_id < 255)) && (apic->uid == acpi_id)) {
 		*apic_id = apic->local_apic_id;
 		return 1;
 	}

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] acpi: x2apic entry with uid < 255 could use processor statement
  2010-07-31  6:51 [PATCH] acpi: x2apic entry with uid < 255 could use processor statement Yinghai Lu
@ 2010-08-02 19:06 ` Suresh Siddha
  2010-08-02 20:18   ` Yinghai Lu
  0 siblings, 1 reply; 5+ messages in thread
From: Suresh Siddha @ 2010-08-02 19:06 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Len Brown, Andrew Morton, H. Peter Anvin,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ingo Molnar

On Sat, 2010-07-31 at 07:51 +0100, Yinghai Lu wrote:
> According to Intel x2apic spec page 46
> 
> " The hand-off to
> OSPM will have processor IDs in the range of 0 to 254 for xAPIC/x2APIC and 0 to 255
> for SAPIC declared as either Processor() or Device() objects, but not both. Processor
> IDs outside these ranges must be declared as Device() objects."
> 
> So only check if Device is used when acpi_id >=255.
> 
> that will help system with less 255 cpus, but some cpus apic id > 255,
> still can use Processor statement instead of Device() objects.

But the entries with apic_id < 255 are supposed to use local APIC
structure and not local x2apic structure. So entries with apic id < 255
must be processed using map_lapic_id() which doesn't have any
device_declaration checks.

Only for apic ids > 255, we use map_x2apic_id() which needs device
declaration. So this patch is not needed. or Am I missing something?

thanks,
suresh

> 
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> 
> ---
>  drivers/acpi/processor_core.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-2.6/drivers/acpi/processor_core.c
> ===================================================================
> --- linux-2.6.orig/drivers/acpi/processor_core.c
> +++ linux-2.6/drivers/acpi/processor_core.c
> @@ -69,7 +69,7 @@ static int map_x2apic_id(struct acpi_sub
>  	if (!(apic->lapic_flags & ACPI_MADT_ENABLED))
>  		return 0;
>  
> -	if (device_declaration && (apic->uid == acpi_id)) {
> +	if ((device_declaration || (acpi_id < 255)) && (apic->uid == acpi_id)) {
>  		*apic_id = apic->local_apic_id;
>  		return 1;
>  	}


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] acpi: x2apic entry with uid < 255 could use processor statement
  2010-08-02 19:06 ` Suresh Siddha
@ 2010-08-02 20:18   ` Yinghai Lu
  2010-08-02 20:53     ` Suresh Siddha
  0 siblings, 1 reply; 5+ messages in thread
From: Yinghai Lu @ 2010-08-02 20:18 UTC (permalink / raw)
  To: Suresh Siddha
  Cc: Len Brown, Andrew Morton, H. Peter Anvin,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ingo Molnar

On Mon, Aug 2, 2010 at 12:06 PM, Suresh Siddha
<suresh.b.siddha@intel.com> wrote:
> On Sat, 2010-07-31 at 07:51 +0100, Yinghai Lu wrote:
>> According to Intel x2apic spec page 46
>>
>> " The hand-off to
>> OSPM will have processor IDs in the range of 0 to 254 for xAPIC/x2APIC and 0 to 255
>> for SAPIC declared as either Processor() or Device() objects, but not both. Processor
>> IDs outside these ranges must be declared as Device() objects."
>>
>> So only check if Device is used when acpi_id >=255.
>>
>> that will help system with less 255 cpus, but some cpus apic id > 255,
>> still can use Processor statement instead of Device() objects.
>
> But the entries with apic_id < 255 are supposed to use local APIC
> structure and not local x2apic structure. So entries with apic id < 255
> must be processed using map_lapic_id() which doesn't have any
> device_declaration checks.
>
> Only for apic ids > 255, we use map_x2apic_id() which needs device
> declaration. So this patch is not needed. or Am I missing something?

it is acpi_id aka  Processor id.

the system has less than 255 cpus, but some cpus apic_id > 255.
BIOS have apic entries for apic_id < 255, and some x2apic entries for
apic_id > 255.

but BIOS still use Processor statement for all cpus.

Thanks

Yinghai

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] acpi: x2apic entry with uid < 255 could use processor statement
  2010-08-02 20:18   ` Yinghai Lu
@ 2010-08-02 20:53     ` Suresh Siddha
  2010-08-02 21:34       ` Yinghai Lu
  0 siblings, 1 reply; 5+ messages in thread
From: Suresh Siddha @ 2010-08-02 20:53 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Len Brown, Andrew Morton, H. Peter Anvin,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ingo Molnar

On Mon, 2010-08-02 at 13:18 -0700, Yinghai Lu wrote:
> On Mon, Aug 2, 2010 at 12:06 PM, Suresh Siddha
> <suresh.b.siddha@intel.com> wrote:
> > On Sat, 2010-07-31 at 07:51 +0100, Yinghai Lu wrote:
> >> According to Intel x2apic spec page 46
> >>
> >> " The hand-off to
> >> OSPM will have processor IDs in the range of 0 to 254 for xAPIC/x2APIC and 0 to 255
> >> for SAPIC declared as either Processor() or Device() objects, but not both. Processor
> >> IDs outside these ranges must be declared as Device() objects."
> >>
> >> So only check if Device is used when acpi_id >=255.
> >>
> >> that will help system with less 255 cpus, but some cpus apic id > 255,
> >> still can use Processor statement instead of Device() objects.
> >
> > But the entries with apic_id < 255 are supposed to use local APIC
> > structure and not local x2apic structure. So entries with apic id < 255
> > must be processed using map_lapic_id() which doesn't have any
> > device_declaration checks.
> >
> > Only for apic ids > 255, we use map_x2apic_id() which needs device
> > declaration. So this patch is not needed. or Am I missing something?
> 
> it is acpi_id aka  Processor id.
> 
> the system has less than 255 cpus, but some cpus apic_id > 255.
> BIOS have apic entries for apic_id < 255, and some x2apic entries for
> apic_id > 255.
> 
> but BIOS still use Processor statement for all cpus.

Ok. I think there might be some confusion or mis-interpretation of the
words here. You referred to x2apic spec page 46, perhaps this is an
older version. Newer x2apic version leaves all the ACPI definitions to
the ACPI 4.0 spec.

And here is what ACPI 4.0 spec says:

In Table5-33 for processor local x2apic structure:

ACPI Processor UID
4
12
OSPM associates the X2APIC Structure with a processor object declared in
the namespace using the Device statement, when the _UID child object of
the processor device evaluates to a numeric value, by matching the
numeric value with this field

And in page 312:

<snip>
The platform may declare processors with IDs in the range of 0-254 for
APIC/x2APIC implementations and 0-255 for SAPIC implementations using
either the ASL Processor statement or the ASL Device statement but not
both. Processors with IDs outside these ranges must be declared using
the ASL Device statement.
</snip>

And in the above paragraph "processors with IDs" are APIC id's and not
ACPI Id's.

So I think your bios need to implement ACPI device objects for the
x2apic entries.

thanks,
suresh

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] acpi: x2apic entry with uid < 255 could use processor statement
  2010-08-02 20:53     ` Suresh Siddha
@ 2010-08-02 21:34       ` Yinghai Lu
  0 siblings, 0 replies; 5+ messages in thread
From: Yinghai Lu @ 2010-08-02 21:34 UTC (permalink / raw)
  To: Suresh Siddha
  Cc: Len Brown, Andrew Morton, H. Peter Anvin,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ingo Molnar

On 08/02/2010 01:53 PM, Suresh Siddha wrote:
> On Mon, 2010-08-02 at 13:18 -0700, Yinghai Lu wrote:
>> On Mon, Aug 2, 2010 at 12:06 PM, Suresh Siddha
>> <suresh.b.siddha@intel.com> wrote:
>>> On Sat, 2010-07-31 at 07:51 +0100, Yinghai Lu wrote:
>>>> According to Intel x2apic spec page 46
>>>>
>>>> " The hand-off to
>>>> OSPM will have processor IDs in the range of 0 to 254 for xAPIC/x2APIC and 0 to 255
>>>> for SAPIC declared as either Processor() or Device() objects, but not both. Processor
>>>> IDs outside these ranges must be declared as Device() objects."
>>>>
>>>> So only check if Device is used when acpi_id >=255.
>>>>
>>>> that will help system with less 255 cpus, but some cpus apic id > 255,
>>>> still can use Processor statement instead of Device() objects.
>>>
>>> But the entries with apic_id < 255 are supposed to use local APIC
>>> structure and not local x2apic structure. So entries with apic id < 255
>>> must be processed using map_lapic_id() which doesn't have any
>>> device_declaration checks.
>>>
>>> Only for apic ids > 255, we use map_x2apic_id() which needs device
>>> declaration. So this patch is not needed. or Am I missing something?
>>
>> it is acpi_id aka  Processor id.
>>
>> the system has less than 255 cpus, but some cpus apic_id > 255.
>> BIOS have apic entries for apic_id < 255, and some x2apic entries for
>> apic_id > 255.
>>
>> but BIOS still use Processor statement for all cpus.
> 
> Ok. I think there might be some confusion or mis-interpretation of the
> words here. You referred to x2apic spec page 46, perhaps this is an
> older version. Newer x2apic version leaves all the ACPI definitions to
> the ACPI 4.0 spec.
> 
> And here is what ACPI 4.0 spec says:
> 
> In Table5-33 for processor local x2apic structure:
> 
> ACPI Processor UID
> 4
> 12
> OSPM associates the X2APIC Structure with a processor object declared in
> the namespace using the Device statement, when the _UID child object of
> the processor device evaluates to a numeric value, by matching the
> numeric value with this field
> 
> And in page 312:
> 
> <snip>
> The platform may declare processors with IDs in the range of 0-254 for
> APIC/x2APIC implementations and 0-255 for SAPIC implementations using
> either the ASL Processor statement or the ASL Device statement but not
> both. Processors with IDs outside these ranges must be declared using
> the ASL Device statement.
> </snip>
> 
> And in the above paragraph "processors with IDs" are APIC id's and not
> ACPI Id's.
> 
> So I think your bios need to implement ACPI device objects for the
> x2apic entries.

that is confusing.

thanks. I will ask BIOS to fix that.

Yinghai

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-08-02 21:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-31  6:51 [PATCH] acpi: x2apic entry with uid < 255 could use processor statement Yinghai Lu
2010-08-02 19:06 ` Suresh Siddha
2010-08-02 20:18   ` Yinghai Lu
2010-08-02 20:53     ` Suresh Siddha
2010-08-02 21:34       ` Yinghai Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).