From patchwork Fri Apr 3 17:12:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 6158501 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3E795BF4A6 for ; Fri, 3 Apr 2015 17:13:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 98F64203AD for ; Fri, 3 Apr 2015 17:13:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E05D4203AC for ; Fri, 3 Apr 2015 17:13:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753555AbbDCRMl (ORCPT ); Fri, 3 Apr 2015 13:12:41 -0400 Received: from mail-ig0-f173.google.com ([209.85.213.173]:37890 "EHLO mail-ig0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753490AbbDCRMj (ORCPT ); Fri, 3 Apr 2015 13:12:39 -0400 Received: by igbqf9 with SMTP id qf9so98817310igb.1; Fri, 03 Apr 2015 10:12:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=8C+K4MJjIAO4H3OQ/9oVk1GNbQd+zU/ACbn+Lv6QcWY=; b=Iq/dwK8vmeM089iaxquq6Mt97FRamVQ3uBENX9lIs48gROMH/PMoGaalAlwLQSLDQ/ xEnp0qpqEt/FbdvviDpPAKLUN+CoybpYhFFkYAI7fBMeqQD+xLyqFUhUTLXkJo2sR8yJ zZYy0OBACoOcOALiNT5cbHaCZ1F8shUsXqAeybODcv0HTgo2fdy/tN1+Lrc5RhkeF2Qf 9JWWzU7xAzS4K+s+RNIMe+PclenKQcCa/jeky5nmIbJLXKAkRYP+X8Cpsqq2I8lrIc6n ktLw2DO9g2aswYmlZthRvwov2p8Yw0kY7GlY2smvKvbgPd2w/gllo2/eVup/Q9Js/R8o 2XIg== MIME-Version: 1.0 X-Received: by 10.50.57.12 with SMTP id e12mr6316496igq.4.1428081159155; Fri, 03 Apr 2015 10:12:39 -0700 (PDT) Received: by 10.64.208.43 with HTTP; Fri, 3 Apr 2015 10:12:39 -0700 (PDT) In-Reply-To: <1428077687.31093.120.camel@misato.fc.hp.com> References: <1427872339-6688-1-git-send-email-hch@lst.de> <1427872339-6688-2-git-send-email-hch@lst.de> <1428077687.31093.120.camel@misato.fc.hp.com> Date: Fri, 3 Apr 2015 10:12:39 -0700 X-Google-Sender-Auth: 2t33M9R5cOJ53UkH_JsPkhsdKJE Message-ID: Subject: Re: [Linux-nvdimm] [PATCH 1/2] x86: add support for the non-standard protected e820 type From: Yinghai Lu To: Toshi Kani Cc: Christoph Hellwig , linux-nvdimm@ml01.01.org, linux-fsdevel@vger.kernel.org, Linux Kernel Mailing List , "the arch/x86 maintainers" , Jens Axboe Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Apr 3, 2015 at 9:14 AM, Toshi Kani wrote: > On Wed, 2015-04-01 at 09:12 +0200, Christoph Hellwig wrote: > : >> @@ -748,7 +758,7 @@ u64 __init early_reserve_e820(u64 size, u64 align) >> /* >> * Find the highest page frame number we have available >> */ >> -static unsigned long __init e820_end_pfn(unsigned long limit_pfn, unsigned type) >> +static unsigned long __init e820_end_pfn(unsigned long limit_pfn) >> { >> int i; >> unsigned long last_pfn = 0; >> @@ -759,7 +769,11 @@ static unsigned long __init e820_end_pfn(unsigned long limit_pfn, unsigned type) >> unsigned long start_pfn; >> unsigned long end_pfn; >> >> - if (ei->type != type) >> + /* >> + * Persistent memory is accounted as ram for purposes of >> + * establishing max_pfn and mem_map. >> + */ >> + if (ei->type != E820_RAM && ei->type != E820_PRAM) >> continue; > > Should we also delete this code, accounting E820_PRAM as ram, along with > the deletion of reserve_pmem() in this version? should revert those end_of_ram change as attached. Tested-by: Christoph Hellwig diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index e2ce85d..e09a346 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c @@ -752,7 +752,7 @@ u64 __init early_reserve_e820(u64 size, u64 align) /* * Find the highest page frame number we have available */ -static unsigned long __init e820_end_pfn(unsigned long limit_pfn) +static unsigned long __init e820_end_pfn(unsigned long limit_pfn, unsigned type) { int i; unsigned long last_pfn = 0; @@ -763,11 +763,7 @@ static unsigned long __init e820_end_pfn(unsigned long limit_pfn) unsigned long start_pfn; unsigned long end_pfn; - /* - * Persistent memory is accounted as ram for purposes of - * establishing max_pfn and mem_map. - */ - if (ei->type != E820_RAM && ei->type != E820_PRAM) + if (ei->type != type) continue; start_pfn = ei->addr >> PAGE_SHIFT; @@ -792,12 +788,12 @@ static unsigned long __init e820_end_pfn(unsigned long limit_pfn) } unsigned long __init e820_end_of_ram_pfn(void) { - return e820_end_pfn(MAX_ARCH_PFN); + return e820_end_pfn(MAX_ARCH_PFN, E820_RAM); } unsigned long __init e820_end_of_low_ram_pfn(void) { - return e820_end_pfn(1UL << (32-PAGE_SHIFT)); + return e820_end_pfn(1UL<<(32 - PAGE_SHIFT), E820_RAM); } static void early_panic(char *msg)