Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1996928rwi; Tue, 1 Nov 2022 02:30:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6UxSxVG4SnV/+aL80c52giDkZTqKlHntOlEPbXPiYQDdafzPDRCSx/ipriDMZ/ePzI6JjE X-Received: by 2002:a05:6a00:b47:b0:56d:5266:464c with SMTP id p7-20020a056a000b4700b0056d5266464cmr11898354pfo.2.1667295024568; Tue, 01 Nov 2022 02:30:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667295024; cv=none; d=google.com; s=arc-20160816; b=StnzArcvjfA7EKtUhI5NMeLA4XX5PUJnTpHPxolB3pz3mW/Ogd/MSkxylcQ0E8U6VC 2R3wD4E5twIMGmjQWOSoXk0FIseeuKaJCFarS1m10Wll49ERa1QIuEhUH4cEMjqFKtbW saCHiwjZlK34NWAYOe0W9W5U3QtipwTq0BCR7IWG1hnf5bOUEcGIq6T0Jfz2AzQE9HEU i+Zy8mkuRpj7rTt5oGVqlxCyd8Jd26q60mDeUdnAxsBl1RyXlH8nMOXUdJ2WWYWunWem 40ZdxW2om/MMNHqg7SbTfaS23/ALhALrOrSAhNn8lmpXkRvSM0I/eHzqPnJNCl9QTu8v HjVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zXeGwp8ffm4fwtJKkuEFRw81OnMm8Zqcq3z8cr7odGw=; b=SdEVaHsq4gUP6nYNEklmU2vrsQHWuGQPlql6T71+sAU+pTZgpC8v6b/CycdPYlVjw0 luz+uXHRoHFaa+r9E0vZEvwYhMGEdNjdj0OUs9hnsCfKQ2MjcQOjMQ4CeM1kYQkrtr7I XxZ6NCkGy8btxMRZotS3pZNzJZ8ve477AU9dFpm6wHwWIKer4GLvlajb0JNgW7VqzUmn QiASHZOHZ+1ACnRTkfchZYSD8J4Uk2GMpI+bRs1IsagNnLkxOzjQsbX2Ym0QDyoyjgDg ACjunJ11XhvVY5koIL8iM77FkuwpSybTbwUjCrrbgG83JoyktdDiAIoGEu2WixyzmQ0s s2Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=P1bFpQlL; 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 o19-20020a635a13000000b0046f7941b7besi13034004pgb.112.2022.11.01.02.30.12; Tue, 01 Nov 2022 02:30:24 -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=@infradead.org header.s=casper.20170209 header.b=P1bFpQlL; 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 S229452AbiKAIsw (ORCPT + 97 others); Tue, 1 Nov 2022 04:48:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229650AbiKAIsu (ORCPT ); Tue, 1 Nov 2022 04:48:50 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76C57186F6 for ; Tue, 1 Nov 2022 01:48:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=zXeGwp8ffm4fwtJKkuEFRw81OnMm8Zqcq3z8cr7odGw=; b=P1bFpQlLYaQecQtsoqX+D6PWBL WMPNEuxeDmJ5FT2QVOkfOuw2ZRXtMijRPV23I+B4H11S/1kzKpeDcNCJeFS3ODtmMweRL+HEs748u EMuW+F0Do5l6WweYGDATlKpdI0qK4jq8+8q7g7Y/QjVYL57QWX8HvmtqewICpydh9wREbIum521YP 6k4976yEpsDnKgIINrLXO/S6epfh/QCW9BNB7vOPc5yT2mVm2WS0M+ZPcXwsAHN6tOAdQIsCYL7pL s4SQtvTwP92qHRxsFI8slreOCWDwciP5wzfpKV5wlArNnxG//sFWTj9KDyxU1UpaPSOFa8Z4SyW45 EPV3qoFw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1opmwM-004SVP-SV; Tue, 01 Nov 2022 08:48:11 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id E24A3300282; Tue, 1 Nov 2022 09:48:03 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D1A2C2010F55F; Tue, 1 Nov 2022 09:48:03 +0100 (CET) Date: Tue, 1 Nov 2022 09:48:03 +0100 From: Peter Zijlstra To: Gaosheng Cui Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, puwen@hygon.cn, TonyWWang-oc@zhaoxin.com, Jason@zx2c4.com, hca@linux.ibm.com, mika.westerberg@linux.intel.com, mario.limonciello@amd.com, tony.luck@intel.com, andrew.cooper3@citrix.com, pawan.kumar.gupta@linux.intel.com, rdunlap@infradead.org, jithu.joseph@intel.com, chenyi.qiang@intel.com, rafael.j.wysocki@intel.com, paulmck@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/cpu: replacing the open-coded shift with BIT(x) Message-ID: References: <20221101060945.722565-1-cuigaosheng1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221101060945.722565-1-cuigaosheng1@huawei.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 01, 2022 at 02:09:45PM +0800, Gaosheng Cui wrote: > Replace the open-coded shift with BIT(x) for x86_power to make the > code a bit more self-documenting, and we will get a UBSAN issue in > arch/x86/kernel/cpu/proc.c, fix it. > > The UBSAN warning calltrace like below: > > UBSAN: shift-out-of-bounds in arch/x86/kernel/cpu/proc.c:138:25 > left shift of 1 by 31 places cannot be represented in type 'int' Same as to the other case; UBSAN is broken garbage, stop quoting it.