Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp6060973rdb; Mon, 18 Sep 2023 03:00:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHSApzBfXx5LjrEKrWW4vtYtLEkRC8biXo+0vmGq7RF49dL5J8FVOImN1QF1XDBqt9aBQhp X-Received: by 2002:a05:6a20:12c4:b0:148:3c72:4878 with SMTP id v4-20020a056a2012c400b001483c724878mr11273318pzg.50.1695031209858; Mon, 18 Sep 2023 03:00:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695031209; cv=none; d=google.com; s=arc-20160816; b=addD8+UyYSI5pSrUrcVYj8q3RO3tih1FEhPAgNI7NRjkIhMvyPvvQ+2pKi3hbYZKqO FX6w62497aXjhEeGTQgZJ/jgP//p+NlHp8t/70MING7F8VYQhiINPC7exZht0fZ7L8Jm RZ255dj1G7T/l9EBJTcG71Nt5BcGRAAL5DY6geVbpvCwjD8w/fnnuHmaKytFqAXuJZgx ckFO0tIfFeAllMnHcK0C1T0dsWG06U79hCQC50Y6Bs45/m+cYaxe8ehoMTYn7q3x7M8e fMWXnH4TpJxacucZ/m1YvJUM3GGJu+K4aU/rquJMTQuIsBdYu+9ZAHLqTzIFPW81wPfl Uniw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=Is0wY4Q44G0ZO+YqBTjrKC2jbp2cH6peiKXAPec8N/I=; fh=Stgu8mWyt9pUVrOudyc26pCcT9oJPr+2jB3PwSnksmc=; b=a36wzQ1NB6dEebIEbL4Nv5YBOkm4sL3wr3C8kZzjNBowzYgG2Be0syolxvQ+qrsvNL TQh1FsUJfX1QNMV3i5mrUM4Nd8yYrSNp/L2MKa1GokAfB3T3drkBNZ+332TEGnr0VVXl 2EuL10Ipx4gpOr2Moa1upaK+Ddp11LOGok2ezasghWf4zoiP0eEHyWTYn1sa3SRz0pEH 2Aif8SisPEROI6rXUPuPoFt3U6YFCZ0xpuIygCWWAzkKOjQ/h7p0sM0C+sMmSQZXc1ku QxrbyKcj9LHOQOFLy4AVLoJ3+90Lz/xZEYcDz0H8d92GzxKeJrOZpxU3Mzf772YGbFi0 8rjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k15vNTBJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id n188-20020a6327c5000000b00565f0e9cfbbsi7848905pgn.382.2023.09.18.03.00.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 03:00:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k15vNTBJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 8425E807DEFC; Mon, 18 Sep 2023 02:46:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231828AbjIRJps (ORCPT + 99 others); Mon, 18 Sep 2023 05:45:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240912AbjIRJp3 (ORCPT ); Mon, 18 Sep 2023 05:45:29 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 057D4CC4 for ; Mon, 18 Sep 2023 02:44:14 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F0EDC433C7; Mon, 18 Sep 2023 09:44:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695030254; bh=d5QNa0rFPQKJhTfE6aV8V13ZKrAJ2zdet4hfSfVVYpg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=k15vNTBJeQ2IwRF75jvpvYHPug/r/abpjSo7sVgKfzVncJt7UNob0Yz70j3Vqva6F iSY7X4waG67B2Pur4aFcXrlfwJCeapbh8K9o60uP7Z1gSszBvar3+u1Mj6sxN8JFMd ICTCnrD0gs6Bhq810dGQ4k7Lq5FrK7M3TA2LBvBfH2U+IFQjfBcifecmPZQvabc033 uq6EtC4WhGmdvKcwGreiNljuJUr97bsqKDq10k52FBQG46IbZILoU8evAKK10tS4rW LvoTiQ7z8AbJKyyJ70PUw+3Y0OG3xNfThziyNA7PWFlQLHvxbVOCHZY4lUFY9GqeMU RLMfPqaMFmyrA== 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 1qiAnb-00DuQH-Us; Mon, 18 Sep 2023 10:44:12 +0100 Date: Mon, 18 Sep 2023 10:44:11 +0100 Message-ID: <867conerys.wl-maz@kernel.org> From: Marc Zyngier To: Miguel Luis Cc: Catalin Marinas , Will Deacon , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev Subject: Re: [PATCH 3/3] KVM: arm64: nv: Handle all _EL02 and _EL12 registers In-Reply-To: <20230913185209.32282-4-miguel.luis@oracle.com> References: <20230913185209.32282-1-miguel.luis@oracle.com> <20230913185209.32282-4-miguel.luis@oracle.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/28.2 (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: 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, 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=-0.4 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,UPPERCASE_50_75 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Mon, 18 Sep 2023 02:46:26 -0700 (PDT) On Wed, 13 Sep 2023 19:52:08 +0100, Miguel Luis wrote: > > Specify both _EL02 and _EL12 system registers. > > Signed-off-by: Miguel Luis > --- > arch/arm64/kvm/emulate-nested.c | 35 +++++++++++++++++++++++++++++---- > 1 file changed, 31 insertions(+), 4 deletions(-) > > diff --git a/arch/arm64/kvm/emulate-nested.c b/arch/arm64/kvm/emulate-nested.c > index 9aa1c06abdb7..957afd97e488 100644 > --- a/arch/arm64/kvm/emulate-nested.c > +++ b/arch/arm64/kvm/emulate-nested.c > @@ -690,10 +690,37 @@ static const struct encoding_to_trap_config encoding_to_cgt[] __initconst = { > SR_RANGE_TRAP(sys_reg(3, 4, 14, 0, 3), > sys_reg(3, 4, 14, 5, 2), CGT_HCR_NV), > /* All _EL02, _EL12 registers */ > - SR_RANGE_TRAP(sys_reg(3, 5, 0, 0, 0), > - sys_reg(3, 5, 10, 15, 7), CGT_HCR_NV), > - SR_RANGE_TRAP(sys_reg(3, 5, 12, 0, 0), > - sys_reg(3, 5, 14, 15, 7), CGT_HCR_NV), > + SR_TRAP(SYS_SCTLR_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_CPACR_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_SCTLR2_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_ZCR_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_TRFCR_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_SMCR_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_TTBR0_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_TTBR1_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_TCR_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_TCR2_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_SPSR_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_ELR_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_AFSR0_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_AFSR1_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_ESR_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_TFSR_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_FAR_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_BRBCR_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_PMSCR_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_MAIR_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_AMAIR_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_VBAR_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_CONTEXTIDR_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_SCXTNUM_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_CNTKCTL_EL12, CGT_HCR_NV), > + SR_TRAP(SYS_CNTP_TVAL_EL02, CGT_HCR_NV), > + SR_TRAP(SYS_CNTP_CTL_EL02, CGT_HCR_NV), > + SR_TRAP(SYS_CNTP_CVAL_EL02, CGT_HCR_NV), > + SR_TRAP(SYS_CNTV_TVAL_EL02, CGT_HCR_NV), > + SR_TRAP(SYS_CNTV_CTL_EL02, CGT_HCR_NV), > + SR_TRAP(SYS_CNTV_CVAL_EL02, CGT_HCR_NV), > SR_TRAP(OP_AT_S1E2R, CGT_HCR_NV), > SR_TRAP(OP_AT_S1E2W, CGT_HCR_NV), > SR_TRAP(OP_AT_S12E1R, CGT_HCR_NV), While I could see the problem with the EL2 registers, I'm not convinced by this patch. Is there an actual case for non _EL02, non _EL12 registers that are included in the two ranges above? Thanks, M. -- Without deviation from the norm, progress is not possible.