All of lore.kernel.org
 help / color / mirror / Atom feed
From: Reiji Watanabe <reijiw@google.com>
To: Marc Zyngier <maz@kernel.org>
Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	kernel-team@android.com, Will Deacon <will@kernel.org>,
	Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH 06/18] KVM: arm64: Add three sets of flags to the vcpu state
Date: Wed, 8 Jun 2022 23:10:14 -0700	[thread overview]
Message-ID: <CAAeT=FzXWDfkR5ck0vpiRLKi0nU9e5Ua=yg=3Rj--Gq+aBaVUg@mail.gmail.com> (raw)
In-Reply-To: <20220528113829.1043361-7-maz@kernel.org>

Hi Marc,

On Sat, May 28, 2022 at 4:38 AM Marc Zyngier <maz@kernel.org> wrote:
>
> It so appears that each of the vcpu flags is really belonging to
> one of three categories:
>
> - a configuration flag, set once and for all
> - an input flag generated by the kernel for the hypervisor to use
> - a state flag that is only for the kernel's own bookkeeping
>
> As we are going to split all the existing flags into these three
> sets, introduce all three in one go.
>
> No functional change other than a bit of bloat...
>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> ---
>  arch/arm64/include/asm/kvm_host.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> index 5eb6791df608..c9dd0d4e22f2 100644
> --- a/arch/arm64/include/asm/kvm_host.h
> +++ b/arch/arm64/include/asm/kvm_host.h
> @@ -338,6 +338,15 @@ struct kvm_vcpu_arch {
>         /* Miscellaneous vcpu state flags */
>         u64 flags;
>
> +       /* Configuration flags */
> +       u64 cflags;
> +
> +       /* Input flags to the hypervisor code */
> +       u64 iflags;
> +
> +       /* State flags, unused by the hypervisor code */
> +       u64 sflags;

Although I think VCPU_SVE_FINALIZED could be considered "state" rather
than "configuration", I assume the reason why it is handled by cflags
in the following patches is because VCPU_SVE_FINALIZED is set once
for all. If my assumption is correct, it would be clearer to add
"set once and for all" in the comment for cflags.

Also, if we end up using VCPU_SVE_FINALIZED in hypervisor code later,
then should it be handled by iflags instead of cflags ?

My understanding of how those flags should be used is as follows.
Is my understanding correct ?

 iflags: flags that are used by hypervisor code
 cflags: flags that are set once for all and unused by hypervisor code
 sflags: flags that could be set/cleared more than once and unused
         by hypervisor code

Thanks,
Reiji

> +
>         /*
>          * We maintain more than a single set of debug registers to support
>          * debugging the guest from the host and to maintain separate host and
> --
> 2.34.1
>
> _______________________________________________
> kvmarm mailing list
> kvmarm@lists.cs.columbia.edu
> https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Reiji Watanabe <reijiw@google.com>
To: Marc Zyngier <maz@kernel.org>
Cc: kvm@vger.kernel.org, kernel-team@android.com,
	Mark Brown <broonie@kernel.org>, Will Deacon <will@kernel.org>,
	kvmarm@lists.cs.columbia.edu,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 06/18] KVM: arm64: Add three sets of flags to the vcpu state
Date: Wed, 8 Jun 2022 23:10:14 -0700	[thread overview]
Message-ID: <CAAeT=FzXWDfkR5ck0vpiRLKi0nU9e5Ua=yg=3Rj--Gq+aBaVUg@mail.gmail.com> (raw)
In-Reply-To: <20220528113829.1043361-7-maz@kernel.org>

Hi Marc,

On Sat, May 28, 2022 at 4:38 AM Marc Zyngier <maz@kernel.org> wrote:
>
> It so appears that each of the vcpu flags is really belonging to
> one of three categories:
>
> - a configuration flag, set once and for all
> - an input flag generated by the kernel for the hypervisor to use
> - a state flag that is only for the kernel's own bookkeeping
>
> As we are going to split all the existing flags into these three
> sets, introduce all three in one go.
>
> No functional change other than a bit of bloat...
>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> ---
>  arch/arm64/include/asm/kvm_host.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> index 5eb6791df608..c9dd0d4e22f2 100644
> --- a/arch/arm64/include/asm/kvm_host.h
> +++ b/arch/arm64/include/asm/kvm_host.h
> @@ -338,6 +338,15 @@ struct kvm_vcpu_arch {
>         /* Miscellaneous vcpu state flags */
>         u64 flags;
>
> +       /* Configuration flags */
> +       u64 cflags;
> +
> +       /* Input flags to the hypervisor code */
> +       u64 iflags;
> +
> +       /* State flags, unused by the hypervisor code */
> +       u64 sflags;

Although I think VCPU_SVE_FINALIZED could be considered "state" rather
than "configuration", I assume the reason why it is handled by cflags
in the following patches is because VCPU_SVE_FINALIZED is set once
for all. If my assumption is correct, it would be clearer to add
"set once and for all" in the comment for cflags.

Also, if we end up using VCPU_SVE_FINALIZED in hypervisor code later,
then should it be handled by iflags instead of cflags ?

My understanding of how those flags should be used is as follows.
Is my understanding correct ?

 iflags: flags that are used by hypervisor code
 cflags: flags that are set once for all and unused by hypervisor code
 sflags: flags that could be set/cleared more than once and unused
         by hypervisor code

Thanks,
Reiji

> +
>         /*
>          * We maintain more than a single set of debug registers to support
>          * debugging the guest from the host and to maintain separate host and
> --
> 2.34.1
>
> _______________________________________________
> kvmarm mailing list
> kvmarm@lists.cs.columbia.edu
> https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Reiji Watanabe <reijiw@google.com>
To: Marc Zyngier <maz@kernel.org>
Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org,
	 Linux ARM <linux-arm-kernel@lists.infradead.org>,
	kernel-team@android.com,  Will Deacon <will@kernel.org>,
	Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH 06/18] KVM: arm64: Add three sets of flags to the vcpu state
Date: Wed, 8 Jun 2022 23:10:14 -0700	[thread overview]
Message-ID: <CAAeT=FzXWDfkR5ck0vpiRLKi0nU9e5Ua=yg=3Rj--Gq+aBaVUg@mail.gmail.com> (raw)
In-Reply-To: <20220528113829.1043361-7-maz@kernel.org>

Hi Marc,

On Sat, May 28, 2022 at 4:38 AM Marc Zyngier <maz@kernel.org> wrote:
>
> It so appears that each of the vcpu flags is really belonging to
> one of three categories:
>
> - a configuration flag, set once and for all
> - an input flag generated by the kernel for the hypervisor to use
> - a state flag that is only for the kernel's own bookkeeping
>
> As we are going to split all the existing flags into these three
> sets, introduce all three in one go.
>
> No functional change other than a bit of bloat...
>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> ---
>  arch/arm64/include/asm/kvm_host.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> index 5eb6791df608..c9dd0d4e22f2 100644
> --- a/arch/arm64/include/asm/kvm_host.h
> +++ b/arch/arm64/include/asm/kvm_host.h
> @@ -338,6 +338,15 @@ struct kvm_vcpu_arch {
>         /* Miscellaneous vcpu state flags */
>         u64 flags;
>
> +       /* Configuration flags */
> +       u64 cflags;
> +
> +       /* Input flags to the hypervisor code */
> +       u64 iflags;
> +
> +       /* State flags, unused by the hypervisor code */
> +       u64 sflags;

Although I think VCPU_SVE_FINALIZED could be considered "state" rather
than "configuration", I assume the reason why it is handled by cflags
in the following patches is because VCPU_SVE_FINALIZED is set once
for all. If my assumption is correct, it would be clearer to add
"set once and for all" in the comment for cflags.

Also, if we end up using VCPU_SVE_FINALIZED in hypervisor code later,
then should it be handled by iflags instead of cflags ?

My understanding of how those flags should be used is as follows.
Is my understanding correct ?

 iflags: flags that are used by hypervisor code
 cflags: flags that are set once for all and unused by hypervisor code
 sflags: flags that could be set/cleared more than once and unused
         by hypervisor code

Thanks,
Reiji

> +
>         /*
>          * We maintain more than a single set of debug registers to support
>          * debugging the guest from the host and to maintain separate host and
> --
> 2.34.1
>
> _______________________________________________
> kvmarm mailing list
> kvmarm@lists.cs.columbia.edu
> https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

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

  parent reply	other threads:[~2022-06-09  6:10 UTC|newest]

Thread overview: 141+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-28 11:38 [PATCH 00/18] KVM/arm64: Refactoring the vcpu flags Marc Zyngier
2022-05-28 11:38 ` Marc Zyngier
2022-05-28 11:38 ` Marc Zyngier
2022-05-28 11:38 ` [PATCH 01/18] KVM: arm64: Always start with clearing SVE flag on load Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-30 14:41   ` Mark Brown
2022-05-30 14:41     ` Mark Brown
2022-05-30 14:41     ` Mark Brown
2022-06-06 11:28     ` Marc Zyngier
2022-06-06 11:28       ` Marc Zyngier
2022-06-06 11:28       ` Marc Zyngier
2022-06-06 12:16       ` Mark Brown
2022-06-06 12:16         ` Mark Brown
2022-06-06 12:16         ` Mark Brown
2022-05-28 11:38 ` [PATCH 02/18] KVM: arm64: Always start with clearing SME " Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-30 14:51   ` Mark Brown
2022-05-30 14:51     ` Mark Brown
2022-05-30 14:51     ` Mark Brown
2022-05-28 11:38 ` [PATCH 03/18] KVM: arm64: Drop FP_FOREIGN_STATE from the hypervisor code Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-06-03  5:23   ` Reiji Watanabe
2022-06-03  5:23     ` Reiji Watanabe
2022-06-03  5:23     ` Reiji Watanabe
2022-06-04  8:10     ` Marc Zyngier
2022-06-04  8:10       ` Marc Zyngier
2022-06-04  8:10       ` Marc Zyngier
2022-06-07  4:47       ` Reiji Watanabe
2022-06-07  4:47         ` Reiji Watanabe
2022-06-07  4:47         ` Reiji Watanabe
2022-06-03  9:09   ` Mark Brown
2022-06-03  9:09     ` Mark Brown
2022-06-03  9:09     ` Mark Brown
2022-05-28 11:38 ` [PATCH 04/18] KVM: arm64: Move FP state ownership from flag to a tristate Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-06-03  9:14   ` Mark Brown
2022-06-03  9:14     ` Mark Brown
2022-06-03  9:14     ` Mark Brown
2022-06-06  8:41     ` Marc Zyngier
2022-06-06  8:41       ` Marc Zyngier
2022-06-06  8:41       ` Marc Zyngier
2022-06-06 10:31       ` Mark Brown
2022-06-06 10:31         ` Mark Brown
2022-06-06 10:31         ` Mark Brown
2022-06-04  8:16   ` Reiji Watanabe
2022-06-04  8:16     ` Reiji Watanabe
2022-06-04  8:16     ` Reiji Watanabe
2022-05-28 11:38 ` [PATCH 05/18] KVM: arm64: Add helpers to manipulate vcpu flags among a set Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-06-08  5:26   ` Reiji Watanabe
2022-06-08  5:26     ` Reiji Watanabe
2022-06-08  5:26     ` Reiji Watanabe
2022-06-08  6:51     ` Marc Zyngier
2022-06-08  6:51       ` Marc Zyngier
2022-06-08  6:51       ` Marc Zyngier
2022-06-09  2:25       ` Reiji Watanabe
2022-06-09  2:25         ` Reiji Watanabe
2022-06-09  2:25         ` Reiji Watanabe
2022-05-28 11:38 ` [PATCH 06/18] KVM: arm64: Add three sets of flags to the vcpu state Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-06-08 15:23   ` Fuad Tabba
2022-06-08 15:23     ` Fuad Tabba
2022-06-08 15:23     ` Fuad Tabba
2022-06-09  6:10   ` Reiji Watanabe [this message]
2022-06-09  6:10     ` Reiji Watanabe
2022-06-09  6:10     ` Reiji Watanabe
2022-06-09  7:46     ` Marc Zyngier
2022-06-09  7:46       ` Marc Zyngier
2022-06-09  7:46       ` Marc Zyngier
2022-06-09 17:24       ` Reiji Watanabe
2022-06-09 17:24         ` Reiji Watanabe
2022-06-09 17:24         ` Reiji Watanabe
2022-06-10  7:48         ` Marc Zyngier
2022-06-10  7:48           ` Marc Zyngier
2022-06-10  7:48           ` Marc Zyngier
2022-05-28 11:38 ` [PATCH 07/18] KVM: arm64: Move vcpu configuration flags into their own set Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-06-09  6:15   ` Reiji Watanabe
2022-06-09  6:15     ` Reiji Watanabe
2022-06-09  6:15     ` Reiji Watanabe
2022-05-28 11:38 ` [PATCH 08/18] KVM: arm64: Move vcpu PC/Exception flags to the input flag set Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-06-10  6:13   ` Reiji Watanabe
2022-06-10  6:13     ` Reiji Watanabe
2022-06-10  6:13     ` Reiji Watanabe
2022-05-28 11:38 ` [PATCH 09/18] KVM: arm64: Move vcpu debug/SPE/TRBE " Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-06-08 15:16   ` Fuad Tabba
2022-06-08 15:16     ` Fuad Tabba
2022-06-08 15:16     ` Fuad Tabba
2022-06-08 16:01     ` Marc Zyngier
2022-06-08 16:01       ` Marc Zyngier
2022-06-08 16:01       ` Marc Zyngier
2022-05-28 11:38 ` [PATCH 10/18] KVM: arm64: Move vcpu SVE/SME flags to the state " Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38 ` [PATCH 11/18] KVM: arm64: Move vcpu ON_UNSUPPORTED_CPU flag " Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38 ` [PATCH 12/18] KVM: arm64: Move vcpu WFIT " Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38 ` [PATCH 13/18] KVM: arm64: Kill unused vcpu flags field Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38 ` [PATCH 14/18] KVM: arm64: Convert vcpu sysregs_loaded_on_cpu to a state flag Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38 ` [PATCH 15/18] KVM: arm64: Warn when PENDING_EXCEPTION and INCREMENT_PC are set together Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-06-08 15:16   ` Fuad Tabba
2022-06-08 15:16     ` Fuad Tabba
2022-06-08 15:16     ` Fuad Tabba
2022-06-08 16:42     ` Marc Zyngier
2022-06-08 16:42       ` Marc Zyngier
2022-06-08 16:42       ` Marc Zyngier
2022-05-28 11:38 ` [PATCH 16/18] KVM: arm64: Add build-time sanity checks for flags Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38 ` [PATCH 17/18] KVM: arm64: Reduce the size of the vcpu flag members Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38 ` [PATCH 18/18] KVM: arm64: Document why pause cannot be turned into a flag Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-28 11:38   ` Marc Zyngier
2022-05-30  8:28 ` [PATCH 00/18] KVM/arm64: Refactoring the vcpu flags Marc Zyngier
2022-05-30  8:28   ` Marc Zyngier
2022-05-30  8:28   ` Marc Zyngier
2022-06-07 13:43 ` Marc Zyngier
2022-06-07 13:43   ` Marc Zyngier
2022-06-07 13:43   ` Marc Zyngier

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='CAAeT=FzXWDfkR5ck0vpiRLKi0nU9e5Ua=yg=3Rj--Gq+aBaVUg@mail.gmail.com' \
    --to=reijiw@google.com \
    --cc=broonie@kernel.org \
    --cc=kernel-team@android.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --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.