From patchwork Thu Sep 12 10:00:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 13801840 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 EBFBFEEB582 for ; Thu, 12 Sep 2024 10:00:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 49CE46B007B; Thu, 12 Sep 2024 06:00:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 44C716B0082; Thu, 12 Sep 2024 06:00:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 33B666B0083; Thu, 12 Sep 2024 06:00:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 162C96B007B for ; Thu, 12 Sep 2024 06:00:37 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A44C612146A for ; Thu, 12 Sep 2024 10:00:36 +0000 (UTC) X-FDA: 82555641672.04.EFF9372 Received: from cstnet.cn (smtp81.cstnet.cn [159.226.251.81]) by imf06.hostedemail.com (Postfix) with ESMTP id C319318000C for ; Thu, 12 Sep 2024 10:00:31 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of zhangchunyan@iscas.ac.cn designates 159.226.251.81 as permitted sender) smtp.mailfrom=zhangchunyan@iscas.ac.cn; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726135129; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=eOPmlE+CYN67HqYCYoHDeKDjg6nzZFcFesNOs/dbAHk=; b=owBbK82ITtdt7gESWIOJdrMa+Vdy+idwSCNrOdmcD4l3GDXNuEOj2PHhSlyWK7xsdEv36j uOMnwLpE5QFlNkGZKPC5J0RSf0nH4ES2NAYJOqJQQ4+D8eqiel+qwzIkzQwOa2lWvjXIji ILkSIsyJAonduBCT5Wk4Ollz5dsn/1g= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726135129; a=rsa-sha256; cv=none; b=FbgwIISgr5t9/q1snCf4tj591XGCkjUcEtCHfntdRFl/cV4Mk6pTriqcQGuu9aTffUuFo7 YSVv7ZURZ1LElnbAPadT4nV5V4zGB8W7lcm4TicWxIhPmXbmiuDhRXGrn50sTkAOKoeaaV y7896zzM4jEWHdZyvKiq/tIkmRDHXsE= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of zhangchunyan@iscas.ac.cn designates 159.226.251.81 as permitted sender) smtp.mailfrom=zhangchunyan@iscas.ac.cn; dmarc=none Received: from ubt.. (unknown [210.73.53.31]) by APP-03 (Coremail) with SMTP id rQCowABXho61u+Jmfr4GAw--.13301S2; Thu, 12 Sep 2024 18:00:22 +0800 (CST) From: Chunyan Zhang To: Andrew Morton , Shuah Khan , Paul Walmsley , Palmer Dabbelt , Alexandre Ghiti Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Chunyan Zhang Subject: [PATCH] selftest/mm: Do not use hint for riscv mmap Date: Thu, 12 Sep 2024 18:00:18 +0800 Message-Id: <20240912100018.736447-1-zhangchunyan@iscas.ac.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CM-TRANSID: rQCowABXho61u+Jmfr4GAw--.13301S2 X-Coremail-Antispam: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210.73.53.31] X-CM-SenderInfo: x2kd0wxfkx051dq6x2xfdvhtffof0/1tbiBwsSB2bif7X3hgAAsm X-Stat-Signature: 759uzeohb3fcihatoxeht1syswy83d53 X-Rspamd-Queue-Id: C319318000C X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1726135231-474351 X-HE-Meta: U2FsdGVkX1/etrxnWqfld47bZLITJKCyGRty6vjhQc9/C5MWBbHXpVCFHrjE8nIh3k0oasauXUdQzoQjRbIl6qzuqwEnxmnADa4GEnlXn78YhzVdSZxOyiZtD3YVL8g0/GlMFY+Wkt7RFWamZsO7x7lnzJs+CV1bKDfG1YuB/WMew9jlDP7k3QZOK3SBCFdAWvncPOlnfwLErwc1wn8NW88ZdU0LUqTpUDSMGHvdAx+2Anp+S2wv/w/HnPfu+NcL9ufni3httn86UDZF3AumdE7GBDkb6AxAVEzNKsla8d+F4xjk0i691O/nZoboLm//Hhz1RVcFaBdZR35OtS7nrv8LV7F9NEb6VAEXG8teUdDqRRhUomnn8OL21H4ZOnGv1rWrk7Ov7A8x3TYl+dH0X7w+F2AxgCVc5fum8L+CKdzb4+89Lx80FtrPll23dYT6QUWgIcXxWrgvUWZYtqjMBPhc1wMZpOK/24jMsmR/q22bQE/zu0EkOjwPTEE6YHMrK5r76Ya28upsSlqAVS/GQp9AW/wHY/2bE+aEcVIoLcixT7CEzOPG7CdZNPMhZ+INPknPZuMc/FSmmepuhK5KECO7MmO6Vg03FwMLvNrWMRAN5tECsoP1BzRU7fsdTlNhizJjL3T8yzB7GDnP+YttJ5Pu3OrgM3dK/lae2n20IfcJJnUTOJZTZm6+pcKKUjGXjPa9EUCRRz9/NqxU2jrKrR5jI2LCkD7mXWwgg9BcfmmZLV+BoN+a/2TTsnQhrByHfzFHtFX36VXIpLc2KGNV1lMgSujjMat8W1S/jQUcOl2mgzU9knv6HerfUX0S4pcvn9WLJ9BLa2vNZOeC6ygMr1daYqaq2OAiLdhshzJs7phQdEu1qUwHWIxyK+OxHVXgJSB+j/6zwv5rJhKOynpciPMWROhVurkRyVrqPnTkrBwZ4F8nNfs1dLeOq6Jm4ezH8dvNmt1yiWFaC+p8CGQ RKVGsx55 FuRR4GgX2G4pP3S6N/PfRw+aTME030O7Uxfy8iq+6EhIw7nvGGLV8OVtrbTlD1pQtOmoZD4J40bwvj3Pxi3/ZtvdJh2UWCL3ZwvkHy8UYUHvWJPRsiJ8WqyF57n4+d5ieYiHeCvvbgdijae8e/0OeWOcX9oYi0seEGjBiSzMkahpKzlWQyMgswd3je2BdifFcS4bmEJGM1L94LJtdlse7FHJzuckK2bDqMRs7 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: When the virtual address range selftest is run on RISC-V platforms, it is observed that using the hint address when calling mmap cannot get the address in the range of that validate_addr() checks, also that will cause '/proc/self/maps' have gaps larger than MAP_CHUNK_SIZE. Signed-off-by: Chunyan Zhang --- tools/testing/selftests/mm/virtual_address_range.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/testing/selftests/mm/virtual_address_range.c b/tools/testing/selftests/mm/virtual_address_range.c index 4e4c1e311247..25f3eb304999 100644 --- a/tools/testing/selftests/mm/virtual_address_range.c +++ b/tools/testing/selftests/mm/virtual_address_range.c @@ -64,6 +64,14 @@ #define NR_CHUNKS_HIGH NR_CHUNKS_384TB #endif +#if defined(__riscv) && (__riscv_xlen == 64) +static char *hind_addr(void) +{ + return NULL; +} + +static void validate_addr(char *ptr, int high_addr) { } +#else static char *hind_addr(void) { int bits = HIGH_ADDR_SHIFT + rand() % (63 - HIGH_ADDR_SHIFT); @@ -81,6 +89,7 @@ static void validate_addr(char *ptr, int high_addr) if (addr > HIGH_ADDR_MARK) ksft_exit_fail_msg("Bad address %lx\n", addr); } +#endif static int validate_lower_address_hint(void) {