kvmarm.lists.cs.columbia.edu archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: arm64: Change default caching mode for {PEND, PROP}BASER.outer
@ 2020-07-01 14:02 Alexander Graf
  2020-07-05 18:11 ` Marc Zyngier
  2020-07-05 18:18 ` Marc Zyngier
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Graf @ 2020-07-01 14:02 UTC (permalink / raw)
  To: kvmarm; +Cc: Marc Zyngier, linux-kernel, linux-arm-kernel

PENDBASER and PROPBASER define the outer caching mode for LPI tables.
The memory backing them may not be outer sharable, so we mark them as nC
by default. This however, breaks Windows on ARM which only accepts
SameAsInner or RaWaWb as values for outer cachability.

We do today already allow the outer mode to be set to SameAsInner
explicitly, so the easy fix is to default to that instead of nC for
situations when an OS asks for a not fulfillable cachability request.

This fixes booting Windows in KVM with vgicv3 and ITS enabled for me.

Signed-off-by: Alexander Graf <graf@amazon.com>
---
 arch/arm64/kvm/vgic/vgic-mmio-v3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kvm/vgic/vgic-mmio-v3.c b/arch/arm64/kvm/vgic/vgic-mmio-v3.c
index d2339a2b9fb9..5c786b915cd3 100644
--- a/arch/arm64/kvm/vgic/vgic-mmio-v3.c
+++ b/arch/arm64/kvm/vgic/vgic-mmio-v3.c
@@ -389,7 +389,7 @@ u64 vgic_sanitise_outer_cacheability(u64 field)
 	case GIC_BASER_CACHE_nC:
 		return field;
 	default:
-		return GIC_BASER_CACHE_nC;
+		return GIC_BASER_CACHE_SameAsInner;
 	}
 }
 
-- 
2.17.1




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879



_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

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

* Re: [PATCH] KVM: arm64: Change default caching mode for {PEND, PROP}BASER.outer
  2020-07-01 14:02 [PATCH] KVM: arm64: Change default caching mode for {PEND, PROP}BASER.outer Alexander Graf
@ 2020-07-05 18:11 ` Marc Zyngier
  2020-07-05 18:18 ` Marc Zyngier
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Zyngier @ 2020-07-05 18:11 UTC (permalink / raw)
  To: Alexander Graf; +Cc: linux-kernel, linux-arm-kernel, kvmarm

On Wed, 01 Jul 2020 15:02:06 +0100,
Alexander Graf <graf@amazon.com> wrote:
> 
> PENDBASER and PROPBASER define the outer caching mode for LPI tables.
> The memory backing them may not be outer sharable, so we mark them as nC
> by default. This however, breaks Windows on ARM which only accepts
> SameAsInner or RaWaWb as values for outer cachability.
> 
> We do today already allow the outer mode to be set to SameAsInner
> explicitly, so the easy fix is to default to that instead of nC for
> situations when an OS asks for a not fulfillable cachability request.
> 
> This fixes booting Windows in KVM with vgicv3 and ITS enabled for me.
> 
> Signed-off-by: Alexander Graf <graf@amazon.com>
> ---
>  arch/arm64/kvm/vgic/vgic-mmio-v3.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kvm/vgic/vgic-mmio-v3.c b/arch/arm64/kvm/vgic/vgic-mmio-v3.c
> index d2339a2b9fb9..5c786b915cd3 100644
> --- a/arch/arm64/kvm/vgic/vgic-mmio-v3.c
> +++ b/arch/arm64/kvm/vgic/vgic-mmio-v3.c
> @@ -389,7 +389,7 @@ u64 vgic_sanitise_outer_cacheability(u64 field)
>  	case GIC_BASER_CACHE_nC:
>  		return field;
>  	default:
> -		return GIC_BASER_CACHE_nC;
> +		return GIC_BASER_CACHE_SameAsInner;
>  	}
>  }
>  

I am going to provisionally queue this for 5.9, with the explicit
reserve that it will be reverted if it causes a regression for other
guests (as this is an observable change in behaviour).

Thanks,

	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

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

* Re: [PATCH] KVM: arm64: Change default caching mode for {PEND, PROP}BASER.outer
  2020-07-01 14:02 [PATCH] KVM: arm64: Change default caching mode for {PEND, PROP}BASER.outer Alexander Graf
  2020-07-05 18:11 ` Marc Zyngier
@ 2020-07-05 18:18 ` Marc Zyngier
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Zyngier @ 2020-07-05 18:18 UTC (permalink / raw)
  To: Alexander Graf, kvmarm; +Cc: linux-kernel, kernel-team, linux-arm-kernel

On Wed, 1 Jul 2020 16:02:06 +0200, Alexander Graf wrote:
> PENDBASER and PROPBASER define the outer caching mode for LPI tables.
> The memory backing them may not be outer sharable, so we mark them as nC
> by default. This however, breaks Windows on ARM which only accepts
> SameAsInner or RaWaWb as values for outer cachability.
> 
> We do today already allow the outer mode to be set to SameAsInner
> explicitly, so the easy fix is to default to that instead of nC for
> situations when an OS asks for a not fulfillable cachability request.
> 
> [...]

Applied to kvm-arm64/next-5.9, thanks!

[1/1] KVM: arm64: vgic-its: Change default outer cacheability for {PEND, PROP}BASER
      commit: 731532176716e2775a5d21115bb9c5c61e0cb704

Cheers,

	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

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

end of thread, other threads:[~2020-07-05 18:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-01 14:02 [PATCH] KVM: arm64: Change default caching mode for {PEND, PROP}BASER.outer Alexander Graf
2020-07-05 18:11 ` Marc Zyngier
2020-07-05 18:18 ` Marc Zyngier

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