Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp560177ybl; Fri, 6 Dec 2019 02:29:55 -0800 (PST) X-Google-Smtp-Source: APXvYqwxJ3EnBsi7/TCCfqeikiBR0wONqbXCaAqLyVnGWqJek1/S+mMmggihWiOCCtQOlJWei8gf X-Received: by 2002:a9d:6d10:: with SMTP id o16mr10851568otp.28.1575628195121; Fri, 06 Dec 2019 02:29:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575628195; cv=none; d=google.com; s=arc-20160816; b=NIjndvb8WT3cbzu4Wqmv/5n4crZYqlrJdxe2Z3rPuqLItwJVssbGHihFOGnyVxRZ4p QjtdQ2QGlj+O7oGMoq4koi9yzkXxoAJ170fI7tO0ZDwA3s64OmRYuIlbRpYgl7AU1eqA CUiYLs3JmfNzJMOxu9S195hJXrn3i/hEPRn1APBgYlljx59n1F2xUyUF1j14e2kIsS1Q MP2UIzxwPsBDi5Kgwo3HetUDIDfhKekgqJDN7ayuZ3e4iI92bFpwligDXBxm+jClqCtu zkobY1jR0mgfIoF7/YOkokiHRR5u8TvhGRSlu5eE7ixKry41fTWKLvOR5vsV1ui2B5sY XvoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5+ss5VBQeK/5DXHbF5iltw+Lt6xrWEPBKgMVgHDfp7s=; b=YFa3PVFO8klmaHouQara/A7ZC+QaNPJM2G0gmSbcvqAxvHDBNkjw+yaK1eRk2UspoD tn5Alb9Pl8/ut3Fs89smtEj2nSeevWVj1Gmib6JCWC38g6Hv40llLFJtovAA8aVjIVMr zC4dPG1+VYXLRuMUA5ccylnSFWZkQL/gCLH3ICVqkyosLR+2f6bWIEMn0V49G1gJMaJq OMJu3pGqhGk/NR3HWKAGiMVw3E5zgwRCGByhKh0v5uAAsAi4ovJgAwQttIYt7lCuPiCS gmkpTQrdrfNI7GcmXBIJZPqWrIMlE/xOWH05HTqSN5guYC8FLs0y469fkHXVYDU6YHyy MvlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=OHHQFTVE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1si7247366otq.141.2019.12.06.02.29.42; Fri, 06 Dec 2019 02:29:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=OHHQFTVE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726284AbfLFK1y (ORCPT + 99 others); Fri, 6 Dec 2019 05:27:54 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:57066 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726070AbfLFK1x (ORCPT ); Fri, 6 Dec 2019 05:27:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5+ss5VBQeK/5DXHbF5iltw+Lt6xrWEPBKgMVgHDfp7s=; b=OHHQFTVEdLhOnZjFVDL+LOxMd 8R/bk6fPrbSm3BUm4w/qV6agHSqHgFU3UlXr+Vpp+/8u5xgVbeF2JHjjRl96YA5ALw5Gd7yoDeeWx cFnDTzpFUrVP+ju6SXNAiO2haqr6cMO/NE/ft5nsRROvm42pZENjBSuxumYuzpovV1vVikhlsLzZQ t7o8mPD4HrbDKY/UX4YGnrwFKhYP9Pe7bZxhctnQ4c3tV9OS7NsK3QFkGUDDrDOkgqU0dLOknzOVl F34/w8SKFLbesvioTJKh6zwGznADJk5Vj7ZdyB8hy46k9SbeKhbJNjQj3MkxE7fHZD5GE5Jfv5wPo YUuuVwwAw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1idApw-0003uO-5i; Fri, 06 Dec 2019 10:27:48 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id AF633303F45; Fri, 6 Dec 2019 11:26:28 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4ED092B26E20D; Fri, 6 Dec 2019 11:27:46 +0100 (CET) Date: Fri, 6 Dec 2019 11:27:46 +0100 From: Peter Zijlstra To: Wei Yang Cc: x86@kernel.org, linux-kernel@vger.kernel.org, richard.weiyang@gmail.com, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.or, tglx@linutronix.de Subject: Re: [Patch v2 4/6] x86/mm: Refine debug print string retrieval function Message-ID: <20191206102746.GD2844@hirez.programming.kicks-ass.net> References: <20191205021403.25606-1-richardw.yang@linux.intel.com> <20191205021403.25606-5-richardw.yang@linux.intel.com> <20191205091311.GD2810@hirez.programming.kicks-ass.net> <20191206015126.GB3846@richard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191206015126.GB3846@richard> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 06, 2019 at 09:51:26AM +0800, Wei Yang wrote: > >> +#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE) > >> + static const char *sz[2] = { "4K", "4M" }; > >> +#else > >> + static const char *sz[4] = { "4K", "2M", "1G", "" }; > >> +#endif > >> + unsigned int idx, s; > >> > >> + for (idx = 0; idx < maxidx; idx++, mr++) { > >> + s = (mr->page_size_mask >> PG_LEVEL_2M) & (ARRAY_SIZE(sz) - 1); > > > >Is it at all possible for !PAE to have 1G here, if you use the sz[4] > >definition unconditionally? > > > > You mean remove the ifdef and use sz[4] for both condition? > > Then how to differentiate 4M and 2M? Argh, I'm blind.. I failed to spot that. N/m then.