Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5070FC433F5 for ; Tue, 4 Oct 2022 14:53:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=KBJhk315nMkEqL8t5wHWqdQeuFSUvaykrPUSsc3x0B8=; b=NcJ0AEVs4+Vnj+ FjYFy9J8g7mJBbLIBxxC9lS4xLIz1RWZ53QgmTXcky5ug9JoUlxRbb8ZkeqTkNjp4TSOIqrYUjOYL m1mTdDVe12ieLK+0N8eQqRF1FsAGcUNNxuY9MfqcOvIusaLANyuvwdHeHP8+jAZk7F2TsrWbt+ixh qE0WkNU48Nu/FOUnGSJ1shzZLdPud3HSsh8Aojh8HILnlOwKCJtxPMfSK28u2WkDw1a1tV7+Mo02+ X1ptIlk/qVywS3XEkMPZyfwlVEnetAp3HX/ItUruZit63R067HeHkahrW43rQ0hje0JlXNzxhd/Va mnMGhr6F52czgG6vfPUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ofjHO-009y0X-9O; Tue, 04 Oct 2022 14:52:18 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ofjH5-009xze-5k for linux-arm-kernel@lists.infradead.org; Tue, 04 Oct 2022 14:52:00 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 601291063; Tue, 4 Oct 2022 07:52:04 -0700 (PDT) Received: from donnerap.arm.com (donnerap.cambridge.arm.com [10.1.197.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EBA5B3F792; Tue, 4 Oct 2022 07:51:56 -0700 (PDT) From: Andre Przywara To: Mark Rutland Cc: Mark Brown , linux-arm-kernel@lists.infradead.org Subject: [boot-wrapper PATCH] sme: Fix sign-extension bug in SMCR_EL3 write Date: Tue, 4 Oct 2022 15:51:52 +0100 Message-Id: <20221004145152.3020464-1-andre.przywara@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221004_075159_282408_FCF0257F X-CRM114-Status: GOOD ( 10.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org To enable the full AArch64 ISA support in streaming SVE mode, we need to set bit 31 in the SMCR_EL3 system register. However ORing (1 << 31) into an unsigned long variable will lead to all upper 32 bits becoming 1, which is not what we want. We are just saved by those bits being RES0, at least for now. Explicitly use an unsigned base for the shift, to avoid the sign extension. Signed-off-by: Andre Przywara --- arch/aarch64/include/asm/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/aarch64/include/asm/cpu.h b/arch/aarch64/include/asm/cpu.h index d063948..0c400cc 100644 --- a/arch/aarch64/include/asm/cpu.h +++ b/arch/aarch64/include/asm/cpu.h @@ -117,7 +117,7 @@ #define ZCR_EL3_LEN_MAX 0xf #define SMCR_EL3 s3_6_c1_c2_6 -#define SMCR_EL3_FA64 (1 << 31) +#define SMCR_EL3_FA64 (1U << 31) #define SMCR_EL3_LEN_MAX 0xf #define ID_AA64ISAR2_EL1 s3_0_c0_c6_2 -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel