Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3269017imj; Tue, 19 Feb 2019 00:01:43 -0800 (PST) X-Google-Smtp-Source: AHgI3IbpFy4A/2WRsVXz5jlWsVl0d4quZy4542na6KtsF1hze+nmCWuEkpfWXnwuM9PAd0GOLmxX X-Received: by 2002:a17:902:82cc:: with SMTP id u12mr9728112plz.189.1550563303146; Tue, 19 Feb 2019 00:01:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550563303; cv=none; d=google.com; s=arc-20160816; b=gGFbUuT2AHLYbtXH1yBC47G8hUb8VH4cENwKQ1KoyVs8Ab8cQOoGM7yJiiNveT+cuc k6Vv0lV2AeXfH8rtjw8P9Fqmdh4u5CWQaCsCt6C5oODjs7MH4nFcnxGrN2yWOlcxmUlk oMcGnCRUYWR4teR0GAsQdoHDQUt4RjTLRJDX/qpdQWTxa/yEmFDwMJk9Mj9x/G/PB7K4 Jie+uC+jLAIM2TUzMOK1U1grol9IDBWIGTw954A+P6Quo8jxwZyQCyBBUFy4reBu0Lo6 13MFG/zbJn7p4icjjIh6q25kv6Sbgzcsx5M/BEfORTE317kNP6tLO5mLsyHxa9rofugE 2CGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=l2XYKbQq4bQ8lpqIwfZ6bYklGSI1OQMVNBfCHUZOBsY=; b=M78huCpA/p89zYDc1a+NDw/eYc9hubdP2cYgP/jhKbZ6GF41yAaegupRcYk3Qzk5PK fbm93NxSCTgsCbpUI0/Dslb2ttaeQ57SapjuhQDlFRDahqmOU4iVIk+ndAxCN/Zzr0gH cOpYxuoWiXewnYRV2ZEkcflJIGz1yKp2KtuYjKLbvE62gslb0qM7YO4hgUaUOF3aQXVz SWMdNn3+55bcxEBkGUeN2FeIf3R39KBPsn/S8j5KuUbQ8BLggY4AsfFpnXdncuQRn+t6 kENJXHH6jX5NsBo7Dixx2/cxEBPRJ0dcz1QGSCNVTRVU4wvlWzVg/ayruF4otIY5xd7N yCfg== 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 r63si8296879plb.148.2019.02.19.00.01.27; Tue, 19 Feb 2019 00:01:43 -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 S1726763AbfBSIBH (ORCPT + 99 others); Tue, 19 Feb 2019 03:01:07 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:39195 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725768AbfBSIBG (ORCPT ); Tue, 19 Feb 2019 03:01:06 -0500 Received: by mail-it1-f193.google.com with SMTP id l15so4109190iti.4 for ; Tue, 19 Feb 2019 00:01:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=l2XYKbQq4bQ8lpqIwfZ6bYklGSI1OQMVNBfCHUZOBsY=; b=JxFGTI02/hlqmSt2o10yYCHCxNlDjFqW7HepaXH0bRbz61DFdTRl0QuB313v4PQW2L evj3SkbArRUsFUyhpEoAlWrl8D5944gunpF3IFo0nBubusUGc2ZGqXdlg8yE8AKMweLb +7R5xwHcGdvCSxLI8ASPanCS6vJo7X0u4+yY8EDHVzae3F4B9OYMeSlCXGqEp9KkU2KA PgAMnGybNyPb2AIBA+nPZpR7J7gizdPoogBW/gDR3nc2aX2WXyJlas2igYIuSZw+2LSf a3UAkUFLOjHABLV6XrYFOHRSXTkcQ2en29JWoDaDVyeGGXYYIlL3lfC6WmTaU1CxMM5A wvEA== X-Gm-Message-State: AHQUAuZgCP0/n78dVtnXviCTKGxorh1SCTZEgmEo1p4VmZugP7UQTmAp ypoeXGupFAxzQ3E3INXQ1aVNKFgBkBD1QFg1Lswutw== X-Received: by 2002:a24:9795:: with SMTP id k143mr1625034ite.147.1550563265399; Tue, 19 Feb 2019 00:01:05 -0800 (PST) MIME-Version: 1.0 References: <20190102105408.7124-1-kasong@redhat.com> <20190123141432.GA19177@MiWiFi-R3L-srv> <20190124021744.GB19177@MiWiFi-R3L-srv> In-Reply-To: <20190124021744.GB19177@MiWiFi-R3L-srv> From: Kairui Song Date: Tue, 19 Feb 2019 16:00:54 +0800 Message-ID: Subject: Re: [PATCH v2] x86/gart/kcore: Exclude GART aperture from kcore To: Baoquan He Cc: Linux Kernel Mailing List , Thomas Gleixner , Borislav Petkov , Ingo Molnar , "H. Peter Anvin" , jbohac@suse.cz, Alexey Dobriyan , Andrew Morton , osandov@fb.com, Bhupesh Sharma , Dave Young Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 24, 2019 at 10:17 AM Baoquan He wrote: > > On 01/23/19 at 10:50pm, Kairui Song wrote: > > > > int fix_aperture __initdata = 1; > > > > > > > > -#ifdef CONFIG_PROC_VMCORE > > > > +#if defined(CONFIG_PROC_VMCORE) || defined(CONFIG_PROC_KCORE) > > > > /* > > > > * If the first kernel maps the aperture over e820 RAM, the kdump kernel will > > > > * use the same range because it will remain configured in the northbridge. > > > > @@ -66,7 +67,7 @@ int fix_aperture __initdata = 1; > > > > */ > > > > static unsigned long aperture_pfn_start, aperture_page_count; > > > > > > > > -static int gart_oldmem_pfn_is_ram(unsigned long pfn) > > > > +static int gart_mem_pfn_is_ram(unsigned long pfn) > > > > { > > > > return likely((pfn < aperture_pfn_start) || > > > > (pfn >= aperture_pfn_start + aperture_page_count)); > > > > @@ -76,7 +77,12 @@ static void exclude_from_vmcore(u64 aper_base, u32 aper_order) > > > > > > Shouldn't this function name be changed? It's not only handling vmcore > > > stuff any more, but also kcore. And this function is not excluding, but > > > resgistering. > > > > > > Other than this, it looks good to me. > > > > > > Thanks > > > Baoquan > > > > > > > Good suggestion, it's good to change this function name too to avoid > > any misleading. This patch hasn't got any other reviews recently, I'll > > update it shortly. > > There's more. > > These two are doing the same thing: > register_mem_pfn_is_ram > register_oldmem_pfn_is_ram > > Need remove one of them and put it in a right place. Furthermore, may > need see if there's existing function which is used to register a > function to a hook. > > Secondly, exclude_from_vmcore() is not excluding anthing, it's only > registering a function which is used to judge if oldmem/pfn is ram. Need > rename it. > > Thanks > Baoquan Thanks a lot for the review! I've sent V3, using a different approach. It's true repeating the hook infrastructure cause duplication, but I see vmcore/kcore didn't share much code, so instead of sharing a common hook infrastructure / registering entry, I used a new kcore memory mapping list enum type to fix it, it also introduced less code. Please have a look at V3, let me know how you think about it, thanks! -- Best Regards, Kairui Song