All of lore.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Mark Brown <broonie@kernel.org>
Cc: Will Deacon <will@kernel.org>, Marc Zyngier <maz@kernel.org>,
	Zhang Lei <zhang.lei@jp.fujitsu.com>,
	James Morse <james.morse@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	Andre Przywara <andre.przywara@arm.com>,
	kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4 3/8] arm64/fpsimd: Have KVM explicitly say which FP registers to save
Date: Sun, 13 Nov 2022 22:27:03 +0000	[thread overview]
Message-ID: <Y3FvN85aHXrdEIT5@arm.com> (raw)
In-Reply-To: <20221021230321.1159287-4-broonie@kernel.org>

On Sat, Oct 22, 2022 at 12:03:16AM +0100, Mark Brown wrote:
> In order to avoid needlessly saving and restoring the guest registers KVM
> relies on the host FPSMID code to save the guest registers when we context
> switch away from the guest. This is done by binding the KVM guest state to
> the CPU on top of the task state that was originally there, then carefully
> managing the TIF_SVE flag for the task to cause the host to save the full
> SVE state when needed regardless of the needs of the host task. This works
> well enough but isn't terribly direct about what is going on and makes it
> much more complicated to try to optimise what we're doing with the SVE
> register state.
> 
> Let's instead have KVM pass in the register state it wants saving when it
> binds to the CPU. We introduce a new FP_STATE_TASK for use during normal
> task binding to indicate that we should base our decisions on the current
> task. This should not ben used when actually saving. Ideally we might

s/ben/be/

> diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
> index 3cce0a4c4e8d..1d48398cb6dc 100644
> --- a/arch/arm64/include/asm/processor.h
> +++ b/arch/arm64/include/asm/processor.h
> @@ -123,6 +123,7 @@ enum vec_type {
>  };
>  
>  enum fp_type {
> +	FP_STATE_TASK,		/* Save based on current task state. */

Nitpick: FP_STATE_CURRENT instead?

Reviewed-by: Catalin Marinas

WARNING: multiple messages have this Message-ID (diff)
From: Catalin Marinas <catalin.marinas@arm.com>
To: Mark Brown <broonie@kernel.org>
Cc: Will Deacon <will@kernel.org>, Marc Zyngier <maz@kernel.org>,
	Zhang Lei <zhang.lei@jp.fujitsu.com>,
	James Morse <james.morse@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	Andre Przywara <andre.przywara@arm.com>,
	kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4 3/8] arm64/fpsimd: Have KVM explicitly say which FP registers to save
Date: Sun, 13 Nov 2022 22:27:03 +0000	[thread overview]
Message-ID: <Y3FvN85aHXrdEIT5@arm.com> (raw)
In-Reply-To: <20221021230321.1159287-4-broonie@kernel.org>

On Sat, Oct 22, 2022 at 12:03:16AM +0100, Mark Brown wrote:
> In order to avoid needlessly saving and restoring the guest registers KVM
> relies on the host FPSMID code to save the guest registers when we context
> switch away from the guest. This is done by binding the KVM guest state to
> the CPU on top of the task state that was originally there, then carefully
> managing the TIF_SVE flag for the task to cause the host to save the full
> SVE state when needed regardless of the needs of the host task. This works
> well enough but isn't terribly direct about what is going on and makes it
> much more complicated to try to optimise what we're doing with the SVE
> register state.
> 
> Let's instead have KVM pass in the register state it wants saving when it
> binds to the CPU. We introduce a new FP_STATE_TASK for use during normal
> task binding to indicate that we should base our decisions on the current
> task. This should not ben used when actually saving. Ideally we might

s/ben/be/

> diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
> index 3cce0a4c4e8d..1d48398cb6dc 100644
> --- a/arch/arm64/include/asm/processor.h
> +++ b/arch/arm64/include/asm/processor.h
> @@ -123,6 +123,7 @@ enum vec_type {
>  };
>  
>  enum fp_type {
> +	FP_STATE_TASK,		/* Save based on current task state. */

Nitpick: FP_STATE_CURRENT instead?

Reviewed-by: Catalin Marinas

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

  reply	other threads:[~2022-11-13 22:27 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21 23:03 [PATCH v4 0/8] arm64/sve: Clean up KVM integration and optimise syscalls Mark Brown
2022-10-21 23:03 ` Mark Brown
2022-10-21 23:03 ` [PATCH v4 1/8] KVM: arm64: Discard any SVE state when entering KVM guests Mark Brown
2022-10-21 23:03   ` Mark Brown
2022-11-13 22:00   ` Catalin Marinas
2022-11-13 22:00     ` Catalin Marinas
2022-10-21 23:03 ` [PATCH v4 2/8] arm64/fpsimd: Track the saved FPSIMD state type separately to TIF_SVE Mark Brown
2022-10-21 23:03   ` Mark Brown
2022-11-13 22:12   ` Catalin Marinas
2022-11-13 22:12     ` Catalin Marinas
2022-11-14 11:10     ` Mark Brown
2022-11-14 11:10       ` Mark Brown
2022-10-21 23:03 ` [PATCH v4 3/8] arm64/fpsimd: Have KVM explicitly say which FP registers to save Mark Brown
2022-10-21 23:03   ` Mark Brown
2022-11-13 22:27   ` Catalin Marinas [this message]
2022-11-13 22:27     ` Catalin Marinas
2022-10-21 23:03 ` [PATCH v4 4/8] arm64/fpsimd: Stop using TIF_SVE to manage register saving in KVM Mark Brown
2022-10-21 23:03   ` Mark Brown
2022-11-13 22:30   ` Catalin Marinas
2022-11-13 22:30     ` Catalin Marinas
2022-10-21 23:03 ` [PATCH v4 5/8] arm64/fpsimd: Load FP state based on recorded data type Mark Brown
2022-10-21 23:03   ` Mark Brown
2022-11-14  9:24   ` Catalin Marinas
2022-11-14  9:24     ` Catalin Marinas
2022-10-21 23:03 ` [PATCH v4 6/8] arm64/fpsimd: SME no longer requires SVE register state Mark Brown
2022-10-21 23:03   ` Mark Brown
2022-11-14 10:18   ` Catalin Marinas
2022-11-14 10:18     ` Catalin Marinas
2022-10-21 23:03 ` [PATCH v4 7/8] arm64/sve: Leave SVE enabled on syscall if we don't context switch Mark Brown
2022-10-21 23:03   ` Mark Brown
2022-11-14 10:31   ` Catalin Marinas
2022-11-14 10:31     ` Catalin Marinas
2022-11-14 11:25     ` Mark Brown
2022-11-14 11:25       ` Mark Brown
2022-10-21 23:03 ` [PATCH v4 8/8] arm64/fp: Use a struct to pass data to fpsimd_bind_state_to_cpu() Mark Brown
2022-10-21 23:03   ` Mark Brown
2022-11-14 10:33   ` Catalin Marinas
2022-11-14 10:33     ` Catalin Marinas

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=Y3FvN85aHXrdEIT5@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=alexandru.elisei@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=broonie@kernel.org \
    --cc=james.morse@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=will@kernel.org \
    --cc=zhang.lei@jp.fujitsu.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.