All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoffer Dall <cdall@linaro.org>
To: Dongjiu Geng <gengdongjiu@huawei.com>
Cc: marc.zyngier@arm.com, christoffer.dall@linaro.org,
	linux@armlinux.org.uk, catalin.marinas@arm.com,
	will.deacon@arm.com, linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org,
	huangshaoyu@huawei.com, wuquanming@huawei.com
Subject: Re: [PATCH v4] KVM: arm/arm64: fix the incompatible matching for external abort
Date: Mon, 30 Oct 2017 08:33:22 +0100	[thread overview]
Message-ID: <20171030073322.GR2166@lvm> (raw)
In-Reply-To: <1509343518-27137-1-git-send-email-gengdongjiu@huawei.com>

On Mon, Oct 30, 2017 at 02:05:18PM +0800, Dongjiu Geng wrote:
> kvm_vcpu_dabt_isextabt() tries to match a full fault syndrome, but
> calls kvm_vcpu_trap_get_fault_type() that only returns the fault class,
> thus reducing the scope of the check. This doesn't cause any observable
> bug yet as we end-up matching a closely related syndrome for which we
> return the same value.
> 
> Using kvm_vcpu_trap_get_fault() instead fixes it for good.
> 
> Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
> Acked-by: Marc Zyngier <marc.zyngier@arm.com>

Applied, thanks.
-Christoffer

> ---
>  arch/arm/include/asm/kvm_emulate.h   | 2 +-
>  arch/arm64/include/asm/kvm_emulate.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h
> index 98089ff..7571b4e 100644
> --- a/arch/arm/include/asm/kvm_emulate.h
> +++ b/arch/arm/include/asm/kvm_emulate.h
> @@ -203,7 +203,7 @@ static inline u8 kvm_vcpu_trap_get_fault_type(struct kvm_vcpu *vcpu)
>  
>  static inline bool kvm_vcpu_dabt_isextabt(struct kvm_vcpu *vcpu)
>  {
> -	switch (kvm_vcpu_trap_get_fault_type(vcpu)) {
> +	switch (kvm_vcpu_trap_get_fault(vcpu)) {
>  	case FSC_SEA:
>  	case FSC_SEA_TTW0:
>  	case FSC_SEA_TTW1:
> diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h
> index e5df3fc..8c918c5 100644
> --- a/arch/arm64/include/asm/kvm_emulate.h
> +++ b/arch/arm64/include/asm/kvm_emulate.h
> @@ -237,7 +237,7 @@ static inline u8 kvm_vcpu_trap_get_fault_type(const struct kvm_vcpu *vcpu)
>  
>  static inline bool kvm_vcpu_dabt_isextabt(const struct kvm_vcpu *vcpu)
>  {
> -	switch (kvm_vcpu_trap_get_fault_type(vcpu)) {
> +	switch (kvm_vcpu_trap_get_fault(vcpu)) {
>  	case FSC_SEA:
>  	case FSC_SEA_TTW0:
>  	case FSC_SEA_TTW1:
> -- 
> 1.9.1
> 

WARNING: multiple messages have this Message-ID (diff)
From: cdall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4] KVM: arm/arm64: fix the incompatible matching for external abort
Date: Mon, 30 Oct 2017 08:33:22 +0100	[thread overview]
Message-ID: <20171030073322.GR2166@lvm> (raw)
In-Reply-To: <1509343518-27137-1-git-send-email-gengdongjiu@huawei.com>

On Mon, Oct 30, 2017 at 02:05:18PM +0800, Dongjiu Geng wrote:
> kvm_vcpu_dabt_isextabt() tries to match a full fault syndrome, but
> calls kvm_vcpu_trap_get_fault_type() that only returns the fault class,
> thus reducing the scope of the check. This doesn't cause any observable
> bug yet as we end-up matching a closely related syndrome for which we
> return the same value.
> 
> Using kvm_vcpu_trap_get_fault() instead fixes it for good.
> 
> Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
> Acked-by: Marc Zyngier <marc.zyngier@arm.com>

Applied, thanks.
-Christoffer

> ---
>  arch/arm/include/asm/kvm_emulate.h   | 2 +-
>  arch/arm64/include/asm/kvm_emulate.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h
> index 98089ff..7571b4e 100644
> --- a/arch/arm/include/asm/kvm_emulate.h
> +++ b/arch/arm/include/asm/kvm_emulate.h
> @@ -203,7 +203,7 @@ static inline u8 kvm_vcpu_trap_get_fault_type(struct kvm_vcpu *vcpu)
>  
>  static inline bool kvm_vcpu_dabt_isextabt(struct kvm_vcpu *vcpu)
>  {
> -	switch (kvm_vcpu_trap_get_fault_type(vcpu)) {
> +	switch (kvm_vcpu_trap_get_fault(vcpu)) {
>  	case FSC_SEA:
>  	case FSC_SEA_TTW0:
>  	case FSC_SEA_TTW1:
> diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h
> index e5df3fc..8c918c5 100644
> --- a/arch/arm64/include/asm/kvm_emulate.h
> +++ b/arch/arm64/include/asm/kvm_emulate.h
> @@ -237,7 +237,7 @@ static inline u8 kvm_vcpu_trap_get_fault_type(const struct kvm_vcpu *vcpu)
>  
>  static inline bool kvm_vcpu_dabt_isextabt(const struct kvm_vcpu *vcpu)
>  {
> -	switch (kvm_vcpu_trap_get_fault_type(vcpu)) {
> +	switch (kvm_vcpu_trap_get_fault(vcpu)) {
>  	case FSC_SEA:
>  	case FSC_SEA_TTW0:
>  	case FSC_SEA_TTW1:
> -- 
> 1.9.1
> 

  reply	other threads:[~2017-10-30  7:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-30  6:05 [PATCH v4] KVM: arm/arm64: fix the incompatible matching for external abort Dongjiu Geng
2017-10-30  6:05 ` Dongjiu Geng
2017-10-30  6:05 ` Dongjiu Geng
2017-10-30  7:33 ` Christoffer Dall [this message]
2017-10-30  7:33   ` 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=20171030073322.GR2166@lvm \
    --to=cdall@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=gengdongjiu@huawei.com \
    --cc=huangshaoyu@huawei.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=marc.zyngier@arm.com \
    --cc=will.deacon@arm.com \
    --cc=wuquanming@huawei.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.