Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp283722rdb; Thu, 19 Oct 2023 04:39:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFCsQaI7tqJfrgnay6ipRYp7Mwo8+Pn1P+KfOY5UQK/eUBMze40t45O9D2vsNjk+gKk4Uo+ X-Received: by 2002:a05:6a21:3387:b0:16b:c20d:f97c with SMTP id yy7-20020a056a21338700b0016bc20df97cmr2106558pzb.0.1697715588401; Thu, 19 Oct 2023 04:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697715588; cv=none; d=google.com; s=arc-20160816; b=G3xARGSUsxT6icRRCaQu2n5sM+l0Fadrpq1cjyNe09ktJCKK+Pcj11Mz/2z1qlWbr3 03I9/USILeKQvRqXpr0/OfIV9BFj9TQc8e0B+BTgR7EfIHBWdDmWEZGbS3KlEo9dBMDW jn1F9G7lioAMfsG4+cLvm4pzmrpAGHDepEGr1XDAu+spu08o3C9YR1qeYfE7dTIfO7D+ kBK2b0ckUlnZ3MaiCGIT1PQEAlc+d4Grbl30l7eKzNye5GppHP/ssriGAmDmYednNdlk cwMcdGraghaSWQKpQeDKDVHpydoeyhcCuxIFFHq7x/eJFbSjUYRIc9/rh7G5CmTOV4h9 U1PQ== 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=hXg9o/oDcZTOg4hG5EDC7dVhb3M2Vz8ogQevd5IUyAc=; fh=4M0yYnXK15iw3DqGIuIg5/aUe+PXAzqOETZT5drnmO0=; b=DePYLMUxeo9LfqhylZagfaKpGxOo5NPnkufB13OMjaP2ZX30UCNc0nCSXE1MNQfDPf WN6dCiM1bP4TQcStgY/2FDAqn50rT3FCaeGaWXLq3005Vm23fSUug+zBW9gF6wyJ3oEw xxipkwpwlqud5i/BCyrAQpzVcybuZGSypH/eDw/xNeQ/aKsFqQGyNYe6dy9H31yr3sWi L1YeV3QwDLOIOHgs6Sxp08IOwEZk4grh0VIoPlOTVxhhTNC0cvKWGBWUz3mC7Up3zTSF 3YwWkdXEgrPSOF/LaiSUPQGXaMojuXsgyOiYbNN2lO6z8HH/xOOqiJFW1yAOerVvjre5 tEyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cGUkEUnk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id i69-20020a636d48000000b005a9f776c57dsi4135466pgc.644.2023.10.19.04.39.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 04:39:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cGUkEUnk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 0B0BA8122F01; Thu, 19 Oct 2023 04:39:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345383AbjJSLj3 (ORCPT + 99 others); Thu, 19 Oct 2023 07:39:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235219AbjJSLj1 (ORCPT ); Thu, 19 Oct 2023 07:39:27 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 488AC18A for ; Thu, 19 Oct 2023 04:39:25 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF650C433C7; Thu, 19 Oct 2023 11:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697715564; bh=6+e6tFBhwXttTI2OnODBoBY84he1JXmNi2O8ceFHcY0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cGUkEUnkDwmjLpWSwji7kRrKtBa9/hEFyX1iZYjdhNx6Mv3SyPW5vmc99ct4ClHXl Fuba2gKB5+qguHr7lh0RI7x1+WZKB6Gf1TCkOMWn94Ifjs9d/uylja4ccrJXyF6gTY qCu5pS1LTACCS+mGdaj+KnJ54lqmY2kXfQj6oRwdyIoLcTAEeev2K8xqr5KYNEk80W ZuFHhJuIrIbYJ1Tcf1lNkwpHxjiM2gzJq7oZlQgn9HTu7eTICP5wr8uC6ZYgp8HlQX Mqg9fOlC/GP0m3p9WGXQuDk8x+lt/NPEY4GttIrCGOPYHXeYjC3biUr7tcPjWOMEVx pe/fWT2I/Ex7Q== 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 1qtRN4-005jF6-61; Thu, 19 Oct 2023 12:39:22 +0100 Date: Thu, 19 Oct 2023 12:39:21 +0100 Message-ID: <86jzrin8nq.wl-maz@kernel.org> From: Marc Zyngier To: Miguel Luis Cc: Catalin Marinas , Will Deacon , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Jing Zhang , Eric Auger , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev Subject: Re: [PATCH v4 2/3] arm64: Add missing _EL2 encodings In-Reply-To: <20231016111743.30331-3-miguel.luis@oracle.com> References: <20231016111743.30331-1-miguel.luis@oracle.com> <20231016111743.30331-3-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/29.1 (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, jingzhangos@google.com, eric.auger@redhat.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 groat.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 (groat.vger.email [0.0.0.0]); Thu, 19 Oct 2023 04:39:46 -0700 (PDT) On Mon, 16 Oct 2023 12:17:41 +0100, Miguel Luis wrote: > > Some _EL2 encodings are missing. Add them. > > Signed-off-by: Miguel Luis > --- > arch/arm64/include/asm/sysreg.h | 39 +++++++++++++++++++++++++++++++++ > 1 file changed, 39 insertions(+) > > diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h > index ba5db50effec..8653fb67a339 100644 > --- a/arch/arm64/include/asm/sysreg.h > +++ b/arch/arm64/include/asm/sysreg.h [...] > +#define SYS_SDER32_EL2 sys_reg(3, 4, 1, 3, 1) [...] > +#define SYS_VSTTBR_EL2 sys_reg(3, 4, 2, 6, 0) > +#define SYS_VSTCR_EL2 sys_reg(3, 4, 2, 6, 2) [...] > +#define SYS_CNTHVS_TVAL_EL2 sys_reg(3, 4, 14, 4, 0) > +#define SYS_CNTHVS_CTL_EL2 sys_reg(3, 4, 14, 4, 1) > +#define SYS_CNTHVS_CVAL_EL2 sys_reg(3, 4, 14, 4, 2) > +#define SYS_CNTHPS_TVAL_EL2 sys_reg(3, 4, 14, 5, 0) > +#define SYS_CNTHPS_CTL_EL2 sys_reg(3, 4, 14, 5, 1) > +#define SYS_CNTHPS_CVAL_EL2 sys_reg(3, 4, 14, 5, 2) While the secure definitions seem correct, what is the rationale behind their presence here? They cannot be trapped from non-secure, and the pseudocode is pretty explicit: if !IsCurrentSecurityState(SS_Secure) then UNDEFINED; Given that, they cannot be trapped, handled or accessed from a KVM guest, as Linux on arm64 *always* runs non-secure. M. -- Without deviation from the norm, progress is not possible.