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 48900C433FE for ; Tue, 4 Oct 2022 15:07:28 +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:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lRDUybjmATP6N+Qe4gBEMfML0j4e3lPK6LFCF974uSI=; b=DKKQFWZbhhtIao KcmOxM6NH+3UvSCBHwaZWYQQd/jb4BPO1wbZg0KImUzeDuo3dxVrGwuEtWDnvNLR6NEoPtW3MeiBG 3GTSePqIe55WpM5azFvs7aJYRbTvwni5pObFl+U5nB7QhgCxcvelROLTZw/WsZMYWScxXwjOVn6hB gYlHego3VcnP4Db2diN3ltiGpN2dTEnWgByBXQJrxGKoy7MxOPgLcU9sok4XkdpppJys0/fd9cWWJ dmMpp3lANOK8b7amokSJSHTBi6vA/tVFxWJBbxqw8GiyazHTU7+XJN4+A2y21qvXWBkdaTTQyAGWG wzb/3UNI+GEQDAkh6gyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ofjV8-009zol-1e; Tue, 04 Oct 2022 15:06:30 +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 1ofjV1-009zmc-VK for linux-arm-kernel@lists.infradead.org; Tue, 04 Oct 2022 15:06:25 +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 77A21106F; Tue, 4 Oct 2022 08:06:28 -0700 (PDT) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 296B73F792; Tue, 4 Oct 2022 08:06:21 -0700 (PDT) Date: Tue, 4 Oct 2022 16:06:18 +0100 From: Andre Przywara To: Mark Rutland Cc: Mark Brown , linux-arm-kernel@lists.infradead.org Subject: Re: [boot-wrapper PATCH] sme: Fix sign-extension bug in SMCR_EL3 write Message-ID: <20221004160618.29596298@donnerap.cambridge.arm.com> In-Reply-To: References: <20221004145152.3020464-1-andre.przywara@arm.com> Organization: ARM X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221004_080624_092079_BE1C1232 X-CRM114-Status: GOOD ( 20.24 ) 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 On Tue, 4 Oct 2022 16:01:23 +0100 Mark Rutland wrote: > On Tue, Oct 04, 2022 at 03:51:52PM +0100, Andre Przywara wrote: > > 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) > > This looks good, but I'd prefer if we used BIT(31) here; that'll do the right > thing internally. > > Are you happy if I fix that up when applying? Yes, sure. Thanks for taking care! Cheers, Andre > > > #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