Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3168361rwd; Mon, 22 May 2023 09:31:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6/pEcpGBhCYX4IhpBYs2daZRxW5yhjmhLR9h6Fcfq1YxIgDURVO+g/vvRfW7niI1zNil2m X-Received: by 2002:a05:6a21:328b:b0:10b:8024:d253 with SMTP id yt11-20020a056a21328b00b0010b8024d253mr4562541pzb.26.1684773117510; Mon, 22 May 2023 09:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684773117; cv=none; d=google.com; s=arc-20160816; b=H7eyPkbt6h5U3o3gNUz8vzpPKNT8wucbn7uWPj5JCWhrWw1JEK5Px2BP7/Xr3+tWPR PApbaK7S8AmiWQfzpfK3lfx6p7MnQ3sNYXUnvPR4o+BidM4lLoKINgORM2CnLwiF0OC3 +2b/9znz3X0C6/+XYtxz76UtjSxtaGsPFlgAN64CD6kW+sAqYI1IWj8z8AH3mw5dsltt jiiHBJmYV2RP7F/L1eCVhIZwWhz2WGvHHkMRwNL7/Eo2rZOMlOt6GamifpAFQXDl7wZ5 q1q7uDpq8AoDNePFAYIJRWgItLHXlhgYCh2OwRUESfqyfFZ7+Evy+AFLPrZ2LFooqKlK B3YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=/7pVRqif5u3rwxU6zTq//mJ9Ci1pZ+RgrrfjkKjAdCU=; b=WsK6YqzplwZKDVSwQ36/YfZLfho37hDIZA+Fr3dA84elDCo1B5nzooWiihECBU9irP 701KHl9LnxsbW1wrq8XIm70UrjmzFYPLNsXSF6bZSJKh0QRGx1iSVizgugXWRHIJDd30 649cCXlrXYuQ3w1i2cVekDs8+3+3xvjo8Dhw3vbC4q/n4AQNKx3jthQjqKO4KTLCuhl5 nQ/vti00WFqvoMDp3Tt7F8eXTs2bMG0xp+M3Z+4oNxCHT3xSiiUP1Qy+4w54Ms97BwGi ZalAZEwTLoFUFCcA6OJOLpMbYhQfGweNf70UP0Xe8pyIS4jrDEn9ge9H3jVAH2R1YF+Y p1BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bToiEcu0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r7-20020aa79887000000b0064d425629dfsi5059733pfl.51.2023.05.22.09.31.44; Mon, 22 May 2023 09:31:57 -0700 (PDT) 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=pass header.i=@kernel.org header.s=k20201202 header.b=bToiEcu0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231547AbjEVQXF (ORCPT + 99 others); Mon, 22 May 2023 12:23:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231448AbjEVQXB (ORCPT ); Mon, 22 May 2023 12:23:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84A96F4 for ; Mon, 22 May 2023 09:23:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0BD1462018 for ; Mon, 22 May 2023 16:23:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FE98C433A1; Mon, 22 May 2023 16:22:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684772579; bh=CbUz/yoL9PyMSTqsbEC82EZry/1wdlsepwx6fDSgjrY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bToiEcu0XHJRGSZDIG9qg2M0S+uaKB7rLa6MAcB9huIBJf0mtmUlJ5xUcRW0cV1HO EP7cIAMwNiCRtYB+O/cd0yOrgfsuj9AvH6srqd4Lga0xdgoojtmCLcRf8m+siFhn3O DTa0gF+ZAFc0j2Rve5Al6elICn3sJKz3lTZUc4X+4ePlxquBkxbFARhfpRruqglYow dd0WrAztZd373eMd5mnhUlzAihvzh1d2ysU3s5Kizr+v59PTifjE05KQ2k7M1rwQ3e xIpB+Amyx8tNlbKmxbIyHOm7UAG2WLOKmiKAz+YKtr0qsalgV9wtfZFl0H6rHJ++8P RcWpiYxxmIpOg== From: Mark Brown Date: Mon, 22 May 2023 17:22:43 +0100 Subject: [PATCH 4/5] arm64/sysreg: Standardise naming of bitfield constants in OSL[AS]R_EL1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230419-arm64-syreg-gen-v1-4-936cd769cb9e@kernel.org> References: <20230419-arm64-syreg-gen-v1-0-936cd769cb9e@kernel.org> In-Reply-To: <20230419-arm64-syreg-gen-v1-0-936cd769cb9e@kernel.org> To: Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, Mark Brown X-Mailer: b4 0.13-dev-bfdf5 X-Developer-Signature: v=1; a=openpgp-sha256; l=3462; i=broonie@kernel.org; h=from:subject:message-id; bh=CbUz/yoL9PyMSTqsbEC82EZry/1wdlsepwx6fDSgjrY=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBka5bWSbm537iErZkk8Xr8ZgULfL2Xb94AV4jb1wRM zEBp0XKJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZGuW1gAKCRAk1otyXVSH0HyhB/ 9Bo7sZXLklp6xHD7EhcM1apRk517eVTUbCt4PPAb5ng28+IiHaLcmt2Dsx8JOpYT7iS9xvtiM2qLKz 7yEEUh4uNXOb3ooFqdubs1dzLBvNy/3jQTZzwzqm+BwMkUMQTtmQg81B99j61lkyJHETRfEPiPmDAL 7fTrLW43BoRCbUJe4hp+6D4K3ZO/qta6SdBVfTU2Hz3CAl5OexaF+MMw1WgQCkYDaqfGxuhP0oVXUy cKNbABwcFjQ/YQ80g2CK7gMwFL0mWVwpo2wde+di9YxbluhMLIIKmwlNMJ4PsVHB2Uq4j45zIHQVJK jWPvX07eAvb2BfuV5MBTV9a2e1EcsI X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Our standard scheme for naming the constants for bitfields in system registers includes _ELx in the name but not the SYS_, update the constants for OSL[AS]R_EL1 to follow this convention. Signed-off-by: Mark Brown --- arch/arm64/include/asm/kvm_host.h | 2 +- arch/arm64/include/asm/sysreg.h | 10 +++++----- arch/arm64/kvm/sys_regs.c | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index bcd774d74f34..cde4ad590f8c 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -996,7 +996,7 @@ void kvm_arm_clear_debug(struct kvm_vcpu *vcpu); void kvm_arm_reset_debug_ptr(struct kvm_vcpu *vcpu); #define kvm_vcpu_os_lock_enabled(vcpu) \ - (!!(__vcpu_sys_reg(vcpu, OSLSR_EL1) & SYS_OSLSR_OSLK)) + (!!(__vcpu_sys_reg(vcpu, OSLSR_EL1) & OSLSR_EL1_OSLK)) int kvm_arm_vcpu_arch_set_attr(struct kvm_vcpu *vcpu, struct kvm_device_attr *attr); diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index 4ecae92b56b5..09de958e79ed 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -141,13 +141,13 @@ #define SYS_MDRAR_EL1 sys_reg(2, 0, 1, 0, 0) #define SYS_OSLAR_EL1 sys_reg(2, 0, 1, 0, 4) -#define SYS_OSLAR_OSLK BIT(0) +#define OSLAR_EL1_OSLK BIT(0) #define SYS_OSLSR_EL1 sys_reg(2, 0, 1, 1, 4) -#define SYS_OSLSR_OSLM_MASK (BIT(3) | BIT(0)) -#define SYS_OSLSR_OSLM_NI 0 -#define SYS_OSLSR_OSLM_IMPLEMENTED BIT(3) -#define SYS_OSLSR_OSLK BIT(1) +#define OSLSR_EL1_OSLM_MASK (BIT(3) | BIT(0)) +#define OSLSR_EL1_OSLM_NI 0 +#define OSLSR_EL1_OSLM_IMPLEMENTED BIT(3) +#define OSLSR_EL1_OSLK BIT(1) #define SYS_OSDLR_EL1 sys_reg(2, 0, 1, 3, 4) #define SYS_DBGPRCR_EL1 sys_reg(2, 0, 1, 4, 4) diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index 53749d3a0996..8a5160a90d3c 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -388,9 +388,9 @@ static bool trap_oslar_el1(struct kvm_vcpu *vcpu, return read_from_write_only(vcpu, p, r); /* Forward the OSLK bit to OSLSR */ - oslsr = __vcpu_sys_reg(vcpu, OSLSR_EL1) & ~SYS_OSLSR_OSLK; - if (p->regval & SYS_OSLAR_OSLK) - oslsr |= SYS_OSLSR_OSLK; + oslsr = __vcpu_sys_reg(vcpu, OSLSR_EL1) & ~OSLSR_EL1_OSLK; + if (p->regval & OSLAR_EL1_OSLK) + oslsr |= OSLSR_EL1_OSLK; __vcpu_sys_reg(vcpu, OSLSR_EL1) = oslsr; return true; @@ -414,7 +414,7 @@ static int set_oslsr_el1(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, * The only modifiable bit is the OSLK bit. Refuse the write if * userspace attempts to change any other bit in the register. */ - if ((val ^ rd->val) & ~SYS_OSLSR_OSLK) + if ((val ^ rd->val) & ~OSLSR_EL1_OSLK) return -EINVAL; __vcpu_sys_reg(vcpu, rd->reg) = val; @@ -1760,7 +1760,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { { SYS_DESC(SYS_MDRAR_EL1), trap_raz_wi }, { SYS_DESC(SYS_OSLAR_EL1), trap_oslar_el1 }, { SYS_DESC(SYS_OSLSR_EL1), trap_oslsr_el1, reset_val, OSLSR_EL1, - SYS_OSLSR_OSLM_IMPLEMENTED, .set_user = set_oslsr_el1, }, + OSLSR_EL1_OSLM_IMPLEMENTED, .set_user = set_oslsr_el1, }, { SYS_DESC(SYS_OSDLR_EL1), trap_raz_wi }, { SYS_DESC(SYS_DBGPRCR_EL1), trap_raz_wi }, { SYS_DESC(SYS_DBGCLAIMSET_EL1), trap_raz_wi }, -- 2.30.2