* [PATCH] x86: fix dummy apic read/write warning [not found] <20090606073737.GA3163@elte.hu> @ 2009-06-06 22:16 ` Yinghai Lu 2009-06-07 7:01 ` Cyrill Gorcunov 0 siblings, 1 reply; 4+ messages in thread From: Yinghai Lu @ 2009-06-06 22:16 UTC (permalink / raw) To: Ingo Molnar, H. Peter Anvin, Thomas Gleixner Cc: Cyrill Gorcunov, linux-kernel@vger.kernel.org ingo got [ 0.000000] Using APIC driver default [ 0.000000] SMP: Allowing 1 CPUs, 0 hotplug CPUs [ 0.000000] Local APIC disabled by BIOS -- you can enable it with "lapic" [ 0.000000] APIC: disable apic facility [ 0.000000] ------------[ cut here ]------------ [ 0.000000] WARNING: at arch/x86/kernel/apic/apic.c:254 native_apic_read_dummy+0x2d/0x3b() [ 0.000000] Hardware name: HP OmniBook PC we have wrong check in dummy read and write. [we only test on system that have APIC with "disableapic"...] Signed-off-by: yinghai Lu <yinghai@kernel.org> --- arch/x86/kernel/apic/apic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux-2.6/arch/x86/kernel/apic/apic.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/apic/apic.c +++ linux-2.6/arch/x86/kernel/apic/apic.c @@ -246,12 +246,12 @@ static int modern_apic(void) */ static void native_apic_write_dummy(u32 reg, u32 v) { - WARN_ON_ONCE((cpu_has_apic || !disable_apic)); + WARN_ON_ONCE((cpu_has_apic && !disable_apic)); } static u32 native_apic_read_dummy(u32 reg) { - WARN_ON_ONCE((cpu_has_apic || !disable_apic)); + WARN_ON_ONCE((cpu_has_apic && !disable_apic)); return 0; } ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86: fix dummy apic read/write warning 2009-06-06 22:16 ` [PATCH] x86: fix dummy apic read/write warning Yinghai Lu @ 2009-06-07 7:01 ` Cyrill Gorcunov 2009-06-07 19:28 ` Yinghai Lu 0 siblings, 1 reply; 4+ messages in thread From: Cyrill Gorcunov @ 2009-06-07 7:01 UTC (permalink / raw) To: Yinghai Lu Cc: Ingo Molnar, H. Peter Anvin, Thomas Gleixner, linux-kernel@vger.kernel.org [Yinghai Lu - Sat, Jun 06, 2009 at 03:16:38PM -0700] | ingo got | [ 0.000000] Using APIC driver default | [ 0.000000] SMP: Allowing 1 CPUs, 0 hotplug CPUs | [ 0.000000] Local APIC disabled by BIOS -- you can enable it with "lapic" | [ 0.000000] APIC: disable apic facility | [ 0.000000] ------------[ cut here ]------------ | [ 0.000000] WARNING: at arch/x86/kernel/apic/apic.c:254 native_apic_read_dummy+0x2d/0x3b() | [ 0.000000] Hardware name: HP OmniBook PC | | we have wrong check in dummy read and write. | [we only test on system that have APIC with "disableapic"...] | | Signed-off-by: yinghai Lu <yinghai@kernel.org> | | --- | arch/x86/kernel/apic/apic.c | 4 ++-- | 1 file changed, 2 insertions(+), 2 deletions(-) | | Index: linux-2.6/arch/x86/kernel/apic/apic.c | =================================================================== | --- linux-2.6.orig/arch/x86/kernel/apic/apic.c | +++ linux-2.6/arch/x86/kernel/apic/apic.c | @@ -246,12 +246,12 @@ static int modern_apic(void) | */ | static void native_apic_write_dummy(u32 reg, u32 v) | { | - WARN_ON_ONCE((cpu_has_apic || !disable_apic)); | + WARN_ON_ONCE((cpu_has_apic && !disable_apic)); | } | | static u32 native_apic_read_dummy(u32 reg) | { | - WARN_ON_ONCE((cpu_has_apic || !disable_apic)); | + WARN_ON_ONCE((cpu_has_apic && !disable_apic)); | return 0; | } | | No Yinghai, this is wrong. native_apic_write_dummy is not admissible to be called after apic->write has been NOP'ified. If a site calls for apic->write after apic_disable() it's a plain *bug* in caller. So we should continute warning if cpu_has_apic _or_ !disable_apic. Though since for SMP compiled kernel we still rely on apic->read the snippet is to be changed to (cpu_has_apic && !disable_apic) indeed. -- Cyrill ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86: fix dummy apic read/write warning 2009-06-07 7:01 ` Cyrill Gorcunov @ 2009-06-07 19:28 ` Yinghai Lu 2009-06-07 21:03 ` Cyrill Gorcunov 0 siblings, 1 reply; 4+ messages in thread From: Yinghai Lu @ 2009-06-07 19:28 UTC (permalink / raw) To: Cyrill Gorcunov Cc: Ingo Molnar, H. Peter Anvin, Thomas Gleixner, linux-kernel@vger.kernel.org On Sun, Jun 7, 2009 at 12:01 AM, Cyrill Gorcunov<gorcunov@gmail.com> wrote: > [Yinghai Lu - Sat, Jun 06, 2009 at 03:16:38PM -0700] > | ingo got > | [ 0.000000] Using APIC driver default > | [ 0.000000] SMP: Allowing 1 CPUs, 0 hotplug CPUs > | [ 0.000000] Local APIC disabled by BIOS -- you can enable it with "lapic" > | [ 0.000000] APIC: disable apic facility > | [ 0.000000] ------------[ cut here ]------------ > | [ 0.000000] WARNING: at arch/x86/kernel/apic/apic.c:254 native_apic_read_dummy+0x2d/0x3b() > | [ 0.000000] Hardware name: HP OmniBook PC > | > | we have wrong check in dummy read and write. > | [we only test on system that have APIC with "disableapic"...] > | > | Signed-off-by: yinghai Lu <yinghai@kernel.org> > | > | --- > | arch/x86/kernel/apic/apic.c | 4 ++-- > | 1 file changed, 2 insertions(+), 2 deletions(-) > | > | Index: linux-2.6/arch/x86/kernel/apic/apic.c > | =================================================================== > | --- linux-2.6.orig/arch/x86/kernel/apic/apic.c > | +++ linux-2.6/arch/x86/kernel/apic/apic.c > | @@ -246,12 +246,12 @@ static int modern_apic(void) > | */ > | static void native_apic_write_dummy(u32 reg, u32 v) > | { > | - WARN_ON_ONCE((cpu_has_apic || !disable_apic)); > | + WARN_ON_ONCE((cpu_has_apic && !disable_apic)); > | } > | > | static u32 native_apic_read_dummy(u32 reg) > | { > | - WARN_ON_ONCE((cpu_has_apic || !disable_apic)); > | + WARN_ON_ONCE((cpu_has_apic && !disable_apic)); > | return 0; > | } > | > | > > No Yinghai, this is wrong. native_apic_write_dummy is not > admissible to be called after apic->write has been NOP'ified. > > If a site calls for apic->write after apic_disable() it's > a plain *bug* in caller. So we should continute warning if > cpu_has_apic _or_ !disable_apic. ok, just change it to WARN_ON_ONCE(1); there. > > Though since for SMP compiled kernel we still rely on > apic->read the snippet is to be changed to (cpu_has_apic && !disable_apic) > indeed. YH ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86: fix dummy apic read/write warning 2009-06-07 19:28 ` Yinghai Lu @ 2009-06-07 21:03 ` Cyrill Gorcunov 0 siblings, 0 replies; 4+ messages in thread From: Cyrill Gorcunov @ 2009-06-07 21:03 UTC (permalink / raw) To: Yinghai Lu Cc: Ingo Molnar, H. Peter Anvin, Thomas Gleixner, linux-kernel@vger.kernel.org [Yinghai Lu - Sun, Jun 07, 2009 at 12:28:07PM -0700] | On Sun, Jun 7, 2009 at 12:01 AM, Cyrill Gorcunov<gorcunov@gmail.com> wrote: | > [Yinghai Lu - Sat, Jun 06, 2009 at 03:16:38PM -0700] | > | ingo got | > | [ 0.000000] Using APIC driver default | > | [ 0.000000] SMP: Allowing 1 CPUs, 0 hotplug CPUs | > | [ 0.000000] Local APIC disabled by BIOS -- you can enable it with "lapic" | > | [ 0.000000] APIC: disable apic facility | > | [ 0.000000] ------------[ cut here ]------------ | > | [ 0.000000] WARNING: at arch/x86/kernel/apic/apic.c:254 native_apic_read_dummy+0x2d/0x3b() | > | [ 0.000000] Hardware name: HP OmniBook PC | > | | > | we have wrong check in dummy read and write. | > | [we only test on system that have APIC with "disableapic"...] | > | | > | Signed-off-by: yinghai Lu <yinghai@kernel.org> | > | | > | --- | > | arch/x86/kernel/apic/apic.c | 4 ++-- | > | 1 file changed, 2 insertions(+), 2 deletions(-) | > | | > | Index: linux-2.6/arch/x86/kernel/apic/apic.c | > | =================================================================== | > | --- linux-2.6.orig/arch/x86/kernel/apic/apic.c | > | +++ linux-2.6/arch/x86/kernel/apic/apic.c | > | @@ -246,12 +246,12 @@ static int modern_apic(void) | > | */ | > | static void native_apic_write_dummy(u32 reg, u32 v) | > | { | > | - WARN_ON_ONCE((cpu_has_apic || !disable_apic)); | > | + WARN_ON_ONCE((cpu_has_apic && !disable_apic)); | > | } | > | | > | static u32 native_apic_read_dummy(u32 reg) | > | { | > | - WARN_ON_ONCE((cpu_has_apic || !disable_apic)); | > | + WARN_ON_ONCE((cpu_has_apic && !disable_apic)); | > | return 0; | > | } | > | | > | | > | > No Yinghai, this is wrong. native_apic_write_dummy is not | > admissible to be called after apic->write has been NOP'ified. | > | > If a site calls for apic->write after apic_disable() it's | > a plain *bug* in caller. So we should continute warning if | > cpu_has_apic _or_ !disable_apic. | | ok, just change it to | | WARN_ON_ONCE(1); | | there. There was some scenario where we had legitime apic->write on SMP kernel when cpu goes to halt. Will recheck tomorrow. That is why we added conditional WARN to eliminate uglifying by additional checks (ie we know that apic->write happens but it's nothing serious). Thanks Yinghai! | | > | > Though since for SMP compiled kernel we still rely on | > apic->read the snippet is to be changed to (cpu_has_apic && !disable_apic) | > indeed. | | YH | -- Cyrill ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-06-07 21:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20090606073737.GA3163@elte.hu>
2009-06-06 22:16 ` [PATCH] x86: fix dummy apic read/write warning Yinghai Lu
2009-06-07 7:01 ` Cyrill Gorcunov
2009-06-07 19:28 ` Yinghai Lu
2009-06-07 21:03 ` Cyrill Gorcunov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox