From mboxrd@z Thu Jan 1 00:00:00 1970 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 AAE11C38142 for ; Wed, 1 Feb 2023 07:05:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E09876B0071; Wed, 1 Feb 2023 02:05:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DB9D56B0072; Wed, 1 Feb 2023 02:05:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C81346B0074; Wed, 1 Feb 2023 02:05:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id BAD076B0071 for ; Wed, 1 Feb 2023 02:05:27 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 5CD3EA03CA for ; Wed, 1 Feb 2023 07:05:27 +0000 (UTC) X-FDA: 80417837094.30.34E559D Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by imf22.hostedemail.com (Postfix) with ESMTP id 50001C000B for ; Wed, 1 Feb 2023 07:05:25 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=jrtc27.com header.s=gmail.jrtc27.user header.b=ZDfGYSyd; spf=pass (imf22.hostedemail.com: domain of jrtc27@jrtc27.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675235125; 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=e8gKGvK+r7EDr5He9Gl8MsjplN89RsEBb0xFGFSeoWY=; b=sBevW6S6ZEFunYNkJqwBYvc2Sr3kLDqxIJztWRj6bGZSrIu+k5iIWhsWwM7Xw5TU1f2sRg UsUI454YgPZ7hk/4oZB7EU17h0sGnF+MkF2fhYnygI4g7AuTN1n/qARB1vQiicIFnw3JUk 5JUSbBEWgn7QAvQfyBcz7+jLX3p0pJM= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=jrtc27.com header.s=gmail.jrtc27.user header.b=ZDfGYSyd; spf=pass (imf22.hostedemail.com: domain of jrtc27@jrtc27.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675235125; a=rsa-sha256; cv=none; b=ZDXK60o+MTMup9pXtKpD+cxNTTSTkWEy+h/cQCjDWSpBQVt8cuaCdtoYf9SqSA7uel2l1e XLcN3rvaiAA3BDOYrieyGU2pIDDFwQvme1bZL+ZdyHBF8tyDhLUwfvUQIOdRBylxN0jx8A dEeg/AxIzCRZxr+VxLcQxq/w59Z++PM= Received: by mail-wm1-f46.google.com with SMTP id m5-20020a05600c4f4500b003db03b2559eso606548wmq.5 for ; Tue, 31 Jan 2023 23:05:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jrtc27.com; s=gmail.jrtc27.user; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=e8gKGvK+r7EDr5He9Gl8MsjplN89RsEBb0xFGFSeoWY=; b=ZDfGYSydUbs+W/mZ/JEdD6Q+8lcaLxLNi99HmCRr8gzdobuZMw/guj3LdnXcCx0jfS i/DhUZgi36mxwP7NxLmv/bIWDlAEd3yc/osBtAxPRl9qH8KIMR349F6AFdABhD0Qtn0I HSXoUmkKir6bff3h+lW+pB/Z6iRz6Ai4zv38CN1gpBrya5U682EU/6QBVmCPDYDVISYV d2oMFyDeR7jUfDue8RH6lTl0NRpDwaVv06H4rEPbemSqpTVQGx29KqonFPRPoXIoJSyM nTBEfeMaLzABTZMAIS0EzErF5H5641OBt4VdmoZuijfWPIN8aeuwXKeNd2jAvv526ZVF LYgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e8gKGvK+r7EDr5He9Gl8MsjplN89RsEBb0xFGFSeoWY=; b=XSFKpqG582afyXimgOjpfUXzSBxxUZCbJUF5g+vevgP992VmZRBR9t/j5GetSK4XiE 1vXhyydXx6q3p2CA7nLozBzIeIh9vy6rgcq5O90TVycc5UkjTFW1bCyS5iMOqs5l1avh 4nTFlw02WDMrP2FICsw3d/lOLS0JKYrujUuYZA/Exoyd2UqspvuADBtq5wgqO5+zz4wv xXbP8FxCimbPwU/hyLDUi1W4cuErLaMPI/XOMn9jXVSF6kQdQOIctGa4F4i7EhzCISXz 874Mgs3da+6dRqgPn0z17uVBHEayg0sMh6t0oruHzq84CNlAr/EEIIZCAbVmPxBOGP7H UO3g== X-Gm-Message-State: AO0yUKVW8CE0pPJ3Y2fdN4d3Vd5xLqAoPOeGkfBdm5v1ta0AGyMqqiO6 RENVb595v0xT2OgRD3UXvuvd8Q== X-Google-Smtp-Source: AK7set+k/wPPr1ZjoqjkmJ3suXeJsAYSrNEbwNPRfVbpz2KUV//5EoU3DiEoIgpuYmPe3INabtxGwA== X-Received: by 2002:a05:600c:4fd3:b0:3dc:5b88:e6dd with SMTP id o19-20020a05600c4fd300b003dc5b88e6ddmr914970wmq.10.1675235123776; Tue, 31 Jan 2023 23:05:23 -0800 (PST) Received: from smtpclient.apple (global-5-143.n-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id r12-20020a05600c35cc00b003d9fba3c7a4sm800681wmq.16.2023.01.31.23.05.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jan 2023 23:05:23 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: [QUERY]: Block region to mmap From: Jessica Clarke In-Reply-To: Date: Wed, 1 Feb 2023 07:05:22 +0000 Cc: Matthew Wilcox , "Lad, Prabhakar" , Linux-MM , linux-riscv , Linux-Renesas , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Palmer Dabbelt , Arnd Bergmann , Rob Herring , Krzysztof Kozlowski , Geert Uytterhoeven , Fabrizio Castro , Biju Das , Chris Paterson Content-Transfer-Encoding: quoted-printable Message-Id: <11BE997B-93C7-4D38-99BF-FD025A1FB945@jrtc27.com> References: To: Christoph Hellwig X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: a7x9dyhu7mn9roa8yio7z48rpy5bpqby X-Rspamd-Queue-Id: 50001C000B X-HE-Tag: 1675235125-30413 X-HE-Meta: U2FsdGVkX1+7x+cb9RJn63QQYs1EL+ID7olAmXKaUyQjBzBDlmfaH2bpLxGe8ZsYhBPHKlyujKQ/T7AOapiVU5jDOK9cKoWPUaCIxh3dlqLy2AkhQNVEvd+KyhemcOzf7M8hyaWZU1hU1pan8lMON23POXqQZmq61nCkL+FdrpIPPOxL6vitBIFRUupnV1mtLLAZbxWJOM0lHU1Q+zO7bRvuEJXe4stOctS9d3xzeOVgISfJvhR01YwfYrwlHf1J98l3e/JZVNMTO1HT75f3e9CMOgsNeIimRbS+3RzPZ6LIUHCHjLXqGhd/FXsaZ2siFsvst4af8BBxqcpO/eHa+C7Okkwf6AgwmFou9R+N07xTBxDQbrgHr2JXFarJ807pAbrxSxZVfsy+Q8kxsmoviwU0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/8pj3JF1J0evBx0rax0RZSkeuZGNZ+B7ShTvp9gJkcxiYQhp/H7J0rSYuqUCQ4n1OU+i0OEK9WIy7zE4SBI2YoWhh45 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 1 Feb 2023, at 06:31, Christoph Hellwig wrote: > On Mon, Jan 30, 2023 at 03:24:40PM +0000, Matthew Wilcox wrote: >>> Basically we are making use of the memory protection unit (MPU) so >>> that only M-mode is allowed to access this region and S/U modes are >>> blocked. >>=20 >> This sounds like RISC-V terminology. I have no idea what M, S or U >> modes are (Supervisor and User, I'd guess for the last two?) >=20 >=20 > Yes, M =3D Machine, S =3D Supervisor, and U =3D User. > M omde is the absolutele worst idea of RISC-V and basically a mix > of microcode and super-SMM mode. >=20 >> Before we go too deeply into it, how much would it cost to buy all of >> these parts and feed them into a shredder? I'm not entirely joking; >> if it's less than the software engineering time it'd take to develop >> and support this feature, we should do it. >=20 > The above suggests this is in no way an actual hardware problem, but = the > stupid decision is done in the M-Mode firmware. I think it is very > reasonable to simply not support the devices in Linux until the = firmware > is fixed. No, it really is a hardware spec violation. Virtual addresses within the magic range bypass translation with no way to turn it off. The firmware is being (has been?) patched to block those accesses at the physical memory protection level so any attempt to use those virtual addresses will fault, but if Linux wants to support this cursed hardware and its gross spec violation then it needs to forbid any allocation of the VA range. This magic range also overlaps with the default base address used for both GNU ld and LLVM LLD, for added entertainment, so almost every position-dependent binary that exists in the world for RISC-V cannot be run on this hardware. One could change that for future binaries, but that doesn=E2=80=99t seem right to me... IMO this hardware is even more = =E2=80=9Cnot RISC-V=E2=80=9D than the D1 with its page table mess, but I don=E2=80=99t = think we=E2=80=99ll ever see RISC-V International come out and say that, so it=E2=80=99s up = to the open-source communities to decide what they want to support and what they view as too much of a violation to be acceptable. Jess