lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a781481a0706071059g7502f18co56cbb30477acf92f@mail.gmail.com>
Date:	Thu, 7 Jun 2007 23:29:55 +0530
From:	"Satyam Sharma" <satyam.sharma@...il.com>
To:	"Heiko Carstens" <heiko.carstens@...ibm.com>
Cc:	"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
	"Ingo Molnar" <mingo@...hat.com>,
	"Andi Kleen" <andi@...stfloor.org>, "Alan Cox" <alan@...hat.com>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	"David Miller" <davem@...emloft.net>
Subject: Re: [PATCH] Make smp_call_function{_single} go WARNING and return -EINVAL on !SMP (was Re: [PATCH] i386/x86_64: NMI watchdog: Protect smp_call_function() within CONFIG_SMP)

On 6/7/07, Heiko Carstens <heiko.carstens@...ibm.com> wrote:
> > The smp_call_function{_single} functions are used to run
> > given function on all {or speicified} *other* CPUs. For
> > UP systems, "other" CPUs simply don't exist, so we flag
> > such incorrect usage of these functions using a WARNING.
>
> If other cpus don't exist then smp_call_function() should just do
> *nothing* (there is no other cpu right?). We don't want to sprinkle
> a ton of #ifdef CONFIG_SMP around each smp_call_function().

Yes, I suspected that, as mentioned on the other thread (ugh).

> > Also, -EBUSY is generally returned by arch implementations
> > when they find that target_cpu == current_cpu, which is not
> > a comparable case to the !SMP case. Use -EINVAL instead,
> > similar to what powerpc does for !cpu_online(target), which
> > is somewhat more analogous.
>
> No. Current semantics of smp_call_function_single() are that it
> returns -EBUSY if called on the *current* cpu. Since on !CONFIG_SMP the
> only possible cpu it can be called on is the current one, the only
> sane return value is -EBUSY.

The inherent assumption that on !SMP the only possible CPU it
can be called on is current (== 0) is precisely what I would want
to be asserted formally in the code over here. If so, then return
-EBUSY, else -EINVAL?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ