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 E2A39C02194 for ; Fri, 7 Feb 2025 14:01:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aAdO5Rw+NG0PawrM+DBUgUxEnTCbLgOT5Cw2hRa2caI=; b=bIp1eBBFRBslFYOda9IAqy37Q3 At56aildUJB+PRi1Ove5dg9FbyU/yD9GeITvi/+EOYqvgmStTOx18IoSAFDgWj6F0D4KTk9UkfpOu THhHrFBnBPg9U4Nhh1CQ/IyfgmeEaPBOd2tkbo9ouUYg72mVJ/qKvzxvuzLol+3ujEdVlEOCfWP/2 qLJWnnBNGOscoQl8Mkhlc9VMDIJTegPrF8iGOH0ukNcMu7fFKhDANpMu0DTu3auDOBE03pNvFsIBg DvYJV1JqMvXYqYM8eIjs5Ob5Bx5obMYW6c9/UuZz2pA3KZsRHBwSQzI55XNVwYa1oTIu6al4NnDNL Hu+qon+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tgOuk-00000009lDY-2wuJ; Fri, 07 Feb 2025 14:01:02 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tgOtM-00000009knd-3a2r for linux-arm-kernel@lists.infradead.org; Fri, 07 Feb 2025 13:59:37 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 88FC45C6085; Fri, 7 Feb 2025 13:58:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED126C4CED1; Fri, 7 Feb 2025 13:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738936776; bh=RUtQSyfhNs+tFAKcDtGzb+C8FwaGeQ+wiIdsyqFhXbg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eAw3hZ5TrI/Hl3CLjQVitGazqSS5beMYFUhRRCBQ6Yf2hQb/ZlVbtGxvPCkmhloIr oCGmTljVG+TGTOeUlifj/csy12k1e/TPZCAKGOBMK4OWN53NmjLWRE2eguiwnjMUIZ ryuRoS1TYrAWLjwZDJxk66sZADu56mbbchsGUZ2Qd/LBxW+ndFVrLfkgyiOUmhFzga PJXWRjzK9K9MSJDQ4+Wu14K1C9xn9CwNcmcsVeg2KP5YUWbdi7qxh0XO5owo+JtOJt gB24B6XM4p8Cp3kGNn7OoxykbUW/Ow3mgy54En8C14IKxp9cosWms/xau0Y1bEWgaw KsBNsuLAY8uuQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tgOtJ-001duf-Dm; Fri, 07 Feb 2025 13:59:33 +0000 Date: Fri, 07 Feb 2025 13:59:31 +0000 Message-ID: <86jza1ua7w.wl-maz@kernel.org> From: Marc Zyngier To: Ganapatrao Kulkarni Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, darren@os.amperecomputing.com, scott@os.amperecomputing.com Subject: Re: [RFC PATCH 1/2] KVM: arm64: nv: selftests: Add guest hypervisor test In-Reply-To: <9b4a8665-4fb8-42e7-b63f-d154ae75a4f0@os.amperecomputing.com> References: <20250206164120.4045569-1-gankulkarni@os.amperecomputing.com> <20250206164120.4045569-2-gankulkarni@os.amperecomputing.com> <86o6zeu668.wl-maz@kernel.org> <9b4a8665-4fb8-42e7-b63f-d154ae75a4f0@os.amperecomputing.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: gankulkarni@os.amperecomputing.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, darren@os.amperecomputing.com, scott@os.amperecomputing.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250207_055936_974093_73C67426 X-CRM114-Status: GOOD ( 26.55 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 07 Feb 2025 13:26:41 +0000, Ganapatrao Kulkarni wrote: > > >> + if (is_vcpu_nested(vcpu)) { > >> + vcpu_set_reg(vcpu, KVM_ARM64_SYS_REG(SYS_CPTR_EL2), fpen); > >> + vcpu_set_reg(vcpu, KVM_ARM64_SYS_REG(SYS_SCTLR_EL2), sctlr_el1); > >> + vcpu_set_reg(vcpu, KVM_ARM64_SYS_REG(SYS_TCR_EL2), tcr_el1); > >> + vcpu_set_reg(vcpu, KVM_ARM64_SYS_REG(SYS_MAIR_EL2), DEFAULT_MAIR_EL1); > >> + vcpu_set_reg(vcpu, KVM_ARM64_SYS_REG(SYS_TTBR0_EL2), ttbr0_el1); > >> + vcpu_set_reg(vcpu, KVM_ARM64_SYS_REG(SYS_TPIDR_EL2), vcpu->id); > > > > How about some of the basics such as HCR_EL2, MDCR_EL2? A bunch of > > things there do have an impact on how the guest behaves, and relying > > on defaults feels like a bad idea. > > Sure, I will try to have these registers also set to required value > explicitly. > > > > > This also assumes VHE, without trying to enforce it. > > Ok, I will try to set specific bits of HCR_EL2 to force it run in VHE. > > > > > Finally, how to you plan to make all the existing tests run as EL2 > > guests if TPIDR_EL1 isn't populated with the expected value? Surely > > you need to change the read side... > > OK, I have not yet tried running existing tests modifying to run as > EL2 guests. I will try to run them modifying to run in vEL2. You shouldn't try to modify them. Just make them take a parameter so that the initialisation is done by configuring everything at EL2. > > Should we modify them to run as EL2 guests by default, if the host > supports/detected NV? or command line argument based run? either in > El1(default) or in EL2? EL1 by default. > > BTW, I have also ran all existing tests on L1, most of the tests are > passing(atleast I did not see any failure prints). > > arm64/debug-exceptions is failing on L1 and needs to be > debugged/fixed/skipped. > arm64/arch_timer_edge_cases fails on both L0 and L1. Then I guess you have some work to do to debug these problems, and it once more means that NV is not ready for merging. M. -- Without deviation from the norm, progress is not possible.