Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp855971ybl; Fri, 6 Dec 2019 07:19:55 -0800 (PST) X-Google-Smtp-Source: APXvYqyXc0jg3xtdvgrLIySE+5czjhMxNkB4xax1rmlXKOljFMOY8NNsEu61QvRi8p34vllK8Hjo X-Received: by 2002:aca:da06:: with SMTP id r6mr6707950oig.82.1575645595800; Fri, 06 Dec 2019 07:19:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575645595; cv=none; d=google.com; s=arc-20160816; b=t4dFRXowQ1zvwnZ8OICumU/L2Es8TR22G6L0v8yHVqojL7erar1rlHasprMezcm+wG E4fVxb2uXydDJ79xFQLUKVmou/3Yb/SfY1IwdpNU8JMJdkihS0bMRoPLigku7JrKT+2V 5ODzLJDjN6v2Dr9B+zwC/4QRi7d7l5w613B2KTkv1K+MYz+zEE+HS4XrlfpyFfe6ZqyU YZzhJNkmkg1Y/A1GwLjEbRIr4r8mN4/mp3l2s26rcZc+hWjr9t383U528S4LQoipWnAc ZfX53D11a5vHdwxQDywejuGQJbesAhMe5fSqCfklabaSWcqd0eQaUOy5+iLklVYIOrhL iMIQ== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=6wZeYmwl/YXx/GXyGvgJM6YWiEkEWNw1TRB/m4JK2Mo=; b=iXHdVCHhIA9KFvlQxkkqZKi1TvXq5TyMpQrrwQSHDjrfzDiHzgwx2Zl680DMZ1g/p7 EQcwATNl+2jWYVe9d8hEUmaj6Ov0l8ReEMGp/oQyFiYz9XPoWdbf6CaDtIMaqyai9eWi z0RGvgngXwJi/aX8xQU0WYThatWqhM/xiHJ1Dqg0le7BGV4TOkCP6WbszDxK6NJaJkp/ KGRCL2UbAYoLO40Xap+DEv8rYVW+Pg+w9+JW9XNhaF2vK2iGMWbaBJo6OdeCYD3TgI3j 6ETL9/BXCmwCS+MY/6AKajemPIOg5VuApqw5b6iaz7DiyMTP+4WhjG19DFp7LGu0PuBI JK0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iAS0ndSZ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d13si7084788otp.196.2019.12.06.07.19.42; Fri, 06 Dec 2019 07:19: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=pass header.i=@gmail.com header.s=20161025 header.b=iAS0ndSZ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726404AbfLFPR4 (ORCPT + 99 others); Fri, 6 Dec 2019 10:17:56 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:42675 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726268AbfLFPR4 (ORCPT ); Fri, 6 Dec 2019 10:17:56 -0500 Received: by mail-wr1-f66.google.com with SMTP id a15so8133195wrf.9 for ; Fri, 06 Dec 2019 07:17:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6wZeYmwl/YXx/GXyGvgJM6YWiEkEWNw1TRB/m4JK2Mo=; b=iAS0ndSZ4+L7Yw0ilQ4vuMWKIlFL9Qowv0BJ8daD8ZwPeyFRl8pT5AlYH01+oAvK54 JXsUAVYKh2EZlQby55NWapr2AXx8FvBl/g5UbdSlVtrRzMIOaKKYUNe3GKEv5PYXKAJJ JouAwi8otTBJgZZA5/IIwwZ8fivE7ve70GTH+1dUBod8FFe8Cc2zeRTQVUGlDrTzjQlH FxGkWNnFPKN1wegAEifsurvD8B0hIsLax2RMIJWC9rIxo+kUmcho8slLD9esEW8n9Qnk hyhAdipsLvSRRWWoRJ/9612misRRgQSqgJPi5VDZuiMLObgBZdKam4Qm5/S5JYgw6m4g eNyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=6wZeYmwl/YXx/GXyGvgJM6YWiEkEWNw1TRB/m4JK2Mo=; b=J2lLio1vFQQubMj6CSN+1ZNou0YzzndaS7LUSzwnpWsYcq7h3x8YCjBFc1f5bm0B6k qY+vyT1XwtCSDeA9gb5ikvfvpJNw88rrZz9+YU6e8znbW8mIR61PTWyK5N6HeLSTGJ4u WkfeVWEIiKXXAXeCl96qRTcIi+OUDTU4jDff4sy0NfbQHTpYqHLVK6s1ZMR1rlb1LPD9 CHfLhS5mvkpuE2BAIGXhbqfbS5sGi5UD8J5dAFf1EsRNhG3+m2teLkDkQ3gwpYtl08Tb DWpvLnvHlNuX7WkzuOaY+TL6j3lCaCn7OC3t/muhz5jTirfW80+vitkRnNGEey1cKwKz 5sSw== X-Gm-Message-State: APjAAAV1X/7JjOpy++cGAAWnDCnsUlsq2tyxaEEz3AejLRd0H9G1jw0g uAm7DvooXfilgGV88e7y7IQ= X-Received: by 2002:a5d:6390:: with SMTP id p16mr16862837wru.170.1575645474304; Fri, 06 Dec 2019 07:17:54 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 5sm16932021wrh.5.2019.12.06.07.17.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Dec 2019 07:17:53 -0800 (PST) Date: Fri, 6 Dec 2019 15:17:52 +0000 From: Wei Yang To: Peter Zijlstra Cc: Wei Yang , 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: <20191206151752.phfiyls3govuqeja@master> Reply-To: Wei Yang 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> <20191206102746.GD2844@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191206102746.GD2844@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20170113 (1.7.2) 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 11:27:46AM +0100, Peter Zijlstra wrote: >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. Never mind. I always do the same thing :-( -- Wei Yang Help you, Help me