Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2439900rbb; Wed, 28 Feb 2024 01:38:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXkIAfTpkSPec4rWVFzqsdqTz+t5nDn+I0AeQqUCpY8XEjTyckM73m1hDI4UgNX4xbl2+H8w+ROSt5quCQ/BWiCwBwwHQ/T//RRXt5ctg== X-Google-Smtp-Source: AGHT+IFV62jAjmB73Hi1uUbUZLK3LuaBiMBiHuORw62f9BE/DPyiTfPbUtnPewCzluDledj/6Yfc X-Received: by 2002:a05:620a:121a:b0:787:a0d2:460e with SMTP id u26-20020a05620a121a00b00787a0d2460emr5347048qkj.35.1709113086310; Wed, 28 Feb 2024 01:38:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709113086; cv=pass; d=google.com; s=arc-20160816; b=0Yoz0IJyC5ANRp/Ax4LC5Y1Ye/W/O2rJy884yCJVoqcn1IgM6N9ZEM1y+52NFhePTD mcoswRg99azCcMG1LXdmvTUSDJ7rTFoyIGsZBUpZBOQAQ74hjCmg9+2M/rvjTWY/R9/Z Z3tb6Em0MHrtEqLahykSNl2692hptrVo0gYWVnaZJ2gJGI25S+0mSmCN+N4c8ndwfWDK VjOKzmm9/+rT7ikka2GWEEnWj5MJtkSpc8Pp+87Rwx0WMQcgHPi6ZYd9NMgVyz6j4aE3 QgRQxMWolukHq7UVsqAnEL/0NUpoxM2OHRkCXFuDwrjmi4xWAfPu35k41W5AOID+onwo 1n4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=Fipvo68beIegpD+jz/4Bvn4gL8bfd7gnzD69X7g/6rM=; fh=dGKL2B6yaHElQKxiWI5c+EzPp2+9RvYgDjse2kBWPWA=; b=VfTPEIDjX9FEGa7IIvCS+Y7O3pxt4GdU7Erw4kJBWI8S548J1RuukQlBcGcIoBWCxQ FrTGttpXvkeSLvWe5fMobblb40zBP/rUUA6casAQZjmZkch9hUvSIsW/10ns2BZv+s2z Uhx8vfEHcpPgMNXxit977oFE3UT6QtHoIvFWNhEGGzf4JnLeup0wMd2VbW62N3VavciA VSjJi4IWq37aYBSJIpPX+hw9ntmXZFEmDB+tEGUPS7vzhdc2XRHLEp1csgiAPi6aNdFt n0gkkv2loBe+D1Qh3tdntGzSqnifR1xwieAjzJZePl7ikQaoeHvBXreG0Tf+SAA4Pd1u tMuA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=shingroup.cn dmarc=pass fromdomain=shingroup.cn); spf=pass (google.com: domain of linux-kernel+bounces-84778-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84778-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id wg3-20020a05620a568300b007879e6bd725si9005556qkn.638.2024.02.28.01.38.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 01:38:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84778-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=shingroup.cn dmarc=pass fromdomain=shingroup.cn); spf=pass (google.com: domain of linux-kernel+bounces-84778-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84778-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 14BF71C2146F for ; Wed, 28 Feb 2024 09:38:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5597A32C9C; Wed, 28 Feb 2024 09:37:59 +0000 (UTC) Received: from smtpbgau2.qq.com (smtpbgau2.qq.com [54.206.34.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2FF22364A0; Wed, 28 Feb 2024 09:37:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.206.34.216 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709113078; cv=none; b=NPiOqPK/sQCLmqr0cDpDVVjYl6Uzwg28pcUHMuaFQrmsYS9aSHStgWp5Q++yd28YiUvP4BpIfFbG4imXO4Hj0LAzYlEAsZtjZszXUFa3JpB7UxqBGtDMb2uPd9oRV2bu08kcHakKjDZfHuCxNSNa0gyxR//NZV+jUqvtvNomzPw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709113078; c=relaxed/simple; bh=ETYaCSTCkH/+x6alJrxspdKAkwPcQ5ZuvtIHKFHEJkk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Rzc1Xk+ZBhbuhCFYkzmOlxsbp5BtRgu1DfSRx4ogMSj70K03M1OaUjvveLYFWIo92UgLaRGgVstE7tZsYhWgILWCsZU+JhAZinyuV/9VPBe37iwjlsuUmqN3U0xi1JdNbq73seejEPmMC8H7xtKZbyVJpKuwt6uDbfSl13nvjVA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shingroup.cn; spf=pass smtp.mailfrom=shingroup.cn; arc=none smtp.client-ip=54.206.34.216 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shingroup.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shingroup.cn X-QQ-mid: bizesmtp73t1709112824t9cd232h X-QQ-Originating-IP: uiXyMgKtLbN8VY9dRXG13TTDgCSMYnB8CAd8jAB8A5w= Received: from localhost ( [112.22.30.30]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 28 Feb 2024 17:33:43 +0800 (CST) X-QQ-SSF: 01400000000000505000000A0000000 X-QQ-FEAT: /+iK7ZpVlLRnFYQIv5bPn+DA7FSTSA0wbVyC272BNntqVw2UrL9cwcKu3+z6A aVv48q8z6t+BdRrZGMo4S6UlZcH2ug2GU4lMmWcvlL3AvbatMnx+U1xVSFOrwoYKPmGP5Ha pp3A6rvbKpwF/9UzxXCOXTIK+mKmFsE8bVy9x5W1BN1swglw3hxyajbrQ9mYED7hkqbyCgo PRuyOXxsRZfn3MN6LGExtwarMGz3QrE+GoqYPzMp+uiqv5BzzPg0oAkPYS0op0TpP95TjRn 2IbRZ28bFFDbfO5b90nFT0QYI/TiDnOL6mKBVJcUrY5Mr5Hi+jIlYJ9eMQh0D/w5CGuwlNF vCg8GMr6mhOrtrGjDzFyJThHrohZAN8R0rl7zSLt/dImC6WM4n7aXX0o+gRMyc226sejq8s 9AKO3UT4kFs= X-QQ-GoodBg: 2 X-BIZMAIL-ID: 12801957611283966463 Date: Wed, 28 Feb 2024 17:33:42 +0800 From: Dawei Li To: Jiri Slaby Cc: geert@linux-m68k.org, gerg@snapgear.com, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org, set_pte_at@outlook.com, stable@vger.kernel.org Subject: Re: [PATCH] mk68k: Fix broken THREAD_SIZE_ORDER Message-ID: <673EAB52C5659E99+Zd799lrOHAVIdm3S@centos8> References: <20240228085824.74639-1-dawei.li@shingroup.cn> <754c3acb-538d-45a1-84a1-0bebd02fd945@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <754c3acb-538d-45a1-84a1-0bebd02fd945@kernel.org> X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:shingroup.cn:qybglogicsvrgz:qybglogicsvrgz5a-1 Hi Jiri, Thanks for quick review. On Wed, Feb 28, 2024 at 10:11:05AM +0100, Jiri Slaby wrote: > On 28. 02. 24, 9:58, Dawei Li wrote: > > Current THREAD_SIZE_ORDER implementation for m68k is incorrect, fix it > > by ilog2(). > > This is not a good commit log. Incorrect in what way and why is the fixed Agreed. > version correct? And what is affected? Note you're referring to a change > which was done 14 years ago. It definitely must not be that incorrect (for > everybody). It's 'right' just for current PAGE_SIZE & THREAD_SIZE configs: // arch/m68k/include/asm/thread_info.h #if PAGE_SHIFT < 13 #ifdef CONFIG_4KSTACKS #define THREAD_SIZE 4096 #else #define THREAD_SIZE 8192 #endif #else #define THREAD_SIZE PAGE_SIZE #endif #define THREAD_SIZE_ORDER ((THREAD_SIZE / PAGE_SIZE) - 1) // arch/m68k/include/asm/page.h #if defined(CONFIG_SUN3) || defined(CONFIG_COLDFIRE) #define PAGE_SHIFT 13 #else #define PAGE_SHIFT 12 #endif #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) #define PAGE_MASK (~(PAGE_SIZE-1)) #define PAGE_OFFSET (PAGE_OFFSET_RAW) But it's incorrect in generic/mathematical way. Thanks, Dawei > > > Fixes: cddafa3500fd ("m68k/m68knommu: merge MMU and non-MMU thread_info.h") > > Signed-off-by: Dawei Li > > Cc: stable@vger.kernel.org > > --- > > arch/m68k/include/asm/thread_info.h | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/arch/m68k/include/asm/thread_info.h b/arch/m68k/include/asm/thread_info.h > > index 31be2ad999ca..50faecd6fc5f 100644 > > --- a/arch/m68k/include/asm/thread_info.h > > +++ b/arch/m68k/include/asm/thread_info.h > > @@ -19,7 +19,8 @@ > > #else > > #define THREAD_SIZE PAGE_SIZE > > #endif > > -#define THREAD_SIZE_ORDER ((THREAD_SIZE / PAGE_SIZE) - 1) > > + > > +#define THREAD_SIZE_ORDER ilog2(THREAD_SIZE / PAGE_SIZE) > > #ifndef __ASSEMBLY__ > > -- > js > suse labs > >