From nobody Mon May 6 02:18:53 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511213045761524.338029612778; Mon, 20 Nov 2017 13:24:05 -0800 (PST) Received: from localhost ([::1]:59808 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtXg-0005mY-Ix for importer@patchew.org; Mon, 20 Nov 2017 16:23:48 -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) 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) 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-Google-Smtp-Source: AGs4zMYMPfyX1tiuXCQm/a57TeCGCgQ8Dfgm0yYVxNDsXuaZG/Fq3DRNxiY+Li64qgbVCJTW9ZrCeg== X-Received: by 10.46.89.196 with SMTP id g65mr4643315ljf.53.1511212906573; 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: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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(-) 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_sigactio= n *act, #define TARGET_SA_RESTORER 0x04000000 #endif =20 +#ifdef TARGET_SA_RESTORER +#define TARGET_ARCH_HAS_SA_RESTORER 1 +#endif + #if defined(TARGET_ALPHA) =20 #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 }; =20 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 --=20 2.14.2 From nobody Mon May 6 02:18:53 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511213219823172.6132759785329; Mon, 20 Nov 2017 13:26:59 -0800 (PST) Received: from localhost ([::1]:59821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtaM-000835-3H for importer@patchew.org; Mon, 20 Nov 2017 16:26:34 -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) 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) 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-Google-Smtp-Source: AGs4zMZShfHL8rT24EM7GZ2WVa2LYXpbxMphFTqM/VOrlGGy9GqRobpuukg+5SxWgAPID2mqPrjBDA== X-Received: by 10.46.2.197 with SMTP id y66mr2164358lje.113.1511212908197; 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: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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(+) 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_sigactio= n *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 */ --=20 2.14.2 From nobody Mon May 6 02:18:53 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511213369339466.38572191698813; Mon, 20 Nov 2017 13:29:29 -0800 (PST) Received: from localhost ([::1]:59829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtct-0002D7-5A for importer@patchew.org; Mon, 20 Nov 2017 16:29:11 -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) 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) 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-Google-Smtp-Source: AGs4zMZY9TPA15/IHm0eBG3XXogH7/Dw+vY0I7hSIR/zkKSqNOOUp1gvSKZTIvujQbmp2+MMPihTMg== X-Received: by 10.46.70.26 with SMTP id t26mr4558913lja.181.1511212909682; 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: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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(+) 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, tar= get_ulong newsp) if (newsp) { env->gr[30] =3D newsp; } + /* Indicate child in return value. */ env->gr[28] =3D 0; + /* Return from the syscall. */ + env->iaoq_f =3D env->gr[31]; + env->iaoq_b =3D env->gr[31] + 4; } =20 static inline void cpu_set_tls(CPUHPPAState *env, target_ulong newtls) --=20 2.14.2 From nobody Mon May 6 02:18:53 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511213517627770.1817813441646; Mon, 20 Nov 2017 13:31:57 -0800 (PST) Received: from localhost ([::1]:59847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtfF-0004Lo-WC for importer@patchew.org; Mon, 20 Nov 2017 16:31:38 -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) 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) 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-Google-Smtp-Source: AGs4zMaoSCm355a2JXSpfatOSoVMXn/wmO5GHgSRxOiQWT8H7RLjagPMpEgGPX3AdRvreJu+aiksmg== X-Received: by 10.46.33.202 with SMTP id h71mr5128152lji.193.1511212911279; 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: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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(-) 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 --=20 2.14.2 From nobody Mon May 6 02:18:53 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 15112132148171002.4879145810584; Mon, 20 Nov 2017 13:26:54 -0800 (PST) Received: from localhost ([::1]:59822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtaN-000857-Ml for importer@patchew.org; Mon, 20 Nov 2017 16:26:35 -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) 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) 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-Google-Smtp-Source: AGs4zMZPallIOM3nFIjNWYDM7dk6pQF8GcJ9ukgtH7DvBe3YaB3IO3nAcel4sHgXJckQVkQAtzr3Ww== X-Received: by 10.25.171.2 with SMTP id u2mr3854233lfe.251.1511212912691; 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: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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(-) 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 =20 /* Target specific */ #if defined(TARGET_MIPS) --=20 2.14.2 From nobody Mon May 6 02:18:53 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511213369211134.32352057660694; Mon, 20 Nov 2017 13:29:29 -0800 (PST) Received: from localhost ([::1]:59830 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtcx-0002Fo-2V for importer@patchew.org; Mon, 20 Nov 2017 16:29:15 -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) 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) 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-Google-Smtp-Source: AGs4zMYZLEa/OwEpkDZTeqJxka5vkimzyhIFfJTY60ciSfky/f8Mnqiq77H0lDlplgkL9dt/0AaMFA== X-Received: by 10.25.21.154 with SMTP id 26mr3702100lfv.93.1511212914281; 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: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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(+) 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 --=20 2.14.2 From nobody Mon May 6 02:18:53 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511213061508846.1309539745607; Mon, 20 Nov 2017 13:24:21 -0800 (PST) Received: from localhost ([::1]:59809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtXv-0005za-MG for importer@patchew.org; Mon, 20 Nov 2017 16:24:03 -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) 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) 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-Google-Smtp-Source: AGs4zMbR2/QMF6o1XVggaKWabr1r7kD/Kz0Th5ZXl7GFvJ0YgwU90MBb/a0p+Aab0jQ97LlAxlJg1w== X-Received: by 10.25.153.65 with SMTP id b62mr3822474lfe.109.1511212915929; Mon, 20 Nov 2017 13:21:55 -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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(-) 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 =3D { }; =20 static bitmask_transtbl mmap_flags_tbl[] =3D { - { 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_ANONYMOU= S }, - { TARGET_MAP_GROWSDOWN, TARGET_MAP_GROWSDOWN, MAP_GROWSDOWN, MAP_GROWSDOW= N }, - { TARGET_MAP_DENYWRITE, TARGET_MAP_DENYWRITE, MAP_DENYWRITE, MAP_DENYWRIT= E }, - { TARGET_MAP_EXECUTABLE, TARGET_MAP_EXECUTABLE, MAP_EXECUTABLE, MAP_EXECU= TABLE }, - { 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 } }; =20 #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 mapp= ing */ #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 mapp= ing */ #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 mapp= ing */ #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 mapp= ing */ #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 mapp= ing */ #define TARGET_MAP_UNINITIALIZED 0x4000000 /* for anonymous mmap, memory c= ould be uninitialized */ #endif =20 --=20 2.14.2 From nobody Mon May 6 02:18:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511213224499173.10918339417674; Mon, 20 Nov 2017 13:27:04 -0800 (PST) Received: from localhost ([::1]:59824 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtaf-0008JG-IT for importer@patchew.org; Mon, 20 Nov 2017 16:26:53 -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) 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) 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-Google-Smtp-Source: AGs4zMZ4GWf0K0/5dprc0iX6T+Daq3/8fIwTzbIZQhFBp9DN5sF/hGLBkLrcXDo/Sv5rkTya3hlHew== X-Received: by 10.25.201.83 with SMTP id z80mr3079656lff.181.1511212917529; 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: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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: James Clarke Fixes: https://bugs.launchpad.net/qemu/+bug/1716767 Reviewed-by: Laurent Vivier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 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(-) 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) =20 /* 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) =3D=3D 1) ; } #elif defined(TARGET_MIPS) && (TARGET_ABI_BITS =3D=3D 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 pa= irs * 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 =20 #define ERRNO_TABLE_SIZE 1200 @@ -6870,7 +6884,7 @@ static inline abi_long target_truncate64(void *cpu_en= v, const char *arg1, abi_long arg3, abi_long arg4) { - if (regpairs_aligned(cpu_env)) { + if (regpairs_aligned(cpu_env, TARGET_NR_truncate64)) { arg2 =3D arg3; arg3 =3D arg4; } @@ -6884,7 +6898,7 @@ static inline abi_long target_ftruncate64(void *cpu_e= nv, abi_long arg1, abi_long arg3, abi_long arg4) { - if (regpairs_aligned(cpu_env)) { + if (regpairs_aligned(cpu_env, TARGET_NR_ftruncate64)) { arg2 =3D arg3; arg3 =3D arg4; } @@ -10508,7 +10522,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_lon= g arg1, #endif #ifdef TARGET_NR_pread64 case TARGET_NR_pread64: - if (regpairs_aligned(cpu_env)) { + if (regpairs_aligned(cpu_env, num)) { arg4 =3D arg5; arg5 =3D arg6; } @@ -10518,7 +10532,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_lon= g arg1, unlock_user(p, arg2, ret); break; case TARGET_NR_pwrite64: - if (regpairs_aligned(cpu_env)) { + if (regpairs_aligned(cpu_env, num)) { arg4 =3D arg5; arg5 =3D arg6; } @@ -11288,7 +11302,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_lon= g arg1, arg6 =3D 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 =3D arg3; arg3 =3D arg4; @@ -11307,7 +11321,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_lon= g 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 =3D arg3; arg3 =3D arg4; @@ -11420,7 +11434,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_lon= g arg1, #ifdef TARGET_NR_readahead case TARGET_NR_readahead: #if TARGET_ABI_BITS =3D=3D 32 - if (regpairs_aligned(cpu_env)) { + if (regpairs_aligned(cpu_env, num)) { arg2 =3D arg3; arg3 =3D arg4; arg4 =3D arg5; --=20 2.14.2 From nobody Mon May 6 02:18:53 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511213061473339.3079002676592; Mon, 20 Nov 2017 13:24:21 -0800 (PST) Received: from localhost ([::1]:59810 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtXx-00060c-Jt for importer@patchew.org; Mon, 20 Nov 2017 16:24:05 -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) 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) 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-Google-Smtp-Source: AGs4zMbr/YkwQIo7KIpMu8mlQevN9uC/uxVHedfqnE0T5DpsrNJ4yN82sfRKftB0i+sz6JAsdHvfPQ== X-Received: by 10.25.202.74 with SMTP id h10mr4136820lfj.63.1511212918889; Mon, 20 Nov 2017 13:21:58 -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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(-) 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); --=20 2.14.2 From nobody Mon May 6 02:18:53 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 15112135318021002.080099398461; Mon, 20 Nov 2017 13:32:11 -0800 (PST) Received: from localhost ([::1]:59848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtfJ-0004Nk-8N for importer@patchew.org; Mon, 20 Nov 2017 16:31:41 -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) 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) 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-Google-Smtp-Source: AGs4zMZCfiL3Pw9eJysOwlfagTD19pkWFIwqV/wMQR+zsLIwLNt4Rf7GPzs29gICJEfyZAHPDI6inw== X-Received: by 10.25.18.146 with SMTP id 18mr3265678lfs.160.1511212920350; 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: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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 h= ost 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(+) 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_lo= ng arg1, break; } #endif + case PR_GET_SECCOMP: + case PR_SET_SECCOMP: + /* Disable seccomp to prevent the target disabling syscalls we + * need. */ + ret =3D -TARGET_EINVAL; + break; default: /* Most prctl options have no pointer arguments */ ret =3D get_errno(prctl(arg1, arg2, arg3, arg4, arg5)); --=20 2.14.2 From nobody Mon May 6 02:18:53 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511213640226857.9138497039444; Mon, 20 Nov 2017 13:34:00 -0800 (PST) Received: from localhost ([::1]:59854 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGthD-0005kn-Fw for importer@patchew.org; Mon, 20 Nov 2017 16:33:39 -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) 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) 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-Google-Smtp-Source: AGs4zMbs4W1eSa5udKDWBjJBLrAZ1bZFHkVQNetZZKql9IIlWEc+N2TDeBFoBUh4WCZD4QvHjJzSdg== X-Received: by 10.25.40.5 with SMTP id o5mr3738564lfo.238.1511212921889; Mon, 20 Nov 2017 13:22:01 -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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 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=C3=A9 Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 */ =20 #ifdef TARGET_S390X + +/* s390x masks the fault address it reports in si_addr for SIGSEGV and SIG= BUS */ +#define S390X_FAIL_ADDR_MASK -4096LL + void cpu_loop(CPUS390XState *env) { CPUState *cs =3D CPU(s390_env_get_cpu(env)); @@ -3294,7 +3298,7 @@ void cpu_loop(CPUS390XState *env) sig =3D TARGET_SIGSEGV; /* XXX: check env->error_code */ n =3D TARGET_SEGV_MAPERR; - addr =3D env->__excp_addr; + addr =3D env->__excp_addr & S390X_FAIL_ADDR_MASK; goto do_signal; case PGM_EXECUTE: case PGM_SPECIFICATION: --=20 2.14.2 From nobody Mon May 6 02:18:53 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511213235565359.38877723183566; Mon, 20 Nov 2017 13:27:15 -0800 (PST) Received: from localhost ([::1]:59823 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtae-0008Ih-QO for importer@patchew.org; Mon, 20 Nov 2017 16:26:52 -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) 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) 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-Google-Smtp-Source: AGs4zMaUVodPvFvURQ+RL6VaolmS0GL5bAdH7ZXM5kHP5hMQoj1ROOqy+AsXj1hg7lKw8kMcsKshLw== X-Received: by 10.25.203.2 with SMTP id b2mr3190785lfg.94.1511212923281; 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: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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(-) 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 =3D TARGET_SEGV_MAPERR; break; } - info._sifields._sigfault._addr =3D env->nip; + info._sifields._sigfault._addr =3D env->spr[SPR_DAR]; queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; case POWERPC_EXCP_ISI: /* Instruction storage exception = */ --=20 2.14.2 From nobody Mon May 6 02:18:53 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 15112136423352.219376370642408; Mon, 20 Nov 2017 13:34:02 -0800 (PST) Received: from localhost ([::1]:59855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGthF-0005mY-LN for importer@patchew.org; Mon, 20 Nov 2017 16:33:41 -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) 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) 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-Google-Smtp-Source: AGs4zMaG1ov4P+NDhT8eqTy6dVw1PO4AFk7049gz8r5/D686BFk27k26ObM4B4j/GcFZaYnpl+alTg== X-Received: by 10.25.225.8 with SMTP id y8mr3767970lfg.209.1511212924689; 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: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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 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=C3=A9 Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- target/sparc/mmu_helper.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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 =3D SPARC_CPU(cs); + CPUSPARCState *env =3D &cpu->env; + if (rw & 2) { cs->exception_index =3D TT_TFAULT; } else { cs->exception_index =3D TT_DFAULT; +#ifdef TARGET_SPARC64 + env->dmmu.mmuregs[4] =3D address; +#else + env->mmuregs[4] =3D address; +#endif } return 1; } --=20 2.14.2 From nobody Mon May 6 02:18:53 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511213388654934.3938900768796; Mon, 20 Nov 2017 13:29:48 -0800 (PST) Received: from localhost ([::1]:59832 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtdE-0002WV-Oz for importer@patchew.org; Mon, 20 Nov 2017 16:29:32 -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) 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) 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-Google-Smtp-Source: AGs4zMZpSXsRHcTw6KTPDHCk1Kc0JPQGg+8BfGsBETtY0LM/zHW0MHAq5D9vXO4wNn9LkDc1cGDo8g== X-Received: by 10.25.228.155 with SMTP id x27mr173216lfi.231.1511212926472; 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: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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 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=C3=A9 Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/syscall.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) 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 =3D 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 =3D 0; =20 if (arg4 !=3D sizeof(target_sigset_t)) { ret =3D -TARGET_EINVAL; @@ -8606,18 +8614,29 @@ abi_long do_syscall(void *cpu_env, int num, abi_lon= g arg1, unlock_user_struct(rt_act, arg3, 1); } #else +#ifdef TARGET_SPARC + target_ulong restorer =3D arg4; + target_ulong sigsetsize =3D arg5; +#else + target_ulong sigsetsize =3D arg4; +#endif struct target_sigaction *act; struct target_sigaction *oact; =20 - if (arg4 !=3D sizeof(target_sigset_t)) { + if (sigsetsize !=3D sizeof(target_sigset_t)) { ret =3D -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 =3D restorer; +#endif + } else { act =3D NULL; + } if (arg3) { if (!lock_user_struct(VERIFY_WRITE, oact, arg3, 0)) { ret =3D -TARGET_EFAULT; --=20 2.14.2 From nobody Mon May 6 02:18:53 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511213393664104.99810767480233; Mon, 20 Nov 2017 13:29:53 -0800 (PST) Received: from localhost ([::1]:59831 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtdC-0002UP-7f for importer@patchew.org; Mon, 20 Nov 2017 16:29:30 -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) 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) 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-Google-Smtp-Source: AGs4zMYG6hOakAsqanR98Tqibb2bvjYOKCL2B/jXdFYLcqMLbZPzyzTlylJOmUYjUryGlQTXYKnf7w== X-Received: by 10.46.95.212 with SMTP id x81mr5296782lje.184.1511212927971; Mon, 20 Nov 2017 13:22:07 -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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(-) 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 a= rgc, int envc, #ifdef ELF_HWCAP2 size +=3D 2; #endif + info->auxv_len =3D size * n; + size +=3D envc + argc + 2; size +=3D 1; /* argc itself */ size *=3D n; @@ -1760,7 +1762,6 @@ static abi_ulong create_elf_tables(abi_ulong p, int a= rgc, int envc, put_user_ual(val, u_auxv); u_auxv +=3D n; \ } while(0) =20 - /* 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 a= rgc, 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 =20 - info->auxv_len =3D u_argv - info->saved_auxv; + /* Check that our initial calculation of the auxv length matches how m= uch + * we actually put into it. + */ + assert(info->auxv_len =3D=3D u_auxv - info->saved_auxv); =20 put_user_ual(argc, u_argc); =20 --=20 2.14.2