All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Martin <Dave.Martin@arm.com>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	Andre Przywara <andre.przywara@arm.com>,
	kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org
Subject: Re: [PATCH 1/2] KVM: arm/arm64: Add save/restore support for firmware workaround state
Date: Fri, 15 Feb 2019 17:26:02 +0000	[thread overview]
Message-ID: <20190215172558.GO3567@e103592.cambridge.arm.com> (raw)
In-Reply-To: <864l95s2fw.wl-marc.zyngier@arm.com>

On Fri, Feb 15, 2019 at 11:42:27AM +0000, Marc Zyngier wrote:
> On Fri, 15 Feb 2019 09:58:57 +0000,
> Andre Przywara <andre.przywara@arm.com> wrote:
> > 
> > On Wed, 30 Jan 2019 11:39:00 +0000
> > Andre Przywara <andre.przywara@arm.com> wrote:
> > 
> > Peter, Marc, Christoffer,
> > 
> > can we have an opinion on whether it's useful to introduce some
> > common scheme for firmware workaround system registers (parts of
> > KVM_REG_ARM_FW_REG(x)), which would allow checking them for
> > compatibility between two kernels without specifically knowing about
> > them?
> > Dave suggested to introduce some kind of signed encoding in the 4
> > LSBs for all those registers (including future ones), where 0 means
> > UNKNOWN and greater values are better. So without knowing about the
> > particular register, one could judge whether it's safe to migrate.
> > I am just not sure how useful this is, given that QEMU seems to ask
> > the receiving kernel about any sysreg, and doesn't particularly care
> > about the meaning of those registers. And I am not sure we really
> > want to introduce some kind of forward looking scheme in the kernel
> > here, short of a working crystal ball. I think the kernel policy was
> > always to be as strict as possible about those things.
> 
> I honestly don't understand how userspace can decide whether a given
> configuration is migratable or not solely based on the value of such a
> register. In my experience, the target system has a role to play, and
> is the only place where we can find out about whether migration is
> actually possible.

Both origin and target system need to be taken into account.  I don't
think that's anything new.

> As you said, userspace doesn't interpret the data, nor should it. It
> is only on the receiving end that compatibility is assessed and
> whether some level of compatibility can be safely ensured.
> 
> So to sum it up, I don't believe in this approach as a general way of
> describing the handling or errata.

For context, my idea attempted to put KVM, not userspace, in charge of
the decision: userspace applies fixed comparison rules determined ahead
of time, but KVM supplies the values compared (and hence determines the
result).

My worry was that otherwise we may end up with a wild-west tangle of
arbitrary properties that userspace needs specific knowledge about.

We can tolerate a few though.  If we accumulate a significant number
of errata/vulnerability properties that need to be reported to
userspace, this may be worth revisiting.  If not, it doesn't matter.

Cheers
---Dave

WARNING: multiple messages have this Message-ID (diff)
From: Dave Martin <Dave.Martin@arm.com>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	Andre Przywara <andre.przywara@arm.com>,
	kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org
Subject: Re: [PATCH 1/2] KVM: arm/arm64: Add save/restore support for firmware workaround state
Date: Fri, 15 Feb 2019 17:26:02 +0000	[thread overview]
Message-ID: <20190215172558.GO3567@e103592.cambridge.arm.com> (raw)
In-Reply-To: <864l95s2fw.wl-marc.zyngier@arm.com>

On Fri, Feb 15, 2019 at 11:42:27AM +0000, Marc Zyngier wrote:
> On Fri, 15 Feb 2019 09:58:57 +0000,
> Andre Przywara <andre.przywara@arm.com> wrote:
> > 
> > On Wed, 30 Jan 2019 11:39:00 +0000
> > Andre Przywara <andre.przywara@arm.com> wrote:
> > 
> > Peter, Marc, Christoffer,
> > 
> > can we have an opinion on whether it's useful to introduce some
> > common scheme for firmware workaround system registers (parts of
> > KVM_REG_ARM_FW_REG(x)), which would allow checking them for
> > compatibility between two kernels without specifically knowing about
> > them?
> > Dave suggested to introduce some kind of signed encoding in the 4
> > LSBs for all those registers (including future ones), where 0 means
> > UNKNOWN and greater values are better. So without knowing about the
> > particular register, one could judge whether it's safe to migrate.
> > I am just not sure how useful this is, given that QEMU seems to ask
> > the receiving kernel about any sysreg, and doesn't particularly care
> > about the meaning of those registers. And I am not sure we really
> > want to introduce some kind of forward looking scheme in the kernel
> > here, short of a working crystal ball. I think the kernel policy was
> > always to be as strict as possible about those things.
> 
> I honestly don't understand how userspace can decide whether a given
> configuration is migratable or not solely based on the value of such a
> register. In my experience, the target system has a role to play, and
> is the only place where we can find out about whether migration is
> actually possible.

Both origin and target system need to be taken into account.  I don't
think that's anything new.

> As you said, userspace doesn't interpret the data, nor should it. It
> is only on the receiving end that compatibility is assessed and
> whether some level of compatibility can be safely ensured.
> 
> So to sum it up, I don't believe in this approach as a general way of
> describing the handling or errata.

For context, my idea attempted to put KVM, not userspace, in charge of
the decision: userspace applies fixed comparison rules determined ahead
of time, but KVM supplies the values compared (and hence determines the
result).

My worry was that otherwise we may end up with a wild-west tangle of
arbitrary properties that userspace needs specific knowledge about.

We can tolerate a few though.  If we accumulate a significant number
of errata/vulnerability properties that need to be reported to
userspace, this may be worth revisiting.  If not, it doesn't matter.

Cheers
---Dave

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-02-15 17:26 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 12:05 [PATCH 0/2] KVM: arm/arm64: Add VCPU workarounds firmware register Andre Przywara
2019-01-07 12:05 ` Andre Przywara
2019-01-07 12:05 ` [PATCH 1/2] KVM: arm/arm64: Add save/restore support for firmware workaround state Andre Przywara
2019-01-07 12:05   ` Andre Przywara
2019-01-07 13:17   ` Steven Price
2019-01-07 13:17     ` Steven Price
2019-01-21 17:04     ` Andre Przywara
2019-01-21 17:04       ` Andre Przywara
2019-02-22 12:26     ` Andre Przywara
2019-02-22 12:26       ` Andre Przywara
2019-01-22 15:17   ` Dave Martin
2019-01-22 15:17     ` Dave Martin
2019-01-25 14:46     ` Andre Przywara
2019-01-25 14:46       ` Andre Przywara
2019-01-29 21:32       ` Dave Martin
2019-01-29 21:32         ` Dave Martin
2019-01-30 11:39         ` Andre Przywara
2019-01-30 11:39           ` Andre Przywara
2019-01-30 12:07           ` Dave Martin
2019-01-30 12:07             ` Dave Martin
2019-02-15  9:58           ` Andre Przywara
2019-02-15  9:58             ` Andre Przywara
2019-02-15 11:42             ` Marc Zyngier
2019-02-15 11:42               ` Marc Zyngier
2019-02-15 17:26               ` Dave Martin [this message]
2019-02-15 17:26                 ` Dave Martin
2019-02-18  9:07                 ` Marc Zyngier
2019-02-18  9:07                   ` Marc Zyngier
2019-02-18 10:28                   ` Dave Martin
2019-02-18 10:28                     ` Dave Martin
2019-02-18 10:59                     ` Marc Zyngier
2019-02-18 10:59                       ` Marc Zyngier
2019-02-18 11:29                   ` André Przywara
2019-02-18 11:29                     ` André Przywara
2019-02-18 14:15                     ` Marc Zyngier
2019-02-18 14:15                       ` Marc Zyngier
2019-01-07 12:05 ` [PATCH 2/2] KVM: doc: add API documentation on the KVM_REG_ARM_WORKAROUNDS register Andre Przywara
2019-01-07 12:05   ` Andre Przywara
2019-01-22 10:17 ` [PATCH 0/2] KVM: arm/arm64: Add VCPU workarounds firmware register Dave Martin
2019-01-22 10:17   ` Dave Martin
2019-01-22 10:41   ` Andre Przywara
2019-01-22 10:41     ` Andre Przywara
2019-01-22 11:11   ` Marc Zyngier
2019-01-22 11:11     ` Marc Zyngier
2019-01-22 13:56     ` Dave Martin
2019-01-22 13:56       ` Dave Martin
2019-01-22 14:51       ` Marc Zyngier
2019-01-22 14:51         ` Marc Zyngier
2019-01-22 15:28         ` Dave Martin
2019-01-22 15:28           ` Dave Martin

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=20190215172558.GO3567@e103592.cambridge.arm.com \
    --to=dave.martin@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=marc.zyngier@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 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.