Received: by 2002:ab2:23c8:0:b0:1f2:fdbc:cb93 with SMTP id a8csp138675lqe; Wed, 27 Mar 2024 00:55:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWIvLBdw0JbZZf50W27lmGIId9slV/SeUyGS37XrG5P6wqMMTuqyOvso9FAUqnQQ8lzDO17B6zUbn8H9vnCvSnLNUjVIXnocin9A2B45A== X-Google-Smtp-Source: AGHT+IHnl9PxfuazvtfhyGkZJg7G0KI0+dGVEhow+mrpgrdfELuyDXxWjBDZUXF5iZ90pkSLxpGD X-Received: by 2002:a05:620a:4496:b0:78a:397b:86ef with SMTP id x22-20020a05620a449600b0078a397b86efmr609281qkp.37.1711526115221; Wed, 27 Mar 2024 00:55:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711526115; cv=pass; d=google.com; s=arc-20160816; b=EOXYtioRXn7yfmAm076XvVlfFkjxnoTN5zwg8NSbsaCep/51ZCXxaUJDvgbC9S/8xq TEtxVf/H3actB7SRQHM2HLa1sPXqM+EkDn1pjrSPp4yqPbR3rE7WUZ/7CQ+sAWEdd3uD HuIU9xAxPBOwPcPR4OCrp0Ah/DXtiTljL4ZM0BC/K8NR0wgUodoxaxLB4KsPKbvS46Wu 3ClXIsBrctMgSEjb5YWkMZFVD9jI/Yh0XT413RfhUKzDaPAYoPitGC82OgY3VszaCTjg 0YhUJHuD3qK4PWbpsgxnj3KIxee6jOTWujc1PqeAVEv7tiuZ0rsm0iFaME/xo5KLYdRU 63xQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=5e8VEDc6X3vdP7dz2M9r9pk6H8tvft/oIARZVKpUkPM=; fh=iHWQaJX8hNtMN6TP8w6EmHohg+Q5VisnFo6kfELGHHA=; b=OYGHeSfDXwERdpE+RohevnAoDWlEfZEQ4/ceWWHyDuYi9Z1Ata9MstPrS8ZW9Ayl8T kWOvtNfNts6hmEI8kfaAQQ9w6LLDjFyjxuvk68whh7uojADbay0jqHkShcaF6tNAk9+F f/KAHmdKJybXaIUQ2K5HP9bHvlfCJFUxzIBKYvQp0DttiRiGBLgPGLli/hrzjcMLONFo 6tAi22oo1bTz7m0qov6maGZhlQABZ1U3zurWuyoTIh+BqW/JrZOKIxjybbfNr0ZCGbQ3 rZN2fMaDXWr0HPMvkvX+ooe3Ibrqb8u73hyWPcp0NnkQ3XB6UkdCAjSmkSxT9jD/spKp DgkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fEFYpdco; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-120473-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120473-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id l1-20020a37f501000000b0078a00d309eesi8972501qkk.554.2024.03.27.00.55.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 00:55:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120473-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fEFYpdco; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-120473-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120473-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EC83E1C26060 for ; Wed, 27 Mar 2024 07:55:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97E0E2C6B0; Wed, 27 Mar 2024 07:54:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fEFYpdco" Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (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 40F0B1DA21 for ; Wed, 27 Mar 2024 07:54:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711526051; cv=none; b=s4LeHk7oWDBfH3bb48H4lNdv6wLBt09dfL07hnhfn/ymlAFGWjrwJrlJ8evHRcLxohU8KCSCgbqW/Gh/5CzAG0t7URbdxV709iQD5/L9ENlDAVJMic1JeK/GgQ/qpLU7XGvy6VgH7ksEwxV++4I0fesiyujqcZGcKtiYztMdL+o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711526051; c=relaxed/simple; bh=k2hKUHtmNw+3Nry+09PEpiWVfUC02KEaPbAqug7TAco=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=ToLM6km/V6nCcVCIgW2mSFr3KnQNdmHDL71uLNfZ+A66gVgJbSsSHdtPHw5Vtz65eUO348t+kX4HMwBqk7Mm8wlaqlPGq5TVfIhlPFeyv3wt69bfJPERGi8/AvuNB1XIGq2d3+KW2GrXF7HvjgIoPlXTD8qYP2WAnfOxnx0u5uc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fEFYpdco; arc=none smtp.client-ip=209.85.216.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2a07b092c4fso1860081a91.0 for ; Wed, 27 Mar 2024 00:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711526046; x=1712130846; darn=vger.kernel.org; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject:from:to:cc :subject:date:message-id:reply-to; bh=5e8VEDc6X3vdP7dz2M9r9pk6H8tvft/oIARZVKpUkPM=; b=fEFYpdco0WVZPEO5jPet4utYDkvHLeSDcF9nIEDzssjc4A5uBzOYjyKkFcEdIGi5B+ gTeZ6aXP1ZKSXs+vguRj76LCbrfKdxospTuA7PARA07TXAT56vaZbZ8FECIX1SK5xDKp tiY8gnY1GmpCDdM+N2Wn/jYXgoCq/jGq1w8sSEh8uhYlma5gLv2H7zZoACJ1mZM8UYEw 9xPxbShwHF7p9VW9dJjpHFXqsKz4LpfHsB8L4xh3noF34zeNhBoJI4KaJuYsS8THzSgW L6ynFHqdSj9XuLMZMEF7Hc+QpG+atMk57Qdnzle8R3KwjYjT/Kj99b4vVVoXWSXywoyX LNjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711526046; x=1712130846; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5e8VEDc6X3vdP7dz2M9r9pk6H8tvft/oIARZVKpUkPM=; b=JktGYzJ5gjuiW0XKVOlDNqkqlTWi9ig6G9CnqXnDSvsRWkj6/nJIFSkJ9sCCYuyAQN 0TT1+6uxl8tTCRbZd+Lgx5s86je5Yw9IrFtoH3bNEGEa5L8/Vijwr13AwIoY1iJb71dj KgI/B33uKV/+adqOojlfjRDhnnNPkqO8Pwqr+HkEpwfUbQK4axh8HgYt8TKihGJWjxpp lCPSa4Tgx4qhO4n8ZKUUi6gB0qD+z7sTeUDB1U1ku5A8/XJ3JYgoJ1PBmPBzM08YL2W4 Afj1fqVRwEo6+qznB26fWVM1EFKKgGhQpaMyU2KbE8uClLh+GCEjvO2NWKyRmM5jCVuj AeVg== X-Forwarded-Encrypted: i=1; AJvYcCX07/nayDAchFJHdXVhbtv/G4OdV99KQVuYtuQiX4hACxjaCJk5p7LRcNDFvuRh5fQ4fUONqUZtgYpiUjIodng/vnEFk68y+RGJkQZ7 X-Gm-Message-State: AOJu0Ywe8UZ8XSRoz8MxIA5PvP7wuZRSwQKya10c5I/dglaKS5X2aeJI LSfQqN7KPkQIy/CT4/122/Wbmb4/lyekHmeTEVdhjwY1bnyy/eRc0ZonKQyGbFQ= X-Received: by 2002:a17:90a:f697:b0:2a0:4835:972 with SMTP id cl23-20020a17090af69700b002a048350972mr400982pjb.4.1711526045593; Wed, 27 Mar 2024 00:54:05 -0700 (PDT) Received: from [192.168.0.13] ([172.92.174.232]) by smtp.gmail.com with ESMTPSA id si13-20020a17090b528d00b0029fe0b8859fsm2531873pjb.1.2024.03.27.00.54.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Mar 2024 00:54:05 -0700 (PDT) Subject: Re: [PATCH 1/4] riscv: Fix TASK_SIZE on 64-bit NOMMU To: Jisheng Zhang , Samuel Holland Cc: Palmer Dabbelt , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org References: <20240227003630.3634533-1-samuel.holland@sifive.com> <20240227003630.3634533-2-samuel.holland@sifive.com> From: Bo Gan Message-ID: <668ad9cf-08bf-92de-b70a-af36defda6e0@gmail.com> Date: Wed, 27 Mar 2024 00:54:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 3/27/24 12:04 AM, Jisheng Zhang wrote: > On Mon, Feb 26, 2024 at 04:34:46PM -0800, Samuel Holland wrote: >> On NOMMU, userspace memory can come from anywhere in physical RAM. The >> current definition of TASK_SIZE is wrong if any RAM exists above 4G, >> causing spurious failures in the userspace access routines. >> >> Fixes: 6bd33e1ece52 ("riscv: add nommu support") >> Fixes: c3f896dcf1e4 ("mm: switch the test_vmalloc module to use __vmalloc_node") >> Signed-off-by: Samuel Holland > > Reviewed-by: Jisheng Zhang > Reviewed-by: Bo Gan Thanks for this patch! I'm doing something similar locally and it fixes the linux nommu + musl libc build on my JH7110 S7 core. Bo >> --- >> >> arch/riscv/include/asm/pgtable.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h >> index 0c94260b5d0c..a564a39e5676 100644 >> --- a/arch/riscv/include/asm/pgtable.h >> +++ b/arch/riscv/include/asm/pgtable.h >> @@ -882,7 +882,7 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte) >> #define PAGE_SHARED __pgprot(0) >> #define PAGE_KERNEL __pgprot(0) >> #define swapper_pg_dir NULL >> -#define TASK_SIZE 0xffffffffUL >> +#define TASK_SIZE _AC(-1, UL) >> #define VMALLOC_START _AC(0, UL) >> #define VMALLOC_END TASK_SIZE >> >> -- >> 2.43.0 >> >> >> _______________________________________________ >> linux-riscv mailing list >> linux-riscv@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/linux-riscv > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv >