From patchwork Thu Oct 11 18:43:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael David Tinoco X-Patchwork-Id: 10637127 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BAD24933 for ; Thu, 11 Oct 2018 18:44:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9F2C2BAAC for ; Thu, 11 Oct 2018 18:44:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DFE62BECD; Thu, 11 Oct 2018 18:44:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FD902BAAC for ; Thu, 11 Oct 2018 18:44:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729569AbeJLCMc (ORCPT ); Thu, 11 Oct 2018 22:12:32 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:41668 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729443AbeJLCMc (ORCPT ); Thu, 11 Oct 2018 22:12:32 -0400 Received: by mail-qk1-f196.google.com with SMTP id 23-v6so6105046qkh.8 for ; Thu, 11 Oct 2018 11:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=y3bQQWocC3HuwOzt4zpfsSQh51EQpWfENSgZkqebcms=; b=JJjrpn3dYWGiwscpAnbnWMRxHGkH3W1d+cbHnr+1utxQXyqUCqB8vp9gQbHRyOSF2P I9gKAE4+L/AeibS+8kK90a0EPKcJoKdtIOsa1gGR8hjB9fXISPur5eQi8C7pUBd/OVyG dmYQb+24p3saB7iZ1iNMOEorqETweiIXnhL90= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=y3bQQWocC3HuwOzt4zpfsSQh51EQpWfENSgZkqebcms=; b=GJ1BIo0dggRXr2nb2iWhkh5kwDnA3T34a7jN+AcZW3DVAwenbHzDdcB8SR9dUA9Ohg p50OtMwy3VE6Y5PtMdTtjuJYhiS2hTR2uJo9apRCWbE9Q1+281RUqR7Kb/NXTPF04GIy Z6lyjSeAVbFT59TzYEOwdg8nVYoJIjoV9JAJ6M9TWOZDr3E467N2Rs1+MvuGSIxqf9cP 2h1Z2FP1c1Xtal1jCK/St2KBOtwGNlsNdMTUgIQpPiA1DL0vAbvJoYBqXgH3PHH6aLNI yjiQQelsYUsngvsfRLjbYHaM6oaoovEi0E6psVNN50TmtvXxTKygtns2V7mRcZaruERY 3Mnw== X-Gm-Message-State: ABuFfoiL8wM1DoaYJ+xpVVcx5V2HtWHXkV9BsvRIfYZWQrBFjyCRfUls znikjzlcGTlKtqWIpjBJPHGhTFtgb1g= X-Google-Smtp-Source: ACcGV61VagJLOMsUTxVNqCZOTfTQkWoTvyccBjuxtLw181lnNvTI3TfOP1Jid+DZlkYtApwDgYg+nA== X-Received: by 2002:a37:6cc3:: with SMTP id h186-v6mr2731001qkc.49.1539283444694; Thu, 11 Oct 2018 11:44:04 -0700 (PDT) Received: from workstation.celeiro.br ([138.204.25.12]) by smtp.gmail.com with ESMTPSA id 18-v6sm18527434qtm.13.2018.10.11.11.44.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Oct 2018 11:44:03 -0700 (PDT) From: Rafael David Tinoco To: linux-kselftest@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, gorcunov@gmail.com, rafael.tinoco@linaro.org, akpm@linux-foundation.org, shuah@kernel.org, adobriyan@gmail.com Subject: [PATCH] proc: fix proc-self-map-files selftest for arm Date: Thu, 11 Oct 2018 15:43:59 -0300 Message-Id: <20181011184359.15627-1-rafael.tinoco@linaro.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP MAP_FIXED is important for this test but, unfortunately, lowest virtual address for user space mapping on arm is (PAGE_SIZE * 2) and NULL hint does not seem to guarantee that when MAP_FIXED is given. This patch sets the virtual address that will hold the mapping for the test, fixing the issue. Link: https://bugs.linaro.org/show_bug.cgi?id=3782 Signed-off-by: Rafael David Tinoco Reviewed-by: Cyrill Gorcunov --- tools/testing/selftests/proc/proc-self-map-files-002.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/proc/proc-self-map-files-002.c b/tools/testing/selftests/proc/proc-self-map-files-002.c index 6f1f4a6e1ecb..0a47eaca732a 100644 --- a/tools/testing/selftests/proc/proc-self-map-files-002.c +++ b/tools/testing/selftests/proc/proc-self-map-files-002.c @@ -55,7 +55,9 @@ 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((void *) (2 * PAGE_SIZE), PAGE_SIZE, PROT_NONE, + MAP_PRIVATE|MAP_FILE|MAP_FIXED, fd, 0); + if (p == MAP_FAILED) { if (errno == EPERM) return 2;