From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 42261C433EF for ; Fri, 20 May 2022 14:02:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kyCSwkU7STfvy2qNZ5gho+iGDNuUKOvFYrsTGAo/nfU=; b=IlBL0pNdmErZcs 7vzj12RzQAzrt6xDkoUMPkv4jk/c00lPYVNVUzTsP2JZ723lBojExx6cPNmoC9bcO/vtX9e7yXDd1 1Vr5eukigipS7PQpcNZ9s6oHOQPuHQ38e2e2K3YWZkRrfwJ2llJW4FmOr90QW+daJcGIJ9S/sqMgM 62XnvKptwMxY5uz0J/GSaNVQJiubSluLa3njcJw+wbNeIuVXTrFOeyH37VqI1+OrGfgrTnqaiXUcr UPxjVjplA0gkbWZXH2ou+0+04u0eNWvs1FWQidxI6trKW3razvj1LJP73VLXSqTtec0vAPOI25mJi o8BzxnN34zQOVaBt0/HQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ns3Bp-00Cncg-9f; Fri, 20 May 2022 14:01:13 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ns3Bm-00CnbE-5Y for linux-arm-kernel@lists.infradead.org; Fri, 20 May 2022 14:01:11 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 96ADC1477; Fri, 20 May 2022 07:01:08 -0700 (PDT) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 31F593F73D; Fri, 20 May 2022 07:01:07 -0700 (PDT) Date: Fri, 20 May 2022 15:01:20 +0100 From: Alexandru Elisei To: Vladimir Murzin Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, will@kernel.org, maz@kernel.org Subject: Re: [PATCH kvmtool] aarch64: Give up with MTE for AArch32 guest Message-ID: References: <20220520123844.127733-1-vladimir.murzin@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220520_070110_365990_7E619CAB X-CRM114-Status: GOOD ( 26.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > >> --- > >> 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 Reviewed-by: Alexandru Elisei 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