Message ID | 20240227003630.3634533-1-samuel.holland@sifive.com |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-82468-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2415006dyb; Mon, 26 Feb 2024 16:37:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWo6vRG+Y0FJdPw/YjIsJbWoFduMS5CB2pai0jzqYGqBOVFZuTE+Ky627lnNOTKbZcTnEGojjnm/Bame+YKFpruEsmwIw== X-Google-Smtp-Source: AGHT+IHHw0fWJ/1+YQMh+OHFDkKksQPqXcBBlzV4h3p5On/WQFvIftDFh64soheZWsjeER2SgGx5 X-Received: by 2002:a17:906:3b99:b0:a3f:a7d0:b57f with SMTP id u25-20020a1709063b9900b00a3fa7d0b57fmr7158300ejf.17.1708994219942; Mon, 26 Feb 2024 16:36:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708994219; cv=pass; d=google.com; s=arc-20160816; b=zmpvuBcz3YuEisahsrNbFQ6lBAh/2ST20JkzwGxStGMquZJPH5PUkBAYWSckQq7P3z zZ5cTUFa7qBru/rDrTnwvB2u31wmJfG8PZswJaG6AQOK8VhXeKL7UIVnx7R9+ZIuD2iR g+8Dj92xC6Lbt6M7xE7bk/lKNOfP7WT/R0VfUaXZhXPIA+w55281xuOADsnOB2RtEtvn waJl1jFrR5EHR1MVyKCG0DEGplmvzzmMwMwTfc0g5PnJNj2tBYYH72EwhI3h6lZEEut6 +qO0f8yh8bUAiWDETV6C38GUWCPScsyK/nh1bytJiJQ/8E2BuVRtL7+RiyYOm1i40liN gGkA== 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=gKpylQvY7fWF0HEhcpoV/u+3QY3QSMz3zE4Q+faMtfw=; fh=qgALqhvBfwh64qlTOA5xcM4euFCRJESH/+60UMp8eRY=; b=nwpzjhn1z1xRfXTTp7NQD7hJrhHqsVptajKJc3V1oJaQkE2QsWG44zp2seLARnh3tX +/OUtqDe2xv2lhUD8J2Jv8Bkdaa+VMa+OjhrtAy0NVv0Cmrn9TnFXFZuVkmzsX6G55/b zM9I7tufYMr+AbjBoSSCSnIhgaUekQUztB7eBDlwMY0req4giNvMRo84rFrdScHblmxP DddPl92x+e8nqx6UkmLi4qCLpAwDy0qplFLpFplrHDfc2VNHQwRcP8IczFFFudToksIR yYACk80USJdG7C5fZRDEzRqlAEkBKnkYND2B1Xk4SQUDOueXiazt+DcyXak7c3oZDoMq 2+Fg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=cYyVNXD1; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-82468-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82468-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c22-20020a170906d19600b00a3ecb834df9si227308ejz.230.2024.02.26.16.36.59 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 16:36:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82468-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=cYyVNXD1; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-82468-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82468-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com 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 8F4361F21E2D for <ouuuleilei@gmail.com>; Tue, 27 Feb 2024 00:36:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BBEAD4A29; Tue, 27 Feb 2024 00:36:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="cYyVNXD1" Received: from mail-oa1-f49.google.com (mail-oa1-f49.google.com [209.85.160.49]) (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 76B2437E for <linux-kernel@vger.kernel.org>; Tue, 27 Feb 2024 00:36:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708994195; cv=none; b=IzjJnubh0JBNjCyvf0JEyUpYfa9ztvVidgUDibaVNZH5RIdknKCwKDzlQSK8+TN6KydHhIm72S0UvQPy8dgzjlfKgIR5D/pIxX47kjJcj3LtolmKTGjKFR1s4sOcA86Db1ooeUe4/PwuFDii0UEOjr3roH1FQqRf/YDl8ZnPOvk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708994195; c=relaxed/simple; bh=IXjp9ffzWGMlN6IdNxjC/u0dQ4UDT6IPvs9OH9Mcs5o=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=s7YLG6cWfuDiqTE8cPQmk+kF9ZqeKWouY/8gwHeZtgBxjVSgbdlU8yuhIbgnC/ckCLC44K9XHsd0cpUcrIPzYOWf3AOY4NwE+0W1J+m2etW0Y6NkQ6SNrjU7pnLIAQx9xr/KFDZ4N8f/HXOb2EdqViWkOWvXnTrE/tYw1r9Gnuw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com; spf=pass smtp.mailfrom=sifive.com; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b=cYyVNXD1; arc=none smtp.client-ip=209.85.160.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-22007fe465bso968178fac.1 for <linux-kernel@vger.kernel.org>; Mon, 26 Feb 2024 16:36:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1708994192; x=1709598992; 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=gKpylQvY7fWF0HEhcpoV/u+3QY3QSMz3zE4Q+faMtfw=; b=cYyVNXD1F1RwCDYf8ksuvfh22H6rMhwcFSt6siQlvCq8KDnoZMFXuCtvVE7WJGBxuP ycW1F0vtLleZt4kJj3sdc3XbXht1yAqwXnQ0lZxYt9PDic0vKK/1kjMMiy9Klv9XzSx4 4S1EpgfyE5o09SEVrYaSWbAJt0kag9Ww31zs6zvjgBGaTCuAdwEdY4q1Fu78qvc27H2q Q6gYko3Z9YjtR2S0hLx+ophZkQNx8pwGveJ+cO8/A4Fae5JX18vx61d5Urd/zBBKrKkf xyq/7ztNUFln7j/9Tm4rTqkoOYRG5ebt95zMIaybN/cc+0MkgqsQrTqrotr53kWBqnIH wx/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708994192; x=1709598992; 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=gKpylQvY7fWF0HEhcpoV/u+3QY3QSMz3zE4Q+faMtfw=; b=LJdCUjb4FjgGgttkn65xTkGDwMbQq3LQB37kLsMKSizfsxGipPKhEnPiCBLcKw760p SSY2lJZdmfGJ7D20VAXaOUVFV3FnYxjTrHTsRykDnpIeVnHDLoxFX1/WX69uskpuKwp+ 1sLN0m0MBmmx2xbaBu5RNAKC54GgwAgfV0Q9VgqY/vs+fHbmlg2wzTXE2MxVBpQPK8r/ qRAAv3wNbz4oYVJ1NJFflbOZCZ+gGis30BJxNu1OgIvhlFmzg81GSQ50uUE6b8yupePP iQPBq5avDpSs+3+oqU5OcGvA2SdlO3iF5MuQ6dPrPAHzcDfrWJ8pOgj30mlySuBybTn3 Cs3Q== X-Gm-Message-State: AOJu0Yw8YJKIZ3ZjLgKYG+Y58UizCqDOFR6Vgl8phdwlzc9TEwLvRs3e 9AqIwTonxrWJ9oDByqhjEsq68iv9HKuIxCkcGMFqe4a0ZIJtGzk6vDmGS13DmuE= X-Received: by 2002:a05:6870:d154:b0:21e:8424:8325 with SMTP id f20-20020a056870d15400b0021e84248325mr9458650oac.18.1708994192531; Mon, 26 Feb 2024 16:36:32 -0800 (PST) Received: from sw06.internal.sifive.com ([4.53.31.132]) by smtp.gmail.com with ESMTPSA id z25-20020a631919000000b005dc85821c80sm4504117pgl.12.2024.02.26.16.36.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 16:36:31 -0800 (PST) From: Samuel Holland <samuel.holland@sifive.com> To: Palmer Dabbelt <palmer@dabbelt.com>, linux-riscv@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Samuel Holland <samuel.holland@sifive.com> Subject: [PATCH 0/4] riscv: 64-bit NOMMU fixes and enhancements Date: Mon, 26 Feb 2024 16:34:45 -0800 Message-ID: <20240227003630.3634533-1-samuel.holland@sifive.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792010322807256871 X-GMAIL-MSGID: 1792010322807256871 |
Series | riscv: 64-bit NOMMU fixes and enhancements | |
Message
Samuel Holland
Feb. 27, 2024, 12:34 a.m. UTC
This series aims to improve support for NOMMU, specifically by making it easier to test NOMMU kernels in QEMU and on various widely-available hardware (errata permitting). After all, everything supports Svbare... After applying this series, a NOMMU kernel based on defconfig (changing only the three options below*) boots to userspace on QEMU when passed as -kernel. # CONFIG_RISCV_M_MODE is not set # CONFIG_MMU is not set CONFIG_NONPORTABLE=y *if you are using LLD, you must also disable BPF_SYSCALL and KALLSYMS, because LLD bails on out-of-range references to undefined weak symbols. Samuel Holland (4): riscv: Fix TASK_SIZE on 64-bit NOMMU riscv: Fix loading 64-bit NOMMU kernels past the start of RAM riscv: Remove MMU dependency from Zbb and Zicboz riscv: Allow NOMMU kernels to run in S-mode arch/riscv/Kconfig | 17 ++++++++++------- arch/riscv/include/asm/page.h | 2 +- arch/riscv/include/asm/pgtable.h | 2 +- arch/riscv/mm/init.c | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-)
Comments
On Mon, Feb 26, 2024 at 04:34:45PM -0800, Samuel Holland wrote: > This series aims to improve support for NOMMU, specifically by making it > easier to test NOMMU kernels in QEMU and on various widely-available > hardware (errata permitting). After all, everything supports Svbare... > > After applying this series, a NOMMU kernel based on defconfig (changing > only the three options below*) boots to userspace on QEMU when passed as > -kernel. > > # CONFIG_RISCV_M_MODE is not set > # CONFIG_MMU is not set > CONFIG_NONPORTABLE=y > > *if you are using LLD, you must also disable BPF_SYSCALL and KALLSYMS, > because LLD bails on out-of-range references to undefined weak symbols. That's not new to these patches though, right? IIRC that's an existing issue. Cheers, Conor. > > > Samuel Holland (4): > riscv: Fix TASK_SIZE on 64-bit NOMMU > riscv: Fix loading 64-bit NOMMU kernels past the start of RAM > riscv: Remove MMU dependency from Zbb and Zicboz > riscv: Allow NOMMU kernels to run in S-mode > > arch/riscv/Kconfig | 17 ++++++++++------- > arch/riscv/include/asm/page.h | 2 +- > arch/riscv/include/asm/pgtable.h | 2 +- > arch/riscv/mm/init.c | 2 +- > 4 files changed, 13 insertions(+), 10 deletions(-) > > -- > 2.43.0 >
Hi Conor, On 2024-02-27 6:13 AM, Conor Dooley wrote: > On Mon, Feb 26, 2024 at 04:34:45PM -0800, Samuel Holland wrote: >> This series aims to improve support for NOMMU, specifically by making it >> easier to test NOMMU kernels in QEMU and on various widely-available >> hardware (errata permitting). After all, everything supports Svbare... >> >> After applying this series, a NOMMU kernel based on defconfig (changing >> only the three options below*) boots to userspace on QEMU when passed as >> -kernel. >> >> # CONFIG_RISCV_M_MODE is not set >> # CONFIG_MMU is not set >> CONFIG_NONPORTABLE=y >> >> *if you are using LLD, you must also disable BPF_SYSCALL and KALLSYMS, >> because LLD bails on out-of-range references to undefined weak symbols. > > That's not new to these patches though, right? IIRC that's an existing > issue. Yes, that's correct. I see that arch/riscv/configs/nommu_* have KALLSYMS disabled already; this may be the reason. Regards, Samuel