Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp556602rdg; Thu, 12 Oct 2023 13:37:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEDDId3HYcOcs7hixUDTRmYb+Rl2xk5mZWXgExGIMoIF76VBMJseFZFyGiYd7WjkCfD0aMo X-Received: by 2002:a05:6a21:1f2f:b0:16b:9285:69e3 with SMTP id ry47-20020a056a211f2f00b0016b928569e3mr14604138pzb.18.1697143024661; Thu, 12 Oct 2023 13:37:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697143024; cv=none; d=google.com; s=arc-20160816; b=SeDPjOfD86Q3Drw3vUGIrsra09Xz+PGGgKYLbxOPp/SL6gZTMC6LuwG8xGzkYMuQm0 QhdeNqZlzoojtPZaQVb+D1n+w66RZjBIbWLUTWspUIpq9KX1ympX+UUInJw+GiEl4X6R F9hE/ABjUuwBDsu1LmAv8w/nbIx94uvcAGwf3UJb+wTLreReXVCgwLhb4MqjZQeEmt8q 4k40MrW9Y31lLHljGvCPU1TLu0kR0ts3KZXlRtHD5id/3jhIhhyhTJ9cFVY2Dk7hcgA0 OmFO4jWGDbm3A/InvnJDaNh3P2zG5en78U/f4OTBQs7E1tFLwG3gKOgXb2rH6EEEOGxv yrSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version :dkim-signature; bh=GTIZsqfjUiCg2k+wtHdDfGm1DPopOSnRzLF5aZJH0WI=; fh=vBIrfLTw6eD3L5ZG2MHwNUu688xcOAgKHHnzq92FS8M=; b=NB0hw2EFpHV8cHDgYotKig3HOu9C01H+i66nIbum3gdxnFOgvTQ9XSz+8Mbbug9lP8 Y1Iv+WOoNrDYL0Sja2+zj6q8HCUCTXGTwe7RHifzLNxHbeS4+oSmYP2Dw2LL2FYKe6yq Y3W5Bc7UFjwiNJFzC9lhIeEiY3HfGfWoNbUhwygJDODILPPtwx4aDP/jF40dv5pf6A4Y axnWNBbeX06hNngFoGmswHeM021eDj8aqnE4FBQouT/xSHnrc+wKelnIfSf1bNZ8DmrH bP3dtUQ4hiTWOj37UgGAHMPwGOVGaFe6TXOFMzrqR+m9CwIjOzu8b7/fVq18clL8wmGO gatg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="T/IGlDQL"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id n6-20020a632706000000b00574035fd472si2955187pgn.31.2023.10.12.13.37.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 13:37:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="T/IGlDQL"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 4641181D55F2; Thu, 12 Oct 2023 13:37:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442588AbjJLUgm (ORCPT + 99 others); Thu, 12 Oct 2023 16:36:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347403AbjJLUgk (ORCPT ); Thu, 12 Oct 2023 16:36:40 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CC8ACA for ; Thu, 12 Oct 2023 13:36:37 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7E70C433C7; Thu, 12 Oct 2023 20:36:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697142996; bh=qfX1SodUJMazOEDs5JlmUHg0AtVW+L6/EyjHuDRfotg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=T/IGlDQLSLZXodptqjPsCe0oLd2w5yn2DZDLWytelFLxee011GUtQir3kcxKUaCJt QDUCbnHpHixhfPdP82/TmVJdQ8xrjgDlJFM7vjfqvLl/3P7fLO4O4KrCwVTMBjS2Rm zAPfOcgM2km+8dzmSJaeD5SOmeJyNh/2SnkbnO3di5ESRFN++0WNbmT/9fsQvPuLY4 oT3PQ3dVuYA4aPCq2nN/tdbVe+/4WllbwBoTncgi8bwSjq95gWlLKoF9k9q5BZNZlk QFraeoe2QTtRDPVPCYTRtmhKwu2jgHzCNTVOVuwNmjgAcp3WqLqmY/i5Gpz4zIns97 Kb1ngR6GQ0XMA== Received: from disco-boy.misterjones.org ([217.182.43.188] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qr2Q6-003eHp-47; Thu, 12 Oct 2023 21:36:34 +0100 MIME-Version: 1.0 Date: Thu, 12 Oct 2023 21:36:33 +0100 From: Marc Zyngier To: eric.auger@redhat.com Cc: Miguel Luis , Catalin Marinas , Will Deacon , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Jing Zhang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev Subject: Re: [PATCH v3 3/3] arm64/kvm: Fine grain _EL2 system registers list that affect nested virtualization In-Reply-To: <7df53e6b-9141-de85-b7a3-b9eb092ef7b4@redhat.com> References: <20231011180103.91774-1-miguel.luis@oracle.com> <20231011180103.91774-4-miguel.luis@oracle.com> <7df53e6b-9141-de85-b7a3-b9eb092ef7b4@redhat.com> User-Agent: Roundcube Webmail/1.4.14 Message-ID: X-Sender: maz@kernel.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 217.182.43.188 X-SA-Exim-Rcpt-To: eric.auger@redhat.com, miguel.luis@oracle.com, catalin.marinas@arm.com, will@kernel.org, oliver.upton@linux.dev, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, jingzhangos@google.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 12 Oct 2023 13:37:02 -0700 (PDT) On 2023-10-12 16:22, Eric Auger wrote: > Hi Miguel, > > On 10/11/23 20:01, Miguel Luis wrote: >> Implement a fine grained approach in the _EL2 sysreg ranges. >> >> Fixes: d0fc0a2519a6 ("KVM: arm64: nv: Add trap forwarding for >> HCR_EL2") >> Signed-off-by: Miguel Luis >> --- >> arch/arm64/kvm/emulate-nested.c | 88 >> ++++++++++++++++++++++++++++++--- >> 1 file changed, 82 insertions(+), 6 deletions(-) >> >> diff --git a/arch/arm64/kvm/emulate-nested.c >> b/arch/arm64/kvm/emulate-nested.c >> index 9ced1bf0c2b7..3af49e130ee6 100644 >> --- a/arch/arm64/kvm/emulate-nested.c >> +++ b/arch/arm64/kvm/emulate-nested.c >> @@ -648,15 +648,91 @@ static const struct encoding_to_trap_config >> encoding_to_cgt[] __initconst = { >> SR_TRAP(SYS_APGAKEYLO_EL1, CGT_HCR_APK), >> SR_TRAP(SYS_APGAKEYHI_EL1, CGT_HCR_APK), >> /* All _EL2 registers */ >> - SR_RANGE_TRAP(sys_reg(3, 4, 0, 0, 0), >> - sys_reg(3, 4, 3, 15, 7), CGT_HCR_NV), >> + SR_TRAP(SYS_VPIDR_EL2, CGT_HCR_NV), > I think you miss DBGVCR32_EL2 I don't think this register should be part of this list. We don't support AArch32 with NV, and the spec says that DBGVCR32_EL2 UNDEFs when EL1 doesn't support AArch32. So the change that needs to happen is to inject an UNDEF when trapping a DBGVCR32_EL2and not forward the trap to the guest. Thanks, M. -- Jazz is not dead. It just smells funny...