Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2982950imm; Mon, 16 Jul 2018 18:52:18 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfsJyu7OiczYachERmIiza+dVpXT1Kn6EkaO+oQX90qtf2K4bCzp8nxnYixQoARbudeZE5L X-Received: by 2002:a63:62c4:: with SMTP id w187-v6mr17474144pgb.55.1531792338246; Mon, 16 Jul 2018 18:52:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531792338; cv=none; d=google.com; s=arc-20160816; b=0BuJjK4Pq10VwU4vFf1vD9xu6HwHtITYx5w0019tHi2XWZvAnJlVLTnWboi01PEYQ9 eA9IbmQbd41bZicWQW8UFj0Bq7Kwyz+tjXIwrg7cLqbQZ8U5bAJoqeMbVfdA+lTrsJC0 3Kv/XaMHFNjxKnnzL7uyskm9xXofU69eOd3SRL1DIWReirsU/BBt6EQkjDgde/4sGVop U8Tc/lkzkqTSTcnW3FlIw3JtZXsugBah6TPlDz7eUlPTgDMuiWDJ5poEZR58/yB2pAZm eGU1RBQgvq0fEwnMyJonHd43NpNpMTWp0WpM5C/XotfeNpyBcWrXajK0C2C5yaiZ7Sjx Xffg== 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:arc-authentication-results; bh=w5ySpYxhEwiRxVDXYcEywMz8M4eGoJdKNWqRZbrPXQo=; b=V1FDWw6YSG51FCUTppDs1WU3jFlO6HJKhtYPT8Ep/DqIxd0yhKX2syAjsqEYGsRqVS 2ndjXAKB2NfhSVbltaVIHREVsybhLplDMNbgiF30ZG2k0ZYpTXtzCc1Tw2SVsmX1VfIT jeBdX2QOjDsozTcYXIRItyST11VC10geRQioCa73/vMmnkCChJEI2qyt8EJ5l+QsTD/X SYlQWq6Ne54pnmXbdl2JMayYz0H8GOpL2jyqmAB1Ljc7VX3ea43yx6fMm1B64yN217/m UGpEgWeoGkzErWYU7C60+kYaDR2eqxXip6Jk1Z+7f64Sjg0nXXVLtu1LYnsC8ztTYixh YmEQ== ARC-Authentication-Results: i=1; mx.google.com; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j24-v6si19373187pfn.363.2018.07.16.18.52.03; Mon, 16 Jul 2018 18:52:18 -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; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730890AbeGQCVc (ORCPT + 99 others); Mon, 16 Jul 2018 22:21:32 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59408 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730056AbeGQCVc (ORCPT ); Mon, 16 Jul 2018 22:21:32 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B19481A4EB9; Tue, 17 Jul 2018 01:51:25 +0000 (UTC) Received: from localhost (ovpn-8-16.pek2.redhat.com [10.72.8.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 66DB52026D65; Tue, 17 Jul 2018 01:51:23 +0000 (UTC) Date: Tue, 17 Jul 2018 09:51:20 +0800 From: Baoquan He To: Michal Hocko Cc: Chao Fan , Dou Liyang , akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, x86@kernel.org, yasu.isimatu@gmail.com, keescook@chromium.org, indou.takao@jp.fujitsu.com, caoj.fnst@cn.fujitsu.com, vbabka@suse.cz, mgorman@techsingularity.net Subject: Re: Bug report about KASLR and ZONE_MOVABLE Message-ID: <20180717015120.GC1724@MiWiFi-R3L-srv> References: <20180711104158.GE2070@MiWiFi-R3L-srv> <20180711104944.GG1969@MiWiFi-R3L-srv> <20180711124008.GF2070@MiWiFi-R3L-srv> <72721138-ba6a-32c9-3489-f2060f40a4c9@cn.fujitsu.com> <20180712060115.GD6742@localhost.localdomain> <20180712123228.GK32648@dhcp22.suse.cz> <20180712235240.GH2070@MiWiFi-R3L-srv> <20180716113845.GM17280@dhcp22.suse.cz> <20180716130202.GB1724@MiWiFi-R3L-srv> <20180716152410.GU17280@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180716152410.GU17280@dhcp22.suse.cz> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 17 Jul 2018 01:51:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 17 Jul 2018 01:51:25 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'bhe@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/16/18 at 05:24pm, Michal Hocko wrote: > On Mon 16-07-18 21:02:02, Baoquan He wrote: > > On 07/16/18 at 01:38pm, Michal Hocko wrote: > > > On Fri 13-07-18 07:52:40, Baoquan He wrote: > > > > Hi Michal, > > > > > > > > On 07/12/18 at 02:32pm, Michal Hocko wrote: > > > [...] > > > > > I am not able to find the beginning of the email thread right now. Could > > > > > you summarize what is the actual problem please? > > > > > > > > The bug is found on x86 now. > > > > > > > > When added "kernelcore=" or "movablecore=" into kernel command line, > > > > kernel memory is spread evenly among nodes. However, this is right when > > > > KASLR is not enabled, then kernel will be at 16M of place in x86 arch. > > > > If KASLR enabled, it could be put any place from 16M to 64T randomly. > > > > > > > > Consider a scenario, we have 10 nodes, and each node has 20G memory, and > > > > we specify "kernelcore=50%", means each node will take 10G for > > > > kernelcore, 10G for movable area. But this doesn't take kernel position > > > > into consideration. E.g if kernel is put at 15G of 2nd node, namely > > > > node1. Then we think on node1 there's 10G for kernelcore, 10G for > > > > movable, in fact there's only 5G available for movable, just after > > > > kernel. > > > > > > OK, I guess I see that part. But who is going to use movablecore along > > > with KASLR enabled? I mean do we really have to support those two > > > obscure command line parameters for KASLR? > > > > Not very sure whether we have to support both of those to work with > > KASLR. Maybe it's time to make clear of it now. > > Yes, I would really like to deprecate this. It is an ugly piece of code > and it's far from easily maintainable as well. > > > For 'kernelcore=mirror', we have solved the conflict to make it work well > > with KASLR. For 'movable_node' conflict with KASLR, Chao is posting > > patches to fix it. As for 'kernelcore=' and 'movablecore=', > > > > 1) solve the conflict between them with KASLR in > > find_zone_movable_pfns_for_nodes(); > > 2) disable KASLR when 'kernelcore=' | 'movablecore=' is set; > > 3) disable 'kernelcore=' | 'movablecore=' when KASLR is enabled; > > 4) add note in doc to notice people to not add them at the same time; > > I would simply warn that those kernel parameters are not supported > anymore. If somebody shows up with a valid usecase we can reconsider. OK, got it. The use case I can think of is that people want to check hotplug on system w/o hotplug ACPI info. I am fine with warning people they are not supported. Should I post a patch to address this, or you will do it? Both is fine to me. > > > 2) and 3) may need be fixed in arch/x86 code. As long as come to an > > agreement, any one is fine to me. > > > > > > In fact I would be much more concerned about memory hotplug and > > > pre-defined movable nodes. Does the current KASLR code work in that > > > case? > > > > As said above, kernelcore=mirror works well with KASLR now. Making > > 'movable_node' work with KASLR is in progress. > > OK, thanks for the info. You are welcome. Thanks Baoquan