X-Received: by 2002:aa7:d343:0:b0:40a:1425:8896 with SMTP id m3-20020aa7d343000000b0040a14258896mr205224edr.242.1645633444418; Wed, 23 Feb 2022 08:24:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645633444; cv=none; d=google.com; s=arc-20160816; b=YnsZe28opJaSmhTaHDEpi5jmmthMk1bHRe3YLwpV80OUq8MAPBtKa+BIhOaj/fsIKX G82KIBZ/ujdD9ueHm6hjgdd5kSDf7xvq2bgWaDcyurpGotCPt6igVCUZf+1BZSMG5CDL oVrNFgGFR8SIbghSFl3nr0l5AoOeOl+qnCnbcuFjzm46ZWtBGb15YTWGdO18gbq1dXQy evh5qmilWnz7zS7o/DLt8nQXBx3U1KRps+FiWfdQxq0aKpmlKw4cVEb0a9tGmwK3SLyV 2WtkbT0nS/viLHnnrvgD2cwtpxtZvuMeCmYwJsuIQML4yPml9zzfmuHpR92G973zmbHv YXgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=JZLWwfZAXa5IAoYAHNoMXqn0/gVGhJwxm48jUibn4iI=; b=Z2zs5jsOmK+NuE+iJI8Ac/Zq9Kh1QAvaXom0IMwmvQN4bvprAFXOwjctESe5athfM6 8vat6Z51lfYuSopjAm7MfG27vi5yZkKIkBVg/x5nAhZU/cv0/ojSqw3WzeepdOfQ4XJm qBe3jKrNc0oJZC2hg9K5Kd9GlS0v67i3EKZP7NZW3m3XF1VsRFZwWo6kNGFpAl0vcJFk rMeKMoDSy0SIRt4PWI2oCLFzIXjCuT4ymMqD3r7ZEIuCq/30WZVOmZrnqsJCy/uXnSpd cmuzXdKV7ua3ENL7PoLAbY7RfL3Cqj/xEgBKRiY1WLw5A1lrgx09+yhWo2zn7dw+Z0Nl WBgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y10si11081974edj.424.2022.02.23.08.23.35; Wed, 23 Feb 2022 08:24:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239169AbiBWLAX (ORCPT + 99 others); Wed, 23 Feb 2022 06:00:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233910AbiBWLAW (ORCPT ); Wed, 23 Feb 2022 06:00:22 -0500 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AE5C8C7D1; Wed, 23 Feb 2022 02:59:54 -0800 (PST) Received: from mail-wr1-f52.google.com ([209.85.221.52]) by mrelayeu.kundenserver.de (mreue009 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MlfCk-1o4Ra6312w-00inTg; Wed, 23 Feb 2022 11:59:52 +0100 Received: by mail-wr1-f52.google.com with SMTP id o4so2135193wrf.3; Wed, 23 Feb 2022 02:59:52 -0800 (PST) X-Gm-Message-State: AOAM532w0I/FQasSXoRn7paj/0r708sN7Hcll05a600icEtPzbVFW5nu NA3gFKSoZzvNLofXWNFCuRR21wXtMvkt8QI7GtY= X-Received: by 2002:adf:90c1:0:b0:1e4:ad27:22b9 with SMTP id i59-20020adf90c1000000b001e4ad2722b9mr23150986wri.219.1645613992251; Wed, 23 Feb 2022 02:59:52 -0800 (PST) MIME-Version: 1.0 References: <20220201150545.1512822-1-guoren@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Wed, 23 Feb 2022 11:59:36 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V5 00/21] riscv: compat: Add COMPAT mode support for rv64 To: Palmer Dabbelt Cc: Guo Ren , Arnd Bergmann , Anup Patel , Greg KH , liush , Wei Fu , Drew Fustini , Wang Junqiang , Christoph Hellwig , linux-arch , Linux Kernel Mailing List , linux-riscv , linux-csky@vger.kernel.org, linux-s390 , sparclinux , linuxppc-dev , Parisc List , "open list:BROADCOM NVRAM DRIVER" , Linux ARM , "the arch/x86 maintainers" , Guo Ren Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:fDj8UNVRV8r/eEkDy+HCLSo5oTnkzwOoBxcvqklwcRxXRwi6wUV 6SE5GCBES+rEkqbaFiHz6aGc/CNcIz7j4g51nG2OX1z+qqp19c2xUqQAOlXIpbA/+vI2jCi 66nCed0HrHG8pKuBjTvpQfJ7mhp2uPg7qBZSY37R2iNdBB0GFnk2uzfcY2yijMhTM9tVR5a 82jnAWH9+MAZlTC76Larg== X-UI-Out-Filterresults: notjunk:1;V03:K0:VYpzYxJP3NU=:KiMJ/01sPAWeZQz4PFOQPd EUCgAbE0c2Cin8EOQRowCayryy7BPpe5bQgq2432OdqeY3VSVKI/wNylTiMVyAmj6FT2ytEiM gL1j8GQTU/d4DIa8yFaX2cUj/wMx2326wezaZ/Eg+xrmMuJ22WbnjY/4ERGhOlKbe2ajo2q4j nB1wwbuu2/KVd3tKlRy0wp6mdIDFpfpVGcEqCqwAj/hP5wu4Bpxj+rAKgQYaWLjMjB0i8h7OV ODpdELWbpwXtYHT1HK6t4KipCMhxoWeyfSxoLNNTG+0iakeWXjAJm7KH4geyKsF5/dBiVLve9 MKzdUoMmTtdVLU0sMdKfHKhCsTfnPdYQbHoCzlVJOPOWfiUsbKZBWyaJbNPiDikGERCSzNAAX C4eXdL1FU/X0/uSzrmBOisTs1d7tFnm4TPPjLwuvkpTeDoFyCotroxkVLOwXyLoW/6Mtt2A5L f7HnXCuoCVK9NDA56rC8hmP4fvF5PgPXfZ53EjoRa0KAXhkeOt6hjiioccWF8GB3wtpYCSz2Q x/w188d2UL8fdFCA4/qcA93GYKxVDxtyijHEs2fv4X9cjVSLS1xofqo82uQlZNOld5oQD8grR 9xl/STptXx2jNltgonnEIU+jCcw8/C7Gq4wQYgpPWV4qU+vacJZX3kzdQKa4ngeO+Nmodh57z d51eBFgsR+V899w2wccXBgAg4hC1fCn0bVJEkBD2re7ZZKS51/XEGqsuqHdGgdz0vP3FvtHR9 q8gtkkCIZPBMtMVsq/zXp0ciSyWaDJ1PcchbymzduRV9j0RoDYiuZAkhzcXQdeR8TUPw23V9y gjOWaejEBuP9kA/k1Ei5FfLOuljURkZ8ilqRlxgTSyUIVJnqi4= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 23, 2022 at 2:43 AM Palmer Dabbelt wrote: > > On Tue, 01 Feb 2022 07:05:24 PST (-0800), guoren@kernel.org wrote: > > From: Guo Ren > > > > Currently, most 64-bit architectures (x86, parisc, powerpc, arm64, > > s390, mips, sparc) have supported COMPAT mode. But they all have > > history issues and can't use standard linux unistd.h. RISC-V would > > be first standard __SYSCALL_COMPAT user of include/uapi/asm-generic > > /unistd.h. > > TBH, I'd always sort of hoped we wouldn't have to do this: it's a lot of > ABI surface to keep around for a use case I'm not really sure is ever > going to get any traction (it's not like we have legacy 32-bit > userspaces floating around, the 32-bit userspace is newer than the > 64-bit userspace). The low-end embedded market isn't usually that newsworthy, but the machines ship in huge quantities, and they all run 32-bit user space for good reasons: The cheapest Linux systems at the moment use a low-end MIPS or Arm core with a single DDR2 (32MB to 128MB) or DDR3 (128MB to 512MB) memory chip that for now is a bit cheaper than a larger LP-DDR4 (256MB+). The smaller configurations will go away over time as they get outpriced by systems with LP-DDR4, but a 32-bit system with 256MB will keep beating a 64-bit-only system with 512MB on price, and will run most workloads better than a 64-bit system with the same amount of RAM. On the Arm side, I hope that these systems will migrate to Armv8 based designs (Cortex-A53/A35 or newer) running 64-bit kernel with 32-bit user space to replace the currently dominant but aging 32-bit Cortex-A7 cores. As you say, RISC-V is at a disadvantage here because there is no existing 32-bit ecosystem, but it may take a chunk of that market anyway based on licensing cost. Between doing this using pure 32-bit cores or on mixed 32/64-bit cores, I found Guo Ren's explanation very sensible, it lets you use the same chip both as a low-end embedded version with SiP memory, or using an external DDR3/LPDDR4 chip with enough capacity to run a generic 64-bit distro. > My assumption is that users who actually wanted the > memory savings (likely a very small number) would be better served with > rv64/ilp32, as that'll allow the larger registers that the hardware > supports. From some earlier discussions it looks like rv64/ilp32 isn't > going to be allowed, though, so this seems like the only way to go. Right, between rv32 user space and a hypothetical rv64-ilp32 target, I think it's clear that the former is better because it means introducing only one fringe ABI rather than two incompatible ones with minor performance differences. Arnd