linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] KVM: arm/arm64: fix the incompatible matching for external abort
@ 2017-10-28  6:45 Dongjiu Geng
  2017-10-29  1:12 ` Marc Zyngier
  0 siblings, 1 reply; 3+ messages in thread
From: Dongjiu Geng @ 2017-10-28  6:45 UTC (permalink / raw)
  To: christoffer.dall, marc.zyngier, linux, catalin.marinas,
	will.deacon, linux-arm-kernel, kvmarm, linux-kernel, gengdongjiu,
	huangshaoyu, wuquanming

For this matching, switch expression uses fault type which is
not {I,D}FSC value, but the case expression uses {I,D}FSC,
they are incompatible. So change the switch expression to
use {I,D}FSC.

Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] KVM: arm/arm64: fix the incompatible matching for external abort
  2017-10-28  6:45 [PATCH v3] KVM: arm/arm64: fix the incompatible matching for external abort Dongjiu Geng
@ 2017-10-29  1:12 ` Marc Zyngier
  2017-10-30  1:13   ` gengdongjiu
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Zyngier @ 2017-10-29  1:12 UTC (permalink / raw)
  To: Dongjiu Geng
  Cc: christoffer.dall, linux, catalin.marinas, will.deacon,
	linux-arm-kernel, kvmarm, linux-kernel, huangshaoyu, wuquanming

On Sat, Oct 28 2017 at  2:45:59 pm BST, Dongjiu Geng <gengdongjiu@huawei.com> wrote:
> For this matching, switch expression uses fault type which is
> not {I,D}FSC value, but the case expression uses {I,D}FSC,
> they are incompatible. So change the switch expression to
> use {I,D}FSC.

I'm sorry, but I can't manage to parse this commit message. How about
something like this?

"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"

Otherwise:

Acked-by: Marc Zyngier <marc.zyngier@arm.com>

	M.
-- 
Jazz is not dead. It just smells funny.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] KVM: arm/arm64: fix the incompatible matching for external abort
  2017-10-29  1:12 ` Marc Zyngier
@ 2017-10-30  1:13   ` gengdongjiu
  0 siblings, 0 replies; 3+ messages in thread
From: gengdongjiu @ 2017-10-30  1:13 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: christoffer.dall, linux, catalin.marinas, will.deacon,
	linux-arm-kernel, kvmarm, linux-kernel, huangshaoyu, wuquanming


On 2017/10/29 9:12, Marc Zyngier wrote:
> I'm sorry, but I can't manage to parse this commit message. How about
> something like this?
> 
> "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"

Marc, thank you very much for your pointing out and good suggestion,
will update it. Thanks a lot.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-30  1:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-28  6:45 [PATCH v3] KVM: arm/arm64: fix the incompatible matching for external abort Dongjiu Geng
2017-10-29  1:12 ` Marc Zyngier
2017-10-30  1:13   ` gengdongjiu

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).