Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2582064imu; Sat, 10 Nov 2018 18:50:41 -0800 (PST) X-Google-Smtp-Source: AJdET5c2rqy2qO5Ek9n0X7Qokn/1vr0d5a4Daedkb9XIQPFlHw6Sj1j861T0CH3Lm+/9xnELHNui X-Received: by 2002:a63:5a57:: with SMTP id k23mr12751223pgm.5.1541904641922; Sat, 10 Nov 2018 18:50:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541904641; cv=none; d=google.com; s=arc-20160816; b=nWDfMq2/ASCu0o/nZY5ymUhKKpMKbyws5KIwCML5sTj3LO497yAPbCtW4KKpW3WpzR RIMzLxXgY8FUBRP2IKEdC00QO11FI0WI1Fk82m36h6vCxsNYPoK5A6t8W9Rdt3CqcckS sLcKNHbph9XuC4JUMimPqow7l1cITgK3Jcae08M0WrnbWD+vBwPUaYdX8Ig3Lz5PmZHx bgoALPyGIMvDIundqOCFeeEtgR3cDCcaN6NSfriwmIAHkQ1E66Rur/ryjKnt+s/lhyfW pa587ua3IeexA/bJixwWb8ioUDJ0c3nVrmf3zLXbSFxnoR8d8mQMMtvAkOwhEtNCxHcg NimA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:date:references :content-transfer-encoding:mime-version:cc:to:from:message-id :dkim-signature; bh=ieUj7dC9LNUl53/E8eb1Cskozd0JqFmxwyec8tEE9j4=; b=FZMlhJ6I49ABPGaij4k1EpNImELBCgj0mHNXimUaAkece7stakw1d7+2o7A9v2TrnN 72LoifT/ObL+43WW/7ayaELxh9lHs7PCBhOCwfgMYOs9MqYlCEQeP+U/UJXwX6h2Wktj CZm3ydPErWGUJuOaxlf0/vKxUckoDwWGOgl8K31LQycFdDFUa92ZO+0bNFp54uvcjnar xnyQyRNZE4E5hBAn8mg/psYRjULHNIfQ9r/32BsoZm5jDL1C5/y9zJRyRWhh0hOOBH5n H9kqhdxfhyZaHvdSuZWVpeviF0ghcBPCEkG+LGm7AIurh9OjrSIsrXkseu+Bo1g7otWJ EdyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BaAot2+q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3-v6si14312384pfl.209.2018.11.10.18.50.26; Sat, 10 Nov 2018 18:50:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BaAot2+q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727395AbeKKMf7 (ORCPT + 99 others); Sun, 11 Nov 2018 07:35:59 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:41311 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727112AbeKKMf7 (ORCPT ); Sun, 11 Nov 2018 07:35:59 -0500 Received: by mail-qk1-f196.google.com with SMTP id 189so8169730qkj.8 for ; Sat, 10 Nov 2018 18:48:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:from:to:cc:mime-version:content-transfer-encoding :references:date:subject:in-reply-to; bh=ieUj7dC9LNUl53/E8eb1Cskozd0JqFmxwyec8tEE9j4=; b=BaAot2+qDgH73Jyum4WxKSxq4c0tkkOWbKehGcSeAJ3Q6pRjPXcExeBfaK08nV7a3n gKAvXNF6oETMAMvmsiaRHPJGMwG8BHJmw63PLrBN90ZxLLaYmMfnSyh3sK+7jT4FgHTK nz8vz/DvvIqr6laSsD8X6EkXc/Bs0erf7wzr8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:from:to:cc:mime-version :content-transfer-encoding:references:date:subject:in-reply-to; bh=ieUj7dC9LNUl53/E8eb1Cskozd0JqFmxwyec8tEE9j4=; b=n15tShb81eb87Kxkwa0xm44RlSF47XoScNs4i7ZurPGpPJgGHAAG1q1MSX76c6vXLq /Loe92oxyYU3S7YQMvz7D7GP+D8s+1w0UAohHJLCAvnuPE1OJUROfRaq0fwLqOObsZ/H KLZ6Bwo0OcsRKAAEEX0GGXQFsS6ngh8mUjljGNZYUVc/AxvIFQ7HeM41BCSmc69+30RZ 7UZeLRHNfnY5HUI/h5HVNsQ7NvH9oNMFuZoot9EYtbfNkaJiZc81zzRaTaULhN9GqWdh RRtvrwZ2xfiBFnOTAr7llTd6Q1rRBdIMa9mhJjDrogV3oAnI8wEZUEe41KrTgzWv8/X7 MMsg== X-Gm-Message-State: AGRZ1gJAMPE47LOZ9lDt85Cz5ozkMeAcJIi5VVnwR6q+kJ5sVN1wNnrV vwwm/iHV6mOMMaXP2qrbWzrqSw== X-Received: by 2002:ac8:1ab8:: with SMTP id x53mr14200346qtj.44.1541904530416; Sat, 10 Nov 2018 18:48:50 -0800 (PST) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id h25-v6sm10242935qtc.44.2018.11.10.18.48.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Nov 2018 18:48:49 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id 1DEA821E49; Sat, 10 Nov 2018 21:48:48 -0500 (EST) Received: from web3 ([10.202.2.213]) by compute1.internal (MEProxy); Sat, 10 Nov 2018 21:48:48 -0500 X-ME-Sender: X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 9623F9E53B; Sat, 10 Nov 2018 21:48:47 -0500 (EST) Message-Id: <1541904527.857883.1572718104.2AE8D0DA@webmail.messagingengine.com> From: Rafael David Tinoco To: Alexey Dobriyan , akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, gorcunov@gmail.com, linux-kselftest@vger.kernel.org, shuah@kernel.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-c0552f07 References: <20181110184920.GA18252@avx2> Date: Sun, 11 Nov 2018 00:48:47 -0200 Subject: Re: [PATCH] proc: fixup map_files test on arm In-Reply-To: <20181110184920.GA18252@avx2> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Including Shuah and kselftest list... On Sat, Nov 10, 2018, at 4:49 PM, Alexey Dobriyan wrote: > https://bugs.linaro.org/show_bug.cgi?id=3782 > > Turns out arm doesn't allow to map address 0, so try minimum virtual > address instead. > > Reported-by: Rafael David Tinoco > Signed-off-by: Alexey Dobriyan > --- > > tools/testing/selftests/proc/proc-self-map-files-002.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > --- a/tools/testing/selftests/proc/proc-self-map-files-002.c > +++ b/tools/testing/selftests/proc/proc-self-map-files-002.c > @@ -13,7 +13,7 @@ > * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT > OF > * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. > */ > -/* Test readlink /proc/self/map_files/... with address 0. */ > +/* Test readlink /proc/self/map_files/... with minimum address. */ > #include > #include > #include > @@ -47,6 +47,11 @@ static void fail(const char *fmt, unsigned long a, > unsigned long b) > int main(void) > { > const unsigned int PAGE_SIZE = sysconf(_SC_PAGESIZE); > +#ifdef __arm__ > + unsigned long va = 2 * PAGE_SIZE; > +#else > + unsigned long va = 0; > +#endif > void *p; > int fd; > unsigned long a, b; > @@ -55,7 +60,7 @@ int main(void) > if (fd == -1) > return 1; > > - p = mmap(NULL, PAGE_SIZE, PROT_NONE, MAP_PRIVATE|MAP_FILE|MAP_FIXED, fd, 0); > + p = mmap(va, PAGE_SIZE, PROT_NONE, MAP_PRIVATE|MAP_FILE|MAP_FIXED, fd, 0); > if (p == MAP_FAILED) { > if (errno == EPERM) > return 2; I have sent a patch removing proc-self-map-files-002 AND making 001 to use as a HINT for mmap (MAP_FIXED) *at least* *(2 * PAGE_SIZE), which would, likely, attend all architectures, avoiding trying to make the test specific to one, and, still, test the symlinks for issues (like bad chars, spaces, so on). Both tests (001 and 002) have pretty much the same code, while they could have 2 tests in a single code, using kselftest framework. Is NULL hint + MAP_FIXED something imperative for this test ? Why not to have all in a single test ? Are you keeping the NULL hint just to test mmap, apart" from the core of this test ? Sorry to insist.. If you want to keep it like this, I can create a similar test in LTP - for the symlinks only, which seem important - and blacklist this one in our function tests kselftest list (https://lkft.linaro.org/), then no change is needed on your side. Thanks