Received: by 10.223.176.5 with SMTP id f5csp2297532wra; Mon, 5 Feb 2018 01:28:02 -0800 (PST) X-Google-Smtp-Source: AH8x2241elTIZR3TSdWW6hfQlrrSKT9bI8b9e+cpDVumNSc2m7fbXdBfP7MH2guL80pSREEmPg9y X-Received: by 2002:a17:902:4083:: with SMTP id c3-v6mr39182870pld.90.1517822882100; Mon, 05 Feb 2018 01:28:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517822882; cv=none; d=google.com; s=arc-20160816; b=nRjUxxDYnhUKIObcC0M7hyVjLk5OB3GQZDA72NEJvsPRO7+R9RSSKwT8+sNUwNX2cT rrn90DAD9bRcBOyveezR4vPN8/H9GTDV/CSmI8aEMf3spYDr2HdpaHQ6gPMR0KVc/L96 yARkiyGafNXPADgztHrIA3znEL8MMg9fvocXPto2hBGkBdJof4noOriwp8OjClni4I/X 4QgD5uVTEMusgMvZ8oOf/LMWhkLUZaaqqf/RSMAEP/TMFw6/aGl6GPpDl0J1JB4eX5yS 6xda0GFJ62jxXBba52vHpjqLQj70DnYi6IURMEVb5wj5RIjtjwoNkozBKmIpbb6o4cfj UDDw== 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=LSeNCrip07W7UFi2sQABN5mHdyYUCXh5HBIZZVxIeHQ=; b=dWKt+vV0k6PnaZCU+gGSaMVicInpVYpqAw0nUydmh+E8YMCQx6PWJ8r8WVjHyJh6YM fRQ5IsKX7qaqw/az+uAhDaL0b9SRHBdEJ/P5+cAtAUQoecY7ujtRN4/tyv0wxhWvVabr yG6qNMoGANIRaBVEr50YlExe3+RyQHDIFoLf9ruMLZZMKqXHivkUlIUHo85dHD3bVIb8 GwclXcOuKof8+iyLt7BUwvjri9cLUy+mdYztVhj1qNnJbYDJbYXvyv+xyCCpsGVccX2F ZGEE2xInbTwsjKbiTj0xHSYom2TjTEDNFSIFsjFQXTKtA8GE/88rMHiKErxacvrBZz6/ 8MNA== 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 v10-v6si4487911plo.820.2018.02.05.01.27.47; Mon, 05 Feb 2018 01:28:02 -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; 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 S1752745AbeBEJ0x (ORCPT + 99 others); Mon, 5 Feb 2018 04:26:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52456 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705AbeBEJ0q (ORCPT ); Mon, 5 Feb 2018 04:26:46 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C3CDC047B97; Mon, 5 Feb 2018 09:26:46 +0000 (UTC) Received: from krava (unknown [10.43.17.63]) by smtp.corp.redhat.com (Postfix) with SMTP id D3EB4605FB; Mon, 5 Feb 2018 09:26:44 +0000 (UTC) Date: Mon, 5 Feb 2018 10:26:44 +0100 From: Jiri Olsa To: Jia Zhang Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] x86/mm/64: Add vsyscall page to /proc/kcore conditionally Message-ID: <20180205092644.GA23191@krava> References: <1517294579-117473-1-git-send-email-zhang.jia@linux.alibaba.com> <1517294579-117473-2-git-send-email-zhang.jia@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1517294579-117473-2-git-send-email-zhang.jia@linux.alibaba.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 05 Feb 2018 09:26:46 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 30, 2018 at 02:42:59PM +0800, Jia Zhang wrote: > The vsyscall page should be visible only if > vsyscall=emulate/native when dumping /proc/kcore. > > Signed-off-by: Jia Zhang > --- > arch/x86/mm/init_64.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c > index dab78f6..3d4cf33 100644 > --- a/arch/x86/mm/init_64.c > +++ b/arch/x86/mm/init_64.c > @@ -1186,8 +1186,9 @@ void __init mem_init(void) > register_page_bootmem_info(); > > /* Register memory areas for /proc/kcore */ > - kclist_add(&kcore_vsyscall, (void *)VSYSCALL_ADDR, > - PAGE_SIZE, KCORE_USER); > + if (get_gate_vma(&init_mm)) > + kclist_add(&kcore_vsyscall, (void *)VSYSCALL_ADDR, > + PAGE_SIZE, KCORE_USER); nit, we use { } when there's more than 1 line code anyway the approach looks ok to me Reviewed-by: Jiri Olsa thanks, jirka