mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Bryan O'Donoghue" <pure.logic@nexus-software.ie>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH] x86/intel/quark: Remove lock bit around kernel IMR
Date: Fri, 22 Jan 2016 11:08:36 +0000	[thread overview]
Message-ID: <1453460916.15129.70.camel@nexus-software.ie> (raw)
In-Reply-To: <CAHp75VeMxsux9pQ4P92=tDCSLqP93P3xacJYbRnV=kpe_=tR_w@mail.gmail.com>

On Thu, 2016-01-21 at 20:44 +0200, Andy Shevchenko wrote:
> On Thu, Jan 21, 2016 at 4:05 PM, Bryan O'Donoghue
> <pure.logic@nexus-software.ie> wrote:
> > Currently when setting up an IMR around the kernel .text area we
> > lock that
> > IMR, preventing further modification. While superficially this
> > appears to
> > be the right thing to do, in fact this doesn't account for a
> > legitimate
> > change in the memory map such as when running through kexec. In
> > such a
> > scenario a second kernel can have a different size and location to
> > it's
> > predecessor and can view some of the memory occupied by its
> > predecessor as
> > legitimately usable RAM. This RAM can then be allocated to DMA
> > agents
> > within the system and trigger an IMR violation.
> > 
> > The solution to this situation is to keep the kernel .text section
> > IMR lock
> > bit false. This means that a subsequent kernel will boot and can
> > tear-down
> > an existing IMR, while still setting up an IMR around its own .text
> > section.
> > 
> 
> Like I said you privately it would be nice to have a knob how to
> behave.

Ok - that can work. The default ought to be !locked and we can
parametrize a different behaviour.


> My idea is to provide kernel command line imr= and supply imr=lock
> when user wants to boot kernel locked.

Agreed.

> 
> Optionally: add a warning if imr=lock and kernel build with kexec
> that
> might bring issues

This makes sense.

> Optionally: add a kernel config option to boot always in locked mode
> (should depend on !KEXEC)

Meh. You can still force the state you want with the parameter though.
I reckon we should skip this change for now.

---
bod

  reply	other threads:[~2016-01-22 11:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21 14:05 Bryan O'Donoghue
2016-01-21 18:44 ` Andy Shevchenko
2016-01-22 11:08   ` Bryan O'Donoghue [this message]
2016-01-22 12:11     ` Andy Shevchenko

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=1453460916.15129.70.camel@nexus-software.ie \
    --to=pure.logic@nexus-software.ie \
    --cc=andy.shevchenko@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®