From mboxrd@z Thu Jan 1 00:00:00 1970 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 4B2DDC4828F for ; Thu, 8 Feb 2024 12:14:13 +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:In-Reply-To:MIME-Version:References: 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=bE9oys6DXYen9UhZTtnSX6KDAKScc0VazpRmBBEYEPU=; b=kh07v+LNiXQz3b MbECLi3I87GP8Yd+CuLW3rfn4BF5PNviizeIeGqSDlV2XiAlMhEgJTYurNzlfZlTCDLhQ1oZjYYRL Sc1ZECJG6qHHI51my6baef1wX8JXaU6o80eXh/NCBZM9q8EG+W3TbuIYS5ln7qIEXPIEiX+9xnLu0 qdlGmdSyikssNJTbsKMuHxXd9JYPza8lBYL/u2A8qgIfpGjJ621m5TUcENCMdo01F7iFLXAzufJgS HF/3bRvfkMS+gbjEHYY3dn7SEoGbAnOq9xYwW0yXb8+U/bK/HGzLcSx0JPdw04/9eRm7q41uFf8/K ud5xtrXIXfsXm1YKUfcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY3I4-0000000DgHY-0KF8; Thu, 08 Feb 2024 12:14:04 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY3I1-0000000DgFy-1ndJ for linux-arm-kernel@lists.infradead.org; Thu, 08 Feb 2024 12:14:02 +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 168791FB; Thu, 8 Feb 2024 04:14:40 -0800 (PST) Received: from arm.com (RQ4T19M611.cambridge.arm.com [10.1.31.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8CD193F5A1; Thu, 8 Feb 2024 04:13:56 -0800 (PST) Date: Thu, 8 Feb 2024 12:13:54 +0000 From: Catalin Marinas To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, Will Deacon , Mark Rutland , Suzuki K Poulose , Ard Biesheuvel , James Morse , Oliver Upton , Zenghui Yu Subject: Re: [PATCH v4 02/10] arm64: cpufeatures: Correctly handle signed values Message-ID: References: <20240122181344.258974-1-maz@kernel.org> <20240122181344.258974-3-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240122181344.258974-3-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240208_041401_537417_602AB8A3 X-CRM114-Status: GOOD ( 15.37 ) 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 Mon, Jan 22, 2024 at 06:13:36PM +0000, Marc Zyngier wrote: > Although we've had signed values for some features such as PMUv3 > and FP, the code that handles the comparaison with some limit > has a couple of annoying issues: > > - the min_field_value is always unsigned, meaning that we cannot > easily compare it with a negative value > > - it is not possible to have a range of values, let alone a range > of negative values > > Fix this by: > > - adding an upper limit to the comparison, defaulting to all bits > being set to the maximum positive value > > - ensuring that the signess of the min and max values are taken into > account > > A ARM64_CPUID_FIELDS_NEG() macro is provided for signed features, but > nothing is using it yet. > > Signed-off-by: Marc Zyngier Reviewed-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel