Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2443240rwi; Tue, 1 Nov 2022 07:47:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7THBbz7XKfpC+SNByuo0A3WxckyZXyTPLjSKXnH1rZGEN+GMnTEj/+cvbJAfkh35/j3GPI X-Received: by 2002:a17:902:b70b:b0:186:b014:9609 with SMTP id d11-20020a170902b70b00b00186b0149609mr20126545pls.108.1667314020809; Tue, 01 Nov 2022 07:47:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667314020; cv=none; d=google.com; s=arc-20160816; b=pP09md3ikwjsz00wqUj8GI0I7W44a10ASKT1vaNJM5PAuhHbtxCeXNMOWUKeKEGTHL 8l5pjA+FjC+eJ1RJzhgESaPGDoEdsjQz1Kl+RMc1CvIZt5NnFluAYlmHG6WEggMcPXHV O5LHcNikipSo3SfdQtCeCFaejFYt+rjn6eNKk6AYl/EEAZeWuWGvqM00huWokzp5YpQG qUcy6ejckykPR8tEhIXjGvpMzIEng4lrQU8wc+dst9y6LC/jOll7iGcJC7gKg6fS5kd8 cUi+OdXrYrQr7s0ZIhlyiHghnUMnjCyF96cjNW0E0jcDd3SwkScCQmsAKxKCOA4wf57g xeRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=oyE6OpXjTjctthd0lu72JE84O8zhS0kja9NY3A+V1Qs=; b=vGrNSejP8n6Kj3VMWRvdwNHnFVqPUGxehZGr8nGjsKxuMz/Bml+jPD9b7yes4x7TkO oiYL8A2ue/MeS6zRSuJu2F2YGL2JJ7dVjYAjtbQIRJBzq31vy+ASZFJjP88MHI8o+Sg9 ALST0bnB4Nli32nZN6bnm5ypz4ypblCUqhgT+uYPKXxAdFOIQJk+YnbT1RvQeWeQDf8Q Pid6QGUuQX+FZIQi2m1xte9N1/htBIfQ0YD13TV1mYgqL8knpdZZ+uxiqU05YI1N3cic QfvH90ZK3v/K+apKBB2yMaZz3rgWm+XbF6w5q8XxkAc9crtrhgMNom0Fsc8Sx4RNStPY Doxg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020a170902b40500b0016efde92292si12936608plr.255.2022.11.01.07.46.43; Tue, 01 Nov 2022 07:47:00 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230163AbiKAOF3 (ORCPT + 96 others); Tue, 1 Nov 2022 10:05:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbiKAOF1 (ORCPT ); Tue, 1 Nov 2022 10:05:27 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9059C1A815 for ; Tue, 1 Nov 2022 07:05:25 -0700 (PDT) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4N1sGn0cBxzHv6r; Tue, 1 Nov 2022 22:05:05 +0800 (CST) Received: from [10.67.110.176] (10.67.110.176) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 1 Nov 2022 22:05:22 +0800 Subject: Re: [PATCH v2] x86/cpu: replacing the open-coded shift with BIT(x) To: "Jason A. Donenfeld" CC: , , , , , , , , , , , , , , , , , , , References: <20221101111418.816139-1-cuigaosheng1@huawei.com> From: cuigaosheng Message-ID: Date: Tue, 1 Nov 2022 22:05:21 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.110.176] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 Yes, maybe we can do the same thing with BIT(), so I add other modifications, should I remove them? Thanks very much! On 2022/11/1 21:43, Jason A. Donenfeld wrote: > On Tue, Nov 1, 2022 at 2:37 PM cuigaosheng wrote: >>> 215 [ 0.953146][ T0] UBSAN: shift-out-of-bounds in mm/shmem.c:3749:18 >>> 216 [ 0.953863][ T0] left shift of 1 by 31 places cannot be represented in type 'int' > Isn't this just an issue with `1 << 31` needing to be `1U << 31`? > > Jason > .