Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2689574lqo; Tue, 14 May 2024 06:36:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX+K4Q7HgNjqIw4P+wON+dvy4Dn8StpKsyPlb0Yl92lncry3y6Lbtu4iy8Q9rCmhjyLfUwgZ+gzf1SqS54pyiBnoXpzSWz10o/vIcsqhw== X-Google-Smtp-Source: AGHT+IHJfdk9MRmSkHyS2T7NAh2l1phBQaiCSMTn3QV0z/fkjlkrz8lijNSkMzUnkHpF3+idTCXy X-Received: by 2002:a17:907:3186:b0:a59:ea4f:46b9 with SMTP id a640c23a62f3a-a5a2d675763mr914567666b.77.1715693787183; Tue, 14 May 2024 06:36:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715693787; cv=pass; d=google.com; s=arc-20160816; b=p2Rp00e3oHGBPlgl7j9goovSBDKsfp1XmljOHzeSmJKtFqxkF4Quikwo9igry659BF cjVZKhC8Qw6A+qN7+F3l2Gmg74XVqs6P4PdUEtoGu/ADdb+b9SXMcOfQaszJxH2O5jjW ChAX2bL5laMbb7u+AedY/zaXkmXf8jWaDhIWf4PtsACflHSUqEkaaFrFqO4cZ8JP3uMO 4fpRGS/wNJ+bOod/sx+3HwMP2iYjU3ByPtZ3DY9kGpHEw3zMadBNjc/aeI6NdQBBRUJU cf9EHCYLOixYOLz4Mmnoh4Q4eIV7N7N3VmGsoLZmPFABTAlhJ9WjyplHvC2TGiFkisJi zeIA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=ELhPDbgArQNQi6ZkTuNkJ3HaLG9b9s1A9lZNaSj8kas=; fh=fYoIRXsjT2EcN7IO2l4DBw4aEzqdSHXh0JfIwd/15kU=; b=S++7C6kenmx1FgmIU6uxInh+gLRaded9ry3iDn7yNZUOngQqWUoaT0kxejpGrTcqzq AvnXKsct7tZSzV++QfeenpkQ81gHNeQquB91HawfbHm/lh5HEqB/meMcigkpbyASI7NI ObNHIyM4KMjpWL9w9oHnBbkYD+5uoMNe8Q+o4+IDVjFjizzbdUudW5kM8A3ZJcGtB2YF AgwyKh+Am2a/MMuh8BemcqVN9OAr0f6qvpK02mJP6SIKSatlshpOqDJjibAZ2Ex5rpvO xnAKGJWupt/4dvEKo1APn0GeuJ4ZKr/3aBeLhLOkJwUkd46QW0LrAI6tiytxPZGbeu+a kcYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=cjQAaCNW; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-178758-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178758-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17c2c8fcsi620102266b.1014.2024.05.14.06.36.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 06:36:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178758-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=cjQAaCNW; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-178758-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178758-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E776B1F22AAB for ; Tue, 14 May 2024 13:36:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7FD671448CD; Tue, 14 May 2024 13:36:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="cjQAaCNW" Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40C7214431B for ; Tue, 14 May 2024 13:36:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715693781; cv=none; b=mdKRellryyfvlcZxrr3+aLyb9XhSOmcFQG3zloJ+b4UHyPKRn8hW5uIvaRUOHNKCs3pI196Vz6q3tS3W9nqRr6LLny+mZ1FmDYJY00X05boXEQXxrDrHH6LStYGlK7eMK9QVD8tgFIE/3KWERR2288kQmG+NPuf/UMowd3XLCrQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715693781; c=relaxed/simple; bh=Nyi+RCrf5Y+WqMKXmI2T5cOWnyBug0P72f6XYQ0uD+Q=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=dcR7wDDYxkCrz1Z1UfTtoWN8wytBOY4d+k4dIFqpKXIrFiBTRyBh/JymuLw/+tncuqAOejwRnypw4X6xRfkzHV4sSVNSefKDsjGGw6U9q110Mas4VFqIhXays4EHE7CItR02dZmmq5N6ZhxJSAWzKTiQc6JUoEsxASkVDlMx93I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=cjQAaCNW; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1eb0e08bfd2so32780205ad.1 for ; Tue, 14 May 2024 06:36:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1715693778; x=1716298578; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ELhPDbgArQNQi6ZkTuNkJ3HaLG9b9s1A9lZNaSj8kas=; b=cjQAaCNWjw7QS+MgedkvCizu5HKRF47jei0ErJEd0ePdKLT2SQINUHQoDDXemBmidt Telb3uiSw13AzXQQVy69rJ3bStqmyd/DNklO2BwfM3OrJeQIkYAUE4c5M2Lm1fk5ZyB+ aUB6UguHsioz5/FttR0JX2IV8AS9Yf3GpoZEzTiR6XoPuDYPVrtywguR6n4WZlojvrVj UO56fgXh49mHl4JiiQOo6REyzgIw7Y63GIM5b11SO6jQTw+NmzaXWjLMxXujFGwABtaq EcrDp3SP7sWy4SeryQzIkwfcNAHl9heP1IwvSshtvz5OAGCHu5DIVncse4/LHs8PTO+i QC0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715693778; x=1716298578; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ELhPDbgArQNQi6ZkTuNkJ3HaLG9b9s1A9lZNaSj8kas=; b=Ow6RGY+GJcsrDn73qzw3IJ8cHFfeTWWvQgZd8CsqCMlbRi4txNjUM0mp0q4L7YXQWY 44E3l+h1jB74oWKtQmAcNEXD4/LKXjRx7YuVFGgijjJs8ofulG8WEBfTqpMIJ77si0Sm nCfSUmlizHh/QfLknQlP1JgeeSE832UMTOegfEPKKioEPkMzs1woW4ucAmHmnthp3upZ NJkKDRr4adQaurzg8klE80GSOrwzHdW+8nrIXOyhwxV7E0PcTuUW0JikbnoZfKnHyu2X EgMS85+mv2MA4eFMI6urCQcwdi/ExQgOjG3jhFIxNAyzi+s0wFXKxOG4A5k2FyBPLnL3 ep/g== X-Forwarded-Encrypted: i=1; AJvYcCUWUuFGofZVUayWfW+8+xbMhlAr28RIkLi6R3cABGUtCevS5QZaelDH2/Aq3Suk+e03PGW06zKLAsruQVnJMy0wXCOYpFf5XKIGXaOR X-Gm-Message-State: AOJu0YwmHAS/DgStmp6yrI1pGzeKyamd8ISTnBEn0c4+SwgAquq9lkcJ BAufJDSCo2NUrxSv1cM3p3zC6yp4icLkMqW2QgSXyBx24KV+rqrAj96CqEziON0= X-Received: by 2002:a17:902:e5c2:b0:1eb:2fb3:f9fd with SMTP id d9443c01a7336-1ef43c0cecbmr165256165ad.14.1715693778566; Tue, 14 May 2024 06:36:18 -0700 (PDT) Received: from alex-rivos.ba.rivosinc.com ([50.204.89.31]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0c13699dsm97908565ad.239.2024.05.14.06.36.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 06:36:17 -0700 (PDT) From: Alexandre Ghiti To: Jonathan Corbet , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Alexandre Ghiti Subject: [PATCH] riscv: Extend sv39 linear mapping max size to 128G Date: Tue, 14 May 2024 15:36:14 +0200 Message-Id: <20240514133614.87813-1-alexghiti@rivosinc.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This harmonizes all virtual addressing modes which can now all map (PGDIR_SIZE * PTRS_PER_PGD) / 4 of physical memory. Signed-off-by: Alexandre Ghiti --- Documentation/arch/riscv/vm-layout.rst | 10 +++++----- arch/riscv/include/asm/page.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/arch/riscv/vm-layout.rst b/Documentation/arch/riscv/vm-layout.rst index e476b4386bd9..f37812863991 100644 --- a/Documentation/arch/riscv/vm-layout.rst +++ b/Documentation/arch/riscv/vm-layout.rst @@ -47,11 +47,11 @@ RISC-V Linux Kernel SV39 | Kernel-space virtual memory, shared between all processes: ____________________________________________________________|___________________________________________________________ | | | | - ffffffc6fea00000 | -228 GB | ffffffc6feffffff | 6 MB | fixmap - ffffffc6ff000000 | -228 GB | ffffffc6ffffffff | 16 MB | PCI io - ffffffc700000000 | -228 GB | ffffffc7ffffffff | 4 GB | vmemmap - ffffffc800000000 | -224 GB | ffffffd7ffffffff | 64 GB | vmalloc/ioremap space - ffffffd800000000 | -160 GB | fffffff6ffffffff | 124 GB | direct mapping of all physical memory + ffffffc5fea00000 | -232 GB | ffffffc5feffffff | 6 MB | fixmap + ffffffc5ff000000 | -232 GB | ffffffc5ffffffff | 16 MB | PCI io + ffffffc600000000 | -232 GB | ffffffc6ffffffff | 4 GB | vmemmap + ffffffc700000000 | -228 GB | ffffffd6ffffffff | 64 GB | vmalloc/ioremap space + ffffffd700000000 | -164 GB | fffffff6ffffffff | 128 GB | direct mapping of all physical memory fffffff700000000 | -36 GB | fffffffeffffffff | 32 GB | kasan __________________|____________|__________________|_________|____________________________________________________________ | diff --git a/arch/riscv/include/asm/page.h b/arch/riscv/include/asm/page.h index 115ac98b8d72..727ed7887cab 100644 --- a/arch/riscv/include/asm/page.h +++ b/arch/riscv/include/asm/page.h @@ -37,7 +37,7 @@ * define the PAGE_OFFSET value for SV48 and SV39. */ #define PAGE_OFFSET_L4 _AC(0xffffaf8000000000, UL) -#define PAGE_OFFSET_L3 _AC(0xffffffd800000000, UL) +#define PAGE_OFFSET_L3 _AC(0xffffffd700000000, UL) #else #define PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL) #endif /* CONFIG_64BIT */ -- 2.39.2