All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Cornelia Huck <cohuck@redhat.com>
Cc: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>,
	Jing Zhang <jingzhangos@google.com>, KVM <kvm@vger.kernel.org>,
	KVMARM <kvmarm@lists.linux.dev>,
	ARMLinux <linux-arm-kernel@lists.infradead.org>,
	Oliver Upton <oupton@google.com>, Will Deacon <will@kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	James Morse <james.morse@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Fuad Tabba <tabba@google.com>, Reiji Watanabe <reijiw@google.com>,
	Raghavendra Rao Ananta <rananta@google.com>
Subject: Re: [PATCH v8 0/6] Support writable CPU ID registers from userspace
Date: Tue, 16 May 2023 17:01:37 +0100	[thread overview]
Message-ID: <86353wmfj2.wl-maz@kernel.org> (raw)
In-Reply-To: <87a5y4gy0b.fsf@redhat.com>

On Tue, 16 May 2023 15:19:00 +0100,
Cornelia Huck <cohuck@redhat.com> wrote:
> 
> On Tue, May 16 2023, Marc Zyngier <maz@kernel.org> wrote:
> 
> > On Tue, 16 May 2023 12:55:14 +0100,
> > Cornelia Huck <cohuck@redhat.com> wrote:
> >> 
> >> Do you have more concrete ideas for QEMU CPU models already? Asking
> >> because I wanted to talk about this at KVM Forum, so collecting what
> >> others would like to do seems like a good idea :)
> >
> > I'm not being asked, but I'll share my thoughts anyway! ;-)
> >
> > I don't think CPU models are necessarily the most important thing.
> > Specially when you look at the diversity of the ecosystem (and even
> > the same CPU can be configured in different ways at integration
> > time). Case in point, Neoverse N1 which can have its I/D caches made
> > coherent or not. And the guest really wants to know which one it is
> > (you can only lie in one direction).
> >
> > But being able to control the feature set exposed to the guest from
> > userspace is a huge benefit in terms of migration.
> 
> Certainly; the important part is that we can keep the guest ABI
> stable... which parts match to a "CPU model" in the way other
> architectures use it is an interesting question. It almost certainly
> will look different from e.g. s390, where we only have to deal with a
> single manufacturer.
> 
> I'm wondering whether we'll end up building frankenmonster CPUs.

We already do. KVM hides a bunch of things we don't want the guest to
see, either because we don't support the feature, or that we want to
present it with a different shape (cache topology, for example), and
these combination don't really exist in any physical implementation.

Which is why I don't really buy the "CPU model" concept as defined by
x86 and s390. We already are in a vastly different place.

The way I see it, you get a bunch of architectural features that can
be enabled/disabled depending on the underlying HW, hypervisor's
capabilities and userspace input. On top of that, there is a layer of
paint that tells you what is the overall implementation you could be
running on (that's what MIDR+REVIDR+AIDR tell you) so that you can
apply some unspeakable, uarch-specific hacks that keep the machine
going (got to love these CPU errata).

> Another interesting aspect is how KVM ends up influencing what the guest
> sees on the CPU level, as in the case where we migrate across matching
> CPUs, but with a different software level. I think we want userspace to
> control that to some extent, but I'm not sure if this fully matches the
> CPU model context.

I'm not sure I get the "different software level" part. Do you mean
VMM revisions?

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Cornelia Huck <cohuck@redhat.com>
Cc: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>,
	Jing Zhang <jingzhangos@google.com>, KVM <kvm@vger.kernel.org>,
	KVMARM <kvmarm@lists.linux.dev>,
	ARMLinux <linux-arm-kernel@lists.infradead.org>,
	Oliver Upton <oupton@google.com>, Will Deacon <will@kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	James Morse <james.morse@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Fuad Tabba <tabba@google.com>, Reiji Watanabe <reijiw@google.com>,
	Raghavendra Rao Ananta <rananta@google.com>
Subject: Re: [PATCH v8 0/6] Support writable CPU ID registers from userspace
Date: Tue, 16 May 2023 17:01:37 +0100	[thread overview]
Message-ID: <86353wmfj2.wl-maz@kernel.org> (raw)
In-Reply-To: <87a5y4gy0b.fsf@redhat.com>

On Tue, 16 May 2023 15:19:00 +0100,
Cornelia Huck <cohuck@redhat.com> wrote:
> 
> On Tue, May 16 2023, Marc Zyngier <maz@kernel.org> wrote:
> 
> > On Tue, 16 May 2023 12:55:14 +0100,
> > Cornelia Huck <cohuck@redhat.com> wrote:
> >> 
> >> Do you have more concrete ideas for QEMU CPU models already? Asking
> >> because I wanted to talk about this at KVM Forum, so collecting what
> >> others would like to do seems like a good idea :)
> >
> > I'm not being asked, but I'll share my thoughts anyway! ;-)
> >
> > I don't think CPU models are necessarily the most important thing.
> > Specially when you look at the diversity of the ecosystem (and even
> > the same CPU can be configured in different ways at integration
> > time). Case in point, Neoverse N1 which can have its I/D caches made
> > coherent or not. And the guest really wants to know which one it is
> > (you can only lie in one direction).
> >
> > But being able to control the feature set exposed to the guest from
> > userspace is a huge benefit in terms of migration.
> 
> Certainly; the important part is that we can keep the guest ABI
> stable... which parts match to a "CPU model" in the way other
> architectures use it is an interesting question. It almost certainly
> will look different from e.g. s390, where we only have to deal with a
> single manufacturer.
> 
> I'm wondering whether we'll end up building frankenmonster CPUs.

We already do. KVM hides a bunch of things we don't want the guest to
see, either because we don't support the feature, or that we want to
present it with a different shape (cache topology, for example), and
these combination don't really exist in any physical implementation.

Which is why I don't really buy the "CPU model" concept as defined by
x86 and s390. We already are in a vastly different place.

The way I see it, you get a bunch of architectural features that can
be enabled/disabled depending on the underlying HW, hypervisor's
capabilities and userspace input. On top of that, there is a layer of
paint that tells you what is the overall implementation you could be
running on (that's what MIDR+REVIDR+AIDR tell you) so that you can
apply some unspeakable, uarch-specific hacks that keep the machine
going (got to love these CPU errata).

> Another interesting aspect is how KVM ends up influencing what the guest
> sees on the CPU level, as in the case where we migrate across matching
> CPUs, but with a different software level. I think we want userspace to
> control that to some extent, but I'm not sure if this fully matches the
> CPU model context.

I'm not sure I get the "different software level" part. Do you mean
VMM revisions?

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

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

  reply	other threads:[~2023-05-16 16:01 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-03 17:16 [PATCH v8 0/6] Support writable CPU ID registers from userspace Jing Zhang
2023-05-03 17:16 ` Jing Zhang
2023-05-03 17:16 ` [PATCH v8 1/6] KVM: arm64: Move CPU ID feature registers emulation into a separate file Jing Zhang
2023-05-03 17:16   ` Jing Zhang
2023-05-16 16:11   ` Marc Zyngier
2023-05-16 16:11     ` Marc Zyngier
2023-05-16 19:14     ` Jing Zhang
2023-05-16 19:14       ` Jing Zhang
2023-05-03 17:16 ` [PATCH v8 2/6] KVM: arm64: Save ID registers' sanitized value per guest Jing Zhang
2023-05-03 17:16   ` Jing Zhang
2023-05-17  7:41   ` Marc Zyngier
2023-05-17  7:41     ` Marc Zyngier
2023-05-17 16:28     ` Jing Zhang
2023-05-17 16:28       ` Jing Zhang
2023-05-03 17:16 ` [PATCH v8 3/6] KVM: arm64: Use per guest ID register for ID_AA64PFR0_EL1.[CSV2|CSV3] Jing Zhang
2023-05-03 17:16   ` Jing Zhang
2023-05-03 23:43   ` kernel test robot
2023-05-03 23:43     ` kernel test robot
2023-05-03 17:16 ` [PATCH v8 4/6] KVM: arm64: Use per guest ID register for ID_AA64DFR0_EL1.PMUVer Jing Zhang
2023-05-03 17:16   ` Jing Zhang
2023-05-03 17:16 ` [PATCH v8 5/6] KVM: arm64: Reuse fields of sys_reg_desc for idreg Jing Zhang
2023-05-03 17:16   ` Jing Zhang
2023-05-16 10:26   ` Cornelia Huck
2023-05-16 10:26     ` Cornelia Huck
2023-05-16 19:10     ` Jing Zhang
2023-05-16 19:10       ` Jing Zhang
2023-05-03 17:16 ` [PATCH v8 6/6] KVM: arm64: Refactor writings for PMUVer/CSV2/CSV3 Jing Zhang
2023-05-03 17:16   ` Jing Zhang
2023-05-17 22:00   ` Jitindar Singh, Suraj
2023-05-17 22:00     ` Jitindar Singh, Suraj
2023-05-17 22:55     ` Jing Zhang
2023-05-17 22:55       ` Jing Zhang
2023-05-18 21:08       ` Jitindar Singh, Suraj
2023-05-18 21:08         ` Jitindar Singh, Suraj
2023-05-19  9:16         ` Marc Zyngier
2023-05-19  9:16           ` Marc Zyngier
2023-05-19 23:04           ` Jitindar Singh, Suraj
2023-05-19 23:04             ` Jitindar Singh, Suraj
2023-05-20  8:45             ` Marc Zyngier
2023-05-20  8:45               ` Marc Zyngier
2023-05-19 23:25   ` Suraj Jitindar Singh
2023-05-19 23:25     ` Suraj Jitindar Singh
2023-05-16 10:37 ` [PATCH v8 0/6] Support writable CPU ID registers from userspace Shameerali Kolothum Thodi
2023-05-16 10:37   ` Shameerali Kolothum Thodi
2023-05-16 11:01   ` Marc Zyngier
2023-05-16 11:01     ` Marc Zyngier
2023-05-16 11:11     ` Shameerali Kolothum Thodi
2023-05-16 11:11       ` Shameerali Kolothum Thodi
2023-05-16 11:55       ` Cornelia Huck
2023-05-16 11:55         ` Cornelia Huck
2023-05-16 13:11         ` Marc Zyngier
2023-05-16 13:11           ` Marc Zyngier
2023-05-16 13:44           ` Shameerali Kolothum Thodi
2023-05-16 13:44             ` Shameerali Kolothum Thodi
2023-05-16 14:21             ` Cornelia Huck
2023-05-16 14:21               ` Cornelia Huck
2023-05-16 14:19           ` Cornelia Huck
2023-05-16 14:19             ` Cornelia Huck
2023-05-16 16:01             ` Marc Zyngier [this message]
2023-05-16 16:01               ` Marc Zyngier
2023-05-17 15:36               ` Cornelia Huck
2023-05-17 15:36                 ` Cornelia Huck
2023-05-17 15:53                 ` Marc Zyngier
2023-05-17 15:53                   ` Marc Zyngier
2023-05-16 16:31           ` Oliver Upton
2023-05-16 16:31             ` Oliver Upton
2023-05-16 16:44             ` Marc Zyngier
2023-05-16 16:44               ` Marc Zyngier
2023-05-16 16:57               ` Oliver Upton
2023-05-16 16:57                 ` Oliver Upton

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=86353wmfj2.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=alexandru.elisei@arm.com \
    --cc=cohuck@redhat.com \
    --cc=james.morse@arm.com \
    --cc=jingzhangos@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=oupton@google.com \
    --cc=pbonzini@redhat.com \
    --cc=rananta@google.com \
    --cc=reijiw@google.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=suzuki.poulose@arm.com \
    --cc=tabba@google.com \
    --cc=will@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 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.