From: Marc Zyngier <maz@kernel.org>
To: Oliver Upton <oupton@google.com>
Cc: kvm@vger.kernel.org, Peter Shier <pshier@google.com>,
kvmarm@lists.cs.columbia.edu,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/3] KVM: arm64: Stash OSLSR_EL1 in the cpu context
Date: Fri, 29 Oct 2021 12:27:37 +0100 [thread overview]
Message-ID: <87lf2c9il2.wl-maz@kernel.org> (raw)
In-Reply-To: <20211029003202.158161-2-oupton@google.com>
On Fri, 29 Oct 2021 01:32:00 +0100,
Oliver Upton <oupton@google.com> wrote:
>
> An upcoming change to KVM will context switch the OS Lock status between
> guest/host. Add OSLSR_EL1 to the cpu context and handle guest reads
> using the stored value.
>
> Signed-off-by: Oliver Upton <oupton@google.com>
> ---
> arch/arm64/include/asm/kvm_host.h | 1 +
> arch/arm64/kvm/sys_regs.c | 13 ++++++-------
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> index f8be56d5342b..c98f65c4a1f7 100644
> --- a/arch/arm64/include/asm/kvm_host.h
> +++ b/arch/arm64/include/asm/kvm_host.h
> @@ -172,6 +172,7 @@ enum vcpu_sysreg {
> MDSCR_EL1, /* Monitor Debug System Control Register */
> MDCCINT_EL1, /* Monitor Debug Comms Channel Interrupt Enable Reg */
> DISR_EL1, /* Deferred Interrupt Status Register */
> + OSLSR_EL1, /* OS Lock Status Register */
Please move it one line up, next to the rest of the debug stuff
(DISR_EL1 is RAS and not debug).
>
> /* Performance Monitors Registers */
> PMCR_EL0, /* Control Register */
> diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
> index 1d46e185f31e..0eb03e7508fe 100644
> --- a/arch/arm64/kvm/sys_regs.c
> +++ b/arch/arm64/kvm/sys_regs.c
> @@ -291,12 +291,11 @@ static bool trap_oslsr_el1(struct kvm_vcpu *vcpu,
> struct sys_reg_params *p,
> const struct sys_reg_desc *r)
> {
> - if (p->is_write) {
> + if (p->is_write)
> return ignore_write(vcpu, p);
This should be UNDEF (though the HW should catch that, really).
> - } else {
> - p->regval = (1 << 3);
> - return true;
> - }
> +
> + p->regval = vcpu_read_sys_reg(vcpu, r->reg);
> + return true;
> }
>
> static bool trap_dbgauthstatus_el1(struct kvm_vcpu *vcpu,
> @@ -1441,7 +1440,7 @@ static const struct sys_reg_desc sys_reg_descs[] = {
>
> { SYS_DESC(SYS_MDRAR_EL1), trap_raz_wi },
> { SYS_DESC(SYS_OSLAR_EL1), trap_raz_wi },
> - { SYS_DESC(SYS_OSLSR_EL1), trap_oslsr_el1 },
> + { SYS_DESC(SYS_OSLSR_EL1), trap_oslsr_el1, reset_val, OSLSR_EL1, 0x00000008 },
> { SYS_DESC(SYS_OSDLR_EL1), trap_raz_wi },
> { SYS_DESC(SYS_DBGPRCR_EL1), trap_raz_wi },
> { SYS_DESC(SYS_DBGCLAIMSET_EL1), trap_raz_wi },
> @@ -1916,7 +1915,7 @@ static const struct sys_reg_desc cp14_regs[] = {
> { Op1( 0), CRn( 1), CRm( 0), Op2( 4), trap_raz_wi },
> DBGBXVR(1),
> /* DBGOSLSR */
> - { Op1( 0), CRn( 1), CRm( 1), Op2( 4), trap_oslsr_el1 },
> + { Op1( 0), CRn( 1), CRm( 1), Op2( 4), trap_oslsr_el1, NULL, OSLSR_EL1 },
> DBGBXVR(2),
> DBGBXVR(3),
> /* DBGOSDLR */
Please update tools/testing/selftests/kvm/aarch64/get-reg-list.c
before Andrew catches you red-handed! :D
M.
--
Without deviation from the norm, progress is not possible.
_______________________________________________
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: Marc Zyngier <maz@kernel.org>
To: Oliver Upton <oupton@google.com>
Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org,
James Morse <james.morse@arm.com>,
Alexandru Elisei <alexandru.elisei@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
linux-arm-kernel@lists.infradead.org,
Andrew Jones <drjones@redhat.com>,
Peter Shier <pshier@google.com>,
Ricardo Koller <ricarkol@google.com>,
Reiji Watanabe <reijiw@google.com>
Subject: Re: [PATCH 1/3] KVM: arm64: Stash OSLSR_EL1 in the cpu context
Date: Fri, 29 Oct 2021 12:27:37 +0100 [thread overview]
Message-ID: <87lf2c9il2.wl-maz@kernel.org> (raw)
In-Reply-To: <20211029003202.158161-2-oupton@google.com>
On Fri, 29 Oct 2021 01:32:00 +0100,
Oliver Upton <oupton@google.com> wrote:
>
> An upcoming change to KVM will context switch the OS Lock status between
> guest/host. Add OSLSR_EL1 to the cpu context and handle guest reads
> using the stored value.
>
> Signed-off-by: Oliver Upton <oupton@google.com>
> ---
> arch/arm64/include/asm/kvm_host.h | 1 +
> arch/arm64/kvm/sys_regs.c | 13 ++++++-------
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> index f8be56d5342b..c98f65c4a1f7 100644
> --- a/arch/arm64/include/asm/kvm_host.h
> +++ b/arch/arm64/include/asm/kvm_host.h
> @@ -172,6 +172,7 @@ enum vcpu_sysreg {
> MDSCR_EL1, /* Monitor Debug System Control Register */
> MDCCINT_EL1, /* Monitor Debug Comms Channel Interrupt Enable Reg */
> DISR_EL1, /* Deferred Interrupt Status Register */
> + OSLSR_EL1, /* OS Lock Status Register */
Please move it one line up, next to the rest of the debug stuff
(DISR_EL1 is RAS and not debug).
>
> /* Performance Monitors Registers */
> PMCR_EL0, /* Control Register */
> diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
> index 1d46e185f31e..0eb03e7508fe 100644
> --- a/arch/arm64/kvm/sys_regs.c
> +++ b/arch/arm64/kvm/sys_regs.c
> @@ -291,12 +291,11 @@ static bool trap_oslsr_el1(struct kvm_vcpu *vcpu,
> struct sys_reg_params *p,
> const struct sys_reg_desc *r)
> {
> - if (p->is_write) {
> + if (p->is_write)
> return ignore_write(vcpu, p);
This should be UNDEF (though the HW should catch that, really).
> - } else {
> - p->regval = (1 << 3);
> - return true;
> - }
> +
> + p->regval = vcpu_read_sys_reg(vcpu, r->reg);
> + return true;
> }
>
> static bool trap_dbgauthstatus_el1(struct kvm_vcpu *vcpu,
> @@ -1441,7 +1440,7 @@ static const struct sys_reg_desc sys_reg_descs[] = {
>
> { SYS_DESC(SYS_MDRAR_EL1), trap_raz_wi },
> { SYS_DESC(SYS_OSLAR_EL1), trap_raz_wi },
> - { SYS_DESC(SYS_OSLSR_EL1), trap_oslsr_el1 },
> + { SYS_DESC(SYS_OSLSR_EL1), trap_oslsr_el1, reset_val, OSLSR_EL1, 0x00000008 },
> { SYS_DESC(SYS_OSDLR_EL1), trap_raz_wi },
> { SYS_DESC(SYS_DBGPRCR_EL1), trap_raz_wi },
> { SYS_DESC(SYS_DBGCLAIMSET_EL1), trap_raz_wi },
> @@ -1916,7 +1915,7 @@ static const struct sys_reg_desc cp14_regs[] = {
> { Op1( 0), CRn( 1), CRm( 0), Op2( 4), trap_raz_wi },
> DBGBXVR(1),
> /* DBGOSLSR */
> - { Op1( 0), CRn( 1), CRm( 1), Op2( 4), trap_oslsr_el1 },
> + { Op1( 0), CRn( 1), CRm( 1), Op2( 4), trap_oslsr_el1, NULL, OSLSR_EL1 },
> DBGBXVR(2),
> DBGBXVR(3),
> /* DBGOSDLR */
Please update tools/testing/selftests/kvm/aarch64/get-reg-list.c
before Andrew catches you red-handed! :D
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
WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Oliver Upton <oupton@google.com>
Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org,
James Morse <james.morse@arm.com>,
Alexandru Elisei <alexandru.elisei@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
linux-arm-kernel@lists.infradead.org,
Andrew Jones <drjones@redhat.com>,
Peter Shier <pshier@google.com>,
Ricardo Koller <ricarkol@google.com>,
Reiji Watanabe <reijiw@google.com>
Subject: Re: [PATCH 1/3] KVM: arm64: Stash OSLSR_EL1 in the cpu context
Date: Fri, 29 Oct 2021 12:27:37 +0100 [thread overview]
Message-ID: <87lf2c9il2.wl-maz@kernel.org> (raw)
In-Reply-To: <20211029003202.158161-2-oupton@google.com>
On Fri, 29 Oct 2021 01:32:00 +0100,
Oliver Upton <oupton@google.com> wrote:
>
> An upcoming change to KVM will context switch the OS Lock status between
> guest/host. Add OSLSR_EL1 to the cpu context and handle guest reads
> using the stored value.
>
> Signed-off-by: Oliver Upton <oupton@google.com>
> ---
> arch/arm64/include/asm/kvm_host.h | 1 +
> arch/arm64/kvm/sys_regs.c | 13 ++++++-------
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> index f8be56d5342b..c98f65c4a1f7 100644
> --- a/arch/arm64/include/asm/kvm_host.h
> +++ b/arch/arm64/include/asm/kvm_host.h
> @@ -172,6 +172,7 @@ enum vcpu_sysreg {
> MDSCR_EL1, /* Monitor Debug System Control Register */
> MDCCINT_EL1, /* Monitor Debug Comms Channel Interrupt Enable Reg */
> DISR_EL1, /* Deferred Interrupt Status Register */
> + OSLSR_EL1, /* OS Lock Status Register */
Please move it one line up, next to the rest of the debug stuff
(DISR_EL1 is RAS and not debug).
>
> /* Performance Monitors Registers */
> PMCR_EL0, /* Control Register */
> diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
> index 1d46e185f31e..0eb03e7508fe 100644
> --- a/arch/arm64/kvm/sys_regs.c
> +++ b/arch/arm64/kvm/sys_regs.c
> @@ -291,12 +291,11 @@ static bool trap_oslsr_el1(struct kvm_vcpu *vcpu,
> struct sys_reg_params *p,
> const struct sys_reg_desc *r)
> {
> - if (p->is_write) {
> + if (p->is_write)
> return ignore_write(vcpu, p);
This should be UNDEF (though the HW should catch that, really).
> - } else {
> - p->regval = (1 << 3);
> - return true;
> - }
> +
> + p->regval = vcpu_read_sys_reg(vcpu, r->reg);
> + return true;
> }
>
> static bool trap_dbgauthstatus_el1(struct kvm_vcpu *vcpu,
> @@ -1441,7 +1440,7 @@ static const struct sys_reg_desc sys_reg_descs[] = {
>
> { SYS_DESC(SYS_MDRAR_EL1), trap_raz_wi },
> { SYS_DESC(SYS_OSLAR_EL1), trap_raz_wi },
> - { SYS_DESC(SYS_OSLSR_EL1), trap_oslsr_el1 },
> + { SYS_DESC(SYS_OSLSR_EL1), trap_oslsr_el1, reset_val, OSLSR_EL1, 0x00000008 },
> { SYS_DESC(SYS_OSDLR_EL1), trap_raz_wi },
> { SYS_DESC(SYS_DBGPRCR_EL1), trap_raz_wi },
> { SYS_DESC(SYS_DBGCLAIMSET_EL1), trap_raz_wi },
> @@ -1916,7 +1915,7 @@ static const struct sys_reg_desc cp14_regs[] = {
> { Op1( 0), CRn( 1), CRm( 0), Op2( 4), trap_raz_wi },
> DBGBXVR(1),
> /* DBGOSLSR */
> - { Op1( 0), CRn( 1), CRm( 1), Op2( 4), trap_oslsr_el1 },
> + { Op1( 0), CRn( 1), CRm( 1), Op2( 4), trap_oslsr_el1, NULL, OSLSR_EL1 },
> DBGBXVR(2),
> DBGBXVR(3),
> /* DBGOSDLR */
Please update tools/testing/selftests/kvm/aarch64/get-reg-list.c
before Andrew catches you red-handed! :D
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2021-10-29 11:27 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-29 0:31 [PATCH 0/3] KVM: arm64: Fixes for the exposed debug architecture Oliver Upton
2021-10-29 0:31 ` Oliver Upton
2021-10-29 0:31 ` Oliver Upton
2021-10-29 0:32 ` [PATCH 1/3] KVM: arm64: Stash OSLSR_EL1 in the cpu context Oliver Upton
2021-10-29 0:32 ` Oliver Upton
2021-10-29 0:32 ` Oliver Upton
2021-10-29 11:27 ` Marc Zyngier [this message]
2021-10-29 11:27 ` Marc Zyngier
2021-10-29 11:27 ` Marc Zyngier
2021-10-29 0:32 ` [PATCH 2/3] KVM: arm64: Allow the guest to change the OS Lock status Oliver Upton
2021-10-29 0:32 ` Oliver Upton
2021-10-29 0:32 ` Oliver Upton
2021-10-29 11:16 ` Marc Zyngier
2021-10-29 11:16 ` Marc Zyngier
2021-10-29 11:16 ` Marc Zyngier
2021-10-29 0:32 ` [PATCH 3/3] KVM: arm64: Raise KVM's reported debug architecture to v8.2 Oliver Upton
2021-10-29 0:32 ` Oliver Upton
2021-10-29 0:32 ` Oliver Upton
2021-10-29 11:31 ` Marc Zyngier
2021-10-29 11:31 ` Marc Zyngier
2021-10-29 11:31 ` Marc Zyngier
2021-10-29 18:18 ` Oliver Upton
2021-10-29 18:18 ` Oliver Upton
2021-10-29 18:18 ` Oliver Upton
2021-11-01 10:21 ` Marc Zyngier
2021-11-01 10:21 ` Marc Zyngier
2021-11-01 10:21 ` 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=87lf2c9il2.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=oupton@google.com \
--cc=pshier@google.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.