Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2615395imm; Sun, 24 Jun 2018 00:16:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLF7YFuof7MMeJq7LIROpuGjy+ajnIvNDhHPfaoCB894QGHc7EdZu9U30il7c7ZCxQQWCfA X-Received: by 2002:a63:ad08:: with SMTP id g8-v6mr6537560pgf.74.1529824563083; Sun, 24 Jun 2018 00:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529824563; cv=none; d=google.com; s=arc-20160816; b=nZWEFvzEGYCrQLy+E2TJoAZI74Ju9Rvn0Ect90Go9H5lG71EwlgTSgxyQ0CNzL4cJr FBhIGPipLuOfJ3SySXkbvYvBt2k+5ACiSVT1R5tlXPE51LQvqIGiQjt/E42kuSn8H2Yu UJVkJ6H91YPcYyTCKZ0KZJ96FOaOcUbysuYRTEzcpB1oyKvinco7a3brIlgw5cwi/qrA umvYt5WC+iGTA2+lSWo8Z4V2iZWIfEJf6mekymPUDgYKu0wDf04uJBJZkAdq4a2pdVJw 5YJ/csPkp4wv471HEIN3PZMFtG4SkQ0Um4dwd6DVLKaPIKbyk3Lr3AXxL3wJWXakNJgo n/Ow== 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:arc-authentication-results; bh=NJQG1XmEjzjlWJG8Q2YEv5a9r2hgwOWk3cmc0jQR67E=; b=rD6Cz3r3nUYOZ8W88pBGYKxd5GqxuCBXz7AD/RBQ/yq+a9BEN6Eh6+vMQTbZQCP00v ikmBxxHs9lzCXGx9v52NEtvtz1QwSSgwyqRbdCJqNtAtsgTZzY3TJRNB2KLSrcQLZMKC xzaLBaLynzf8POpJcsC1zf8qMCc6WnSp8kSX6ZK5S9kWWE3rDvJLaQRzs4rwuLowGYmI do27lKfCdKmzeAffrlspphxzMMwgQjPdnDmpFRJOKWQ/4Fy873NwKcvh8CibpSGthEEe 7BXJu/Xv8bPw7gUsG5D7OQxFCqeoVCx4fJn39ILn54hLDQZwBIb5f0xt9kf2p7b/NkM3 6lNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=cQ04Bd70; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 134-v6si9633129pgc.116.2018.06.24.00.15.48; Sun, 24 Jun 2018 00:16:03 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=cQ04Bd70; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751888AbeFXHNs (ORCPT + 99 others); Sun, 24 Jun 2018 03:13:48 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:37874 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751689AbeFXHNr (ORCPT ); Sun, 24 Jun 2018 03:13:47 -0400 Received: by mail-wm0-f67.google.com with SMTP id r125-v6so6651004wmg.2 for ; Sun, 24 Jun 2018 00:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=NJQG1XmEjzjlWJG8Q2YEv5a9r2hgwOWk3cmc0jQR67E=; b=cQ04Bd7035uPL+Q0XM7jyXaMXuB56aPZcrz4u9rnlejNii9zw1/ioxPbnwwn5thKTK qvLMVmISbqzrk64vlMywsJ8cxwmaSunw411xPIeTYRyAfGPR4S7oO39xRoCEiu7z8PGA j5szpCYiGVzA1q2RDfik+OT6RS4lIKtiVH+rKdXV7RlqmfsKCBOLN2jHUA0qCFKeC7ou OdgRiGGJTA9DYQCX4m4D07DmzimapCSvUn1wNrxIj1NckBN4rsNHXnGjy9WUHOVh0kZn 1QYekCQUR+4pbi1IdUi/wPSIqoepy8XSDxzcQXNnuj7qGBHmeSX07kr+JWVNamaf1A6I piRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=NJQG1XmEjzjlWJG8Q2YEv5a9r2hgwOWk3cmc0jQR67E=; b=VoCKl1Q737ofx9zzCmBlDdxwJhboxzvjpIkQBN9AE3pwd4YOSBjzpx67d2KZCdkQj6 4qyh1UW2nL4weUbUv6U6KP43MIChhll1E7/gwMofFqQV4klqzsR5qdTnCdMyd9QP50rs vUduSq9uuuLwc4y+2vdC4jwvXSzg8fKEAa0lLuzeo88klNvX7+i/ptQh0Voz8lSTu+3s tK3hRc8XZB0gmKkLGZm82++D42sFOysR2BLtvzn8+cdq6fHGlXTkasXeHIHVt50+YNjQ k3AbsuFOgBJw8sKib+RXQyCYbj9b7YvvEAMMjyglckePFdGQKzXf69pBFN5LG1oLt4oW vsDw== X-Gm-Message-State: APt69E1Mt8IccESlpXXw2+uFxR374eFEhDIXww8Ni8rOi0PzMVXaNCaa v+vWWY++AjbFCAGtFVzbM/Q= X-Received: by 2002:a1c:8fd5:: with SMTP id r204-v6mr6488499wmd.77.1529824426256; Sun, 24 Jun 2018 00:13:46 -0700 (PDT) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id m10-v6sm15237225wrq.56.2018.06.24.00.13.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 24 Jun 2018 00:13:45 -0700 (PDT) Date: Sun, 24 Jun 2018 09:13:43 +0200 From: Ingo Molnar To: Baoquan He Cc: linux-kernel@vger.kernel.org, lcapitulino@redhat.com, keescook@chromium.org, tglx@linutronix.de, x86@kernel.org, hpa@zytor.com, fanc.fnst@cn.fujitsu.com, yasu.isimatu@gmail.com, indou.takao@jp.fujitsu.com, douly.fnst@cn.fujitsu.com Subject: Re: [PATCH 1/2] x86/boot/KASLR: Add two functions for 1GB huge pages handling Message-ID: <20180624071343.GC29407@gmail.com> References: <20180516100532.14083-1-bhe@redhat.com> <20180516100532.14083-2-bhe@redhat.com> <20180621150111.GA23607@gmail.com> <20180622121445.GP29979@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180622121445.GP29979@MiWiFi-R3L-srv> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Baoquan He wrote: > On 06/21/18 at 05:01pm, Ingo Molnar wrote: > > > > * Baoquan He wrote: > > > > > +/* Store the number of 1GB huge pages which user specified.*/ > > > +static unsigned long max_gb_huge_pages; > > > + > > > +static int parse_gb_huge_pages(char *param, char* val) > > > +{ > > > + char *p; > > > + u64 mem_size; > > > + static bool gbpage_sz = false; > > > + > > > + if (!strcmp(param, "hugepagesz")) { > > > + p = val; > > > + mem_size = memparse(p, &p); > > > + if (mem_size == PUD_SIZE) { > > > + if (gbpage_sz) > > > + warn("Repeadly set hugeTLB page size of 1G!\n"); > > > + gbpage_sz = true; > > > + } else > > > + gbpage_sz = false; > > > + } else if (!strcmp(param, "hugepages") && gbpage_sz) { > > > + p = val; > > > + max_gb_huge_pages = simple_strtoull(p, &p, 0); > > > + debug_putaddr(max_gb_huge_pages); > > > + } > > > +} > > > > This function has at least one style problem and one typo. > > > > Also, we don't put statics in the middle of function variable blocks. > > > > Sorry, I will check all of them carefully and repost according to your > comments. Thanks! Ingo