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: 827574 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="jfpyZ1fH"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yHBQX6Dysz9s2G for ; Wed, 18 Oct 2017 23:37:08 +1100 (AEDT) Received: from localhost ([::1]:44443 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nas-0007Rw-T1 for incoming@patchwork.ozlabs.org; Wed, 18 Oct 2017 08:37:06 -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+incoming=patchwork.ozlabs.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(-) 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