From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
Julien Thierry <julien.thierry@arm.com>,
Marc Zyngier <marc.zyngier@arm.com>,
Will Deacon <will.deacon@arm.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
Morten Rasmussen <Morten.Rasmussen@arm.com>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
linux-arm-kernel@lists.infradead.org,
Qais Yousef <Qais.Yousef@arm.com>
Subject: Re: [PATCH v2 5/5] ARM: spectre-v2: per-CPU vtables to work around big.Little systems
Date: Thu, 6 Dec 2018 10:00:52 +0000 [thread overview]
Message-ID: <20181206100052.GR30658@n2100.armlinux.org.uk> (raw)
In-Reply-To: <dda0be26-5ac8-a158-3210-4bc6861bede2@samsung.com>
On Thu, Dec 06, 2018 at 10:32:56AM +0100, Marek Szyprowski wrote:
> Hi All,
>
> On 2018-11-06 13:39, Russell King wrote:
> > In big.Little systems, some CPUs require the Spectre workarounds in
> > paths such as the context switch, but other CPUs do not. In order
> > to handle these differences, we need per-CPU vtables.
> >
> > We are unable to use the kernel's per-CPU variables to support this
> > as per-CPU is not initialised at times when we need access to the
> > vtables, so we have to use an array indexed by logical CPU number.
> >
> > We use an array-of-pointers to avoid having function pointers in
> > the kernel's read/write .data section.
> >
> > Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
>
> Today I've noticed that this patch (which has landed in v4.20-rc3 as
> commit 383fb3ee8024) causes regression in CPU hotplug and suspend/resume
> handling on Samsung Exynos4412 SoC (4*CortexA9 SMP). After putting any
> non-zero CPU offline, it is no longer possible to get it online again.
> Same in system suspend/resume - after s2r cycle, only CPU0 is online.
> The regression can be observed on Hardkernel's Odroid U3 and Samsung
> Trats2 boards.
>
> Any idea how to fix this issue?
This is getting _really_ annoying. I send the patches out, I ask for
people to test, they seem to ignore the patches, and then they later
report problems. This is the _second_ time that this has happened,
both times with Exynos, the first time it caused the patches to miss
the merge window. Given that Spectre has to deal with every kernel
entry path, wouldn't it be logical to test every form of entry - boot,
CPU hotplug, suspend/resume etc?
Sorry, but at this point I have little sympathy.
I've no idea based on what you've supplied given that the SoC
maintainers are responsible for writing the code to deal with hotplug
etc, and Exynos's code there is something of a maze. It's not clear
which bits are being used. I think you at the very least need to debug
to find out whether the problem is at CPU down or CPU up.
From the ARM architecture point of view, for Cortex A9, all the
processor function instances should be identical. The only difference
as a result of the patch is that we'll be calling smp_processor_id()
early (which should be fine), and indirecting through the cpu_vtable[]
array rather than merely dereferencing the processor struct.
What about checking dmesg - messages from offline CPUs do not appear
on the console(s) but are still logged in the kernel log.
You could try making PROC_VTABLE() the same as PROC_TABLE() (iow,
always access cpu_vtable[0]) to see whether it's the smp_processor_id()
that's causing your problem or not. If it is, then try and work out
which of the processor functions is causing it by restoring
PROC_VTABLE() and then switching each from PROC_VTABLE() to
PROC_TABLE() until it does work.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2018-12-06 10:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-06 12:37 [PATCH v2 0/5] Spectre big.Little updates Russell King - ARM Linux
2018-11-06 12:38 ` [PATCH 1/5] ARM: make lookup_processor_type() non-__init Russell King
2018-11-06 12:38 ` [PATCH v2 " Russell King
2018-11-06 12:38 ` [PATCH v2 2/5] ARM: split out processor lookup Russell King
2018-11-06 12:39 ` [PATCH v2 3/5] ARM: clean up per-processor check_bugs method call Russell King
2018-11-06 12:39 ` [PATCH v2 4/5] ARM: add PROC_VTABLE and PROC_TABLE macros Russell King
2018-11-06 12:39 ` [PATCH v2 5/5] ARM: spectre-v2: per-CPU vtables to work around big.Little systems Russell King
2018-11-07 17:42 ` Julien Thierry
2018-12-06 9:32 ` Marek Szyprowski
2018-12-06 10:00 ` Russell King - ARM Linux [this message]
2018-12-06 10:24 ` Krzysztof Kozlowski
2018-12-06 12:39 ` Russell King - ARM Linux
2018-12-06 13:54 ` Krzysztof Kozlowski
2018-12-06 14:07 ` Russell King - ARM Linux
2018-12-06 14:30 ` Krzysztof Kozlowski
2018-12-06 14:37 ` Russell King - ARM Linux
2018-12-06 15:03 ` Krzysztof Kozlowski
2018-12-06 15:31 ` Russell King - ARM Linux
2018-12-06 15:54 ` Marek Szyprowski
2018-12-06 15:58 ` Krzysztof Kozlowski
2018-12-07 9:11 ` Ard Biesheuvel
2018-12-07 10:37 ` Russell King - ARM Linux
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181206100052.GR30658@n2100.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=Morten.Rasmussen@arm.com \
--cc=Qais.Yousef@arm.com \
--cc=dietmar.eggemann@arm.com \
--cc=julien.thierry@arm.com \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=m.szyprowski@samsung.com \
--cc=marc.zyngier@arm.com \
--cc=mark.rutland@arm.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).