From: christoffer.dall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] arm/arm64: KVM: Don't BUG_ON if IT bits are set in ARM mode
Date: Thu, 1 Sep 2016 13:56:16 +0200 [thread overview]
Message-ID: <20160901115616.GD10162@cbox> (raw)
In-Reply-To: <1471610295-1456-2-git-send-email-marc.zyngier@arm.com>
On Fri, Aug 19, 2016 at 01:38:11PM +0100, Marc Zyngier wrote:
> The ARM ARM asserts that having the IT bits set in ARM mode is
> unpredictable. But should a CPU do that (and still be able to
> run correctly), we shouldn't kill the system.
>
> So let's drop the BUG_ON that checks for this, as it is not
> very helpful.
>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
not sure how this relates to the series, but looks fine otherwise:
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
> ---
> arch/arm/kvm/emulate.c | 4 +---
> arch/arm64/kvm/emulate.c | 4 +---
> 2 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/kvm/emulate.c b/arch/arm/kvm/emulate.c
> index af93e3f..eda9ddd 100644
> --- a/arch/arm/kvm/emulate.c
> +++ b/arch/arm/kvm/emulate.c
> @@ -221,9 +221,7 @@ static void kvm_adjust_itstate(struct kvm_vcpu *vcpu)
> unsigned long cpsr = *vcpu_cpsr(vcpu);
> bool is_arm = !(cpsr & PSR_T_BIT);
>
> - BUG_ON(is_arm && (cpsr & PSR_IT_MASK));
> -
> - if (!(cpsr & PSR_IT_MASK))
> + if (is_arm || !(cpsr & PSR_IT_MASK))
> return;
>
> cond = (cpsr & 0xe000) >> 13;
> diff --git a/arch/arm64/kvm/emulate.c b/arch/arm64/kvm/emulate.c
> index f87d8fb..df76590 100644
> --- a/arch/arm64/kvm/emulate.c
> +++ b/arch/arm64/kvm/emulate.c
> @@ -120,9 +120,7 @@ static void kvm_adjust_itstate(struct kvm_vcpu *vcpu)
> unsigned long cpsr = *vcpu_cpsr(vcpu);
> bool is_arm = !(cpsr & COMPAT_PSR_T_BIT);
>
> - BUG_ON(is_arm && (cpsr & COMPAT_PSR_IT_MASK));
> -
> - if (!(cpsr & COMPAT_PSR_IT_MASK))
> + if (is_arm || !(cpsr & COMPAT_PSR_IT_MASK))
> return;
>
> cond = (cpsr & 0xe000) >> 13;
> --
> 2.1.4
>
next prev parent reply other threads:[~2016-09-01 11:56 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-19 12:38 [PATCH 0/5] arm64: KVM: vgic-v2: Allow unsafe GICV accesses Marc Zyngier
2016-08-19 12:38 ` [PATCH 1/5] arm/arm64: KVM: Don't BUG_ON if IT bits are set in ARM mode Marc Zyngier
2016-09-01 11:56 ` Christoffer Dall [this message]
2016-09-01 12:21 ` Marc Zyngier
2016-08-19 12:38 ` [PATCH 2/5] arm64: KVM: Allow kvm_skip_instr32 to be shared between kernel and HYP code Marc Zyngier
2016-09-01 12:09 ` Christoffer Dall
2016-09-01 12:23 ` Marc Zyngier
2016-09-01 12:45 ` Peter Maydell
2016-08-19 12:38 ` [PATCH 3/5] arm64: KVM: vgic-v2: Add the GICV emulation infrastructure Marc Zyngier
2016-09-01 12:46 ` Christoffer Dall
2016-09-01 14:28 ` Marc Zyngier
2016-09-01 14:39 ` Peter Maydell
2016-09-01 14:55 ` Christoffer Dall
2016-08-19 12:38 ` [PATCH 4/5] arm64: KVM: vgic-v2: Add GICV access from HYP Marc Zyngier
2016-09-01 13:28 ` Christoffer Dall
2016-08-19 12:38 ` [PATCH 5/5] arm64: KVM: vgic-v2: Enable GICV access from HYP if access from guest is unsafe Marc Zyngier
2016-08-19 12:53 ` Peter Maydell
2016-08-19 13:05 ` Marc Zyngier
2016-08-19 13:31 ` Peter Maydell
2016-08-19 14:54 ` Marc Zyngier
2016-09-01 13:30 ` Christoffer Dall
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=20160901115616.GD10162@cbox \
--to=christoffer.dall@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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 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).