Received: by 10.223.185.116 with SMTP id b49csp2264716wrg; Mon, 12 Feb 2018 07:04:17 -0800 (PST) X-Google-Smtp-Source: AH8x225GIAmHvLNLtqo7dTJL4u6CXiPV2ldVPEzJCV21dhyU5fMEujJuuC++TYpM1WXZJAFOeT7K X-Received: by 2002:a17:902:5a8c:: with SMTP id r12-v6mr10739126pli.87.1518447857286; Mon, 12 Feb 2018 07:04:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518447857; cv=none; d=google.com; s=arc-20160816; b=reAsWovgPiW3sADkNASez1xtiKrTHEoBSf0lYdFDteBFUqk8DwFPNgCyzyv3qR9rHk diPC1+T6CbT8umuO1FAs6RtyN7ksXh/EYW75qRa6TcLWAPDBZuQFxOqJfrv9ZbZKZmkI csU5FXmWmBkKj3tms10T77tVJr8JuHiV3HVcuAJWRmswY+TMbLAdYICQI1237iwAyv6J XzgtpV1IJUyhp615ZJCSo/WhQaY49e6a0PGK+6jSaQOmarMRxeRrwwCWJrigLdVp3447 3PJrm1FiMcXZNgN1ACT95+gYkBf4RFPbZTfZtjgvGA0XyXrAtcm73vCFiNtkAajHzHjv ybnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=3lZvfAaDQc3r3mHlsZybIm2loaYZY8YH/nB07QeP2NI=; b=z6OO8F3O4VYl7IJ6NGFgo0COwmt2/gJp8SDpa0zDzY7MMKwug1gvaE063AhMTxVxWJ unX2FGga2o0KGD//TAr39Tm2/x+f8Y3qWfEiFfh2Iu4x4Djzl/4CaKNhhG6+JqqkrwDL NP3Trf6M7y0XP2vyeRX5khJaKSAsTfkp5snOLcr02X5jMLnhh7EhlHxAtSPLvIqOmVqR c5CYOGZ0tQgsK0Pow7Td927Ecjb4YZ7xoXBkW5k53ukJdN/IR9zLiwN8WNtJPrM4HpYx 6yqDQQWKkgx/3EVP1//STsEsyrZf9I95J9ICBXrO6tutPtYR6cnPvUkX4Lk6h8tq5jaj ABPA== 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=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b89si19156pfk.163.2018.02.12.07.04.03; Mon, 12 Feb 2018 07:04:17 -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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964841AbeBLOpX (ORCPT + 99 others); Mon, 12 Feb 2018 09:45:23 -0500 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:43792 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935941AbeBLOpQ (ORCPT ); Mon, 12 Feb 2018 09:45:16 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R551e4;CH=green;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01353;MF=zhang.jia@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0Sy3nJF7_1518446695; Received: from localhost(mailfrom:zhang.jia@linux.alibaba.com fp:106.11.233.93) by smtp.aliyun-inc.com(127.0.0.1); Mon, 12 Feb 2018 22:44:56 +0800 From: Jia Zhang To: tglx@linutronix.de, jolsa@redhat.com, mingo@redhat.com, hpa@zytor.com Cc: x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] x86/mm/64: Add vsyscall page to /proc/kcore conditionally Date: Mon, 12 Feb 2018 22:44:54 +0800 Message-Id: <1518446694-21124-3-git-send-email-zhang.jia@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518446694-21124-1-git-send-email-zhang.jia@linux.alibaba.com> References: <1518446694-21124-1-git-send-email-zhang.jia@linux.alibaba.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The vsyscall page should be visible only if vsyscall=emulate/native when dumping /proc/kcore. Signed-off-by: Jia Zhang Reviewed-by: Jiri Olsa --- arch/x86/mm/init_64.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 14cd7f8..cbd6ea4 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -1193,8 +1193,10 @@ 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); + } mem_init_print_info(NULL); } -- 1.8.3.1