All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH kvmtool] aarch64: Give up with MTE for AArch32 guest
@ 2022-05-20 12:38 ` Vladimir Murzin
  0 siblings, 0 replies; 10+ messages in thread
From: Vladimir Murzin @ 2022-05-20 12:38 UTC (permalink / raw)
  To: linux-arm-kernel, kvmarm; +Cc: will, maz

KVM doesn't support combination of MTE and AArch32 guest, so do not
even try.

Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arm/aarch64/kvm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arm/aarch64/kvm.c b/arm/aarch64/kvm.c
index 1b992dd..f3fe854 100644
--- a/arm/aarch64/kvm.c
+++ b/arm/aarch64/kvm.c
@@ -120,6 +120,11 @@ void kvm__arch_enable_mte(struct kvm *kvm)
 		.cap = KVM_CAP_ARM_MTE,
 	};
 
+	if (kvm->cfg.arch.aarch32_guest) {
+		pr_debug("MTE is incompatible with AArch32");
+		return;
+	}
+
 	if (kvm->cfg.arch.mte_disabled) {
 		pr_debug("MTE disabled by user");
 		return;
-- 
2.25.1

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

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

* [PATCH kvmtool] aarch64: Give up with MTE for AArch32 guest
@ 2022-05-20 12:38 ` Vladimir Murzin
  0 siblings, 0 replies; 10+ messages in thread
From: Vladimir Murzin @ 2022-05-20 12:38 UTC (permalink / raw)
  To: linux-arm-kernel, kvmarm; +Cc: alexandru.elisei, will, maz

KVM doesn't support combination of MTE and AArch32 guest, so do not
even try.

Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arm/aarch64/kvm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arm/aarch64/kvm.c b/arm/aarch64/kvm.c
index 1b992dd..f3fe854 100644
--- a/arm/aarch64/kvm.c
+++ b/arm/aarch64/kvm.c
@@ -120,6 +120,11 @@ void kvm__arch_enable_mte(struct kvm *kvm)
 		.cap = KVM_CAP_ARM_MTE,
 	};
 
+	if (kvm->cfg.arch.aarch32_guest) {
+		pr_debug("MTE is incompatible with AArch32");
+		return;
+	}
+
 	if (kvm->cfg.arch.mte_disabled) {
 		pr_debug("MTE disabled by user");
 		return;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH kvmtool] aarch64: Give up with MTE for AArch32 guest
  2022-05-20 12:38 ` Vladimir Murzin
@ 2022-05-20 13:31   ` Alexandru Elisei
  -1 siblings, 0 replies; 10+ messages in thread
From: Alexandru Elisei @ 2022-05-20 13:31 UTC (permalink / raw)
  To: Vladimir Murzin; +Cc: maz, will, kvmarm, linux-arm-kernel

Hi Vladimir,

When I run an --aarch32 guest with --debug this is the message that I'm
getting:

  Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:146: MTE capability not available

Would you mind elaborating on the merits of the message that you are
proposing:

  Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:124: MTE is incompatible with AArch32

Is it because it explains why the capability is not available?

Thanks,
Alex

On Fri, May 20, 2022 at 01:38:44PM +0100, Vladimir Murzin wrote:
> KVM doesn't support combination of MTE and AArch32 guest, so do not
> even try.
> 
> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
> ---
>  arm/aarch64/kvm.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arm/aarch64/kvm.c b/arm/aarch64/kvm.c
> index 1b992dd..f3fe854 100644
> --- a/arm/aarch64/kvm.c
> +++ b/arm/aarch64/kvm.c
> @@ -120,6 +120,11 @@ void kvm__arch_enable_mte(struct kvm *kvm)
>  		.cap = KVM_CAP_ARM_MTE,
>  	};
>  
> +	if (kvm->cfg.arch.aarch32_guest) {
> +		pr_debug("MTE is incompatible with AArch32");
> +		return;
> +	}
> +
>  	if (kvm->cfg.arch.mte_disabled) {
>  		pr_debug("MTE disabled by user");
>  		return;
> -- 
> 2.25.1
> 
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

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

* Re: [PATCH kvmtool] aarch64: Give up with MTE for AArch32 guest
@ 2022-05-20 13:31   ` Alexandru Elisei
  0 siblings, 0 replies; 10+ messages in thread
From: Alexandru Elisei @ 2022-05-20 13:31 UTC (permalink / raw)
  To: Vladimir Murzin; +Cc: linux-arm-kernel, kvmarm, will, maz

Hi Vladimir,

When I run an --aarch32 guest with --debug this is the message that I'm
getting:

  Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:146: MTE capability not available

Would you mind elaborating on the merits of the message that you are
proposing:

  Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:124: MTE is incompatible with AArch32

Is it because it explains why the capability is not available?

Thanks,
Alex

On Fri, May 20, 2022 at 01:38:44PM +0100, Vladimir Murzin wrote:
> KVM doesn't support combination of MTE and AArch32 guest, so do not
> even try.
> 
> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
> ---
>  arm/aarch64/kvm.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arm/aarch64/kvm.c b/arm/aarch64/kvm.c
> index 1b992dd..f3fe854 100644
> --- a/arm/aarch64/kvm.c
> +++ b/arm/aarch64/kvm.c
> @@ -120,6 +120,11 @@ void kvm__arch_enable_mte(struct kvm *kvm)
>  		.cap = KVM_CAP_ARM_MTE,
>  	};
>  
> +	if (kvm->cfg.arch.aarch32_guest) {
> +		pr_debug("MTE is incompatible with AArch32");
> +		return;
> +	}
> +
>  	if (kvm->cfg.arch.mte_disabled) {
>  		pr_debug("MTE disabled by user");
>  		return;
> -- 
> 2.25.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH kvmtool] aarch64: Give up with MTE for AArch32 guest
  2022-05-20 13:31   ` Alexandru Elisei
@ 2022-05-20 13:48     ` Vladimir Murzin
  -1 siblings, 0 replies; 10+ messages in thread
From: Vladimir Murzin @ 2022-05-20 13:48 UTC (permalink / raw)
  To: Alexandru Elisei; +Cc: maz, will, kvmarm, linux-arm-kernel

Hi Alexandru,

On 5/20/22 14:31, Alexandru Elisei wrote:
> Hi Vladimir,
> 
> When I run an --aarch32 guest with --debug this is the message that I'm
> getting:
> 
>   Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:146: MTE capability not available
> 
> Would you mind elaborating on the merits of the message that you are
> proposing:
> 
>   Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:124: MTE is incompatible with AArch32
> 
> Is it because it explains why the capability is not available?

Hmm, without this patch I'm getting

 lkvm run -k /opt/kvm/guest-0/Image -d /opt/kvm/guest-0/fs.ext2 -c 4 -m 681 --console virtio '--irqchip=gicv3' --params 'console=hvc earlycon swiotlb=1024' --aarch32 --debug

+ lkvm run -k /opt/kvm/guest-0/Image -m 681 -c 4 --name guest-115
  Info: (arm/aarch64/kvm.c) kvm__get_vm_type:76: max_ipa aa8fffff ipa_bits 32 max_ipa_bits 40
  Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:104: MTE capability enabled
  Info: (arm/kvm.c) kvm__arch_load_kernel_image:118: Loaded kernel to 0x80008000 (17280980 bytes)
  Info: (arm/kvm.c) kvm__arch_load_kernel_image:134: Placing fdt at 0x8fe00000 - 0x8fffffff
  Fatal: Unable to initialise vcpu

with patch applied

lkvm run -k /opt/kvm/guest-0/Image -d /opt/kvm/guest-0/fs.ext2 -c 4 -m 681 --console virtio '--irqchip=gicv3' --params 'console=hvc earlycon swiotlb=1024' --aarch32 --debug
+ lkvm run -k /opt/kvm/guest-0/Image -d /opt/kvm/guest-0/fs.ext2 -c 4 -m 681 --console virtio '--irqchip=gicv3' --params 'console=hvc earlycon swiotlb=1024' --aarch32 --debug
  # lkvm run -k /opt/kvm/guest-0/Image -m 681 -c 4 --name guest-114
  Info: (arm/aarch64/kvm.c) kvm__get_vm_type:76: max_ipa aa8fffff ipa_bits 32 max_ipa_bits 40
  Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:92: MTE is incompatible with AArch32
  Info: (arm/kvm.c) kvm__arch_load_kernel_image:118: Loaded kernel to 0x80008000 (17280980 bytes)
  Info: (arm/kvm.c) kvm__arch_load_kernel_image:134: Placing fdt at 0x8fe00000 - 0x8fffffff
  Info: (virtio/mmio.c) virtio_mmio_init:325: virtio-mmio.devices=0x200@0x3000000:36
  Info: (virtio/mmio.c) virtio_mmio_init:325: virtio-mmio.devices=0x200@0x3000200:37
  Info: (virtio/mmio.c) virtio_mmio_init:325: virtio-mmio.devices=0x200@0x3000400:38

My host and guest kernel is 5.15, maybe I'm just missing some backport?

Cheers
Vladimir

> 
> Thanks,
> Alex
> 
> On Fri, May 20, 2022 at 01:38:44PM +0100, Vladimir Murzin wrote:
>> KVM doesn't support combination of MTE and AArch32 guest, so do not
>> even try.
>>
>> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
>> ---
>>  arm/aarch64/kvm.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/arm/aarch64/kvm.c b/arm/aarch64/kvm.c
>> index 1b992dd..f3fe854 100644
>> --- a/arm/aarch64/kvm.c
>> +++ b/arm/aarch64/kvm.c
>> @@ -120,6 +120,11 @@ void kvm__arch_enable_mte(struct kvm *kvm)
>>  		.cap = KVM_CAP_ARM_MTE,
>>  	};
>>  
>> +	if (kvm->cfg.arch.aarch32_guest) {
>> +		pr_debug("MTE is incompatible with AArch32");
>> +		return;
>> +	}
>> +
>>  	if (kvm->cfg.arch.mte_disabled) {
>>  		pr_debug("MTE disabled by user");
>>  		return;
>> -- 
>> 2.25.1
>>

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

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

* Re: [PATCH kvmtool] aarch64: Give up with MTE for AArch32 guest
@ 2022-05-20 13:48     ` Vladimir Murzin
  0 siblings, 0 replies; 10+ messages in thread
From: Vladimir Murzin @ 2022-05-20 13:48 UTC (permalink / raw)
  To: Alexandru Elisei; +Cc: linux-arm-kernel, kvmarm, will, maz

Hi Alexandru,

On 5/20/22 14:31, Alexandru Elisei wrote:
> Hi Vladimir,
> 
> When I run an --aarch32 guest with --debug this is the message that I'm
> getting:
> 
>   Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:146: MTE capability not available
> 
> Would you mind elaborating on the merits of the message that you are
> proposing:
> 
>   Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:124: MTE is incompatible with AArch32
> 
> Is it because it explains why the capability is not available?

Hmm, without this patch I'm getting

 lkvm run -k /opt/kvm/guest-0/Image -d /opt/kvm/guest-0/fs.ext2 -c 4 -m 681 --console virtio '--irqchip=gicv3' --params 'console=hvc earlycon swiotlb=1024' --aarch32 --debug

+ lkvm run -k /opt/kvm/guest-0/Image -m 681 -c 4 --name guest-115
  Info: (arm/aarch64/kvm.c) kvm__get_vm_type:76: max_ipa aa8fffff ipa_bits 32 max_ipa_bits 40
  Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:104: MTE capability enabled
  Info: (arm/kvm.c) kvm__arch_load_kernel_image:118: Loaded kernel to 0x80008000 (17280980 bytes)
  Info: (arm/kvm.c) kvm__arch_load_kernel_image:134: Placing fdt at 0x8fe00000 - 0x8fffffff
  Fatal: Unable to initialise vcpu

with patch applied

lkvm run -k /opt/kvm/guest-0/Image -d /opt/kvm/guest-0/fs.ext2 -c 4 -m 681 --console virtio '--irqchip=gicv3' --params 'console=hvc earlycon swiotlb=1024' --aarch32 --debug
+ lkvm run -k /opt/kvm/guest-0/Image -d /opt/kvm/guest-0/fs.ext2 -c 4 -m 681 --console virtio '--irqchip=gicv3' --params 'console=hvc earlycon swiotlb=1024' --aarch32 --debug
  # lkvm run -k /opt/kvm/guest-0/Image -m 681 -c 4 --name guest-114
  Info: (arm/aarch64/kvm.c) kvm__get_vm_type:76: max_ipa aa8fffff ipa_bits 32 max_ipa_bits 40
  Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:92: MTE is incompatible with AArch32
  Info: (arm/kvm.c) kvm__arch_load_kernel_image:118: Loaded kernel to 0x80008000 (17280980 bytes)
  Info: (arm/kvm.c) kvm__arch_load_kernel_image:134: Placing fdt at 0x8fe00000 - 0x8fffffff
  Info: (virtio/mmio.c) virtio_mmio_init:325: virtio-mmio.devices=0x200@0x3000000:36
  Info: (virtio/mmio.c) virtio_mmio_init:325: virtio-mmio.devices=0x200@0x3000200:37
  Info: (virtio/mmio.c) virtio_mmio_init:325: virtio-mmio.devices=0x200@0x3000400:38

My host and guest kernel is 5.15, maybe I'm just missing some backport?

Cheers
Vladimir

> 
> Thanks,
> Alex
> 
> On Fri, May 20, 2022 at 01:38:44PM +0100, Vladimir Murzin wrote:
>> KVM doesn't support combination of MTE and AArch32 guest, so do not
>> even try.
>>
>> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
>> ---
>>  arm/aarch64/kvm.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/arm/aarch64/kvm.c b/arm/aarch64/kvm.c
>> index 1b992dd..f3fe854 100644
>> --- a/arm/aarch64/kvm.c
>> +++ b/arm/aarch64/kvm.c
>> @@ -120,6 +120,11 @@ void kvm__arch_enable_mte(struct kvm *kvm)
>>  		.cap = KVM_CAP_ARM_MTE,
>>  	};
>>  
>> +	if (kvm->cfg.arch.aarch32_guest) {
>> +		pr_debug("MTE is incompatible with AArch32");
>> +		return;
>> +	}
>> +
>>  	if (kvm->cfg.arch.mte_disabled) {
>>  		pr_debug("MTE disabled by user");
>>  		return;
>> -- 
>> 2.25.1
>>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH kvmtool] aarch64: Give up with MTE for AArch32 guest
  2022-05-20 13:48     ` Vladimir Murzin
@ 2022-05-20 14:01       ` Alexandru Elisei
  -1 siblings, 0 replies; 10+ messages in thread
From: Alexandru Elisei @ 2022-05-20 14:01 UTC (permalink / raw)
  To: Vladimir Murzin; +Cc: maz, will, kvmarm, linux-arm-kernel

Hi,

On Fri, May 20, 2022 at 02:48:10PM +0100, Vladimir Murzin wrote:
> Hi Alexandru,
> 
> On 5/20/22 14:31, Alexandru Elisei wrote:
> > Hi Vladimir,
> > 
> > When I run an --aarch32 guest with --debug this is the message that I'm
> > getting:
> > 
> >   Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:146: MTE capability not available
> > 
> > Would you mind elaborating on the merits of the message that you are
> > proposing:
> > 
> >   Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:124: MTE is incompatible with AArch32
> > 
> > Is it because it explains why the capability is not available?
> 
> Hmm, without this patch I'm getting
> 
>  lkvm run -k /opt/kvm/guest-0/Image -d /opt/kvm/guest-0/fs.ext2 -c 4 -m 681 --console virtio '--irqchip=gicv3' --params 'console=hvc earlycon swiotlb=1024' --aarch32 --debug
> 
> + lkvm run -k /opt/kvm/guest-0/Image -m 681 -c 4 --name guest-115
>   Info: (arm/aarch64/kvm.c) kvm__get_vm_type:76: max_ipa aa8fffff ipa_bits 32 max_ipa_bits 40
>   Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:104: MTE capability enabled
>   Info: (arm/kvm.c) kvm__arch_load_kernel_image:118: Loaded kernel to 0x80008000 (17280980 bytes)
>   Info: (arm/kvm.c) kvm__arch_load_kernel_image:134: Placing fdt at 0x8fe00000 - 0x8fffffff
>   Fatal: Unable to initialise vcpu
> 
> with patch applied
> 
> lkvm run -k /opt/kvm/guest-0/Image -d /opt/kvm/guest-0/fs.ext2 -c 4 -m 681 --console virtio '--irqchip=gicv3' --params 'console=hvc earlycon swiotlb=1024' --aarch32 --debug
> + lkvm run -k /opt/kvm/guest-0/Image -d /opt/kvm/guest-0/fs.ext2 -c 4 -m 681 --console virtio '--irqchip=gicv3' --params 'console=hvc earlycon swiotlb=1024' --aarch32 --debug
>   # lkvm run -k /opt/kvm/guest-0/Image -m 681 -c 4 --name guest-114
>   Info: (arm/aarch64/kvm.c) kvm__get_vm_type:76: max_ipa aa8fffff ipa_bits 32 max_ipa_bits 40
>   Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:92: MTE is incompatible with AArch32
>   Info: (arm/kvm.c) kvm__arch_load_kernel_image:118: Loaded kernel to 0x80008000 (17280980 bytes)
>   Info: (arm/kvm.c) kvm__arch_load_kernel_image:134: Placing fdt at 0x8fe00000 - 0x8fffffff
>   Info: (virtio/mmio.c) virtio_mmio_init:325: virtio-mmio.devices=0x200@0x3000000:36
>   Info: (virtio/mmio.c) virtio_mmio_init:325: virtio-mmio.devices=0x200@0x3000200:37
>   Info: (virtio/mmio.c) virtio_mmio_init:325: virtio-mmio.devices=0x200@0x3000400:38
> 
> My host and guest kernel is 5.15, maybe I'm just missing some backport?

I'm embarassed now, I didn't check that MTE was enabled on the model.
Without this patch I am indeed seeing the error message:

  Fatal: Unable to initialise vcpu

which goes away after I apply your patch.

> 
> Cheers
> Vladimir
> 
> > 
> > Thanks,
> > Alex
> > 
> > On Fri, May 20, 2022 at 01:38:44PM +0100, Vladimir Murzin wrote:
> >> KVM doesn't support combination of MTE and AArch32 guest, so do not
> >> even try.
> >>
> >> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
> >> ---
> >>  arm/aarch64/kvm.c | 5 +++++
> >>  1 file changed, 5 insertions(+)
> >>
> >> diff --git a/arm/aarch64/kvm.c b/arm/aarch64/kvm.c
> >> index 1b992dd..f3fe854 100644
> >> --- a/arm/aarch64/kvm.c
> >> +++ b/arm/aarch64/kvm.c
> >> @@ -120,6 +120,11 @@ void kvm__arch_enable_mte(struct kvm *kvm)
> >>  		.cap = KVM_CAP_ARM_MTE,
> >>  	};
> >>  
> >> +	if (kvm->cfg.arch.aarch32_guest) {
> >> +		pr_debug("MTE is incompatible with AArch32");

Nitpick: I think "MTE disabled because it is incompatible with AArch32" is
slightly better, as it better matches the disabled by user message below.
It's up to you if you want to change the patch, I don't have a preference
either way.

> >> +		return;
> >> +	}
> >> +

I checked and this also matches the documentation for KVM_CAP_ARM_MTE:

Tested-by: Alexandru Elisei <alexandru.elisei@arm.com>
Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>

Thanks,
Alex

> >>  	if (kvm->cfg.arch.mte_disabled) {
> >>  		pr_debug("MTE disabled by user");
> >>  		return;
> >> -- 
> >> 2.25.1
> >>
> 
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

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

* Re: [PATCH kvmtool] aarch64: Give up with MTE for AArch32 guest
@ 2022-05-20 14:01       ` Alexandru Elisei
  0 siblings, 0 replies; 10+ messages in thread
From: Alexandru Elisei @ 2022-05-20 14:01 UTC (permalink / raw)
  To: Vladimir Murzin; +Cc: linux-arm-kernel, kvmarm, will, maz

Hi,

On Fri, May 20, 2022 at 02:48:10PM +0100, Vladimir Murzin wrote:
> Hi Alexandru,
> 
> On 5/20/22 14:31, Alexandru Elisei wrote:
> > Hi Vladimir,
> > 
> > When I run an --aarch32 guest with --debug this is the message that I'm
> > getting:
> > 
> >   Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:146: MTE capability not available
> > 
> > Would you mind elaborating on the merits of the message that you are
> > proposing:
> > 
> >   Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:124: MTE is incompatible with AArch32
> > 
> > Is it because it explains why the capability is not available?
> 
> Hmm, without this patch I'm getting
> 
>  lkvm run -k /opt/kvm/guest-0/Image -d /opt/kvm/guest-0/fs.ext2 -c 4 -m 681 --console virtio '--irqchip=gicv3' --params 'console=hvc earlycon swiotlb=1024' --aarch32 --debug
> 
> + lkvm run -k /opt/kvm/guest-0/Image -m 681 -c 4 --name guest-115
>   Info: (arm/aarch64/kvm.c) kvm__get_vm_type:76: max_ipa aa8fffff ipa_bits 32 max_ipa_bits 40
>   Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:104: MTE capability enabled
>   Info: (arm/kvm.c) kvm__arch_load_kernel_image:118: Loaded kernel to 0x80008000 (17280980 bytes)
>   Info: (arm/kvm.c) kvm__arch_load_kernel_image:134: Placing fdt at 0x8fe00000 - 0x8fffffff
>   Fatal: Unable to initialise vcpu
> 
> with patch applied
> 
> lkvm run -k /opt/kvm/guest-0/Image -d /opt/kvm/guest-0/fs.ext2 -c 4 -m 681 --console virtio '--irqchip=gicv3' --params 'console=hvc earlycon swiotlb=1024' --aarch32 --debug
> + lkvm run -k /opt/kvm/guest-0/Image -d /opt/kvm/guest-0/fs.ext2 -c 4 -m 681 --console virtio '--irqchip=gicv3' --params 'console=hvc earlycon swiotlb=1024' --aarch32 --debug
>   # lkvm run -k /opt/kvm/guest-0/Image -m 681 -c 4 --name guest-114
>   Info: (arm/aarch64/kvm.c) kvm__get_vm_type:76: max_ipa aa8fffff ipa_bits 32 max_ipa_bits 40
>   Info: (arm/aarch64/kvm.c) kvm__arch_enable_mte:92: MTE is incompatible with AArch32
>   Info: (arm/kvm.c) kvm__arch_load_kernel_image:118: Loaded kernel to 0x80008000 (17280980 bytes)
>   Info: (arm/kvm.c) kvm__arch_load_kernel_image:134: Placing fdt at 0x8fe00000 - 0x8fffffff
>   Info: (virtio/mmio.c) virtio_mmio_init:325: virtio-mmio.devices=0x200@0x3000000:36
>   Info: (virtio/mmio.c) virtio_mmio_init:325: virtio-mmio.devices=0x200@0x3000200:37
>   Info: (virtio/mmio.c) virtio_mmio_init:325: virtio-mmio.devices=0x200@0x3000400:38
> 
> My host and guest kernel is 5.15, maybe I'm just missing some backport?

I'm embarassed now, I didn't check that MTE was enabled on the model.
Without this patch I am indeed seeing the error message:

  Fatal: Unable to initialise vcpu

which goes away after I apply your patch.

> 
> Cheers
> Vladimir
> 
> > 
> > Thanks,
> > Alex
> > 
> > On Fri, May 20, 2022 at 01:38:44PM +0100, Vladimir Murzin wrote:
> >> KVM doesn't support combination of MTE and AArch32 guest, so do not
> >> even try.
> >>
> >> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
> >> ---
> >>  arm/aarch64/kvm.c | 5 +++++
> >>  1 file changed, 5 insertions(+)
> >>
> >> diff --git a/arm/aarch64/kvm.c b/arm/aarch64/kvm.c
> >> index 1b992dd..f3fe854 100644
> >> --- a/arm/aarch64/kvm.c
> >> +++ b/arm/aarch64/kvm.c
> >> @@ -120,6 +120,11 @@ void kvm__arch_enable_mte(struct kvm *kvm)
> >>  		.cap = KVM_CAP_ARM_MTE,
> >>  	};
> >>  
> >> +	if (kvm->cfg.arch.aarch32_guest) {
> >> +		pr_debug("MTE is incompatible with AArch32");

Nitpick: I think "MTE disabled because it is incompatible with AArch32" is
slightly better, as it better matches the disabled by user message below.
It's up to you if you want to change the patch, I don't have a preference
either way.

> >> +		return;
> >> +	}
> >> +

I checked and this also matches the documentation for KVM_CAP_ARM_MTE:

Tested-by: Alexandru Elisei <alexandru.elisei@arm.com>
Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>

Thanks,
Alex

> >>  	if (kvm->cfg.arch.mte_disabled) {
> >>  		pr_debug("MTE disabled by user");
> >>  		return;
> >> -- 
> >> 2.25.1
> >>
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH kvmtool] aarch64: Give up with MTE for AArch32 guest
  2022-05-20 12:38 ` Vladimir Murzin
@ 2022-05-20 20:51   ` Will Deacon
  -1 siblings, 0 replies; 10+ messages in thread
From: Will Deacon @ 2022-05-20 20:51 UTC (permalink / raw)
  To: kvmarm, linux-arm-kernel, Vladimir Murzin
  Cc: catalin.marinas, kernel-team, Will Deacon, maz

On Fri, 20 May 2022 13:38:44 +0100, Vladimir Murzin wrote:
> KVM doesn't support combination of MTE and AArch32 guest, so do not
> even try.
> 
> 

Applied to kvmtool (master), thanks!

[1/1] aarch64: Give up with MTE for AArch32 guest
      https://git.kernel.org/will/kvmtool/c/324cc0969b7c

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

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

* Re: [PATCH kvmtool] aarch64: Give up with MTE for AArch32 guest
@ 2022-05-20 20:51   ` Will Deacon
  0 siblings, 0 replies; 10+ messages in thread
From: Will Deacon @ 2022-05-20 20:51 UTC (permalink / raw)
  To: kvmarm, linux-arm-kernel, Vladimir Murzin
  Cc: catalin.marinas, kernel-team, Will Deacon, maz

On Fri, 20 May 2022 13:38:44 +0100, Vladimir Murzin wrote:
> KVM doesn't support combination of MTE and AArch32 guest, so do not
> even try.
> 
> 

Applied to kvmtool (master), thanks!

[1/1] aarch64: Give up with MTE for AArch32 guest
      https://git.kernel.org/will/kvmtool/c/324cc0969b7c

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-05-20 20:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-20 12:38 [PATCH kvmtool] aarch64: Give up with MTE for AArch32 guest Vladimir Murzin
2022-05-20 12:38 ` Vladimir Murzin
2022-05-20 13:31 ` Alexandru Elisei
2022-05-20 13:31   ` Alexandru Elisei
2022-05-20 13:48   ` Vladimir Murzin
2022-05-20 13:48     ` Vladimir Murzin
2022-05-20 14:01     ` Alexandru Elisei
2022-05-20 14:01       ` Alexandru Elisei
2022-05-20 20:51 ` Will Deacon
2022-05-20 20:51   ` Will Deacon

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.