All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Oliver Upton <oliver.upton@linux.dev>
Cc: Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	kvmarm@lists.linux.dev, Akihiko Odaki <akihiko.odaki@daynix.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Raghavendra Rao Ananta <rananta@google.com>,
	linux-arm-kernel@lists.infradead.org,
	Salil Mehta <salil.mehta@huawei.com>
Subject: Re: [RFC PATCH v2 5/6] KVM: arm64: Add support for KVM_EXIT_HYPERCALL
Date: Mon, 13 Feb 2023 16:01:29 +0000	[thread overview]
Message-ID: <Y+pe2T2uK2efUNve@google.com> (raw)
In-Reply-To: <20230211013759.3556016-6-oliver.upton@linux.dev>

On Sat, Feb 11, 2023, Oliver Upton wrote:
> Finally, we need a flag to let userspace know what conduit instruction
> was used (i.e. SMC vs. HVC). Redefine the remaining padding in
> kvm_run::hypercall to accomplish this. Let's all take a moment
> to admire the flowers and see how 'longmode' tied up a full u32 in the
> UAPI. Weep.

I don't think it has to, at least not for other architectures.  No other arch
currently supports KVM_EXIT_HYPERCALL, so breakage is extremely unlikely.  E.g.
we can likely get away with this, and then just have x86 add new flags at bit 32.

diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 55155e262646..7d3ad820d55c 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -341,8 +341,14 @@ struct kvm_run {
                        __u64 nr;
                        __u64 args[6];
                        __u64 ret;
-                       __u32 longmode;
-                       __u32 pad;
+                       union {
+                               /*
+                                * Long Mode, a.k.a. 64-bit mode, takes up the
+                                * first 32 flags on x86 (historical sludge).
+                                */
+                               __u32 longmode;
+                               __u64 flags;
+                       };
                } hypercall;
                /* KVM_EXIT_TPR_ACCESS */
                struct {
 

WARNING: multiple messages have this Message-ID (diff)
From: Sean Christopherson <seanjc@google.com>
To: Oliver Upton <oliver.upton@linux.dev>
Cc: Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	kvmarm@lists.linux.dev, Akihiko Odaki <akihiko.odaki@daynix.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Raghavendra Rao Ananta <rananta@google.com>,
	linux-arm-kernel@lists.infradead.org,
	Salil Mehta <salil.mehta@huawei.com>
Subject: Re: [RFC PATCH v2 5/6] KVM: arm64: Add support for KVM_EXIT_HYPERCALL
Date: Mon, 13 Feb 2023 16:01:29 +0000	[thread overview]
Message-ID: <Y+pe2T2uK2efUNve@google.com> (raw)
In-Reply-To: <20230211013759.3556016-6-oliver.upton@linux.dev>

On Sat, Feb 11, 2023, Oliver Upton wrote:
> Finally, we need a flag to let userspace know what conduit instruction
> was used (i.e. SMC vs. HVC). Redefine the remaining padding in
> kvm_run::hypercall to accomplish this. Let's all take a moment
> to admire the flowers and see how 'longmode' tied up a full u32 in the
> UAPI. Weep.

I don't think it has to, at least not for other architectures.  No other arch
currently supports KVM_EXIT_HYPERCALL, so breakage is extremely unlikely.  E.g.
we can likely get away with this, and then just have x86 add new flags at bit 32.

diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 55155e262646..7d3ad820d55c 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -341,8 +341,14 @@ struct kvm_run {
                        __u64 nr;
                        __u64 args[6];
                        __u64 ret;
-                       __u32 longmode;
-                       __u32 pad;
+                       union {
+                               /*
+                                * Long Mode, a.k.a. 64-bit mode, takes up the
+                                * first 32 flags on x86 (historical sludge).
+                                */
+                               __u32 longmode;
+                               __u64 flags;
+                       };
                } hypercall;
                /* KVM_EXIT_TPR_ACCESS */
                struct {
 

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

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

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-11  1:37 [RFC PATCH v2 0/6] KVM: arm64: Userspace SMCCC call filtering Oliver Upton
2023-02-11  1:37 ` Oliver Upton
2023-02-11  1:37 ` [RFC PATCH v2 1/6] KVM: arm64: Add a helper to check if a VM has ran once Oliver Upton
2023-02-11  1:37   ` Oliver Upton
2023-02-13 15:36   ` Sean Christopherson
2023-02-13 15:36     ` Sean Christopherson
2023-02-13 15:49     ` Marc Zyngier
2023-02-13 15:49       ` Marc Zyngier
2023-02-11  1:37 ` [RFC PATCH v2 2/6] KVM: arm64: Add vm fd device attribute accessors Oliver Upton
2023-02-11  1:37   ` Oliver Upton
2023-02-11  1:37 ` [RFC PATCH v2 3/6] KVM: arm64: Refactor hvc filtering to support different actions Oliver Upton
2023-02-11  1:37   ` Oliver Upton
2023-02-11  1:37 ` [RFC PATCH v2 4/6] KVM: arm64: Use a maple tree to represent the SMCCC filter Oliver Upton
2023-02-11  1:37   ` Oliver Upton
2023-02-11  1:37 ` [RFC PATCH v2 5/6] KVM: arm64: Add support for KVM_EXIT_HYPERCALL Oliver Upton
2023-02-11  1:37   ` Oliver Upton
2023-02-13 16:01   ` Sean Christopherson [this message]
2023-02-13 16:01     ` Sean Christopherson
2023-02-13 19:24     ` Oliver Upton
2023-02-13 19:24       ` Oliver Upton
2023-02-24 15:12   ` James Morse
2023-02-24 15:12     ` James Morse
2023-02-24 21:42     ` Oliver Upton
2023-02-24 21:42       ` Oliver Upton
2023-02-11  1:37 ` [RFC PATCH v2 6/6] KVM: arm64: Indroduce support for userspace SMCCC filtering Oliver Upton
2023-02-11  1:37   ` Oliver Upton
2023-02-17 18:35   ` Oliver Upton
2023-02-17 18:35     ` Oliver Upton
2023-02-24 15:12 ` [RFC PATCH v2 0/6] KVM: arm64: Userspace SMCCC call filtering James Morse
2023-02-24 15:12   ` James Morse
2023-02-24 21:32   ` Oliver Upton
2023-02-24 21:32     ` 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=Y+pe2T2uK2efUNve@google.com \
    --to=seanjc@google.com \
    --cc=akihiko.odaki@daynix.com \
    --cc=james.morse@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=rananta@google.com \
    --cc=salil.mehta@huawei.com \
    --cc=suzuki.poulose@arm.com \
    --cc=yuzenghui@huawei.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.