From: Dave Martin <Dave.Martin@arm.com>
To: Amit Daniel Kachhap <amit.kachhap@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
linux-kernel@vger.kernel.org,
Kristina Martsenko <kristina.martsenko@arm.com>,
Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>,
kvmarm@lists.cs.columbia.edu,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v6 2/6] arm64/kvm: preserve host MDCR_EL2 value
Date: Thu, 21 Feb 2019 15:51:01 +0000 [thread overview]
Message-ID: <20190221155101.GV3567@e103592.cambridge.arm.com> (raw)
In-Reply-To: <1550568271-5319-3-git-send-email-amit.kachhap@arm.com>
On Tue, Feb 19, 2019 at 02:54:27PM +0530, Amit Daniel Kachhap wrote:
> Save host MDCR_EL2 value during kvm HYP initialisation and restore
> after every switch from host to guest. There should not be any
> change in functionality due to this.
>
> The value of mdcr_el2 is now stored in struct kvm_cpu_context as
> both host and guest can now use this field in a common way.
Is MDCR_EL2 somehow relevant to pointer auth?
It's not entirely clear why this patch is here.
If this is a cleanup to align the handling of this register with
how HCR_EL2 is handled, it would be good to explain that in the commit
message.
> Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Christoffer Dall <christoffer.dall@arm.com>
> Cc: kvmarm@lists.cs.columbia.edu
> ---
> arch/arm/include/asm/kvm_host.h | 1 -
> arch/arm64/include/asm/kvm_host.h | 6 ++----
> arch/arm64/kvm/debug.c | 28 ++++++----------------------
> arch/arm64/kvm/hyp/switch.c | 17 ++++-------------
> arch/arm64/kvm/hyp/sysreg-sr.c | 6 ++++++
> virt/kvm/arm/arm.c | 1 -
> 6 files changed, 18 insertions(+), 41 deletions(-)
>
> diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
> index 05706b4..704667e 100644
> --- a/arch/arm/include/asm/kvm_host.h
> +++ b/arch/arm/include/asm/kvm_host.h
> @@ -294,7 +294,6 @@ static inline void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu) {}
> static inline void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu) {}
> static inline void kvm_arch_vcpu_block_finish(struct kvm_vcpu *vcpu) {}
>
> -static inline void kvm_arm_init_debug(void) {}
> static inline void kvm_arm_setup_debug(struct kvm_vcpu *vcpu) {}
> static inline void kvm_arm_clear_debug(struct kvm_vcpu *vcpu) {}
> static inline void kvm_arm_reset_debug_ptr(struct kvm_vcpu *vcpu) {}
> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> index 1b2e05b..2f1bb86 100644
> --- a/arch/arm64/include/asm/kvm_host.h
> +++ b/arch/arm64/include/asm/kvm_host.h
> @@ -205,6 +205,8 @@ struct kvm_cpu_context {
>
> /* HYP host/guest configuration */
> u64 hcr_el2;
> + u32 mdcr_el2;
> +
ARMv8-A says MDCR_EL2 is a 64-bit register.
Bits [63:20] are currently RES0, so this is probably not a big deal.
But it would be better to make this 64-bit to prevent future accidents.
It may be better to make that change in a separate patch.
This is probably non-urgent, since this is clearly not causing problems
for anyone today.
[...]
Cheers
---Dave
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-02-21 15:51 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-19 9:24 [PATCH v6 0/6] Add ARMv8.3 pointer authentication for kvm guest Amit Daniel Kachhap
2019-02-19 9:24 ` [PATCH v6 1/6] arm64/kvm: preserve host HCR_EL2 value Amit Daniel Kachhap
2019-02-21 11:50 ` Mark Rutland
2019-02-25 18:09 ` Marc Zyngier
2019-02-28 6:43 ` Amit Daniel Kachhap
2019-02-21 15:49 ` Dave Martin
2019-03-01 5:56 ` Amit Daniel Kachhap
2019-02-25 17:39 ` James Morse
2019-02-26 10:06 ` James Morse
2019-03-02 11:09 ` Amit Daniel Kachhap
2019-02-19 9:24 ` [PATCH v6 2/6] arm64/kvm: preserve host MDCR_EL2 value Amit Daniel Kachhap
2019-02-21 11:57 ` Mark Rutland
2019-02-21 15:51 ` Dave Martin [this message]
2019-03-01 6:10 ` Amit Daniel Kachhap
2019-02-19 9:24 ` [PATCH v6 3/6] arm64/kvm: context-switch ptrauth registers Amit Daniel Kachhap
2019-02-21 12:29 ` Mark Rutland
2019-02-21 15:51 ` Dave Martin
2019-03-01 6:17 ` Amit Daniel Kachhap
2019-02-28 9:07 ` Amit Daniel Kachhap
2019-02-21 15:53 ` Dave Martin
2019-03-01 9:35 ` Amit Daniel Kachhap
2019-02-26 18:31 ` James Morse
2019-03-04 10:51 ` Amit Daniel Kachhap
2019-02-19 9:24 ` [PATCH v6 4/6] arm64/kvm: add a userspace option to enable pointer authentication Amit Daniel Kachhap
2019-02-21 12:34 ` Mark Rutland
2019-02-28 9:25 ` Amit Daniel Kachhap
2019-02-21 15:53 ` Dave Martin
2019-03-01 9:41 ` Amit Daniel Kachhap
2019-03-01 12:22 ` Dave P Martin
2019-02-26 18:33 ` James Morse
2019-03-04 10:56 ` Amit Daniel Kachhap
2019-02-19 9:24 ` [PATCH v6 5/6] arm64/kvm: control accessibility of ptrauth key registers Amit Daniel Kachhap
2019-02-21 15:53 ` Dave Martin
2019-02-26 18:34 ` James Morse
2019-02-19 9:24 ` [kvmtool PATCH v6 6/6] arm/kvm: arm64: Add a vcpu feature for pointer authentication Amit Daniel Kachhap
2019-02-21 15:54 ` Dave Martin
2019-03-01 10:37 ` Amit Daniel Kachhap
2019-03-01 11:24 ` Dave P Martin
2019-03-04 11:08 ` Amit Daniel Kachhap
2019-03-05 11:11 ` Dave Martin
2019-02-26 18:03 ` [PATCH v6 0/6] Add ARMv8.3 pointer authentication for kvm guest James Morse
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=20190221155101.GV3567@e103592.cambridge.arm.com \
--to=dave.martin@arm.com \
--cc=amit.kachhap@arm.com \
--cc=catalin.marinas@arm.com \
--cc=kristina.martsenko@arm.com \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=ramana.radhakrishnan@arm.com \
--cc=will.deacon@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).