From patchwork Wed Aug 28 05:49:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13780623 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5233C5474A for ; Wed, 28 Aug 2024 05:49:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 576B26B0096; Wed, 28 Aug 2024 01:49:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5274E6B0098; Wed, 28 Aug 2024 01:49:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C7A16B0099; Wed, 28 Aug 2024 01:49:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 1DE2D6B0096 for ; Wed, 28 Aug 2024 01:49:47 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id BD40D141CBB for ; Wed, 28 Aug 2024 05:49:46 +0000 (UTC) X-FDA: 82500577572.02.C98FD6E Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by imf15.hostedemail.com (Postfix) with ESMTP id C87FCA0013 for ; Wed, 28 Aug 2024 05:49:44 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b="IgSu/Pbh"; spf=pass (imf15.hostedemail.com: domain of charlie@rivosinc.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=charlie@rivosinc.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724824141; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Q5srBcKEXlmg65Adrhp9lVjL7ktMhhBJWYWob6ko31g=; b=tBnK6/tVY3seYnhVH1Yxu5gOdVZi3wS6H2I/t+3Tp8sSluzGv4rPSGTGJ5seW4yjOPadZQ fnJiGm/b/VarXSFfFWC6o5dhVeee60B8VKGK5iuNiGnYnuq/0ViiNEDmBSOTi1DKMVNKZJ XBzJlp2j1/1BzHx9w5IYXFsDkTDuCXc= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b="IgSu/Pbh"; spf=pass (imf15.hostedemail.com: domain of charlie@rivosinc.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=charlie@rivosinc.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724824141; a=rsa-sha256; cv=none; b=jn/bAF3Sg2Amid+kReraXEMgwP7pxz6p0+351ZJWUyxgdsOVgCTXxqHyU0obc5xxW5fj0t 4IjoTHXoDZ90FaVeO6qHHzbzzz9CFNWVUfPEWuJifB5bT2Sx12gvnkbnQXLsp4bAQPvwns EOzkloXOUFYuoqblgJiDBsxlS+eQZYU= Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-201f7fb09f6so54511005ad.2 for ; Tue, 27 Aug 2024 22:49:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1724824183; x=1725428983; darn=kvack.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Q5srBcKEXlmg65Adrhp9lVjL7ktMhhBJWYWob6ko31g=; b=IgSu/Pbh9ZtcXpYereWQDkMMoS/8ica9w/m80YJ+jDKmGMcK5tixPqYryzuzfmIya/ 7EHjW8eeIe7W0df4YVu5nZc0xzSVnroWNRsFa42dInDBbu3KPIF0OG2GMCDmxDuM2Cl0 hpXjuHwOtwhIVkXTsdDMfuZydf1JZRAJbP6uO8zUlR1ub2f3g5T+GrpRjmrp+Q5WkdcX hSQvJPoQY9nPOk4t9j25NTp/eXltYoJlo3ZFPHXZHvOMIxjUD1ZA57lVdhQ0Sq8N04Xx pUYrdJ/gcny22miBgeqz50b1PydkF1uzFvCOZ7F8LVxBAj4AbWruwxrDkjdsSzGK/PKv MeYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724824183; x=1725428983; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q5srBcKEXlmg65Adrhp9lVjL7ktMhhBJWYWob6ko31g=; b=dYp9dgtU/MFVXaJrmdYTeFnlf8Qh6zPR0vYhya5md0/b9vgJWvIlrnTP0AKJttB1R7 XWChl4sxlZ7NV5sNnJDKwg/1TTyej/921dLbivSMsizeZGTTJQM8Np5EQQ57jJRANeJU 5VaQEZszrkztg6KVb7eLD/aiL/PrmLOcYhdwJU8rVnp2unY1fjOmtDdl85VG1zH5e7zq ZieSxLpxy2+jhA8IJqejBg8BrdYgRYlGaDVVEIoRjLtAglVgzzSJFwya/7Su//aAUGzo HrC3KgebaqMht+xHjhb/lzqfxloRR/IjlAmf4uw1/n7c3FZLUaepLxmnQjXVGUSu7c+e 7eTQ== X-Forwarded-Encrypted: i=1; AJvYcCVHib1JbjDzTYYe0lWB4zsKYevQpmQ/W3NYQuRqinCnUC7Tk/Zuh7nIYCava1MwY6g/KOFpUpdGsg==@kvack.org X-Gm-Message-State: AOJu0YwZ33OzoemVe4UFEFRMVJLL4O83N2eUwihVZGON3/HcB/LIhzUb 9mVzbEL20Sm7Siz0c9IsDzvFwyJig+9Gl3W/IzU4YyIol6a4+r9oOgqRI9J6Msg= X-Google-Smtp-Source: AGHT+IGHu+eM9GywkA2KKhkiXH1gwQVKDtYtrmu0o3xp962KqVz7yKVZ3UFfIj7ogPOJug6LrKMhnQ== X-Received: by 2002:a17:902:e54c:b0:1fb:3474:9500 with SMTP id d9443c01a7336-2039e4ab846mr148619915ad.27.1724824183237; Tue, 27 Aug 2024 22:49:43 -0700 (PDT) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-203855df0c4sm92092495ad.157.2024.08.27.22.49.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2024 22:49:42 -0700 (PDT) From: Charlie Jenkins Date: Tue, 27 Aug 2024 22:49:11 -0700 Subject: [PATCH 05/16] riscv: mm: Support MAP_BELOW_HINT MIME-Version: 1.0 Message-Id: <20240827-patches-below_hint_mmap-v1-5-46ff2eb9022d@rivosinc.com> References: <20240827-patches-below_hint_mmap-v1-0-46ff2eb9022d@rivosinc.com> In-Reply-To: <20240827-patches-below_hint_mmap-v1-0-46ff2eb9022d@rivosinc.com> To: Arnd Bergmann , Paul Walmsley , Palmer Dabbelt , Albert Ou , Catalin Marinas , Will Deacon , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Muchun Song , Andrew Morton , "Liam R. Howlett" , Vlastimil Babka , Lorenzo Stoakes , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Huacai Chen , WANG Xuerui , Russell King , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , "David S. Miller" , Andreas Larsson , Shuah Khan , Alexandre Ghiti Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=921; i=charlie@rivosinc.com; h=from:subject:message-id; bh=h9Jl0isly8hfO1RunVOJNqZoeZvdanuDoXET0lufwJg=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ9q5XXFHufOLGl2Wf1oQkLR82ZWndTOfPt314eCzeyv3r BZKWtO7oKOUhUGMg0FWTJGF51oDc+sd/bKjomUTYOawMoEMYeDiFICJNPxjZOjefGX9Tl/G6Irp nxS+dN0zOpEeMVEk78LzG1JnNgQw8RYzMpwwaro+TU52Snefw54npdeqTGoNrXMnik1KMY5Wjl7 KxwgA X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: C87FCA0013 X-Stat-Signature: yi6wpkxa5yrwidpmzt186ohfis8kngnu X-HE-Tag: 1724824184-688803 X-HE-Meta: U2FsdGVkX1+md+gMP4GPWc09i1xn4PXMtji90yTnYeIHnFGMUh/NdQw2HLaEBrFt55v3anHigOMce9RzCnC2wbo2SW9AyQC28LwnfH84W7IIP92NilCay8IPJINOzHB+MhYAU/OttSSHqZaznv9yvqJwmpYCdJ3CmEppuNpFdo+dk1sqin5DW61xBClKDEuC4Aq34Q1wB83xuVW5kDpC2enwwNawlkkjWhcbd0vF5GdYZgiZ/EI7EwIdC/cB+2puA9NR79JX4SjCztb7USiBfC7pCAw8FPOrn0QMbFaofsPqwKkL3R7QktkuDV4qlk0aoMR7virzVPGh+Y9iPyuPZ8C01lKewc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X-Bogosity: Ham, tests=bogofilter, spamicity=0.000369, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: When adding support for MAP_BELOW_HINT, the riscv implementation becomes identical to the default implementation, so arch_get_mmap_base() and arch_get_mmap_end() can be removed. Signed-off-by: Charlie Jenkins --- arch/riscv/include/asm/processor.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/arch/riscv/include/asm/processor.h b/arch/riscv/include/asm/processor.h index 7ff559bf46f2..20b4ba7d32be 100644 --- a/arch/riscv/include/asm/processor.h +++ b/arch/riscv/include/asm/processor.h @@ -14,16 +14,6 @@ #include -#define arch_get_mmap_end(addr, len, flags) \ -({ \ - STACK_TOP_MAX; \ -}) - -#define arch_get_mmap_base(addr, len, base, flags) \ -({ \ - base; \ -}) - #ifdef CONFIG_64BIT #define DEFAULT_MAP_WINDOW (UL(1) << (MMAP_VA_BITS - 1)) #define STACK_TOP_MAX TASK_SIZE_64