Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7060937rwl; Fri, 30 Dec 2022 03:03:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXtzXC6QZsti/ApZ+ZsREy+TFPuzWcqpaIk61B7BXmFMra0XUl/MfXPqbbYgrkFpVocFTfOx X-Received: by 2002:a05:6a20:8ee1:b0:ac:3f3f:9fbd with SMTP id m33-20020a056a208ee100b000ac3f3f9fbdmr32057336pzk.48.1672398211488; Fri, 30 Dec 2022 03:03:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672398211; cv=none; d=google.com; s=arc-20160816; b=YEhrYgX3oYQLfZVuL4NaVrBdB6u8bes5TXf85JYt+2EqWmN3aREwJ3VWq/tkk1V+kj 0UlNFQscMfeeM0phVRG6ck6+V7+ntsNcUrR4T3MA9tMD6CfqysIndwt98CCSEvy7kEU1 /LYroO6PsuRDW++4MoaTBqT4W/VIErDppXNCSP98YpgEdGIV61k6XSLeD5XGo3dI9NQf hjtIKE0cEbVRajBaXkg9fKch/7hOg4jctuYy264d7MeufILzpNpZpJmJSaJljh1WCYXO C6dpiotJNlQClk/0ZAhwMVOElVQ5pu8gMu7Qn2BRQNYdzOt/prGLZPmADYTQwd4i0P+S chUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=nQ3SWUnwOxxOnluQcCUMkWWYY8S0x44bkExbOVLaC48=; b=c+JXW5niGQCINP0KQmE7lEN7Xa9oveItvUji6C/yvAbSPFQG1V6Uo2rslmBEvvKXpl hXScLyz20W032yixMhEP9cnjRNYov07++F3zKwLtIlfXM1vcg0Z5ol/9aWS5hFH86T3H +TywD/mcFtkeI0dhZIxNfzVepNMSgr1tBHEkznD0TeL3duGBuJfeyyNlkISw2od+lWmC DwjLS/g7yH0/Uxy7FSzweMqS35TsZMq7kFOHoREqZ8jjNP+TYR6LQqvpiX6VtdrxyMsh DRRFepOKnM3e/D8BQFmi94qV2T2GJIIEI1h23lT3IRV7wCA4kVXbVgfwnT6hI3tFi4Cn d+OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@daynix-com.20210112.gappssmtp.com header.s=20210112 header.b=PIewojQz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r27-20020a63441b000000b00476e62744a8si19942433pga.388.2022.12.30.03.03.21; Fri, 30 Dec 2022 03:03:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@daynix-com.20210112.gappssmtp.com header.s=20210112 header.b=PIewojQz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234941AbiL3JzK (ORCPT + 63 others); Fri, 30 Dec 2022 04:55:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbiL3JzF (ORCPT ); Fri, 30 Dec 2022 04:55:05 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 872231A807 for ; Fri, 30 Dec 2022 01:55:04 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id o2so16277621pjh.4 for ; Fri, 30 Dec 2022 01:55:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nQ3SWUnwOxxOnluQcCUMkWWYY8S0x44bkExbOVLaC48=; b=PIewojQzM9gdaK16yPowjVkvS9gJxGqd0smybnMugXbwyRtcY9H2OninVnk985ilXH TMWVfHPA6BRCAnxu5fpX77ZfejmB4fbFbMB4bZCf4KFAroubnEKJHZk11sW0q7kA5nIs 4AiXg5tEX7bf5/QTRMAMlAsnF/sR5DdLlV11Hz22LrvJp6XBYdpK0ojD6wIdst2/HdoE h5k+/ypI8nAiyoWOTPOamgGfAJG+2fJQjM6Y3EmvQOda/slt8HZszf64VtPkmYWabqpz QvMutBmXygyO0yarbfhdi5U9YqE/M2I+OzeWzKt1l/uzbgi6eArPebW5MjKoXgrdrxha Vtxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nQ3SWUnwOxxOnluQcCUMkWWYY8S0x44bkExbOVLaC48=; b=5OKnIVUeDf3eiZ2bzV8De1hQGHXJO8ESg/Ujh/LMwx3bAfks+xTtIo//DN59j5neiX +gr38xdySGqVj8Lf9ASFhWeRw0wEOdHICdyg4W7JgfR37INOGIt5SHBGszomq5klqrPD UI/5T/AfnsbxKW4025KpjNSP71WqnlEC2FXhMk4UB35s35lUyaCMs7OZfCaw5jz//APO tes7yaEK72Kjw3XSfQaPKMlzTx4clTEyrRqfFwUl+CZzRAqstqPmHrvxCNCv0dSh7TVU 6ckWDTYdTmf1JxRoLz50AdXv33olPUJaXw+4IdEoHzagqZvyUZzvrIQJxyj5YVNMfm/d 3Nog== X-Gm-Message-State: AFqh2kpHJFK+P/P8DrWHAAiAz1BUpLyx5bu6PRAILMvrqcMcEy4dsN0z fudUftwcqQq1fdoW8eFGsby7AQ== X-Received: by 2002:a17:902:f38c:b0:189:5f5c:da1f with SMTP id f12-20020a170902f38c00b001895f5cda1fmr25292169ple.5.1672394104051; Fri, 30 Dec 2022 01:55:04 -0800 (PST) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id b7-20020a170902650700b00189c536c72asm14487719plk.148.2022.12.30.01.55.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Dec 2022 01:55:03 -0800 (PST) From: Akihiko Odaki Cc: Mark Brown , Marc Zyngier , linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Mathieu Poirier , Oliver Upton , Suzuki K Poulose , Alexandru Elisei , James Morse , Will Deacon , Catalin Marinas , asahi@lists.linux.dev, Alyssa Rosenzweig , Sven Peter , Hector Martin , Akihiko Odaki Subject: [PATCH v5 1/7] arm64: Allow the definition of UNKNOWN system register fields Date: Fri, 30 Dec 2022 18:54:46 +0900 Message-Id: <20221230095452.181764-2-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221230095452.181764-1-akihiko.odaki@daynix.com> References: <20221230095452.181764-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marc Zyngier The CCSIDR_EL1 register contains an UNKNOWN field (which replaces fields that were actually defined in previous revisions of the architecture). Define an 'Unkn' field type modeled after the Res0/Res1 types to allow such description. This allows the generation of #define CCSIDR_EL1_UNKN (UL(0) | GENMASK_ULL(31, 28)) which may have its use one day. Hopefully the architecture doesn't add too many of those in the future. Signed-off-by: Marc Zyngier Signed-off-by: Akihiko Odaki Reviewed-by: Mark Brown --- arch/arm64/tools/gen-sysreg.awk | 20 +++++++++++++++++++- arch/arm64/tools/sysreg | 2 ++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/arch/arm64/tools/gen-sysreg.awk b/arch/arm64/tools/gen-sysreg.awk index db461921d256..f6909a6b8380 100755 --- a/arch/arm64/tools/gen-sysreg.awk +++ b/arch/arm64/tools/gen-sysreg.awk @@ -98,6 +98,7 @@ END { res0 = "UL(0)" res1 = "UL(0)" + unkn = "UL(0)" next_bit = 63 @@ -112,11 +113,13 @@ END { define(reg "_RES0", "(" res0 ")") define(reg "_RES1", "(" res1 ")") + define(reg "_UNKN", "(" unkn ")") print "" reg = null res0 = null res1 = null + unkn = null next } @@ -134,6 +137,7 @@ END { res0 = "UL(0)" res1 = "UL(0)" + unkn = "UL(0)" define("REG_" reg, "S" op0 "_" op1 "_C" crn "_C" crm "_" op2) define("SYS_" reg, "sys_reg(" op0 ", " op1 ", " crn ", " crm ", " op2 ")") @@ -161,7 +165,9 @@ END { define(reg "_RES0", "(" res0 ")") if (res1 != null) define(reg "_RES1", "(" res1 ")") - if (res0 != null || res1 != null) + if (unkn != null) + define(reg "_UNKN", "(" unkn ")") + if (res0 != null || res1 != null || unkn != null) print "" reg = null @@ -172,6 +178,7 @@ END { op2 = null res0 = null res1 = null + unkn = null next } @@ -190,6 +197,7 @@ END { next_bit = 0 res0 = null res1 = null + unkn = null next } @@ -215,6 +223,16 @@ END { next } +/^Unkn/ && (block == "Sysreg" || block == "SysregFields") { + expect_fields(2) + parse_bitdef(reg, "UNKN", $2) + field = "UNKN_" msb "_" lsb + + unkn = unkn " | GENMASK_ULL(" msb ", " lsb ")" + + next +} + /^Field/ && (block == "Sysreg" || block == "SysregFields") { expect_fields(3) field = $3 diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg index 384757a7eda9..8f26fe1bedc6 100644 --- a/arch/arm64/tools/sysreg +++ b/arch/arm64/tools/sysreg @@ -15,6 +15,8 @@ # Res1 [:] +# Unkn [:] + # Field [:] # Enum [:] -- 2.38.1