From patchwork Wed Oct 18 12:33:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 10014613 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4BEBE601E7 for ; Wed, 18 Oct 2017 12:37:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B91528AAE for ; Wed, 18 Oct 2017 12:37:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3040B28B2D; Wed, 18 Oct 2017 12:37:39 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A307C28B12 for ; Wed, 18 Oct 2017 12:37:38 +0000 (UTC) Received: from localhost ([::1]:44443 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nbN-0007Rw-RM for patchwork-qemu-devel@patchwork.kernel.org; Wed, 18 Oct 2017 08:37:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nXU-0005C6-HZ for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4nXO-0003ss-Mj for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:35 -0400 Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]:44717) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4nXO-0003sM-FB for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:30 -0400 Received: by mail-lf0-x22c.google.com with SMTP id 75so5619267lfx.1 for ; Wed, 18 Oct 2017 05:33:30 -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:in-reply-to:references; bh=db+Q/UGdtGY7xkcnoAu57nku9CX0VOQRh3/g7TLmeDk=; b=jfpyZ1fH3ax9Y+ALwWgUTdhPbuzkOP7THR0Vmzoy+YIqP7604LX4PlbFm8WInywTSJ 2KXc+EtKfAlOV3+K6hvCvVIUc85E7E9UXDeEBzkHQbdwv5kzqXDgvhRx/GoCW4zxs8Hy O/f2hAyHNec6vBMrmFl0RGlxh26TFvDTyPU7k= 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:in-reply-to :references; bh=db+Q/UGdtGY7xkcnoAu57nku9CX0VOQRh3/g7TLmeDk=; b=IryG2XSxC6Gxu/stm5SKaQUiwLSJP91fXCy4F0giirxaH4txI2bbZ23oRmo+VU8JeX tkRUozNNMJD9mmT8oF1wQiC9hUMQyH9w+AnbnuJzp2SnTRM+IUfD8Krc7SSRz37TNqFF m5fbzgYpIYp/PQZmdSR4aK+wmEwc4qwcpjfiZ9FBhWU7WRshPgUL4Q7X+OMclXdjrrM0 Aowsxbsp3DgrRxeBfvajaNxX4rbzdE/cr5V1JfV3jzirXK5584HyTxz7kYNkayYizz6t 0VR0R+47l6HbUozG8+kOv5DJ8kSQS7rZA9qNcMsIVUkyb+EKyBDoXoLuROZ1tIg+eRhk 6pPA== X-Gm-Message-State: AMCzsaUGMHnRWT8FGdxW7vOs2b9B5Z+5c8lFva3Z16ObrDPtu6zxzS/v jB3yMgSwEpMv1DkplVcY06IWDtKmpBk= X-Google-Smtp-Source: ABhQp+TFvTU0y1AXHgtn2HchclQq9vidvgNha8IEALeyp5aUPa3o63sv4uSCcyFYfXXVe9LGynSrNA== X-Received: by 10.46.92.199 with SMTP id q190mr2404874ljb.88.1508330008846; Wed, 18 Oct 2017 05:33:28 -0700 (PDT) Received: from berserk.kos.to (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id j71sm2590718lfk.6.2017.10.18.05.33.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 05:33:27 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 18 Oct 2017 15:33:15 +0300 Message-Id: <5f9cee46cd4ec4600e1a2fdcca20adcf30348f9e.1508329282.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::22c Subject: [Qemu-devel] [PULL 01/10] linux-user: fix O_TMPFILE handling X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Riku Voipio Since O_TMPFILE might differ between guest and host, add it to the bitmask_transtbl. While at it, fix the definitions of O_DIRECTORY etc which should arm32 according to kernel sources. This fixes open14 and openat03 ltp testcases. Fixes: https://bugs.launchpad.net/qemu/+bug/1709170 --- linux-user/strace.c | 4 ++++ linux-user/syscall.c | 3 +++ linux-user/syscall_defs.h | 8 +++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index d821d165ff..bd897a3f20 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -837,6 +837,10 @@ UNUSED static struct flags open_flags[] = { #endif #ifdef O_PATH FLAG_TARGET(O_PATH), +#endif +#ifdef O_TMPFILE + FLAG_TARGET(O_TMPFILE), + FLAG_TARGET(__O_TMPFILE), #endif FLAG_END, }; diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 9b6364a266..08fbc4d5f7 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -341,6 +341,9 @@ static bitmask_transtbl fcntl_flags_tbl[] = { #endif #if defined(O_PATH) { TARGET_O_PATH, TARGET_O_PATH, O_PATH, O_PATH }, +#endif +#if defined(O_TMPFILE) + { TARGET_O_TMPFILE, TARGET_O_TMPFILE, O_TMPFILE, O_TMPFILE }, #endif /* Don't terminate the list prematurely on 64-bit host+guest. */ #if TARGET_O_LARGEFILE != 0 || O_LARGEFILE != 0 diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 40c5027e93..6e2287e918 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2416,7 +2416,7 @@ struct target_statfs64 { #define TARGET_O_CLOEXEC 010000000 #define TARGET___O_SYNC 000100000 #define TARGET_O_PATH 020000000 -#elif defined(TARGET_ARM) || defined(TARGET_M68K) +#elif defined(TARGET_ARM) || defined(TARGET_M68K) || defined(TARGET_AARCH64) #define TARGET_O_DIRECTORY 040000 /* must be a directory */ #define TARGET_O_NOFOLLOW 0100000 /* don't follow links */ #define TARGET_O_DIRECT 0200000 /* direct disk access hint */ @@ -2513,6 +2513,12 @@ struct target_statfs64 { #ifndef TARGET_O_PATH #define TARGET_O_PATH 010000000 #endif +#ifndef TARGET___O_TMPFILE +#define TARGET___O_TMPFILE 020000000 +#endif +#ifndef TARGET_O_TMPFILE +#define TARGET_O_TMPFILE (TARGET___O_TMPFILE | TARGET_O_DIRECTORY) +#endif #ifndef TARGET_O_NDELAY #define TARGET_O_NDELAY TARGET_O_NONBLOCK #endif