Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp271260lqg; Thu, 11 Apr 2024 02:12:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3CyXn5nyoTjnT6+0I65QG3Z4NQxjbjkgu2DfRPxJuvKH7pO+45XfMOVHPU4GgcwcXhFUU++uPvpM5trBi8JZwhjhu1iCikonkIi9LGw== X-Google-Smtp-Source: AGHT+IEqTfDivC2dY9q2PT6Be+Zf9W8QcT6nbGuUyJhe0qPWw90MaLYiaPjMpu0zl4LzkhXLiaaj X-Received: by 2002:a17:903:249:b0:1e4:24bc:426f with SMTP id j9-20020a170903024900b001e424bc426fmr5965929plh.24.1712826779352; Thu, 11 Apr 2024 02:12:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712826779; cv=pass; d=google.com; s=arc-20160816; b=dsPVgOD7JRP9j9prAR2FKWF9bkaB1hNhdThDjCmGZP1Ukd+1uekzC6fN4LsjAYI3wv Dkm/L02vcY13GmirxFVyDZ1Vir/PI78fiCfP5Ym8qT+9aT8JuJS5FfAFuGBA0bAWsm0S qbYV8Q8RWdK9ZqjfcDOmPzqeeWetpxDS8RNBTl1Hv8XzKt+UyejGkfkhwnqD6G1+tVbg dUXFCcWTlIBXyZBKjeKlqOSw8O0Z8iIKzdCJ6KMMfFTL9maGXRV55k9b7s6aQg8JnoN5 V3aLlPz72v43MUe+C49gFfF0IiqH/66p3uQvbr6N/cPXW2nQoCh1+DujNrDlt+zOuRRn zhXg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=oGLZ4Bj9Hdxr3MjSAXtF+JGNelZvm/tPlncMYTe7qhA=; fh=peYE7c+J/oXsS8T6MJ7+1qaHMgBovzIui6vtdZD5zww=; b=pOHUX8MerZT3WP0hFZp6W99HPl2Gf0ONmLKpxZ6asZxDIXGBcic77th84rFTSIlBP7 UX5PkWTA1nAn/EAVUwy8H85CMC78eiNlxCh669qgBVh6zJBfarlLk+nvaNZbTntFYhZn 6sb8RFz6WLh6o7MH07t848st53iKbjZt7IhGsW8SBCFAmU+SioXdV4Wy/AsQZ9CNC3jh 45+Py/kleczQ/IaRDTBMWZsQTs0aGQv8e59vytaSOguXWnCy6Rkl3vGJN/pfLW9i4ruS 8/VBLx4baxy/7x28c0+MxP1luxRAaX4XmGwHj5vd+NK9ZBRYG6d8PPORzuTEs/0n2qmh 2VDg==; 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=AsdzxpZk; 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-140145-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140145-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q4-20020a17090311c400b001e035bf0f00si951957plh.513.2024.04.11.02.12.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 02:12:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-140145-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=AsdzxpZk; 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-140145-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140145-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 086432861A9 for ; Thu, 11 Apr 2024 09:12:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 83F6014388B; Thu, 11 Apr 2024 09:12:54 +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="AsdzxpZk" Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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 0155713FD68 for ; Thu, 11 Apr 2024 09:12:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712826773; cv=none; b=hVQev/T3eTzuPh2ZKi1vnsUBjeFuaUoKYPv3V5zqzyxIL1ACWGi5L2TFA6yk9Fq6G9F3jYcJ4brk+9u/qEEGxoII1tn9Da8C0TAGT9Kh7SyalnA3v6wnpuqhxtcHBOW34X0+wFtt0RdB9ETFNvlpSnGrTNISZMyIjvBCSXoF4OA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712826773; c=relaxed/simple; bh=E5KHIQZZU0rzeBrHyjg0655at+txunPpF+rRvnVl86U=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=mmLCbQzJcTv1GNTv2EAKHahC4nXoyh6ptszvWN1/zSYMo9YN1cnczHnK/k6mOjWBVuoN0k87C+u/O/3yooTS9wHBazJqqQ9u6U81C5lQId93bmGoNQpuTUrX+dwpGapuabt2xka7rmk+aFS14WgJePhvqrYRnxN55skSpcfLYfQ= 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=AsdzxpZk; arc=none smtp.client-ip=209.85.208.178 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-lj1-f178.google.com with SMTP id 38308e7fff4ca-2d874b89081so8387421fa.0 for ; Thu, 11 Apr 2024 02:12:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1712826770; x=1713431570; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=oGLZ4Bj9Hdxr3MjSAXtF+JGNelZvm/tPlncMYTe7qhA=; b=AsdzxpZkSvBu8sX/Rlcdr3UE4tP/dTRPqa419RUwlELv/3a39p+QFfEildjBPh+iOb +cz1KamX9yoTI4z1ZCspLJNxE/HIv0Xgqxqv58Z6AFWAoBNSpt0zgQjMSKiyUc0bX6Eh HQ9SKcoqLtqHSAgKvcnSNS1d9QffKWyumpTdMBS2C+8GtuLUCkghMVffAFldiTRh161K 5sBXmfT6ziLizUdXDw9lRKHirGYE0jybGIBseqLW7rXUmv+5H5voqsqCqaaKYQ7Oxwm2 /Q6E4kQSFQGNf5FE2XTG18RJo7sMZ09+/MNm6WF5WGB2RdhlZQpweXkqxD+vomIcfprk hVmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712826770; x=1713431570; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oGLZ4Bj9Hdxr3MjSAXtF+JGNelZvm/tPlncMYTe7qhA=; b=kAll/540ZEjbej1piSvwgGDtLvOOTF0vve6EyWXwN1dE76W0tLXIKjGN+hHJ7gozx3 Hv4qkEcqcDMMxJxMHQOvsZwWjaywjpdbPOvfDtFGjOCdyjCZlP1DjBLaouvTMtXwgDV4 NYnyxoWisqeWuNmIa2v5HU5O2sNxeYd+00K9J6Gf67Lvfm4SmstsoPXVw/39TXT+qvrQ m+k8oPQ7KX/LG53zxungagNMi/cGHWPIPeOgONI4JT8K73LYr6riOR/TpC64u4cCr714 AAg1iNl1tzYoJHxuBDx6sVCFFIIG+fo2Olm7fYbDELit0wt14YZR9/u1NWYLeLHvQslH jZRA== X-Forwarded-Encrypted: i=1; AJvYcCWyMcfJ/Z64XfeNXNQhJF6h7+XkpVwFPh1Y47whixV0G2im4+lZC9jIC7OzkmsmEpxRtNgFU/Xe7m5Ebq2fZUB6hquZub0eH1tawVaG X-Gm-Message-State: AOJu0YwNb3Y0oJf9W23tcYqUuc0Z1j0H1qiIwEieDOChLR9t7BDpXsza hwz0sXu8Y0iUH4BwwwBpjtFPhtO251w+SnhMNzP5SvzIBLncRUE5MG590NnnipA= X-Received: by 2002:a05:651c:2121:b0:2d8:d41f:931c with SMTP id a33-20020a05651c212100b002d8d41f931cmr2981577ljq.0.1712826770072; Thu, 11 Apr 2024 02:12:50 -0700 (PDT) Received: from ?IPV6:2a01:e0a:999:a3a0:3624:d9b3:4998:d76b? ([2a01:e0a:999:a3a0:3624:d9b3:4998:d76b]) by smtp.gmail.com with ESMTPSA id jg25-20020a05600ca01900b004169836bf9asm4821377wmb.23.2024.04.11.02.12.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Apr 2024 02:12:49 -0700 (PDT) Message-ID: <5a285147-4bf8-4634-8f9e-fe78c033b7cb@rivosinc.com> Date: Thu, 11 Apr 2024 11:12:48 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/2] riscv: nommu: remove PAGE_OFFSET hardcoding From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= To: Jisheng Zhang , Paul Walmsley , Palmer Dabbelt , Albert Ou , Daniel Lezcano , Thomas Gleixner , Samuel Holland , Conor Dooley Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org References: <20240410142347.964-1-jszhang@kernel.org> <20240410142347.964-2-jszhang@kernel.org> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 10/04/2024 17:30, Clément Léger wrote: > > > On 10/04/2024 16:23, Jisheng Zhang wrote: >> Currently, PAGE_OFFSET is hardcoded as 0x8000_0000, it works fine since >> there's only one nommu platform in the mainline. However, there are >> many cases where the (S)DRAM base address isn't 0x8000_0000, so remove >> the hardcoding value, and introduce DRAM_BASE which will be set by > > Hi Jisheng, > > Typo: s/harcoding/hardcoded > >> users during configuring. DRAM_BASE is 0x8000_0000 by default. >> >> Signed-off-by: Jisheng Zhang >> --- >> arch/riscv/Kconfig | 8 +++++++- >> 1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig >> index 7895c77545f1..b4af1df86352 100644 >> --- a/arch/riscv/Kconfig >> +++ b/arch/riscv/Kconfig >> @@ -247,10 +247,16 @@ config MMU >> Select if you want MMU-based virtualised addressing space >> support by paged memory management. If unsure, say 'Y'. >> >> +if !MMU >> +config DRAM_BASE >> + hex '(S)DRAM Base Address' >> + default 0x80000000 >> +endif > > I'm not sure but it feels odd to have this at top level config menu. > Maybe it would make more sense for this to be located under the > "Platform Type" section ? > > Thanks, > > Clément > >> + >> config PAGE_OFFSET >> hex >> default 0xC0000000 if 32BIT && MMU >> - default 0x80000000 if !MMU >> + default DRAM_BASE if !MMU >> default 0xff60000000000000 if 64BIT By the way, you should probably rebase that on top of Samuel's work [1] in order to support !MMU is S-mode. Thanks, Clément Link: https://lore.kernel.org/lkml/20240227003630.3634533-5-samuel.holland@sifive.com/ [1] >> >> config KASAN_SHADOW_OFFSET