From patchwork Wed Sep 18 10:38:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greentime Hu X-Patchwork-Id: 11150075 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 822D276 for ; Wed, 18 Sep 2019 10:39:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5E9B7214AF for ; Wed, 18 Sep 2019 10:39:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="b0XdDlC7"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="DOnXq/J2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E9B7214AF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=zT57u4Ztu2qWGOWapO5gLMg4daHAjQ9pjzu6bi6Zlfg=; b=b0XdDlC79z1+mJ rx94hjQkMCqyexCvIA0s1OeZlWAVvUZYcfEaflyp/6METczEYICQ46ZjGVlNoxYSgLAaqY2abznEb WNBKS0c+C/mLxRXE7DWYfeE+bevJxhy2iYNbPE83hsyPfP5AV8eIZ+pH8wcqUbuS3+99NV/dM6YUW d87AcoRuF4UHnFvWWc3nF+am78mF3Ta6Vj/sV/JsgfYp5oCAjVYbrdtdzk2nBbQl1nlhPKlcuqWEW sq9zT41etka8QMhlmi6uiGdXpvS1Bkc6hR/CtM7eKDRAgqZVAHlf4OKGUXT2STJP6Mm6rSr4e2y1j d9Mq5HWLGRtTA+IAeGgA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iAXMo-0005vJ-NC; Wed, 18 Sep 2019 10:39:22 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iAXMl-0005ub-3t for linux-riscv@lists.infradead.org; Wed, 18 Sep 2019 10:39:20 +0000 Received: by mail-pf1-x442.google.com with SMTP id y5so4144562pfo.4 for ; Wed, 18 Sep 2019 03:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=PJMTj/Fq70plK6xajf5o6p+A1XUkzJJscq2WFg4Ok1g=; b=DOnXq/J274NOWRNt1DTh/uPChnrXdFihmCSYcMmvTR3F5sIF+5JU3PBEyH0UObAUCY rHI4PA/azQA+0lFnPqx5pZUjyVOmGPdE4qNRPR6A9nGVKXaytQMXT2bbpywkcpc8WZUW N5nlrUbLa8eVJtUGyQb5cSCEPadblD/PbsW6O7ajoALlDrFBavFGNXcZZ2oeyumOpRSe 2UNzbRSwRXbi9ccsqKI931OZJf6ZtqmZO+gNVI3Gal1pk5RoUjLcuo8lYiZwvhrOVejK Vw4M6SN6zBG34yV4l/r/p2APdt1mdGc7KZWQ07as1lPEiTYGQudUQDys3byry8JjSuwJ I+YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=PJMTj/Fq70plK6xajf5o6p+A1XUkzJJscq2WFg4Ok1g=; b=ma0T3LWk4ImSNx+LcLhgFaUZBJllbPvpxJnrYnGxNb6TfMStNJFrh07BOIEsJxYXuu 8IXx5oadOskeTZvL3iUPH+R1Xa5hgQ3VpS/5q5AneWxOtj0UEM5SvzFcfpymuWz7S30O siJsjC96/sA10hQ/Fooz6ZxPLcYQFVv6UcYsSotdJLRVNtOGApibc3RKcSKJBB1RXjDd HFfJU0HsM+cJJPXrLn579bsbxdhebwyz7Ah2MoVZ4oLb066Z+Xh/bjt7Fx1YS++8Tpn5 bx+woZl/HjwTRDVOnw6LMGjCMVXc4OzaqXVRUxldAVChBJqR0do1X27LUOidSuN2kuJE TcHg== X-Gm-Message-State: APjAAAXj1dcybBE4vksOZyNC3o1IIW63VIkhbfe5GRDqOxZMpJiJw197 027Op7NTygzj8n5gyFLH8AHA3g== X-Google-Smtp-Source: APXvYqwT7yE8ZvtiPNDu0qZs9cEmt2AKc8FFBPrLCdbKTMHPu+9h5U5gAJn9fIaC/1yIDkmIDWiqtQ== X-Received: by 2002:a17:90a:a6e:: with SMTP id o101mr3072132pjo.71.1568803157898; Wed, 18 Sep 2019 03:39:17 -0700 (PDT) Received: from localhost.localdomain (220-132-236-182.HINET-IP.hinet.net. [220.132.236.182]) by smtp.gmail.com with ESMTPSA id 31sm5751587pgr.55.2019.09.18.03.39.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2019 03:39:17 -0700 (PDT) From: greentime.hu@sifive.com To: greentime.hu@sifive.com, green.hu@gmail.com, paul.walmsley@sifive.com, linux-hackers@sifive.com, palmer@sifive.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] RISC-V: Fix building error when CONFIG_SPARSEMEM_MANUAL=y Date: Wed, 18 Sep 2019 18:38:24 +0800 Message-Id: <20190918103825.8694-1-greentime.hu@sifive.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190918_033919_190310_0687397C X-CRM114-Status: UNSURE ( 7.01 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org From: Greentime Hu To adjust the place of VMALLOC_* and FIXADDR_* defined location to let VMEMMAP_* get it. CC init/main.o In file included from ./include/linux/mm.h:99, from ./include/linux/ring_buffer.h:5, from ./include/linux/trace_events.h:6, from ./include/trace/syscall.h:7, from ./include/linux/syscalls.h:85, from init/main.c:21: ./arch/riscv/include/asm/pgtable.h: In function ‘pmd_page’: ./arch/riscv/include/asm/pgtable.h:95:24: error: ‘VMALLOC_START’ undeclared (first use in this function); did you mean ‘VMEMMAP_START’? #define VMEMMAP_START (VMALLOC_START - VMEMMAP_SIZE) ^~~~~~~~~~~~~ Fixes: d95f1a542c3d ("RISC-V: Implement sparsemem") Signed-off-by: Greentime Hu Signed-off-by: Greentime Hu Signed-off-by: Paul Walmsley --- arch/riscv/include/asm/pgtable.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index 80905b27ee98..4f4162d90586 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -83,6 +83,18 @@ extern pgd_t swapper_pg_dir[]; #define __S110 PAGE_SHARED_EXEC #define __S111 PAGE_SHARED_EXEC +#define VMALLOC_SIZE (KERN_VIRT_SIZE >> 1) +#define VMALLOC_END (PAGE_OFFSET - 1) +#define VMALLOC_START (PAGE_OFFSET - VMALLOC_SIZE) + +#define FIXADDR_TOP VMALLOC_START +#ifdef CONFIG_64BIT +#define FIXADDR_SIZE PMD_SIZE +#else +#define FIXADDR_SIZE PGDIR_SIZE +#endif +#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) + /* * Roughly size the vmemmap space to be large enough to fit enough * struct pages to map half the virtual address space. Then @@ -429,18 +441,6 @@ static inline void pgtable_cache_init(void) /* No page table caches to initialize */ } -#define VMALLOC_SIZE (KERN_VIRT_SIZE >> 1) -#define VMALLOC_END (PAGE_OFFSET - 1) -#define VMALLOC_START (PAGE_OFFSET - VMALLOC_SIZE) - -#define FIXADDR_TOP VMALLOC_START -#ifdef CONFIG_64BIT -#define FIXADDR_SIZE PMD_SIZE -#else -#define FIXADDR_SIZE PGDIR_SIZE -#endif -#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) - /* * Task size is 0x4000000000 for RV64 or 0x9fc00000 for RV32. * Note that PGDIR_SIZE must evenly divide TASK_SIZE.