[PATCH]
PATCH 1/1 [PATCH]
I have sent this patch before to lkml, but it appears it wasn't picked up. Also I have to admit this isn't tested. This is a patch against linus' tree.
ACPI_MADT_ENABLED is defined 1 (include/acpi/actbl1.h 501)lapic_flags: an u32 of struct acpi_madt_local_sapic (include/acpi/actbl1.h 467) --
'!' has a higher priority than '&', so as was
this won't test the first bit, but rather evaluates to false for any non-zero lsapic->lapic_flags.
---
arch/ia64/kernel/acpi.c +1 -1
@@ -858,7 +858,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu) lsapic = (struct acpi_madt_local_sapic *)obj->buffer.pointer;if ((lsapic->header.type !=ACPI_MADT_TYPE_LOCAL_SAPIC ) || - (!lsapic->lapic_flags &ACPI_MADT_ENABLED )) { + (!(lsapic->lapic_flags &ACPI_MADT_ENABLED ))) {kfree (buffer.pointer);return -EINVAL ; }
Re: [PATCH with title] priority fix in acpi_map_lsapic() arch/ia64/kernel/acpi.c
As above should have been its title.
Quoted 26 lines · Roel Kluin
I have sent this patch before to lkml, but it appears it wasn't picked up. Also I have to admit this isn't tested. This is a patch against linus' tree.
ACPI_MADT_ENABLEDis defined 1 (include/acpi/actbl1.h501)lapic_flags: an u32 of structacpi_madt_local_sapic(include/acpi/actbl1.h467) --
'!' has a higher priority than '&', so as was
this won't test the first bit, but rather evaluates to false for any non-zerolsapic->lapic_flags.Signed-off-by Roel Kluin <[email protected]>---
arch/ia64/kernel/acpi.c +1
-1@@ -858,7 +858,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu) lsapic = (struct acpi_madt_local_sapic *)obj->buffer.pointer;if ((lsapic->header.type !=ACPI_MADT_TYPE_LOCAL_SAPIC ) || - (!lsapic->lapic_flags &ACPI_MADT_ENABLED )) { + (!(lsapic->lapic_flags &ACPI_MADT_ENABLED ))) {kfree (buffer.pointer);return -EINVAL ; }
Simon Horman
Acked-byRe: [PATCH with title] priority fix in acpi_map_lsapic() arch/ia64/kernel/acpi.c
Quoted 14 lines · Roel Kluin
As above should have been its title.
Quoted 11 lines · Roel Kluin
I have sent this patch before to lkml, but it appears it wasn't picked up. Also I have to admit this isn't tested. This is a patch against linus' tree.
ACPI_MADT_ENABLEDis defined 1 (include/acpi/actbl1.h501)lapic_flags: an u32 of structacpi_madt_local_sapic(include/acpi/actbl1.h467) --
'!' has a higher priority than '&', so as was
this won't test the first bit, but rather evaluates to false for any non-zerolsapic->lapic_flags.Signed-off-by Roel Kluin <[email protected]>
This looks correct to me, though I was curious to know why the problem wasn't manifesting in a bug. I investigated
a bit and found that it seems that the only values lapic_flags currently takes are 0 and ACPI_MADT_ENABLED,
so it turns out that the bogus logic actually gives the correct result (by chance).
Quoted 15 lines
Quoted 15 lines
---
arch/ia64/kernel/acpi.c +1
-1@@ -858,7 +858,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu) lsapic = (struct acpi_madt_local_sapic *)obj->buffer.pointer;if ((lsapic->header.type !=ACPI_MADT_TYPE_LOCAL_SAPIC ) || - (!lsapic->lapic_flags &ACPI_MADT_ENABLED )) { + (!(lsapic->lapic_flags &ACPI_MADT_ENABLED ))) {kfree (buffer.pointer);return -EINVAL ; }
Signature · 1 line
Horms
Re: [PATCH with title] priority fix in acpi_map_lsapic() arch/ia64/kernel/acpi.c
Applied.
thanks,
-Len
Quoted 41 lines · Simon Horman
Quoted 14 lines · Roel Kluin
As above should have been its title.
Quoted 11 lines · Roel Kluin
I have sent this patch before to lkml, but it appears it wasn't picked up. Also I have to admit this isn't tested. This is a patch against linus' tree.
ACPI_MADT_ENABLEDis defined 1 (include/acpi/actbl1.h501)lapic_flags: an u32 of structacpi_madt_local_sapic(include/acpi/actbl1.h467) --
'!' has a higher priority than '&', so as was
this won't test the first bit, but rather evaluates to false for any non-zerolsapic->lapic_flags.Signed-off-by Roel Kluin <[email protected]>This looks correct to me, though I was curious to know why the problem wasn't manifesting in a bug. I investigated
a bit and found that it seems that the only valueslapic_flagscurrently takes are 0 andACPI_MADT_ENABLED,
so it turns out that the bogus logic actually gives the correct result (by chance).Acked-by Simon Horman <[email protected]>Quoted 15 lines
Quoted 15 lines
---
arch/ia64/kernel/acpi.c +1
-1@@ -858,7 +858,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu) lsapic = (struct acpi_madt_local_sapic *)obj->buffer.pointer;if ((lsapic->header.type !=ACPI_MADT_TYPE_LOCAL_SAPIC ) || - (!lsapic->lapic_flags &ACPI_MADT_ENABLED )) { + (!(lsapic->lapic_flags &ACPI_MADT_ENABLED ))) {kfree (buffer.pointer);return -EINVAL ; }