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: 116281 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6015227qgn; Wed, 18 Oct 2017 05:36:53 -0700 (PDT) X-Received: by 10.55.157.78 with SMTP id g75mr1962739qke.347.1508330213053; Wed, 18 Oct 2017 05:36:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508330213; cv=none; d=google.com; s=arc-20160816; b=uqdnk6tRDeY7TnfkNb1fQ60eFCp/xE4uaYxhU7eKlcUI4mkywBwFLpUUkjLnNVfc39 /Ds6ZPBM3QNBhH8+RW4bhiHqHR4JGpT72i/qU1z7QoVwlg9AiauKNh4oA/lxbi/MzAcu mr9NkGVz9iEBmXze5o00FGaMymzGRAHWAr0Ca7y4tQyH3RUPSjpfvTTSHVETbeO1iIV6 RPU3Qx2L3N4gOgZO/SsIaK1ZG1OfRmKAmq3GasIzH7qRq2Knqhi4ixR61L4V5iRjjLf+ AuMcF3H6eBUKid/+wootrm5UJ1H5Oq4opK8DiIajR4TqC+BRDIYIlVPr+DWpp6Hqnx3k eu5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=db+Q/UGdtGY7xkcnoAu57nku9CX0VOQRh3/g7TLmeDk=; b=iFjY0jErLBhFGHFwZL9+N4Sk/Go/UfXYydRk9LkByoT/ewNmnjrqG0T1u7xdUBGi+D 5inxFPIpLutosUWbFwcsbKjJiOMjJ5OCN/58tu+WgDUEdTGu7T2DEi4ew0G7UlvY3t9K X4C696/Z6G9hqQiTtuIXZJFexTq33dYHvgi+v2H7W0SvsQRliVRe8rmPrFITlv2tjgWo v+q41j7+KCft+eoiDwQ7myCMwwZVcVZY0mwjnKWuXOOmhx3lodlI1izbAxCYhPA6BuYX RSBO8fr3YpaNunkVRdH9mEM4HTSiwRMfwryQeL5DvD4UHBNWD9c9fgxuQPfFaDrOWfz3 gwOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jfpyZ1fH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c49si3718917qta.389.2017.10.18.05.36.52 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 18 Oct 2017 05:36:53 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jfpyZ1fH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44443 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nad-0007Rw-29 for patch@linaro.org; Wed, 18 Oct 2017 08:36:51 -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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.14.2 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