All of lore.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>
Subject: Re: [PATCH] sched, cpuidle: Do not access cpuidle_devices when !CONFIG_CPU_IDLE
Date: Wed, 1 Jun 2016 22:48:37 +0100	[thread overview]
Message-ID: <20160601214836.GA14666@mbp> (raw)
In-Reply-To: <4245615.v9qo6igreM@vostro.rjw.lan>

On Wed, Jun 01, 2016 at 10:20:03PM +0200, Rafael J. Wysocki wrote:
> On Wednesday, June 01, 2016 06:52:16 PM Catalin Marinas wrote:
> > The cpuidle_devices per-CPU variable is only defined when CPU_IDLE is
> > enabled. Commit c8cc7d4de7a4 ("sched/idle: Reorganize the idle loop")
> > removed the #ifdef CONFIG_CPU_IDLE around cpuidle_idle_call() with the
> > compiler optimising away __this_cpu_read(cpuidle_devices). However, with
> > CONFIG_UBSAN && !CONFIG_CPU_IDLE, this optimisation no longer happens
> > and the kernel fails to link since cpuidle_devices is not defined.
> > 
> > This patch introduces an accessor function for the current CPU cpuidle
> > device (returning NULL when !CONFIG_CPU_IDLE) and uses it in
> > cpuidle_idle_call().
> > 
> > Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
> > Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> > Cc: Ingo Molnar <mingo@redhat.com>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
> > Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> 
> OK
> 
> Is this needed in -stable?

Not sure how common this config combination is (I was just testing
different options and came across it). Even though it's not a fix for
UBSAN, we could add it up to 4.5 since that's when UBSAN was merged:

Cc: <stable@vger.kernel.org> # 4.5+

-- 
Catalin

      reply	other threads:[~2016-06-01 21:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 17:52 [PATCH] sched, cpuidle: Do not access cpuidle_devices when !CONFIG_CPU_IDLE Catalin Marinas
2016-06-01 20:20 ` Rafael J. Wysocki
2016-06-01 21:48   ` Catalin Marinas [this message]

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=20160601214836.GA14666@mbp \
    --to=catalin.marinas@arm.com \
    --cc=aryabinin@virtuozzo.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rjw@rjwysocki.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.