From patchwork Mon Nov 20 21:21:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 119316 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4392532qgn; Mon, 20 Nov 2017 13:24:36 -0800 (PST) X-Google-Smtp-Source: AGs4zMaNQQXHejaK77iZiQ15xCtwsdOQvGQ/sQ4zW4XS8M3mDZ0VZ29qxUpKcQUv2DVC15U7vjjp X-Received: by 10.129.117.197 with SMTP id q188mr9742329ywc.348.1511213076889; Mon, 20 Nov 2017 13:24:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511213076; cv=none; d=google.com; s=arc-20160816; b=QeB/jXfpB1wqgHbuK8QhRGN6hQcmWbIeirL75ZSCp4+BjXwC7cxWMvimawAPmxJ+K6 /UIeBXE16+0NMXPx7dpr66YbhlwbycGHr1xvI6Mfg/7jEIBB8swwhJx6ngUulqZv4iCv CS2XBB9K4elae+SGvMn8hPgE28e3Q1Bj40F3v6AnBY9j11cz1ffljtJpxO1w+klkRUzR z9Sgq7aJFKzfVMgoVv47Gv1lxEtp0z1tLFYkURhSJ9nRdtAyYfmkPZFvphQn4Nu5ecjw XcGN3bFHFd9M/do0DVc3zUjYW+r8TQfTN7Bh2MeSxakG9+6JCqztXGcPcsj9T3kZhECP +C2Q== 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=sxp7NkQJ0fCFMZAWQwuA4SBV3gox/kUeV3nqW9idGoY=; b=H2UOhnZPobQbbx3wTyhlN1zOp+RbbT/x2/gQlMMyVgPgsDjGL8VlU3lg36QZovAKlk gm7GHAdLU/L11Y9PwV5UFqxmiE/TUykJfLEeN1rT8PHf9u2aqQou8LGX6mStAITRRucd 7/x/TNttu7gDph3AiDC9pqIomSV2I/GP8y2levE8T2FdwvEKyJutRYdnIoCX2lsEPAHa l8bfyPmmhsB+IbkXPIqJEwO4BRyco70chPwnGMcXJkAE0tmbF2D4hhO8zUTkACm4KuXw 6YgzSWELt6qS/CWP4DX9uIv8m4+DDy7SZWUZB1S2KjMzbaCuHiCRedtBF+TmzzwelSya BLcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=T9nYiPQY; 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 n2si2217802ybh.251.2017.11.20.13.24.36 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 13:24:36 -0800 (PST) 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=T9nYiPQY; 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]:59808 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtYS-0005mY-Bj for patch@linaro.org; Mon, 20 Nov 2017 16:24:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtVn-0004Tc-1s for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtVk-0007dx-Bu for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:51 -0500 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:36361) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtVk-0007ca-4L for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:48 -0500 Received: by mail-lf0-x244.google.com with SMTP id k66so11726548lfg.3 for ; Mon, 20 Nov 2017 13:21:48 -0800 (PST) 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=sxp7NkQJ0fCFMZAWQwuA4SBV3gox/kUeV3nqW9idGoY=; b=T9nYiPQYIxhJxPe3KxV1JcUGo2oClZAbsAAv8PH3nJaU0joWQJmbJVBN0OXxRiRYkt 00ekHuzvwcZOOrI/S8J+zAinvXE8Zt+FJr8oaqEC/9CSb5lMexbKnMVZTTP8tsGYy6jc 2XzoM9r5dKfmiFTu+lvnDSTv8juj8Ahj+by7I= 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=sxp7NkQJ0fCFMZAWQwuA4SBV3gox/kUeV3nqW9idGoY=; b=O9sdpMV90cprMjKU/CyjVJeQOXdtIW9n8jzPHFxub9fWJ7KyI84e2kaRHiEbLupCu7 MODT4ZzJWR2IiVp415+xBEgbSx7udHn4UYHerlF98bXOAMjV+FMP41QJws32K+vZUxTR yOOeUa+SaaACzU4NghnqJITBmso160Pw12EV7NzK6b9+HiyAWkDnAlO+C1kNhZooRPUA DXKf7s1Vy0L4XPl/KfBkLY9tw5ZpA6SnPA1yc3n5c3QwdW7t7o03TcnvO/TOSzZlC+pb 6TmaViaMmURxS7ldrmKCcWxuI6nUWxZt9FIXRl2fYdGqphsmeB67hi8+VS2JaHSVLNJO upRg== X-Gm-Message-State: AJaThX7CvfSdjQ34kCFNnSCAqoBoLT4NL4nmIZQ8G/3jfzD5jJdVBEPJ aUQ/huiDc36FGvQAqJ1KtIByQT6u8nA= X-Received: by 10.46.89.196 with SMTP id g65mr4643315ljf.53.1511212906573; Mon, 20 Nov 2017 13:21:46 -0800 (PST) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id v63sm1645409lje.39.2017.11.20.13.21.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:21:45 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:29 +0200 Message-Id: <7f047de18cf6cd51915d4fdbe1a7e66c38b45e98.1511212753.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::244 Subject: [Qemu-devel] [PULL 01/15] linux-user: Restrict usage of sa_restorer 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: Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Reading and writing to an sa_restorer member that isn't supposed to exist corrupts user memory. Introduce TARGET_ARCH_HAS_SA_RESTORER, similar to the kernel's __ARCH_HAS_SA_RESTORER. Reported-by: Helge Deller Signed-off-by: Richard Henderson Signed-off-by: Riku Voipio --- linux-user/signal.c | 4 ++-- linux-user/syscall_defs.h | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) -- 2.14.2 diff --git a/linux-user/signal.c b/linux-user/signal.c index 7a238aaea1..cf35473671 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -777,7 +777,7 @@ int do_sigaction(int sig, const struct target_sigaction *act, if (oact) { __put_user(k->_sa_handler, &oact->_sa_handler); __put_user(k->sa_flags, &oact->sa_flags); -#if !defined(TARGET_MIPS) +#ifdef TARGET_ARCH_HAS_SA_RESTORER __put_user(k->sa_restorer, &oact->sa_restorer); #endif /* Not swapped. */ @@ -787,7 +787,7 @@ int do_sigaction(int sig, const struct target_sigaction *act, /* FIXME: This is not threadsafe. */ __get_user(k->_sa_handler, &act->_sa_handler); __get_user(k->sa_flags, &act->sa_flags); -#if !defined(TARGET_MIPS) +#ifdef TARGET_ARCH_HAS_SA_RESTORER __get_user(k->sa_restorer, &act->sa_restorer); #endif /* To be swapped in target_to_host_sigset. */ diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 450960bb54..e366183419 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -445,6 +445,7 @@ int do_sigaction(int sig, const struct target_sigaction *act, #define TARGET_SA_RESTART 2u #define TARGET_SA_NODEFER 0x20u #define TARGET_SA_RESETHAND 4u +#define TARGET_ARCH_HAS_SA_RESTORER 1 #elif defined(TARGET_MIPS) #define TARGET_SA_NOCLDSTOP 0x00000001 #define TARGET_SA_NOCLDWAIT 0x00010000 @@ -483,6 +484,10 @@ int do_sigaction(int sig, const struct target_sigaction *act, #define TARGET_SA_RESTORER 0x04000000 #endif +#ifdef TARGET_SA_RESTORER +#define TARGET_ARCH_HAS_SA_RESTORER 1 +#endif + #if defined(TARGET_ALPHA) #define TARGET_SIGHUP 1 @@ -718,19 +723,27 @@ struct target_sigaction { abi_ulong _sa_handler; #endif target_sigset_t sa_mask; +#ifdef TARGET_ARCH_HAS_SA_RESTORER + /* ??? This is always present, but ignored unless O32. */ + abi_ulong sa_restorer; +#endif }; #else struct target_old_sigaction { abi_ulong _sa_handler; abi_ulong sa_mask; abi_ulong sa_flags; +#ifdef TARGET_ARCH_HAS_SA_RESTORER abi_ulong sa_restorer; +#endif }; struct target_sigaction { abi_ulong _sa_handler; abi_ulong sa_flags; +#ifdef TARGET_ARCH_HAS_SA_RESTORER abi_ulong sa_restorer; +#endif target_sigset_t sa_mask; }; #endif From patchwork Mon Nov 20 21:21:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 119317 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4392941qgn; Mon, 20 Nov 2017 13:25:04 -0800 (PST) X-Google-Smtp-Source: AGs4zMYlaJNtj9LWJzVSpqEDdnAhYZBWJFDaqE6XmKUK/fze74jwb/IiLHbnb9Y10zU5atUP4XPO X-Received: by 10.37.121.10 with SMTP id u10mr1416632ybc.21.1511213104087; Mon, 20 Nov 2017 13:25:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511213104; cv=none; d=google.com; s=arc-20160816; b=OOpdP/Q9QYts8QzGWVKFylQO3sTFuVSvS29qIfuCtg0A1Bg3yCpATCRZBvwscV+xBK 3ZW7gqEulkDveruehqQ/KsT8z2yXUzgNqld22tugo59+8F60o5bcKn0DWS++dHQChIBe pyTPxOjl3YIQ4nty9CaMQs7qHQxYvVzjsIC93O3YS1blCyoINWENTn1Y9JcerYaO4+X6 S5ehYuPHxuM3U3ItBXWFu1EMnA5++DK2JM/2wBxkp4jQ8dqCSJEbYGmz6T3vtiHWs+T7 zfoNvyW1EfoVh1Cl6+mPUmcmkfifCthQswbrGof4LoJS4WDS9y2V/xfv7dt8pVynV8yw M8ug== 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=yfVflxY5YmtqLvy2DuUO8gMtJFetVmDM28VGUjSawgk=; b=vGsyAaBFLbmphZyeBrKshcAMIwH/p4XIShB3+LPNqzG0G8vq5h7IbGgcqGVZD/gbXc IKlrOoAakteP35U16f36njGNyx3a8BsEhdctMQdSTVJdSJw5oRLxGRZUl/m09ljQO7nF ags+mVcbTaY0TIqfwIxd2Ctl/0suWhcgk/WJxSJEv/TnBlN9grfiuHvCBuliwOeUg5xn iaFi0b7TRW6oBVcbtUrReVxyT9F3uOWKcq1afCdf5EWRP20a4r35shFfrBDftFOXh2Rb MSMVN+kH3t6MXk/EQ1kMK83AJyoUP6NmswFlX6ol+YPPHSmXRLDsgT6MM5u6tYKXMQyS Cibw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Uq44AvEA; 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 r126si2292293ybr.574.2017.11.20.13.25.04 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 13:25:04 -0800 (PST) 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=Uq44AvEA; 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]:59811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtYt-0006q7-Jd for patch@linaro.org; Mon, 20 Nov 2017 16:25:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtVn-0004Te-1z for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtVl-0007eX-Uz for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:51 -0500 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:45017) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtVl-0007eD-N3 for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:49 -0500 Received: by mail-lf0-x241.google.com with SMTP id w23so11685540lfd.11 for ; Mon, 20 Nov 2017 13:21:49 -0800 (PST) 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=yfVflxY5YmtqLvy2DuUO8gMtJFetVmDM28VGUjSawgk=; b=Uq44AvEArnFHOvfsthBINpGhSblyPyR5N83NGhArDaLFDkRdupDHcdlEyzVL1XPjqC CM5vu6B76hhX+IB4SEoAzqX/mMVQ70aRBbQ0YllCYkwO9euyb061zGmAwG3Ft9mXIxwl zElyLc1/j8HqR9MnQRRFXI7nenSKIOV5pal14= 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=yfVflxY5YmtqLvy2DuUO8gMtJFetVmDM28VGUjSawgk=; b=FRW6DE5/4IrAAXoNPdCwubwRq/mNMLIg2LycePki5iPo7YjuOynyU6ZEG+gxMd8/B3 E4cd8KS79tEOQjMrDKQtXFcdiIIJeeglkM3NVmD56YcHNIN6ssmljACLdoUvE/Vq5AG2 dV0ItMTab2p64lWdUqQKiJj4v6fOqtA8DSajMiWoAcJffsuMgVa8nAQ6J/Ed41R19lgN ToENjR25hpLIcUp/TUqAX20yhfbk2oUoBCKP+/O/wk/WxB/o93zWYdW7ZaY+mJdYqs0r GyHI2Z5GZhEFzkltGImmqNGcPjRL3amNyelTdXw2cGbzd+0nHeepM8naBW+3qm72tf1G xJAg== X-Gm-Message-State: AJaThX4krdOiCsOfPsnC0AiRMzcSXjkwz5RHNoRWKKCoKfBSFILz2FI4 5NYEOK7jCCARHtMDiSux0gUR+KYpxGI= X-Received: by 10.46.2.197 with SMTP id y66mr2164358lje.113.1511212908197; Mon, 20 Nov 2017 13:21:48 -0800 (PST) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id v63sm1645409lje.39.2017.11.20.13.21.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:21:46 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:30 +0200 Message-Id: <2da6e76ccaf5c5aad4192fddaa2062480ad82345.1511212753.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::241 Subject: [Qemu-devel] [PULL 02/15] linux-user/hppa: Fix TARGET_SA_* defines 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: Helge Deller Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Helge Deller Reviewed-by: Laurent Vivier Signed-off-by: Helge Deller Signed-off-by: Richard Henderson Signed-off-by: Riku Voipio --- linux-user/syscall_defs.h | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.14.2 diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index e366183419..38339ecb9a 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -473,6 +473,14 @@ int do_sigaction(int sig, const struct target_sigaction *act, #define TARGET_SA_RESETHAND 0x00000010 #define TARGET_SA_NOCLDWAIT 0x00000020 /* not supported yet */ #define TARGET_SA_SIGINFO 0x00000040 +#elif defined(TARGET_HPPA) +#define TARGET_SA_ONSTACK 0x00000001 +#define TARGET_SA_RESETHAND 0x00000004 +#define TARGET_SA_NOCLDSTOP 0x00000008 +#define TARGET_SA_SIGINFO 0x00000010 +#define TARGET_SA_NODEFER 0x00000020 +#define TARGET_SA_RESTART 0x00000040 +#define TARGET_SA_NOCLDWAIT 0x00000080 #else #define TARGET_SA_NOCLDSTOP 0x00000001 #define TARGET_SA_NOCLDWAIT 0x00000002 /* not supported yet */ From patchwork Mon Nov 20 21:21:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 119321 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4395557qgn; Mon, 20 Nov 2017 13:27:46 -0800 (PST) X-Google-Smtp-Source: AGs4zMZGlmWy8b1xokJlzf8RM1fvP+OsJgvt4yAG30LaRAx0LhmQhPiJmmsPq0InGIUPX0fGciFw X-Received: by 10.129.93.6 with SMTP id r6mr11083433ywb.95.1511213266549; Mon, 20 Nov 2017 13:27:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511213266; cv=none; d=google.com; s=arc-20160816; b=U5dyHOf+mVrHjYIcI6thwul8wN51cuwk00pqs/QI+qWg2B9qSB9jZmbuVfOH/RSzQj VQoIy4+sMoDVRZQcGzj/XAppx6oHTW/ZMu9LyYWkh1QLZ/lgVje0ad+FV4t0KL1Gp2dD j8DvEpIJbYZyAAVbAOeUSbRBZF4gpd5F/gLGPXVqVaIAwbuCVsJ13BsN063gT4wVxrsz xSIqGaB6697Tw901Bj3pw9L2eWxwX0EOVr7nOeyc+0Mb59f2D+l31YEt3fHdVCC+20tn 7mwEBuzqMmr/YixDb8RGuVJTUL7T0L59YOU5DgdBnT/D+JHYPQVYRYEuNHTbyX+ac/Kb KQKQ== 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=EINUFEocM2tBA4frb4/XJv57aamHc/zNVZQt/EVHD5w=; b=zK7Tw+v54YO5F2OyZNw39KFDsSbHnJCMu4ojsrg7SHYAnZoaLjG2QqzEbkgLieUHX1 HaR3xRlog4/C6zjp/AA7L4XhYatBS1aaOmVdY3cr3ygBElGjCu5CDwNntWswiS4qDL0n KuC9MyVdq9ZOj321hWet6+JehRGTt/s5eqKjQD4Unatb1oLkrvR/NDUEagY9YLU2v1QF XrZAlCtkSvLawnXC0st/ZarbV51+A8TXuKlgtmBrFNSelDTLrVVuLiVGya9RRGr5Sn/o 9LLLmmolyVBT5mY7ypOA9tQoBG4RX0w9h7aOg6CcgsUhk2ei7ql3RKPSUtIktaiNWZtN gqxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GByk3qHm; 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 y5si2231425ybg.367.2017.11.20.13.27.46 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 13:27:46 -0800 (PST) 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=GByk3qHm; 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]:59825 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtbW-000177-2S for patch@linaro.org; Mon, 20 Nov 2017 16:27:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtVo-0004Ur-3u for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtVn-0007iJ-DG for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:52 -0500 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:43426) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtVn-0007em-6P for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:51 -0500 Received: by mail-lf0-x242.google.com with SMTP id 73so11682380lfu.10 for ; Mon, 20 Nov 2017 13:21:51 -0800 (PST) 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=EINUFEocM2tBA4frb4/XJv57aamHc/zNVZQt/EVHD5w=; b=GByk3qHmj3P5hsUaEATBe8xWt6m+H4Dl5cn4w4biiFcn8m0rFPEjD/6MGaXpBeWd1+ SjRoWlZ+6msFJwS5G9H766hWv+mDpbejygJcn4kkMOVbaHyJHk/G6fvzH9k6DiAXPjAc 6j0g+MkBFQ3ds1ML8QTSHWEhNUJP/8nN+qK4o= 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=EINUFEocM2tBA4frb4/XJv57aamHc/zNVZQt/EVHD5w=; b=cK6RxfTxC2CdouZlnXgur5NO3hTWIw7axRWxyheQQNB6vK9ZBxqbN7jkGDzM9WhlQY kYkw0r+r4UqI2FyOWwICFIpdnswAFQFDTESQ0JCl2HU26Y2QxNEcZ+S6XoEAk6FaOk14 v3paqtEpaaAKTSYcI64dGNXQEL7tzV1ICDFugDC+ftxjlom0wNsdB/mMk/YnoXBnLHzJ VA3eZIruGySvtySMgDv09Xne337S4Xs/j/aO1jf2Pb4bVNz6sYsVoxhIlVXmiPaa5Geg PVrPzBu/BI2ikgfY74yxMqacKoDtH1a8gC6Cq2G7hp3masoIFDdd2jcUaUNRIrPPPHBa 3NYg== X-Gm-Message-State: AJaThX7IuK9aR+29SSNFleyFg6E7DtPPFSGguDYQ0E3CDUanwyp8o4By UeWXJhRJvpbtR2kp/ZQVzjT+G9+ii30= X-Received: by 10.46.70.26 with SMTP id t26mr4558913lja.181.1511212909682; Mon, 20 Nov 2017 13:21:49 -0800 (PST) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id v63sm1645409lje.39.2017.11.20.13.21.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:21:48 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:31 +0200 Message-Id: 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::242 Subject: [Qemu-devel] [PULL 03/15] linux-user/hppa: Fix cpu_clone_regs 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: Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson By failing to return from the syscall in the child, the child issues another clone syscall and hilarity ensues. Signed-off-by: Richard Henderson Signed-off-by: Riku Voipio --- linux-user/hppa/target_cpu.h | 4 ++++ 1 file changed, 4 insertions(+) -- 2.14.2 diff --git a/linux-user/hppa/target_cpu.h b/linux-user/hppa/target_cpu.h index 1a5cecad3c..e50522eae9 100644 --- a/linux-user/hppa/target_cpu.h +++ b/linux-user/hppa/target_cpu.h @@ -24,7 +24,11 @@ static inline void cpu_clone_regs(CPUHPPAState *env, target_ulong newsp) if (newsp) { env->gr[30] = newsp; } + /* Indicate child in return value. */ env->gr[28] = 0; + /* Return from the syscall. */ + env->iaoq_f = env->gr[31]; + env->iaoq_b = env->gr[31] + 4; } static inline void cpu_set_tls(CPUHPPAState *env, target_ulong newtls) From patchwork Mon Nov 20 21:21:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 119327 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4400366qgn; Mon, 20 Nov 2017 13:32:20 -0800 (PST) X-Google-Smtp-Source: AGs4zMancG6k8hLlyf2Ql3PZmqp/P7iD4KKRib6oYAkSKsRhXpR+THp1htqdJYI9AF0OYpjn9yp6 X-Received: by 10.37.163.166 with SMTP id e35mr9468027ybi.152.1511213540441; Mon, 20 Nov 2017 13:32:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511213540; cv=none; d=google.com; s=arc-20160816; b=Pr1UXLf7e324qWXqbEoDeVK8JpG46Ay0eKrWggIWJnPmOKiosUzzmVJGH4Q/knrQC2 YyvRlkkjT5H/gJQ3ailwFnQnojB+lzcLqQx3+m/nBFYB2FmnfA5f1JZJmjk3ygPql9Mu W3AF+51LFi3Me0IdAWFNACbgRFJMRL4Hylm7CREXvvjgYkO8HFJ6Yt106rcZaKaTThp3 NSh2EOyN0odTIwhfAMTOXBw+e9HSqxW5gGTdzCj02TxT2IJpZ1bwy9oeRtEGcErNlAZ5 3hlryit7swucpuavAEd2veA2yj8WKz1wp3Vb2SR/hSswAu+vp3IJUDzFJGMrH/xa0DNs wqFw== 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=3n1bwgqAE5IrU9YDKtiBCXQfhlP9DyBtAUhr/dg/1EI=; b=iq3TfRvfK42ega7LBaYn9TfHLcJgcDd9Iec6YRWc1grBQ5w1C+gvadtjp62X9FNo3g yB5+jow3DEW0z7YdewP8NdxphPffdjLxdTXJ+YqZ6BjNfnfxPDiPdKA18K7yxFKkwecp 8QMTVmwWuH56j36ItA5ZgkVpQH/IS7AiFx7VRtdIn1gLN/F+Fiyu20J0sk3xV3ohg1rB xNuq3aqa20ZPLyZZ2Jbnd0l//h4JiXsYqt9II0PKoGPSrQTD5MdO/ReLNDkHcJ+iPRzc 2NabL6h2leK/sD6fQTlhIm62TZJe0gouiMSgbVTSkLNzrZX6eVHxw/Ct5ceuoVmq169s +B1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZJ8lTYY2; 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 i205si2355059ywg.502.2017.11.20.13.32.20 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 13:32:20 -0800 (PST) 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=ZJ8lTYY2; 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]:59847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtfw-0004Lo-0e for patch@linaro.org; Mon, 20 Nov 2017 16:32:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtVp-0004WP-O0 for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtVo-0007j9-TP for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:53 -0500 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:42558) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtVo-0007if-Lv for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:52 -0500 Received: by mail-lf0-x242.google.com with SMTP id m1so11692099lfj.9 for ; Mon, 20 Nov 2017 13:21:52 -0800 (PST) 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=3n1bwgqAE5IrU9YDKtiBCXQfhlP9DyBtAUhr/dg/1EI=; b=ZJ8lTYY2ve1G4T/E25KTO/xaT/DJtnenKwSJtSp8hMHseXGA3yqWaclXSYADGSmrPN KrUcBP0OSY0MtdMhWEdzd6PNxTDgXWNJO/TkUJjiLAglM5Db47PDPlR0Wc5xcO8vqv7R WeCeOJMKdsNbLj+1e6RjoMbBX8akwU9oUpeck= 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=3n1bwgqAE5IrU9YDKtiBCXQfhlP9DyBtAUhr/dg/1EI=; b=UDyzhp3283N1VcSGoGw28iXyzAlluI20Fyie27uSI8NeZaCz9Bvvr2tuYbRBxAHD/k dQwZyKSiiyGt0NKuVfDehIlPKUpuIflBcJUV+6GmggLnpRjzPbX9AtCSMJIFSqR0M7Ir MhhgawHE/P1HbpcHMthtasLSjjtkdSHg9yUogTBjBa92Z3vEwgiwJ0GIug5GAItJLp3q bd5i6XU1U6YCRsDubRJgtZpNoHHQbvvB80enY8deLT373vRbadEvByLibsHVZn5JvfoH iJURtFtgrD/XybiNW10qIW5F6vz5IcdDMJD2azTMGArWUaD75JNPKuW30JMHtSqG9zSl 9esQ== X-Gm-Message-State: AJaThX7loEGl3lGMySBJkUUIPri/lmfZachCw/YVQMfZkBkw6FAM0CMn CPB+RAVwZcefnMiUJjvv38kzV9ZqcCM= X-Received: by 10.46.33.202 with SMTP id h71mr5128152lji.193.1511212911279; Mon, 20 Nov 2017 13:21:51 -0800 (PST) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id v63sm1645409lje.39.2017.11.20.13.21.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:21:49 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:32 +0200 Message-Id: <92afb153103c38c1ccc9d4c34512cf1767e676c5.1511212753.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::242 Subject: [Qemu-devel] [PULL 04/15] linux-user/hppa: Fix typo for TARGET_NR_epoll_wait 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: Helge Deller Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Helge Deller Reviewed-by: Laurent Vivier Signed-off-by: Helge Deller Message-Id: <20170311100543.GA29669@ls3530.fritz.box> Signed-off-by: Richard Henderson Signed-off-by: Riku Voipio --- linux-user/hppa/syscall_nr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.14.2 diff --git a/linux-user/hppa/syscall_nr.h b/linux-user/hppa/syscall_nr.h index 0f396fa1e2..55bdf71d50 100644 --- a/linux-user/hppa/syscall_nr.h +++ b/linux-user/hppa/syscall_nr.h @@ -228,7 +228,7 @@ #define TARGET_NR_lookup_dcookie 223 #define TARGET_NR_epoll_create 224 #define TARGET_NR_epoll_ctl 225 -#define TARGET_NR_epill_wait 226 +#define TARGET_NR_epoll_wait 226 #define TARGET_NR_remap_file_pages 227 #define TARGET_NR_semtimedop 228 #define TARGET_NR_mq_open 229 From patchwork Mon Nov 20 21:21:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 119318 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4392972qgn; Mon, 20 Nov 2017 13:25:05 -0800 (PST) X-Google-Smtp-Source: AGs4zMb/shBw55FSY6rd/dEtQhEQ4ybTMHNvuYRfK/2h/tiZY3WEs97Lg6RGSwNgL0xw/QKAhgpQ X-Received: by 10.37.20.9 with SMTP id 9mr9221222ybu.283.1511213105686; Mon, 20 Nov 2017 13:25:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511213105; cv=none; d=google.com; s=arc-20160816; b=0BzzTxc84BD2xhyg37eYKVyiFLdqxv1MNQQNp5OwU69dzbT1BFSEDfgW12UoAfZdi7 YxVLY0hzhCGEJZsPrS5554OxPjUfiquDDIsofek3AZ0T3Og1XD5W1OgZcZDBg8AswB7R +yE2sgo+WtGrzos4ppWSonmwxu3b+ttEq+OC9b1gh31mK8b6UjteeZcT34aCeHCOauPD AsuR7oWu2Xwb3Gq4HnkHIuvXBTixxhZCmFN9Jpi2e9/hXbjvtUbK80c4aPcAR6zXZD4U w8ZPpziFG51XNRW8oZ8BaDdfE5muH/zq9bCS3LsSzfcwiweHnaVFVyRc3gDE4uM/3WNW T5kQ== 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=0v2vk1Y3Y4d0OmkNLC869msKfFN1j7oP0J00tPup+YI=; b=sTeZ80ULKX4bLQ6hbDUGe1BkeErMqJa7jd43i9fF7IQwqNqWC4kQUJ5wiCdovX5gxS lV8JXZi7CkvN85VwTuGNiVdnrIYBundonfU1XwDecsZCYQkVLSdVEKMLo1/T1cvKICeL IGsrfm+1H3H946783s4BQRczhcghaA9Ik+x9n3RXEscXSVYpWdlmSI09eovvneVuVgNs u80i/f8EJMXlXpzk3JgSeGGEzYHOOu3qHF9ViiPoPK3BqfXHs8kE7zmdo46ojBn59OcE /seutyXMXBkchx6KvpmXaSLdRFFtmIB45ZR2+zDGPX/1OlHvNg6QlEllpYFHjLNqBJM4 nx3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Pq3aFMd3; 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 t66si2403062ywd.602.2017.11.20.13.25.05 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 13:25:05 -0800 (PST) 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=Pq3aFMd3; 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]:59812 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtYv-0006s4-63 for patch@linaro.org; Mon, 20 Nov 2017 16:25:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtVr-0004Xp-3L for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtVq-0007lu-CK for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:55 -0500 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:33260) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtVq-0007jO-4d for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:54 -0500 Received: by mail-lf0-x241.google.com with SMTP id x68so11726863lff.0 for ; Mon, 20 Nov 2017 13:21:54 -0800 (PST) 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=0v2vk1Y3Y4d0OmkNLC869msKfFN1j7oP0J00tPup+YI=; b=Pq3aFMd3kdkJ6RV0CgOKBspSDyaTdr2U8Cnr3A9+l/rrEe9NeBQu/pahttjsB3I3PK LUEVeNth73QIyCFUba20A2RDPS5h1jrLt83t2terVFICD5xah2TToCQVTEp01yaw1YyC x9ngbmHhyIArNfZL56AfX4vyejYve5yV7t8aQ= 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=0v2vk1Y3Y4d0OmkNLC869msKfFN1j7oP0J00tPup+YI=; b=pAj/+6VqCeJpUDWWMitFRRHNtVBStndDNyef6KQ5nvRJvKZgMwJdDlxu0TLEAbwyZk sMHo9wpRo36HxWLwNHaKvimmnxxyQI0XZ+Bv9qNylTtaTkY0Q/nRG1dbcAKZBuSXUgIy 5co2LTVbaG1WfMe9uAfcgkz8w6TmqcMkTEi//3b8JH2vj6jaQc7rYxkavLGGXTICI9iM 3jvBH863SIey83ZAuYb9H+G1Q3YJm0Vhjgad5Vp25st0bFBJBOyJ6CJzA1YSSLvaG0zf Uaoz1+lLwqrv6BHuH1KARMNvd+uRPh/5T0ctx57Xn2vdmG6UzNjjl7fK6q/mAdfbPYEn 2Mpg== X-Gm-Message-State: AJaThX4LakCxVcrz3WmBZqobEK5ZcuzWzkyhDUUIwp6Nx+21ncoL0Hsk fbCrU3Vm2fjHuh66WeLaRdnldEa9JpY= X-Received: by 10.25.171.2 with SMTP id u2mr3854233lfe.251.1511212912691; Mon, 20 Nov 2017 13:21:52 -0800 (PST) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id v63sm1645409lje.39.2017.11.20.13.21.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:21:51 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:33 +0200 Message-Id: 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::241 Subject: [Qemu-devel] [PULL 05/15] linux-user/hppa: Fix TARGET_MAP_TYPE 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: Helge Deller Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Helge Deller TARGET_MAP_TYPE needs to be 0x03 instead of 0x0f on the hppa architecture, otherwise it conflicts with MAP_FIXED which is 0x04. Signed-off-by: Helge Deller Signed-off-by: Richard Henderson Message-ID: <20170311175019.GA7195@ls3530.fritz.box> Signed-off-by: Riku Voipio --- linux-user/syscall_defs.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.14.2 diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 38339ecb9a..a6ed30d70e 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -1336,7 +1336,11 @@ struct target_winsize { /* Common */ #define TARGET_MAP_SHARED 0x01 /* Share changes */ #define TARGET_MAP_PRIVATE 0x02 /* Changes are private */ -#define TARGET_MAP_TYPE 0x0f /* Mask for type of mapping */ +#if defined(TARGET_HPPA) +#define TARGET_MAP_TYPE 0x03 /* Mask for type of mapping */ +#else +#define TARGET_MAP_TYPE 0x0f /* Mask for type of mapping */ +#endif /* Target specific */ #if defined(TARGET_MIPS) From patchwork Mon Nov 20 21:21:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 119322 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4395604qgn; Mon, 20 Nov 2017 13:27:50 -0800 (PST) X-Google-Smtp-Source: AGs4zMbl8TgkdN7ej5962iRNMml1hx0e96tLW5bw4rEcqTj9FbOmW4X+sF1JUGE82kiFVcUMRa91 X-Received: by 10.37.173.202 with SMTP id d10mr9791680ybe.38.1511213270124; Mon, 20 Nov 2017 13:27:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511213270; cv=none; d=google.com; s=arc-20160816; b=dYqhjpCjPBvw8e99bHweCxtayRdXy7STQX2o1NpzRfv/4cRUcI85idZsbIe5OA8uRJ s/YmqIR26lC2Ff/0lA9rVT4yTnCxIfK+3KCZB1jHB3e2Gc3AxqV8QN9chRO7jnxiXWfV 9uhgnX4KlZSogi1aSlxApLTzyGhO+LojgKQBTCRbwViUxhG2pcwfQSUO3rYH5XJEXpN4 GcX+i1S9IZP2KlGvQUCiKCogxX8V50NyGpO6i7e1YLyL6AnQiGmyvdiUr+IRL2uTJu9z jSm1hvfi+yU36jhNMLEIJN8bXP+jzC3CzBDbuhrRH2rKa6N/uYfB3F12SQitIJkXxMAr 0ccA== 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=Hvz9xrtwjsC7UFCAwcxbWiygLn6YfehGWmtU28YNCsI=; b=lQGzwrt1RTj3cMvy0I4HaS+77ztNH9QqwXPF9fG0mQvz1lGXH3nc4WgbGOs+rx0saX 1ia7ZRVeBkHe61ECfYKlk/4yAfxhBlvP+UnzS+YVtwQT9/WAgMNJi0CVHIL8x+7NYQZF DCgn5kepVUP9J9py9wGT0fAj6AwheNEQS1cqbMZl3qkcnqz8HSLhoRSDq0ZJkpKUcuSt rvNa0rJbbL1LAyRrALRYBLn/QHVBb6EGdWK/seZ9cgmOZRUdqG+lHNpMWH04iHIce2VJ zIKhIXPzusa4DDhRrrVhSrlnvnLUaOHI3QdWL6JBN5JvoOXLTf5M+5El9az8e/sTfx+3 Bi4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YneezGWt; 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 n2si2218824ybh.251.2017.11.20.13.27.50 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 13:27:50 -0800 (PST) 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=YneezGWt; 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]:59826 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtbZ-00019j-I4 for patch@linaro.org; Mon, 20 Nov 2017 16:27:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtVv-0004c9-BH for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtVs-0007n1-5H for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:59 -0500 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:42558) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtVr-0007mK-UU for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:56 -0500 Received: by mail-lf0-x244.google.com with SMTP id m1so11692250lfj.9 for ; Mon, 20 Nov 2017 13:21:55 -0800 (PST) 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=Hvz9xrtwjsC7UFCAwcxbWiygLn6YfehGWmtU28YNCsI=; b=YneezGWtsCk25h6QQkUkHQnUWtWoEufX29yiPoj9Cxm0/iU7I5hTi1I+tHnK97z7vs 9SL25od2NCVdCPVNLbsTTsRNC4zynTSL1JETOzvLFqEv36cMQG+VGAEQ0Z2/lkfjTpb9 CxfJI6nT7LxfAiynVfbwdcaUw1oLpdyGs1nQs= 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=Hvz9xrtwjsC7UFCAwcxbWiygLn6YfehGWmtU28YNCsI=; b=HotKJg9DpKJjExBfyqLPWC6JM1PWmNYbHvtEvgG17IGjoLRlDrU/x79iPFu0PXizW1 zFmv+PDOmF+/vW3/LWb+u35al7lu3LOV6HvoOdK2R3orlvkRGxu1RFl+VRXYmXyxDPW0 vSX5gbHSSNPo/h2/kidRFZ9IUyzXCqIxe8OugDimLa5k3G5wO8sODd+n3Tc4U7zIo9JT C4QM3DGa23Gs07v+ghThecgS8kpmZelGHmUcsjYKCXGJGeCx8XhhlMtIBjgGlvvDySsu rXc5/t+W7QSjC/vXOInyRrukONQCiQ6KQmclyyc/6kA+C8YNR+RkASmY7CGgJH8I5cKU iSFw== X-Gm-Message-State: AJaThX4Too3nl4zNGogaorwzs6DpwJpA3h4UXvd/6sLYvM3sMHST/KoO X7znASuePRAg18V/AvkFSFCX+y4hkyk= X-Received: by 10.25.21.154 with SMTP id 26mr3702100lfv.93.1511212914281; Mon, 20 Nov 2017 13:21:54 -0800 (PST) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id v63sm1645409lje.39.2017.11.20.13.21.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:21:52 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:34 +0200 Message-Id: <3d60c84deaa11826ff0bc7599aeb73cad54c4fbf.1511212753.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::244 Subject: [Qemu-devel] [PULL 06/15] linux-user/hppa: Fix TARGET_F_RDLCK, TARGET_F_WRLCK, TARGET_F_UNLCK 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: Helge Deller Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Helge Deller Signed-off-by: Helge Deller Signed-off-by: Richard Henderson Message-ID: <20170311175019.GA7195@ls3530.fritz.box> Signed-off-by: Riku Voipio --- linux-user/syscall_defs.h | 3 +++ 1 file changed, 3 insertions(+) -- 2.14.2 diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index a6ed30d70e..daa2a57398 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2361,6 +2361,9 @@ struct target_statfs64 { #define TARGET_F_SETOWN 24 /* for sockets. */ #define TARGET_F_GETOWN 23 /* for sockets. */ #elif defined(TARGET_HPPA) +#define TARGET_F_RDLCK 1 +#define TARGET_F_WRLCK 2 +#define TARGET_F_UNLCK 3 #define TARGET_F_GETLK 5 #define TARGET_F_SETLK 6 #define TARGET_F_SETLKW 7 From patchwork Mon Nov 20 21:21:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 119314 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4390292qgn; Mon, 20 Nov 2017 13:22:31 -0800 (PST) X-Google-Smtp-Source: AGs4zMZMYMNHr08MiWVURM7dYIsvz8ymrjfPxNp3IsRzKQc0HcaiUz4OTOZTlu07N2FQ4aL9A7sa X-Received: by 10.37.195.65 with SMTP id t62mr9362898ybf.71.1511212950986; Mon, 20 Nov 2017 13:22:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511212950; cv=none; d=google.com; s=arc-20160816; b=qg87DdTxcQmmRQ/n0b48nxMp1z0OwxRRuBZwMFLoLKPlCmCrLCmvTg7hZJr3eQMOf5 rQLYgxhxSJUYHMzjL4kdynt9WZkA9QTGFpJ7Clb26blZoVcNV/PAvRHLvW7k2KWlERYX gF08/qcdqlz63suKnI9Z4gQmIrNOP/cImt/gZQrk8O6wI/47fRaKAIZnrLj7p6RN3xUI 5rsXWY0RQf6EMdW24KysIBEz5Ks4l3Qki76AfuUeNYBc8x6xlsa5B1u3Chm3LmmuuoAr IKaDuZdNuJciJ0blGHRNmOrPMdz8uoDm1N1jeaLqowe8JKdWVWwqZ1lWE+StasmXP4w7 Mc3A== 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=Ug3qIumfGZ8e/5KNVP6eHDrA3Si8g9ay4B2NqWHPYm8=; b=PSMcCXUazBDZG5MKT5Yo2T4B2UzmQlkHe47yuUyo/fm+hVruHEWx1z9pHCkbEQL0hE BNKtcDGtSyjIFy+yV9MUJh598cO6MP8vgiRj+hcM9lezEu6bQGDnt1wMS1aB7K/iH/Gz xoSvMebQBBNSEbIRxCseMUXQMlTKnQ1NBE6pP/MqYj1PTwXOa9o+1BdDfm2+PSPvhT1a Z4KNLQSeqLG4yJFD/lJVb2YkBG7mFmiyL6srlB7SyfcFJKT9pMxSrcyuOHwQZ6SZaShA C1poC56fw/AKl7EJEsJYVGPrvv5IK+tSpZwKkt+CIciL5wtUa7Xzg/cJcHbYQiJ42ET+ pedQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EPuLtKPy; 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 t13si1864528ybc.833.2017.11.20.13.22.30 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 13:22:30 -0800 (PST) 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=EPuLtKPy; 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]:59804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtWQ-0004mx-F2 for patch@linaro.org; Mon, 20 Nov 2017 16:22:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtVv-0004cA-BN for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtVt-0007rD-QU for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:59 -0500 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:45633) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtVt-0007nZ-Eo for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:57 -0500 Received: by mail-lf0-x242.google.com with SMTP id f131so3687973lff.12 for ; Mon, 20 Nov 2017 13:21:57 -0800 (PST) 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=Ug3qIumfGZ8e/5KNVP6eHDrA3Si8g9ay4B2NqWHPYm8=; b=EPuLtKPyNaPMH/Ue+jFwZzUQKuewAm+O2MFt1int5oX1g3RuTnG8HEAP0ytmBhbbRx 0xXJI6yRResaS2T0lg8bf4/4oR71fhVsEpCKfoIeEddpHOFudJS2uIjYkTqsGjQyqPM0 KQcxFN5tE+Da+5DZ5lteE/CqRr/8lyAltSOfA= 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=Ug3qIumfGZ8e/5KNVP6eHDrA3Si8g9ay4B2NqWHPYm8=; b=BDr02tEFPBHrrrc3AIihZ2hhJh6fN6i84mKUm9z75Ve0/oTok8gWQLj+SqPGrm4whJ lugPX6L62rR0WainCw3mssx2X6zS3Yrn0H8QFwTzeaMJXXB/BAg3C7QyJvSFxejTsoRw 4sz2Lfw2h5jEblT5Ie4Ql0VGM9CasD4bsh8l25o9jbuWY3LwmRgZyVxcL6Rs952msxoi l3rhaWvHFvLZODOz1s5HycclvZrn18oHGQr3nYtEFLjG7u51LriPGEDxZ+RstG0qoYIM 0mr+Ugy27EuAHimlS1S9H5sqDnJNMpQRMfN9xqXIKBEmInBuxhMOAIXQ7Qf8nO0eocki Jx3w== X-Gm-Message-State: AJaThX5yXf4UGDerdiyRmt28cGqlJzCgbdcprXwciuCdnewOGHke+C/O qA7DasHeZ5xf7WONmNqC0hSU2Kude5k= X-Received: by 10.25.153.65 with SMTP id b62mr3822474lfe.109.1511212915929; Mon, 20 Nov 2017 13:21:55 -0800 (PST) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id v63sm1645409lje.39.2017.11.20.13.21.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:21:54 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:35 +0200 Message-Id: <541e1690420d293c1b09eeb128fac74e98cbef7a.1511212753.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::242 Subject: [Qemu-devel] [PULL 07/15] linux-user: Handle TARGET_MAP_STACK and TARGET_MAP_HUGETLB 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: Helge Deller Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Helge Deller Add the missing defines and for TARGET_MAP_STACK and TARGET_MAP_HUGETLB for alpha, mips, ppc, x86, hppa. Fix the mmap_flags translation table to translate MAP_HUGETLB between host and target architecture, and to drop MAP_STACK. Signed-off-by: Helge Deller Message-Id: <20170311183016.GA20514@ls3530.fritz.box> [rth: Drop MAP_STACK instead of translating it, since it is ignored in the kernel anyway. Fix tabs to spaces.] Signed-off-by: Richard Henderson Signed-off-by: Riku Voipio --- linux-user/syscall.c | 31 ++++++++++++++++++++----------- linux-user/syscall_defs.h | 10 ++++++++++ 2 files changed, 30 insertions(+), 11 deletions(-) -- 2.14.2 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index d4497dec5d..8047bf3aac 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5872,17 +5872,26 @@ static const StructEntry struct_termios_def = { }; static bitmask_transtbl mmap_flags_tbl[] = { - { TARGET_MAP_SHARED, TARGET_MAP_SHARED, MAP_SHARED, MAP_SHARED }, - { TARGET_MAP_PRIVATE, TARGET_MAP_PRIVATE, MAP_PRIVATE, MAP_PRIVATE }, - { TARGET_MAP_FIXED, TARGET_MAP_FIXED, MAP_FIXED, MAP_FIXED }, - { TARGET_MAP_ANONYMOUS, TARGET_MAP_ANONYMOUS, MAP_ANONYMOUS, MAP_ANONYMOUS }, - { TARGET_MAP_GROWSDOWN, TARGET_MAP_GROWSDOWN, MAP_GROWSDOWN, MAP_GROWSDOWN }, - { TARGET_MAP_DENYWRITE, TARGET_MAP_DENYWRITE, MAP_DENYWRITE, MAP_DENYWRITE }, - { TARGET_MAP_EXECUTABLE, TARGET_MAP_EXECUTABLE, MAP_EXECUTABLE, MAP_EXECUTABLE }, - { TARGET_MAP_LOCKED, TARGET_MAP_LOCKED, MAP_LOCKED, MAP_LOCKED }, - { TARGET_MAP_NORESERVE, TARGET_MAP_NORESERVE, MAP_NORESERVE, - MAP_NORESERVE }, - { 0, 0, 0, 0 } + { TARGET_MAP_SHARED, TARGET_MAP_SHARED, MAP_SHARED, MAP_SHARED }, + { TARGET_MAP_PRIVATE, TARGET_MAP_PRIVATE, MAP_PRIVATE, MAP_PRIVATE }, + { TARGET_MAP_FIXED, TARGET_MAP_FIXED, MAP_FIXED, MAP_FIXED }, + { TARGET_MAP_ANONYMOUS, TARGET_MAP_ANONYMOUS, + MAP_ANONYMOUS, MAP_ANONYMOUS }, + { TARGET_MAP_GROWSDOWN, TARGET_MAP_GROWSDOWN, + MAP_GROWSDOWN, MAP_GROWSDOWN }, + { TARGET_MAP_DENYWRITE, TARGET_MAP_DENYWRITE, + MAP_DENYWRITE, MAP_DENYWRITE }, + { TARGET_MAP_EXECUTABLE, TARGET_MAP_EXECUTABLE, + MAP_EXECUTABLE, MAP_EXECUTABLE }, + { TARGET_MAP_LOCKED, TARGET_MAP_LOCKED, MAP_LOCKED, MAP_LOCKED }, + { TARGET_MAP_NORESERVE, TARGET_MAP_NORESERVE, + MAP_NORESERVE, MAP_NORESERVE }, + { TARGET_MAP_HUGETLB, TARGET_MAP_HUGETLB, MAP_HUGETLB, MAP_HUGETLB }, + /* MAP_STACK had been ignored by the kernel for quite some time. + Recognize it for the target insofar as we do not want to pass + it through to the host. */ + { TARGET_MAP_STACK, TARGET_MAP_STACK, 0, 0 }, + { 0, 0, 0, 0 } }; #if defined(TARGET_I386) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index daa2a57398..bec3680b94 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -1353,6 +1353,8 @@ struct target_winsize { #define TARGET_MAP_NORESERVE 0x0400 /* don't check for reservations */ #define TARGET_MAP_POPULATE 0x10000 /* populate (prefault) pagetables */ #define TARGET_MAP_NONBLOCK 0x20000 /* do not block on IO */ +#define TARGET_MAP_STACK 0x40000 /* ignored */ +#define TARGET_MAP_HUGETLB 0x80000 /* create a huge page mapping */ #elif defined(TARGET_PPC) #define TARGET_MAP_FIXED 0x10 /* Interpret addr exactly */ #define TARGET_MAP_ANONYMOUS 0x20 /* don't use a file */ @@ -1363,6 +1365,8 @@ struct target_winsize { #define TARGET_MAP_NORESERVE 0x0040 /* don't check for reservations */ #define TARGET_MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ #define TARGET_MAP_NONBLOCK 0x10000 /* do not block on IO */ +#define TARGET_MAP_STACK 0x20000 /* ignored */ +#define TARGET_MAP_HUGETLB 0x40000 /* create a huge page mapping */ #elif defined(TARGET_ALPHA) #define TARGET_MAP_ANONYMOUS 0x10 /* don't use a file */ #define TARGET_MAP_FIXED 0x100 /* Interpret addr exactly */ @@ -1373,6 +1377,8 @@ struct target_winsize { #define TARGET_MAP_NORESERVE 0x10000 /* no check for reservations */ #define TARGET_MAP_POPULATE 0x20000 /* pop (prefault) pagetables */ #define TARGET_MAP_NONBLOCK 0x40000 /* do not block on IO */ +#define TARGET_MAP_STACK 0x80000 /* ignored */ +#define TARGET_MAP_HUGETLB 0x100000 /* create a huge page mapping */ #elif defined(TARGET_HPPA) #define TARGET_MAP_ANONYMOUS 0x10 /* don't use a file */ #define TARGET_MAP_FIXED 0x04 /* Interpret addr exactly */ @@ -1383,6 +1389,8 @@ struct target_winsize { #define TARGET_MAP_NORESERVE 0x04000 /* no check for reservations */ #define TARGET_MAP_POPULATE 0x10000 /* pop (prefault) pagetables */ #define TARGET_MAP_NONBLOCK 0x20000 /* do not block on IO */ +#define TARGET_MAP_STACK 0x40000 /* ignored */ +#define TARGET_MAP_HUGETLB 0x80000 /* create a huge page mapping */ #else #define TARGET_MAP_FIXED 0x10 /* Interpret addr exactly */ #define TARGET_MAP_ANONYMOUS 0x20 /* don't use a file */ @@ -1393,6 +1401,8 @@ struct target_winsize { #define TARGET_MAP_NORESERVE 0x4000 /* don't check for reservations */ #define TARGET_MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ #define TARGET_MAP_NONBLOCK 0x10000 /* do not block on IO */ +#define TARGET_MAP_STACK 0x20000 /* ignored */ +#define TARGET_MAP_HUGETLB 0x40000 /* create a huge page mapping */ #define TARGET_MAP_UNINITIALIZED 0x4000000 /* for anonymous mmap, memory could be uninitialized */ #endif From patchwork Mon Nov 20 21:21:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 119320 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4395436qgn; Mon, 20 Nov 2017 13:27:39 -0800 (PST) X-Google-Smtp-Source: AGs4zMbRW3iHgq8Q8cna+PE1ZzpMaaC7121nVBWyhYnvfY3lWh9SuWPX8TLqhJqSmhDPqIU5WdOg X-Received: by 10.13.211.70 with SMTP id v67mr9507363ywd.406.1511213259648; Mon, 20 Nov 2017 13:27:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511213259; cv=none; d=google.com; s=arc-20160816; b=jvRvsVSLX6NoQXN3sK1IZUrm05TevW7ZeB+V/cX0LCthFqq5IWuIIGGCq25+Ll3Rot JuH/HDWF9tE1O1kiIxcINXLBrosXw2kQZRA0CWmNC23lQzbuMNO7pbkeD1ylFSOBxVtw CVm1K4sjuA1IKqiOqjG7pVEukFFAOZqiCmCl3ZdMt0P4Gafrjr+ldwn3SQptWVa0bl0N TAmBvZvS10NpbQcU4UGw+/z6ln/r2Lx7EcMYkqA/KoQ7e5wIOzPwu2+tQPOXXpfmKYAz uoUUItv3KVbqA9EoiI2JN+gG4sIQ2IzAOzDcaLx2OaX5u9gOh0j7gYekBwBVQ4CuT04c I9gw== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=DTF3+mU/xxZboCYV8UZ09Hb//OLojZa0AIzSAHN2Z40=; b=ne+PXygN2IlcCupu0lwCKAJPn9mItWEq5YVbGXlt1zXWyNtPlJYdKBYvwzt8d1+MC4 adt4RZn7ci6a0ZrpihMSK1EMCGs1P98Ld75591DVZThByQkazHYCplZ7pYy+beSeGwdh nt65OHWDQo4PZevGD1WZBp0nVJRmfOF+dWVj6IMcj0Uda+/l+qDDYe5if/1UpCNwwQp6 UhOub9czvQp+jIHdMPSxGPaKdBaWSTF8B85hCQ+eSaZOoPy6x0ullywHFSBlbaQp2/3l Oz52aOWx2RTtbFtXDL5hjCzwoZ4/oaNdpCPA45GO4RDWUatj4ibmMrw5bU7BbSnwAH65 qO4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NtirAUps; 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 j3si2377005ywd.357.2017.11.20.13.27.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 13:27:39 -0800 (PST) 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=NtirAUps; 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]:59824 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtbP-0008JG-4f for patch@linaro.org; Mon, 20 Nov 2017 16:27:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtVx-0004fl-26 for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtVv-0007rx-DE for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:01 -0500 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:33260) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtVv-0007rO-26 for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:59 -0500 Received: by mail-lf0-x243.google.com with SMTP id x68so11727102lff.0 for ; Mon, 20 Nov 2017 13:21:58 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=DTF3+mU/xxZboCYV8UZ09Hb//OLojZa0AIzSAHN2Z40=; b=NtirAUpskCrarxY15kL2W7Kj07ubtIlxVMHs3n42Hbb9Vv4gtDaFZJ033eGVTWwRi2 sS8X/MNcoKZvQeS6DVQ3y5YfAnLvJ/Z5zm8DjDtJnsIKPN3qULHZmX9z3wAtk/csMzUG HlleUa8qiiBxJlvw00w7ZsKWfDSvsoE+si8vo= 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:mime-version:content-transfer-encoding; bh=DTF3+mU/xxZboCYV8UZ09Hb//OLojZa0AIzSAHN2Z40=; b=fsIdDWJTAUAud3Mr9IGDez1AEw8gGLg5to1luvUPVRFllT078EXRa99z1ckJQ8v1Wc 2XMnocj6NoSwh55P7kHySzRdAu5wK5VFRc693sKZVb14j8yMfL/2GmDog2qwvuHOHHyc aQIMY+mwGJsYEGTqEsuO+g/J2GOe3M6qQL3oOJFav25NOaj2XvjMRNInEJKuYneuxoh9 72PK4TlzeJuWlxAUhZMNzx97pandIvZgyGcAWDiUJQeeafGF2/gkvGa1vWo3A3JYu314 UEFlGTirNqQJNEkMXAI8g0pf4dweYbH5hENOnmD2zU3e0vPij3dVaRPVpvS7/4JUwJPU WzsA== X-Gm-Message-State: AJaThX4zzb1BUo4O7B6X+yiCOgvFu8JRXKIiZ3bhW0/xJKf9kBXjoJba x4PNB7Yr9SFrPxSVlIlpZ5zm16bevR8= X-Received: by 10.25.201.83 with SMTP id z80mr3079656lff.181.1511212917529; Mon, 20 Nov 2017 13:21:57 -0800 (PST) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id v63sm1645409lje.39.2017.11.20.13.21.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:21:56 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:36 +0200 Message-Id: <8bf8e9df4a7d82c7a47cc961c9cdee1615595de0.1511212753.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::243 Subject: [Qemu-devel] [PULL 08/15] linux-user/syscall.c: Handle SH4's exceptional alignment for p{read, write}64 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: James Clarke Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: James Clarke Fixes: https://bugs.launchpad.net/qemu/+bug/1716767 Reviewed-by: Laurent Vivier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Tested-By: John Paul Adrian Glaubitz Signed-off-by: James Clarke Signed-off-by: Riku Voipio --- linux-user/syscall.c | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) -- 2.14.2 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 8047bf3aac..9268c3ef69 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -671,18 +671,32 @@ static inline int next_free_host_timer(void) /* ARM EABI and MIPS expect 64bit types aligned even on pairs or registers */ #ifdef TARGET_ARM -static inline int regpairs_aligned(void *cpu_env) { +static inline int regpairs_aligned(void *cpu_env, int num) +{ return ((((CPUARMState *)cpu_env)->eabi) == 1) ; } #elif defined(TARGET_MIPS) && (TARGET_ABI_BITS == 32) -static inline int regpairs_aligned(void *cpu_env) { return 1; } +static inline int regpairs_aligned(void *cpu_env, int num) { return 1; } #elif defined(TARGET_PPC) && !defined(TARGET_PPC64) /* SysV AVI for PPC32 expects 64bit parameters to be passed on odd/even pairs * of registers which translates to the same as ARM/MIPS, because we start with * r3 as arg1 */ -static inline int regpairs_aligned(void *cpu_env) { return 1; } +static inline int regpairs_aligned(void *cpu_env, int num) { return 1; } +#elif defined(TARGET_SH4) +/* SH4 doesn't align register pairs, except for p{read,write}64 */ +static inline int regpairs_aligned(void *cpu_env, int num) +{ + switch (num) { + case TARGET_NR_pread64: + case TARGET_NR_pwrite64: + return 1; + + default: + return 0; + } +} #else -static inline int regpairs_aligned(void *cpu_env) { return 0; } +static inline int regpairs_aligned(void *cpu_env, int num) { return 0; } #endif #define ERRNO_TABLE_SIZE 1200 @@ -6870,7 +6884,7 @@ static inline abi_long target_truncate64(void *cpu_env, const char *arg1, abi_long arg3, abi_long arg4) { - if (regpairs_aligned(cpu_env)) { + if (regpairs_aligned(cpu_env, TARGET_NR_truncate64)) { arg2 = arg3; arg3 = arg4; } @@ -6884,7 +6898,7 @@ static inline abi_long target_ftruncate64(void *cpu_env, abi_long arg1, abi_long arg3, abi_long arg4) { - if (regpairs_aligned(cpu_env)) { + if (regpairs_aligned(cpu_env, TARGET_NR_ftruncate64)) { arg2 = arg3; arg3 = arg4; } @@ -10508,7 +10522,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_pread64 case TARGET_NR_pread64: - if (regpairs_aligned(cpu_env)) { + if (regpairs_aligned(cpu_env, num)) { arg4 = arg5; arg5 = arg6; } @@ -10518,7 +10532,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, unlock_user(p, arg2, ret); break; case TARGET_NR_pwrite64: - if (regpairs_aligned(cpu_env)) { + if (regpairs_aligned(cpu_env, num)) { arg4 = arg5; arg5 = arg6; } @@ -11288,7 +11302,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, arg6 = ret; #else /* 6 args: fd, offset (high, low), len (high, low), advice */ - if (regpairs_aligned(cpu_env)) { + if (regpairs_aligned(cpu_env, num)) { /* offset is in (3,4), len in (5,6) and advice in 7 */ arg2 = arg3; arg3 = arg4; @@ -11307,7 +11321,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #ifdef TARGET_NR_fadvise64 case TARGET_NR_fadvise64: /* 5 args: fd, offset (high, low), len, advice */ - if (regpairs_aligned(cpu_env)) { + if (regpairs_aligned(cpu_env, num)) { /* offset is in (3,4), len in 5 and advice in 6 */ arg2 = arg3; arg3 = arg4; @@ -11420,7 +11434,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #ifdef TARGET_NR_readahead case TARGET_NR_readahead: #if TARGET_ABI_BITS == 32 - if (regpairs_aligned(cpu_env)) { + if (regpairs_aligned(cpu_env, num)) { arg2 = arg3; arg3 = arg4; arg4 = arg5; From patchwork Mon Nov 20 21:21:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 119315 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4390319qgn; Mon, 20 Nov 2017 13:22:32 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ2gC6knqrE+CGv4OxuUj9ukPzZkB2hm8nWHKHkJdkoa48AVzxNVCEFtAH5xqxiPGNbm1XF X-Received: by 10.129.174.76 with SMTP id g12mr9980837ywk.153.1511212952155; Mon, 20 Nov 2017 13:22:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511212952; cv=none; d=google.com; s=arc-20160816; b=gkdyXZsaUph4umP2VwkvKve7He6DYDz204qYI1fsXiJ2DdTuC0LWsDujm8grddGrNB jRbcEorpo25srE5+akaJZx/5eAWFNwaZ3SUHtg+qeHTXXoUiQrSxgXtkiyDT4vQE2MoM RLqT5EhPBitN6+jvhcjBBtwracwQJ5AYYdbLlXpWE1OjvUPGwRbrJuZtmphzwTnIDGFN kUy7JoYpcjuqcWOMyf3WxYDWzpSbq7JCrnar+YvXWYNQ6Zqe0AXQIIpt/Lts00F5AidB zC1iOa/7q4VQvy6ikqm2Ax4soJPHG1nFvFmSRTtv243OzRMDKgXgkQznJd3LAnstG0pH B+ZQ== 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=ILTCHkDgq2ZW9vCAwDRUl8aoPiF7Gk81H7oak08g9W4=; b=wekSxOVdkbhevd+NKJ2ypEmNtwD3H+7qcXDh/lWASiphcEuOEXke+1cWbYuzdeAOJO 3NkK8Ayu4ns5s161/AYa+bfIMjJqCdU1sv2JDIbFOwFXK8FfIeGtdP8RDgGtGNEgaNX1 E0yFTIU7ZuUYJ/DPC5jPnhC8sa+Iq0KgFF+z1jgJCP0EAbCYOecRAEskOshymNYdynnx g4d2ZieHxVvPKlIF5lNuSb4HqziCoBdcI2h9Wk5N6pNWMXRd3/DWOSjPSRhlHWKCn+oD XDhSKxwBWdMktQQF63kamFeFeZEfEmWesjZ8ExI2/YcHTC0e/CWDSzqxs/agAiP0d3P5 wHZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jlkyGXEh; 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 b125si2279389ybh.819.2017.11.20.13.22.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 13:22:32 -0800 (PST) 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=jlkyGXEh; 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]:59805 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtWR-0004nz-Km for patch@linaro.org; Mon, 20 Nov 2017 16:22:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtVx-0004fz-Bp for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtVw-0007ty-GG for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:01 -0500 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:33260) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtVw-0007s6-9E for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:00 -0500 Received: by mail-lf0-x244.google.com with SMTP id x68so11727188lff.0 for ; Mon, 20 Nov 2017 13:22:00 -0800 (PST) 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=ILTCHkDgq2ZW9vCAwDRUl8aoPiF7Gk81H7oak08g9W4=; b=jlkyGXEhp4p6nF7zWB+0ZT/EbpAVNt3IFnkoEUa0R+birJNq6+XS9aMVVowGgGMupj sLlZzLIwYGhIuKIQ2qG31GswCC92YpZ3yhNU7EawQYFaXcvOPDhEsNjIbU9INYgFcUcr PJS9JpgJQjhCUV3CStEd9YlFGu/ZlI54d49cE= 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=ILTCHkDgq2ZW9vCAwDRUl8aoPiF7Gk81H7oak08g9W4=; b=A0ONvStt/NiJBQxiFF7NiLREzl12KTghsdikEyvex+gGEp5yETRDnou+leTklIf9Q+ MHKrpIJaDzbQV1gjrGDB/SfrNdTwqStk7gZ6R0/GbFudXEh4jHYv3KAp/y96fGr1aYEB XleQS0BWhOC8rqNf4P/XYtr4lzBlCLVPhytAgqCbRrQtnJIYrxF255IZoLcJv89lVAcE jQlZQ4GdAPL8EkL1Z+1QshKBseAKZjIDFX3Gw4BEqdLI12HdEJRapSads9RuBNPJOzlF Sfkypmu881bngwZtpS+NpaV7cNYp1bj2V4qn6RccnDashsiFPTvS8sfL+cyQgYV6dZ3n +tNA== X-Gm-Message-State: AJaThX7g1G7WVayYhNd+XW5Q1FB4DtLOfF66KOdnl+JZfU1DNdDWRm6u 4I9yi8C3FzW5u7MBfmP8kR63H3ZJCfc= X-Received: by 10.25.202.74 with SMTP id h10mr4136820lfj.63.1511212918889; Mon, 20 Nov 2017 13:21:58 -0800 (PST) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id v63sm1645409lje.39.2017.11.20.13.21.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:21:57 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:37 +0200 Message-Id: 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::244 Subject: [Qemu-devel] [PULL 09/15] linux-user: fix 'finshed' typo in comment 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: "Emilio G. Cota" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Signed-off-by: Riku Voipio --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.14.2 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 9268c3ef69..84e123b67b 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6258,7 +6258,7 @@ static void *clone_func(void *arg) pthread_mutex_lock(&info->mutex); pthread_cond_broadcast(&info->cond); pthread_mutex_unlock(&info->mutex); - /* Wait until the parent has finshed initializing the tls state. */ + /* Wait until the parent has finished initializing the tls state. */ pthread_mutex_lock(&clone_lock); pthread_mutex_unlock(&clone_lock); cpu_loop(env); From patchwork Mon Nov 20 21:21:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 119325 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4397986qgn; Mon, 20 Nov 2017 13:30:25 -0800 (PST) X-Google-Smtp-Source: AGs4zMYG1eD/o7h2nfikmly9JGqu3CD9KHJhWrfPAbuDCWp9mKDVdmbdqgEy0lbDyy/CHX8QJ3Gm X-Received: by 10.129.118.74 with SMTP id j10mr1439708ywk.152.1511213425457; Mon, 20 Nov 2017 13:30:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511213425; cv=none; d=google.com; s=arc-20160816; b=LWWUr/hUfwSHxUc0JVRbzXh5s3ZghKw8Q6oEhUDIa9Bi8Lr80/gW0DqIiMw3trqPBn 55pz/kk5LQ+fNs+nK4rWGmeRhCplf0MtKIavLI+hVIWFY4jRYdQxtmeONeCmBEJKIhKw 2w27Zq3nz8GGO8nQ84GLXq8UGS1ffwmTAAuX+vlsOwugCcHIbNxqxT7QPZgNjcd4XADE lOcUgDc+SqBrny2TRGj9K4Vv33zNj3E6hecwizm4wID7nky8APy9BV9FUCSDZsceJLUK dN3v64q745UEupRkWr4JsovTwwItyO2Getdz1lCQYzRpqGu0Oc6bCd3OFMQWLuBoZZ6r 7+kg== 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=hhsx5CA6sbOw77fMKH++zZhcMEV1dHmJ6/2FsTPNMOo=; b=zz2FcFAHrmuraZwsEX6D2Sb9uqL+6uNYid8/vvNwWIbLfni74gRfKJ8qTRGh6m2Wip PueOQ/Q9Wxr64t0Miifua3StT0Wv8J2M0PUviz4eoyE2VEeKgsJp4z4W5d9w36JiyNR9 6tRE6iQqpeN15iZ2DOW/+4f2GwIWrI2NNZHJ///LZ7IsiFi0j6pU+4zFK8nXAGNI+/ry IKUxSoCFQE/RVsLFquE7TMYnOLhTZ4GWR9UO1uR0pbNDvA2A7SdOFcnTulAxl0lLG01k Kfi9/lOZfNHHkreGtddDkFaCoFiAT6u61pFwXKcMCv67C70dTAuB+djlmiztsgf2ns/S SotA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HsGCLG26; 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 j73si2343781ybj.3.2017.11.20.13.30.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 13:30:25 -0800 (PST) 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=HsGCLG26; 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]:59835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGte4-0003Mv-Ty for patch@linaro.org; Mon, 20 Nov 2017 16:30:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtVz-0004g1-1N for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtVy-0007xd-1i for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:03 -0500 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:42559) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtVx-0007wv-QM for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:01 -0500 Received: by mail-lf0-x241.google.com with SMTP id m1so11692554lfj.9 for ; Mon, 20 Nov 2017 13:22:01 -0800 (PST) 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=hhsx5CA6sbOw77fMKH++zZhcMEV1dHmJ6/2FsTPNMOo=; b=HsGCLG26V4lacFignAeS9UipmoSEkOgOYcjY/HAsgoiQDvBn2TB3DkIhkolqmnccEj Fkp/ob3WiSl4CbDn6h0fuqxwpvEHA/0MTJEPdDMOdRtxDAEc29Bg7OYkbHWFc52dTh4b KgBsfY08y3lWHqc/8IRspZo+jwIP1WZSSpTAY= 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=hhsx5CA6sbOw77fMKH++zZhcMEV1dHmJ6/2FsTPNMOo=; b=o+3h0ddAyI7g+eNljvfuaJnqWdJYWhoImJoQU0CqVjSBmyaGflEMtc66H9IxZNNdG5 GHJfEkopB8TnV3Ulyn6sNmuCAi4r8j81YleSNSkHXohwgBZjW2the16DxFgg5Zul58jC sG/ReD/f4H8NN9b7tCAQhG8fJ7V7NoMvCDsexO/DUzbvSh5El9U8cf6TibKNfWawgJcv wwRga77jy6Qp8sS68dn4o0FOWTCbvJoGu0zmLhLKK5b5chIT5KyUZu9JhNx0ii9GA/lG djvUNmjYmaIF8aGFhiXG7ZaeIvOhuKHWWxdRGNou+ASlMIjXUJtXjy3ZIDJGlNCvKOv4 iLrg== X-Gm-Message-State: AJaThX6aYWOIdtvVCw89+vmjjfXRgTKKhgdjyvW0L5p5zygR/G3CVEui 23a0gufX+3gQ/KFskXifbZkMC3fyOHg= X-Received: by 10.25.18.146 with SMTP id 18mr3265678lfs.160.1511212920350; Mon, 20 Nov 2017 13:22:00 -0800 (PST) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id v63sm1645409lje.39.2017.11.20.13.21.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:21:59 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:38 +0200 Message-Id: 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::241 Subject: [Qemu-devel] [PULL 10/15] linux-user: return EINVAL from prctl(PR_*_SECCOMP) 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: James Cowgill Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: James Cowgill If an application tries to install a seccomp filter using prctl(PR_SET_SECCOMP), the filter is likely for the target instead of the host architecture. This will probably cause qemu to be immediately killed when it executes another syscall. Prevent this from happening by returning EINVAL from both seccomp prctl calls. This is the error returned by the kernel when seccomp support is disabled. Fixes: https://bugs.launchpad.net/qemu/+bug/1726394 Reviewed-by: Laurent Vivier Signed-off-by: James Cowgill Signed-off-by: Riku Voipio --- linux-user/syscall.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.14.2 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 84e123b67b..f31b853bb7 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -10505,6 +10505,12 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, break; } #endif + case PR_GET_SECCOMP: + case PR_SET_SECCOMP: + /* Disable seccomp to prevent the target disabling syscalls we + * need. */ + ret = -TARGET_EINVAL; + break; default: /* Most prctl options have no pointer arguments */ ret = get_errno(prctl(arg1, arg2, arg3, arg4, arg5)); From patchwork Mon Nov 20 21:21:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 119328 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4400673qgn; Mon, 20 Nov 2017 13:32:38 -0800 (PST) X-Google-Smtp-Source: AGs4zMbfbKXKJAI8h3GlRHX8GL5sX+UfIXnU2jyDR8zuOkH4+wr7yJWrzxpiQ2TzA2AXuK/Nkurc X-Received: by 10.37.180.69 with SMTP id c5mr9723607ybg.193.1511213558312; Mon, 20 Nov 2017 13:32:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511213558; cv=none; d=google.com; s=arc-20160816; b=lpQCOoDtCrATV1INeYbOH0xkyF49W4+D3GGQ4WfQnviJEjlc05Svbvk8+4URuGCNJ2 Vx5aCOBy3bzQdhzA7xIdTV3RtkMkfSecSCYSv0LPnGU00JfmAbhatc8jTBQY6nll2W6m AtxsJcKAkyvMTp8q2WZnWepTcqU90bWfjahZ+hTTxiMxqyMDvksd5ni/auFgnJjd5FUi 1T2AJl0U8z7Ae5X7DuNxy+lxNHUvVvKz70b/n6LjAdb2gJZhwV+lzFYh1KAGkb1TBajO TOrEde9zbAaeENEAnEHk7v0KSXm8VVKB56fUhjwdDqnhjUu/MplIIeQ+jugp+fDmErrO rwfw== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=jpBWKIEaeGIsqdpEFfpflzsn3MKjwBVJ5ygjem87Imo=; b=0JCsuiV+qmpdRaZP7YMs77m6xMf595JRX/SKIuEfCE/PK8AfRoNMz0nJlV2NaBpkND l+/a4Muz8cUUui3/xwpyjdlbcivLjxUpBSr1PKXfDqhnvrMj19yfP/7qXAqwpmMl3dMY BnOa7HI47FxfxQcw53nYAYV5IWNDaB28Bj5AEeXHZQkI1qKDefW/OXy+yfGxDrgFZ0P5 dRWRrEl5wl185WpOAraDt5mtDHscfyp8gPokDZw1uuYPl9j+TEfXkiJrbsY9b0teK2Uv p4ctLeR7oy8/pm96IWPP3Ryxi1Qn25rQ+A3kjnitrrJqhprbmqcMZ/Z/d/kp+JvYT3cL AzGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=cLwHPXu3; 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 t9si2256223ybg.209.2017.11.20.13.32.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 13:32:38 -0800 (PST) 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=cLwHPXu3; 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]:59852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtgD-0005BJ-T0 for patch@linaro.org; Mon, 20 Nov 2017 16:32:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtW0-0004kO-Er for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtVz-0007yQ-Hb for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:04 -0500 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:42561) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtVz-0007xn-Af for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:03 -0500 Received: by mail-lf0-x241.google.com with SMTP id m1so11692656lfj.9 for ; Mon, 20 Nov 2017 13:22:03 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=jpBWKIEaeGIsqdpEFfpflzsn3MKjwBVJ5ygjem87Imo=; b=cLwHPXu3vckAVVL11Il6vTsI8bEr/O3dLSQWkGE/3UP5WxIfS9bT5u/Om4TnUVN4I6 pbCCXGlu+YJ953JHkKaatUOidLEX6F9jqIxUqAQ4CgGLuIPpUQzrQb20BMwL8FPfFEwB fxw/qyqj+AAz9IGHs4kGU4trl5jZ/cn0v4rIE= 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:mime-version:content-transfer-encoding; bh=jpBWKIEaeGIsqdpEFfpflzsn3MKjwBVJ5ygjem87Imo=; b=hMY/OeTid2rZ1RhYEJ7dQrmOzDYz7CcAtriZTLYKHFcKUUDHRtUsn2cqiPSxqhH5qD iO3MbyhtUPQG9ht0TYJEQ4NmpLWfWxt6Jn7+DlyQW68zce6WH4xI4KBtOoVbqXdA0ly3 YXY+BTU4aBQhLZQU2mCbUUmnm+SjVIRJVA2ADj6D19VCHUJhOYaATX6XO+bA5A+nDhuT nUbpeM/eeHnqs3cdoTUkNZa8DpeMkagUji4KrCh+X0rj/T6b/Rd6GMxH9iZFm0a+lcpH fWnoXbLfEnGP1J9UPzeEwjM2cE2BPb8SmY8aUEnGfrTS4s4inf0jKbX56ajCZ41fMib0 4Hlw== X-Gm-Message-State: AJaThX4t3umJJ7TVd5jU1ecAPLwo7LmLlwsfM2xZXchc5ds6m4pTQECm 6+3WcZcqkcWS0U+zWOnmTGHlMLUg/b4= X-Received: by 10.25.40.5 with SMTP id o5mr3738564lfo.238.1511212921889; Mon, 20 Nov 2017 13:22:01 -0800 (PST) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id v63sm1645409lje.39.2017.11.20.13.22.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:22:00 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:39 +0200 Message-Id: X-Mailer: git-send-email 2.14.2 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::241 Subject: [Qemu-devel] [PULL 11/15] linux-user/s390x: Mask si_addr for SIGSEGV 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell For s390x, the address passed to a signal handler in the siginfo_t si_addr field is masked (in the kernel this is done in do_sigbus() and do_sigsegv() in arch/s390/mm/fault.c). Implement this architecture-specific oddity in linux-user. This is one of the issues described in https://bugs.launchpad.net/qemu/+bug/1705118 Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.14.2 diff --git a/linux-user/main.c b/linux-user/main.c index aa02f25b85..b6dd9efd2d 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3238,6 +3238,10 @@ void cpu_loop(CPUAlphaState *env) #endif /* TARGET_ALPHA */ #ifdef TARGET_S390X + +/* s390x masks the fault address it reports in si_addr for SIGSEGV and SIGBUS */ +#define S390X_FAIL_ADDR_MASK -4096LL + void cpu_loop(CPUS390XState *env) { CPUState *cs = CPU(s390_env_get_cpu(env)); @@ -3294,7 +3298,7 @@ void cpu_loop(CPUS390XState *env) sig = TARGET_SIGSEGV; /* XXX: check env->error_code */ n = TARGET_SEGV_MAPERR; - addr = env->__excp_addr; + addr = env->__excp_addr & S390X_FAIL_ADDR_MASK; goto do_signal; case PGM_EXECUTE: case PGM_SPECIFICATION: From patchwork Mon Nov 20 21:21:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 119319 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4393284qgn; Mon, 20 Nov 2017 13:25:23 -0800 (PST) X-Google-Smtp-Source: AGs4zMawW1QT7ZO7rpEl4ByzU5+tqLD7QKm3edmMereHi2OdvqwpoBfOmqdxyNVzR4a8KTn6fhvL X-Received: by 10.37.139.133 with SMTP id j5mr9500997ybl.4.1511213123434; Mon, 20 Nov 2017 13:25:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511213123; cv=none; d=google.com; s=arc-20160816; b=USiYdCHOW2qEeI+PR/9hRyWJi6CblWaiFHIlKDfQvcck/TNvKPo+DP1YwuFuq1FiLP 8CWa0XlJFO6fsnSyOoQ/Xxr7KTB+ZuserE3g8fKIE3yhdQVyKN7T6XQDfHC9+ymrdh9C XQNZ0aG1jFfbkAf8d4fS0jApMYTHv3WzQG0o058K3ZyWnW5u4ExJ52mH2ywTPfQIPO7T K5eTrP/wHGFBYp7bXkFbHJ5DK20JcPhXzrSMilbvAl/NF1g2VxvWPlPIjLBN4SSlr76I l0CIbEFCoVXKE0oKWclvvU+5p3RAJWTkc208gz5H9pmI3isPXRDmzPjfTYKX7zMZ4Bzk 2JGw== 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=SwkXu0fPmqui88eJDIiUHicKxDg2XKWY1onT5RhrQxA=; b=wO/I+iBXxmpIDkKJm5IPYWXq8skOuwwthWdWImDTHd3WGwl3ADklzOCpZay0C2R8vZ 5h/BAwblLKMWzQlm1tACY/RHgi9c/oXBbl4ytfEN6YHTUyWKVLTIpP0FWm1e+qboo/zI GrnSrCQ4T+07WlLjTcRXwFcZ+cTgTakfYPtgV7VCaNYju5jCi/ZVMZlFX2bdxueP+1rn s6Ns1PWAR0rzOb8Aumo7py0wrgZTSQmgP710W0Mw0fa2s9FkII9UwqGy+GT3RU1hUN64 MuYI301LyqNg65SKuya2ILhMf02tNAtbLnShhh9qm79MqYFco+bkex22CNo2JJpMR0w+ GMUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BCxcSyA4; 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 x127si2364890ybg.139.2017.11.20.13.25.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 13:25:23 -0800 (PST) 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=BCxcSyA4; 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]:59814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtZC-00075k-Tx for patch@linaro.org; Mon, 20 Nov 2017 16:25:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtW1-0004nM-Nx for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtW0-000827-Tn for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:05 -0500 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:37686) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtW0-0007yn-Mk for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:04 -0500 Received: by mail-lf0-x244.google.com with SMTP id y2so10781007lfj.4 for ; Mon, 20 Nov 2017 13:22:04 -0800 (PST) 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=SwkXu0fPmqui88eJDIiUHicKxDg2XKWY1onT5RhrQxA=; b=BCxcSyA4tyRc6BZgom6ZVxXfRmuZPk7Qc2k3RE+I18+W/GQwdqIXA3QSriCMBgrddi PYFJnGADElFOj/DHLBuCI3cTjVaBwt7jvhQCHWYJkVFbU66SlWLFAAcHRnm/XWlM+5/6 fPUzxNcYyiTvup1WbTgBXMKDKoql6+eApTx+g= 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=SwkXu0fPmqui88eJDIiUHicKxDg2XKWY1onT5RhrQxA=; b=mhrCRqXi7Cb03eqN1bI9UALIG7EsNdN+lLszQno2+nq1IP2DXJqciCbAVp+1juWIM3 MPpXcA+M8kANhHHntw/aWY9Q4txANk9kF3XZ7/ltJKSNLcYwXaxbGLlXZ797WZp4ap1s iZ8xjHVLvhp2nRriSAaGm1L83hT6t6SeiQVLfg0Tjt02ega99t1BA31SJIsOufw531Pl 6/TKRvfcSKWDx7g2HIMBWLSFr8vgGrzvowY1pFtYZbR53JnmXUfxYQqbRfXI2TeUcMko vgd2szNN+Hd9anEzgaxEjOaV295Wx/w2vo4ZmZa/hYMESVbkYCZVN9XqwvMCPkx+cvMg gD2w== X-Gm-Message-State: AJaThX7uhrm28FIKIAhkJj1n5jSik2Q9g2zur8yGkxx83SJk01LrGP1O SORH41lO5EHY/yNzICL7dYMn4kH3TyI= X-Received: by 10.25.203.2 with SMTP id b2mr3190785lfg.94.1511212923281; Mon, 20 Nov 2017 13:22:03 -0800 (PST) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id v63sm1645409lje.39.2017.11.20.13.22.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:22:02 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:40 +0200 Message-Id: <15e692a6fc716f32976eea47946a4892e8ad7a3f.1511212753.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::244 Subject: [Qemu-devel] [PULL 12/15] linux-user/ppc: Report correct fault address for data faults 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell For faults on loads and stores, ppc_cpu_handle_mmu_fault() in target/ppc/user_only_helper.c stores the offending address in env->spr[SPR_DAR]. Report this correctly to the guest in si_addr, rather than incorrectly using the address of the instruction that caused the fault. This fixes the test case in https://bugs.launchpad.net/qemu/+bug/1077116 for ppc, ppc64 and ppc64le. Reviewed-by: Laurent Vivier Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.14.2 diff --git a/linux-user/main.c b/linux-user/main.c index b6dd9efd2d..6286661bd3 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -1420,7 +1420,7 @@ void cpu_loop(CPUPPCState *env) info.si_code = TARGET_SEGV_MAPERR; break; } - info._sifields._sigfault._addr = env->nip; + info._sifields._sigfault._addr = env->spr[SPR_DAR]; queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; case POWERPC_EXCP_ISI: /* Instruction storage exception */ From patchwork Mon Nov 20 21:21:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 119332 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4402347qgn; Mon, 20 Nov 2017 13:34:14 -0800 (PST) X-Google-Smtp-Source: AGs4zMbhXOPoF4SEtIMwN6f9DnwsnVcYmXhtnW2hzp9I3W4KojNtV9PSF+AfoXQwlFLoyrCz5BP2 X-Received: by 10.37.172.208 with SMTP id x16mr9293308ybd.386.1511213654590; Mon, 20 Nov 2017 13:34:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511213654; cv=none; d=google.com; s=arc-20160816; b=IZyEUsSWxQSf4Hh9SKYDl/Wy5fnVoP1L1PmCvLgBcfaQ2Sk6K5NJ8iTRSwsXxQRPpr kDmkkAnAqMSvZJTDFH4IdcVUFM70xF2F1zkmxu/gh4dyNTpRfNiCG6FGen3dXHeRz9y4 bC1tQcU7lFuHXbpTHENftiK2uCHwHILW2o/wJg+0l6ShmTTu8v7GNJRo6xsvkN8SrZ9B L4NdFMRy+w90wpBA/vPxr0J0A29qzi2GzJEcHcsv8FS7Uo0PU4xtsV08MIOroAZjVmB1 jYTF1OxAmfI7zKLysdqD75vK2T/XmJpYavi4UqF9FvVXGqtH+wb2hvNdZ8odPNZ9uPCj AGaw== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=W4VHbrpagaYLA8j/FOA/MBf3OH6euAv9ISEr6iEZ1nY=; b=lkio4QZFrfu5NltsYHQt5TrbNoIlsVtR2oez2AZbbDaKoXt+fTM4kuHPjIXhCgxgAL 9xPgt4CKCP6titd5zuCSxdcDWOsGNY2LtsUSNSQbojKJdLXqEtq++se7ZH9bbSy8NFo6 OOJJVzmb1Qd3GWA323XrzJ8O5uvEjdSGH0M94p1RbJp1U7jrGRsthSSkuUNwVZDt+ufZ PxbHD3o8goSE08dw610urGFJxbMv5HPmDgziDWlK84mPNZhj5T/RvdxmO152tNHZNq+L VxfvgKLpZeA90D1TT71uGHWFzHHpJGLBN1oLTqKchSCtVzi+sXgSpIgkqQos0WnOlFTl pOiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UXQu/7wh; 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 h25si2376284ybj.219.2017.11.20.13.34.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 13:34:14 -0800 (PST) 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=UXQu/7wh; 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]:59855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGthm-0005mY-4C for patch@linaro.org; Mon, 20 Nov 2017 16:34:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtW4-0004vR-WA for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtW2-00082s-Ex for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:08 -0500 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:36363) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtW2-00082H-6o for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:06 -0500 Received: by mail-lf0-x244.google.com with SMTP id k66so11727387lfg.3 for ; Mon, 20 Nov 2017 13:22:06 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=W4VHbrpagaYLA8j/FOA/MBf3OH6euAv9ISEr6iEZ1nY=; b=UXQu/7whbFvaGhYEk2jFR4ULjdTlTnXOBBIswR7VxeLPJz18BI1HuoLJngLgG0mck+ D1SxFvQTr67p9jvDDYiFRZS5CmX9g/d6CYeuFCi9cUIe/UeMuSk9R9je7jteHJSUferj g26ysucJ02NeCECldkhqhPXZAaejRY5NaLmP4= 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:mime-version:content-transfer-encoding; bh=W4VHbrpagaYLA8j/FOA/MBf3OH6euAv9ISEr6iEZ1nY=; b=MMe3vp83/j5aJc/yndvbLZvkMTAKx+FitE/a1K+zjRUyOyMzGtZB8Zta/EWjQ80U3i yM/3UPVtQKB0Ss1Zx9qFVBWnGWlZU+wjzG8rE61Ps+OriP3VbW2XlTGOmZXAi84yXBqD fnhrQzY30Uozy1o85emZtnxG92bStxWoK/74/QM2sZFMV7Wc9bGpifD0nV9fJaS4DVTJ dxUCrHdeFe1TfrFLsnyNJ16wcIxUUDzazfq465q4GQNfV/39KzmZGcicGCMnDlU7s2S2 JohKkZhrv/FfX04bsOyBcvhSiM0qh3yDfIuEv/yD/uD2rNli7Qr1vRE1OQRBWKa06iw4 vYwQ== X-Gm-Message-State: AJaThX7ZN9fvBa4t3HHvGxIiovr9kEuxZY4M+EUhdXdaPWQ6/PfzkVHU zrsZHNKm2rxmvjwT7vQX/r+fXda1lFM= X-Received: by 10.25.225.8 with SMTP id y8mr3767970lfg.209.1511212924689; Mon, 20 Nov 2017 13:22:04 -0800 (PST) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id v63sm1645409lje.39.2017.11.20.13.22.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:22:03 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:41 +0200 Message-Id: <8d8cb956e0a679fcf0a8e24f1b2f34e038cdd48e.1511212753.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::244 Subject: [Qemu-devel] [PULL 13/15] linux-user/sparc: Put address for data faults where linux-user expects it 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell In the user-mode-only version of sparc_cpu_handle_mmu_fault(), we must save the fault address for a data fault into the CPU state's mmu registers, because the code in linux-user/main.c expects to find it there in order to populate the si_addr field of the guest siginfo. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- target/sparc/mmu_helper.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.14.2 diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c index 126ea5e3ee..d5b6c1e48c 100644 --- a/target/sparc/mmu_helper.c +++ b/target/sparc/mmu_helper.c @@ -30,10 +30,18 @@ int sparc_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int rw, int mmu_idx) { + SPARCCPU *cpu = SPARC_CPU(cs); + CPUSPARCState *env = &cpu->env; + if (rw & 2) { cs->exception_index = TT_TFAULT; } else { cs->exception_index = TT_DFAULT; +#ifdef TARGET_SPARC64 + env->dmmu.mmuregs[4] = address; +#else + env->mmuregs[4] = address; +#endif } return 1; } From patchwork Mon Nov 20 21:21:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 119324 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4395828qgn; Mon, 20 Nov 2017 13:28:06 -0800 (PST) X-Google-Smtp-Source: AGs4zMaW7aLp0c62UZYbp7woJLr/utzQba+210ubdQZxlas72mfDv/5q9H4E6GDQufeaDpjcYyB9 X-Received: by 10.37.208.88 with SMTP id h85mr9557540ybg.363.1511213286492; Mon, 20 Nov 2017 13:28:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511213286; cv=none; d=google.com; s=arc-20160816; b=YQPYMSepoKsjM5q3lmgrgsjJvVyaS0LL3M/jjMYZVq3Utp+J5ouqfEsSZc7IbroW4o 3cKIBzpZ5FkIC1Oka9eHrJKHTAfkZ+EJ4blWp3vBEZQvAM5V14fe4F43GRcYTu8NiLGM nhEvXV3D+38RdVPkL8ssrhw45/5QlwlRE5V19oLzFPLsg5hanXRn/KUf/0Q62HIeCJPT C8gTa56ukuQv9vmHI/EOy7UutWYgYH8rnKoKmvFURVj4dwW4jU0LjKhtP7XuZVnxoAiJ ghp/Ac0Vuylh4ZVeY05sEBSx4HUM4Ccm0Q70djWvWgV6enYKNeUTedT8OrZbSYbW9PUu LDYQ== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=vsOs+oYYn+PCPaX4vVkt5j6zcyxWA0dA3DU3czrhMNA=; b=PoX/bknl90u2do6ahTexzDic9LuOgUWb+YmSjl5refnwUHV1b7AijnKY7Df4nUK+gq DKJBphkvjAbxw2u52f2Hv8RkGn2BWaWiKQJ1Fq2gSopwP70ypWEo4hiW1Ryc9Mz7Wye1 BQsQ8ZI3p8pZUJBGdsRyQRRrfyA5I1ZFPR49/kVID7//PFI4L9my4a4a6ZUWp1CimXDU YdJi/Gb6VqO5RybGPvVcWSkn9POmTuLOfE0dQmyf2WfVHi/OUq4w/FLMsJRWBYBvA0K5 6u2x2hgeFo6S8M+poRcrK+IcIJHzbhgpbx4DX9d6c50mCoyF7wQQPY17gafklvByL6DH Y+MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ds2aCKyU; 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 l124si740785ywe.718.2017.11.20.13.28.06 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 13:28:06 -0800 (PST) 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=Ds2aCKyU; 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]:59828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtbp-0001Ny-TD for patch@linaro.org; Mon, 20 Nov 2017 16:28:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtW5-0004vh-6b for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtW4-00086M-6J for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:09 -0500 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:41055) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtW3-00083W-UF for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:08 -0500 Received: by mail-lf0-x244.google.com with SMTP id f134so11686961lfg.8 for ; Mon, 20 Nov 2017 13:22:07 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=vsOs+oYYn+PCPaX4vVkt5j6zcyxWA0dA3DU3czrhMNA=; b=Ds2aCKyUtY8VKf1ip2XT6hI7enubjGCGb9C61ttzVqMkHPkpemwp/Oe01ddDjmsRg1 c0lZX/89s0adeKElUfA3zQjOnpM+O2X5df0szOeDeINJbZ4XS89JYxN1UJ/xvRABIehB U0Q9dYyPj7LmXRAZLYXMb0KNI52IQaqaxC8Ww= 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:mime-version:content-transfer-encoding; bh=vsOs+oYYn+PCPaX4vVkt5j6zcyxWA0dA3DU3czrhMNA=; b=Nm3FduZ/RvOnlzhWH4RISdLSeXnZApBrk8gyEmeNwboLj7UsFzIfAqbFTO4Qgc7ovH RymMocYLCyMrXSUNISu1YPw1CO+2pa3S/QHGX6wLCfD1PNXoparEsEjiQlcmDKtvyLya x+jRsrpd1wdDwOQoZcHnJo/qE4zpniWJbz/woMxo+Y0JZUU530qmSAMdfXSxPhiPi/vM NAC6bqS2fZGIf5aJz0fUIEVWbRYdR/F/WQW0vGUT1XFSNYZqV9KQe9e6htE3Sk0Bac66 QW7y6Pf8t/DmWKhHeyWur6VJsyrOOXvjDHdarkf5TS2VaqJsAj/cd5qQwPLpigGhq9qH Fq4Q== X-Gm-Message-State: AJaThX55Le3WTXXOM1U2iRnSdow/3cMJzGrbUbIUuys/VuC1DeZCdyRM xoOwFFwAVIVkENnTBC+tTGqEXQC5uF4= X-Received: by 10.25.228.155 with SMTP id x27mr173216lfi.231.1511212926472; Mon, 20 Nov 2017 13:22:06 -0800 (PST) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id v63sm1645409lje.39.2017.11.20.13.22.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:22:04 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:42 +0200 Message-Id: <78bfef72fbf8705f002c5c57cf3f1d3b8e83399e.1511212753.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::244 Subject: [Qemu-devel] [PULL 14/15] linux-user: Handle rt_sigaction correctly for SPARC 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell SPARC is like Alpha in its handling of the rt_sigaction syscall: it takes an extra parameter 'restorer' which needs to be copied into the sa_restorer field of the sigaction struct. The order of the arguments differs slightly between SPARC and Alpha but the implementation is otherwise the same. (Compare the rt_sigaction() functions in arch/sparc/kernel/sys_sparc_64.c and arch/alpha/kernel/signal.c.) Note that this change is somewhat moot until SPARC acquires support for actually delivering RT signals. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/syscall.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) -- 2.14.2 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f31b853bb7..11c9116c4a 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8579,8 +8579,16 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, case TARGET_NR_rt_sigaction: { #if defined(TARGET_ALPHA) - struct target_sigaction act, oact, *pact = 0; + /* For Alpha and SPARC this is a 5 argument syscall, with + * a 'restorer' parameter which must be copied into the + * sa_restorer field of the sigaction struct. + * For Alpha that 'restorer' is arg5; for SPARC it is arg4, + * and arg5 is the sigsetsize. + * Alpha also has a separate rt_sigaction struct that it uses + * here; SPARC uses the usual sigaction struct. + */ struct target_rt_sigaction *rt_act; + struct target_sigaction act, oact, *pact = 0; if (arg4 != sizeof(target_sigset_t)) { ret = -TARGET_EINVAL; @@ -8606,18 +8614,29 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, unlock_user_struct(rt_act, arg3, 1); } #else +#ifdef TARGET_SPARC + target_ulong restorer = arg4; + target_ulong sigsetsize = arg5; +#else + target_ulong sigsetsize = arg4; +#endif struct target_sigaction *act; struct target_sigaction *oact; - if (arg4 != sizeof(target_sigset_t)) { + if (sigsetsize != sizeof(target_sigset_t)) { ret = -TARGET_EINVAL; break; } if (arg2) { - if (!lock_user_struct(VERIFY_READ, act, arg2, 1)) + if (!lock_user_struct(VERIFY_READ, act, arg2, 1)) { goto efault; - } else + } +#ifdef TARGET_SPARC + act->sa_restorer = restorer; +#endif + } else { act = NULL; + } if (arg3) { if (!lock_user_struct(VERIFY_WRITE, oact, arg3, 0)) { ret = -TARGET_EFAULT; From patchwork Mon Nov 20 21:21:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 119323 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4395808qgn; Mon, 20 Nov 2017 13:28:04 -0800 (PST) X-Google-Smtp-Source: AGs4zManvKVS280a5nTMpkwl+3XgfirF2ZFlcDoWt4dRXeyEPhuOstAkWaliz220t+NTUua2Qhmn X-Received: by 10.37.78.130 with SMTP id c124mr7590155ybb.383.1511213284112; Mon, 20 Nov 2017 13:28:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511213284; cv=none; d=google.com; s=arc-20160816; b=on0EPGWgU6SAY0ruNuGrclNvwPeQjt5KO6GzgrzPuzC+nCXnfF5XPYfENePrXiUOxc g+2Cz4RD+X6utcbyCeCqix9y4U46+358y4wjo5Vwu5U/9ig/FlskehmAu5SKmdIlFdrE aQC6z+xzDqZ2qSvolssiNHQqxJurnblpxssmu1diXZ/Kgmj4/pXMJ1QkJoyNxuOaZv4q MJJ6QVu1UfoFGcLv4RyxwoVxV+J7JsyMS03NSr1EJ69wBkwCRVTBasSkpHtFoIfpuTDZ fQq3Zi+G5yXvyFX/x1bsrn6fNk3vXDRsLKIURI7yvgVkaqMJwcBc5H8GH76Kmm0dpeSG b3Fw== 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=uIVpqLT7MT9xmVbQ1a9ljDsAY7KrxgwugJ0GkGCg4hA=; b=CrmCsCXm6asD2jL3wXjOWqL52+cFfRtRVcIn2hn1xVhDvOwSTx8+3GWCADZOoz+nYs 8sewl2HygoM9pKX7mGbU0VtmWnySg69No8a1zX8Tp9aHgKAxLk1QBadLI4g8KVXA+CT7 CllxYEzFbOxtmWVD9+TKwMGyHiSHpAW0+vWTsAm1R0zb1Ov/nCcKDQA3xC1+N8Fq8BT9 cIRTxk8SDvkusz9otW+QHzfTuWxgkPV0U+n9Prd9XxZb78fBhsMGVJebDHCJAtutB7TY U4/aS/0hONPac1IC8iD4tkAckJYR8NAhXf98fJ26wFVCX3+7O6WP4trPoXx5tDoYu9x2 XvzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Z9x2MZzt; 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 s83si2460361ybc.108.2017.11.20.13.28.04 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 13:28:04 -0800 (PST) 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=Z9x2MZzt; 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]:59827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtbn-0001Md-Hy for patch@linaro.org; Mon, 20 Nov 2017 16:28:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtW6-0004xQ-S6 for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtW5-00087A-Mf for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:10 -0500 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:36364) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtW5-00086U-El for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:09 -0500 Received: by mail-lf0-x242.google.com with SMTP id k66so11727525lfg.3 for ; Mon, 20 Nov 2017 13:22:09 -0800 (PST) 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=uIVpqLT7MT9xmVbQ1a9ljDsAY7KrxgwugJ0GkGCg4hA=; b=Z9x2MZztQ1rmkOJSEMMr/s22VH7CT3wTYr3ACkvGb04b4RFxS1CPQjLtztEd6Ns704 JABBAc7rLiRT9Ax4KZSoI/YCNYolmIiTZOpIyX84jHqZXfFwr4x89DbQMEnHj2q7AIMH umdXqmcOzh2WGtX4T4UlVrglJhx5LpbkPgAl0= 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=uIVpqLT7MT9xmVbQ1a9ljDsAY7KrxgwugJ0GkGCg4hA=; b=nmIhv6jHjHd+cE9K5uug2nY//deF16r+3nHy+dNbfbxk5HNgbnhgZw8SZefcahPbhG AXBD0MXMuYROZwL/1FM+VB7+1w3NpxcRZ9VCLRBgh4qlySJS3GZiLBzUPck8s92eOTBv K9i6wQIRwcsKmFlZK1Sy9mQMKYz/E+M8cvUPzv/WtFNPvJAUyCN3/AC0ELq3yjw8OyaG XCApRQ6zUvsr38HCrkU5nkjuoGrmSvRYwSaXYCw95Dit8/NsXYYUNKp7yRVL/TF2H9JS 5VPYGnxCoym7F45N6lRuAwgZa+QoY3TkLwwEWAABHSGBJ4dMfpyu4+hFwOcA6hnOGSNp ikmg== X-Gm-Message-State: AJaThX6v92CJODGwA0d8+Hg9erVRYoBvT8EJKknTx0O8USZEFjImCvLi suimSPv+dQz8R5gwmyhOyWgrWvfXggM= X-Received: by 10.46.95.212 with SMTP id x81mr5296782lje.184.1511212927971; Mon, 20 Nov 2017 13:22:07 -0800 (PST) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id v63sm1645409lje.39.2017.11.20.13.22.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:22:06 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:43 +0200 Message-Id: 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::242 Subject: [Qemu-devel] [PULL 15/15] linux-user: Fix calculation of auxv length 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell In commit 7c4ee5bcc82e643 we changed the order in which we construct the AUXV, but forgot to adjust the calculation of the length. The result is that we set info->auxv_len to a bogus and negative value, and then later on the code in open_self_auxv() gets confused and ends up presenting the guest with an empty file. Since we now have to calculate the auxv length up-front as part of figuring out how much we're going to put on the stack, set info->auxv_len then; this allows us to assert that we put the same number of entries into auxv as we pre-calculated, rather than merely having a comment saying we need to do that. Fixes: https://bugs.launchpad.net/qemu/+bug/1728116 Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/elfload.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) -- 2.14.2 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 3b857fbc9c..20f3d8c2c3 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1732,6 +1732,8 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc, #ifdef ELF_HWCAP2 size += 2; #endif + info->auxv_len = size * n; + size += envc + argc + 2; size += 1; /* argc itself */ size *= n; @@ -1760,7 +1762,6 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc, put_user_ual(val, u_auxv); u_auxv += n; \ } while(0) - /* There must be exactly DLINFO_ITEMS entries here. */ #ifdef ARCH_DLINFO /* * ARCH_DLINFO must come first so platform specific code can enforce @@ -1768,6 +1769,9 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc, */ ARCH_DLINFO; #endif + /* There must be exactly DLINFO_ITEMS entries here, or the assert + * on info->auxv_len will trigger. + */ NEW_AUX_ENT(AT_PHDR, (abi_ulong)(info->load_addr + exec->e_phoff)); NEW_AUX_ENT(AT_PHENT, (abi_ulong)(sizeof (struct elf_phdr))); NEW_AUX_ENT(AT_PHNUM, (abi_ulong)(exec->e_phnum)); @@ -1793,7 +1797,10 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc, NEW_AUX_ENT (AT_NULL, 0); #undef NEW_AUX_ENT - info->auxv_len = u_argv - info->saved_auxv; + /* Check that our initial calculation of the auxv length matches how much + * we actually put into it. + */ + assert(info->auxv_len == u_auxv - info->saved_auxv); put_user_ual(argc, u_argc);