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 3D155FC6182 for ; Fri, 13 Sep 2024 22:33:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 881D96B0082; Fri, 13 Sep 2024 18:33:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 80BB36B00A2; Fri, 13 Sep 2024 18:33:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 653806B009E; Fri, 13 Sep 2024 18:33:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 43C1C6B0082 for ; Fri, 13 Sep 2024 18:33:56 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id B5AC5C0DE0 for ; Fri, 13 Sep 2024 22:33:55 +0000 (UTC) X-FDA: 82561168830.07.ED4F8DB Received: from mail-oo1-f46.google.com (mail-oo1-f46.google.com [209.85.161.46]) by imf13.hostedemail.com (Postfix) with ESMTP id DE16220009 for ; Fri, 13 Sep 2024 22:33:52 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=VX3IjbWv; spf=pass (imf13.hostedemail.com: domain of jeffxu@chromium.org designates 209.85.161.46 as permitted sender) smtp.mailfrom=jeffxu@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726266725; 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=nR+aFVWTVq8CbCarFENk6QxpMqmR4IKiYC+//JY1HWs=; b=NO5BYE/Hrc8I2QSkyVR8HZUd6G2rflLtLtpueEY9HmyKoke8J2yVQnYZOosdCdHemvrt1z AA79TBx8JNtm73pZoBWNFGW4/K1Jhkd7+9Dxf52KSJaMw9ymGHeax3y8lHsFiPKgdsrmGo Hj8Wgop7Yzx7WHrZQyi9Pwz/U9dgDwI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726266725; a=rsa-sha256; cv=none; b=v7s20kTYuMhlj0CsSEjCGGMzvFM3DIms3PaxpQBlI+/21oRB/Vdur4Am/oLmX5ElY8cDxO lsJJeyBIMUCBOwXuTkF7cc+pmJccMPTSi0uiFBsW+QCYZYMJOYrQ6jEKVqRDsGrctt9XN4 kJjtTLYgXZeNbNVBhZJzL4xcR+YdUDc= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=VX3IjbWv; spf=pass (imf13.hostedemail.com: domain of jeffxu@chromium.org designates 209.85.161.46 as permitted sender) smtp.mailfrom=jeffxu@chromium.org; dmarc=pass (policy=none) header.from=chromium.org Received: by mail-oo1-f46.google.com with SMTP id 006d021491bc7-5e1e4f8353cso126435eaf.2 for ; Fri, 13 Sep 2024 15:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726266832; x=1726871632; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=nR+aFVWTVq8CbCarFENk6QxpMqmR4IKiYC+//JY1HWs=; b=VX3IjbWvBar4Co20BcQ4ZNOsi3ZiFRSw4KwMsxTeJ9rBSvcJHLu57UERQUBladpE3D Idg4E05cOlhGRBUF0AzkPxhU9vUNQXIdGXH/R8s3WtA5PYG/EYhm8JZE4FSHmMh2l4xN GMPfnasPGNUjVa7I+FWfXKxPa3Y21tlSsZ+Tc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726266832; x=1726871632; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nR+aFVWTVq8CbCarFENk6QxpMqmR4IKiYC+//JY1HWs=; b=DWFvArZIYC9VoDXTuJQazYGl6XJf13jdKxXzocGiV2rAezOwKyBTS00xSTA2mvH++7 t/U4WJXG4GUw8D2TEzuNpzSaAT0CfXUuCMQRpFiM+1pS3HcXkopnYQgaRqjP3NeL2cz2 xGT+Ca/cI1JjSD/tvEs8InkXqA7fq+q0xyM5biB9BmxESk0scWEaSui+kuElOyKbpiY5 quhZl6g3khTMcYESGLdhpQX9P3pGGDOTp1AXf5LVRpe+a7SnYdBoaa5oS3Ui0qWK49o2 KOp666cvLs9uN0ht87+V/QNBy2VyUnIPYGJceS/lDZ4njB5JK6oVVJmprrigrn7xvOy/ 0XIA== X-Forwarded-Encrypted: i=1; AJvYcCUsguLd95/IOPfQTXsSXnkLMKkTpsrI7/M9dKlEdXXvKrPr0eyZqtZzwz4Q9dC9YzWlRlbp3JuWfQ==@kvack.org X-Gm-Message-State: AOJu0Yx6MW8GfPjnPG4UWGG5A+Xeud8s2uwMVg/kgN3X1K8w9HAveyNJ gWibaWosIqWEZx07PSuN3BUg16j2oaK4iU7QPGw9WRg4L+uQOqG1pNrRuBEDvau3B52NPvIbpZy KiypKVyrqwruHI7RpVqWdC09HZGtOMa11r5ID X-Google-Smtp-Source: AGHT+IHoRn8wPvaGm0XnG3869dlzoogkjY3U7o40PCg3lnku1IuTJCyxK495TTkFeC7nabla4nDYmkGBplV0McjYN34= X-Received: by 2002:a05:6870:65a4:b0:27b:9f8b:7e4a with SMTP id 586e51a60fabf-27c3f694c07mr1516649fac.12.1726266831574; Fri, 13 Sep 2024 15:33:51 -0700 (PDT) MIME-Version: 1.0 References: <20240809082511.497266-1-usama.anjum@collabora.com> <1b36ba43-60a4-441c-981f-9b62f366aa95@collabora.com> In-Reply-To: <1b36ba43-60a4-441c-981f-9b62f366aa95@collabora.com> From: Jeff Xu Date: Fri, 13 Sep 2024 15:33:39 -0700 Message-ID: Subject: Re: [PATCH] selftests: mm: Fix build errors on armhf To: Muhammad Usama Anjum Cc: Andrew Morton , Shuah Khan , Kees Cook , "Liam R. Howlett" , kernel@collabora.com, stable@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Stat-Signature: ckyp49c7zqtxefsbsmtym6yjuwnx5b38 X-Rspamd-Queue-Id: DE16220009 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1726266832-631791 X-HE-Meta: U2FsdGVkX1/0sPOgxqknujcyCQAjcVfLZH6dA3+ABUfhLLDqHloCpayy22I+in7bUkpOE/+bEArHo2TLvmdksJRUW+GKOY/SamHvnS3cfR9a2sldPpOxPca0jhUfqeYnBu8tNc9y/EE72o/bwYRLItYMkHj4BhrSmtWA3fYFHAlucz+P8ujpmdm3itUk0r9Y1zxcFD6qEd8lOnY81FMtd3vcx6szfNtZsMw+yI+U7eFtrhF9GlPntw9L2elZTugAd9u99WJOYsFZD5NQir/9LJIrdqvuQzgP2wyXag7xm9PedE0hPoBgZFgc6OF/cbsmjED0tzglzimn5vZFAqYBK06W+x3jpOlXP23iTx9sT4FVtm9XYD2sFTTBvpx1ZyLHI8yuqAbtLLNN4LDlasdEHRETlCa1y6MwivvpVfBqtEqx/K5dqztZaqV6JuQ1nJiLdGglvtgDqH3jA9JwzgUwF4Ws5OOC6Z45UNP0Yb+IFQdSer1yQgEiPzwg0vNQeiO5Q/egrodSABwoWfep0J3XUKeiM8ScDVw+18lGanSctZNwfcLdt5KAtzziIK6WswhyWAs03x6F/1SKiaENmOumTMdNuLBhrZGCZUBs7MJccPbxXJUlYxT0lUOiL3gnGakS4SYGPbyIfFK6ExfbH3boYo4TGPIsoAr4FPYjleS6zY9ZnDtYLPbOR7gmB4X7yveZSBn1y012ILTqYcpP/qR/y9+/a7GIiYztbMaTiLfDrGLlU0t/YKgsCfQXbqiHi5Nk1UB6nkOVnG66jejrFxY8cR4xo3Yd98cu7gKDkOcON8dVqFQmyhuwZWjpRJiDjEORlUbpYxi4S8mae13qwk5DgkUPgV3O2e9VTBiX7p8JZMheEhFQoJyZBKgkgANOYiL5yHuE9VRSjJm8IMjT/QjAtMJgFyFzbRGJwVRdTec+ncq7d55htfIVyQTHSa2Eq7W/t7T3QGgSJWzzT8Ps3w1 J4zlDXnw IO2taONYYPWDNgnm6hkNMILlsk0/h4+PN1Q/08QaSF0/RmxZDo/c1SFZ9kY113y/B789jo069xscRGVjQIzOa3tCMohUpUVIHeDSgFiUyaadExl3ENh/DYrIfnp5M82WmpFDbtVwqaXgZMXxPFL4hMBFTnavFDymwI4KuhhQ95RfWfUF5QPkiDUFab0PYaLflsipejJ1SFSMbcsnxEIHU/WlAXmMtihx71qvY7Bgi2vzqJtejEa1TGnxL9X4nxbF7sVRX X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Mon, Aug 19, 2024 at 3:05=E2=80=AFAM Muhammad Usama Anjum wrote: > > On 8/14/24 3:29 AM, Jeff Xu wrote: > > Hi Muhammad > > > > On Fri, Aug 9, 2024 at 1:25=E2=80=AFAM Muhammad Usama Anjum > > wrote: > >> > >> The __NR_mmap isn't found on armhf. The mmap() is commonly available What is armhf ? is that arm64 ? I was able to build arm64 correctly. -Jeff > >> system call and its wrapper is presnet on all architectures. So it > >> should be used directly. It solves problem for armhf and doesn't creat= e > >> problem for architectures as well. Remove sys_mmap() functions as they > >> aren't doing anything else other than calling mmap(). There is no need > >> to set errno =3D 0 manually as glibc always resets it. > >> > > The mseal_test should't have dependency on libc, and mmap() is > > implemented by glibc, right ? > > > > I just fixed a bug to switch mremap() to sys_mremap to address an > > issue that different glibc version's behavior is slightly different > > for mremap(). > > > > What is the reason that __NR_mmap not available in armhf ? (maybe it > > is another name ?) there must be a way to call syscall directly on > > armhf, can we use that instead ? > > It seems __NR_mmap syscall is deprecated for arm. Found this comment in > arch/arm/include/asm/unistd.h: > /* > * The following syscalls are obsolete and no longer available for EABI: > * __NR_time > * __NR_umount > * __NR_stime > * __NR_alarm > * __NR_utime > * __NR_getrlimit > * __NR_select > * __NR_readdir > * __NR_mmap > * __NR_socketcall > * __NR_syscall > * __NR_ipc > */ > > The glibc mmap() calls mmap2() these days by adjusting the parameters > internally. From man mmap: > C library/kernel differences: > This page describes the interface provided by the glibc mmap() wrapper > function. Originally, this function invoked a system call of the same > name. Since Linux 2.4, that system call has been superseded by > mmap2(2), and nowadays the glibc mmap() wrapper function invokes > mmap2(2) with a suitably adjusted value for offset. > > I'm not sure if behaviour of glibc mmap() and syscall mmap2() would be > same, but we should use glibc at most places which accounts for > different architectures correctly. Maybe the differences were only > present in case of mremap(). > > -- > BR, > Muhammad Usama Anjum >