From nobody Sat May 4 00:18:22 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624273741534548.9606127087958; Mon, 21 Jun 2021 04:09:01 -0700 (PDT) Received: from localhost ([::1]:51006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvHnY-00035w-G2 for importer2@patchew.org; Mon, 21 Jun 2021 07:09:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHjY-0002o9-FE for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:04:53 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:53975) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHjV-0003uQ-Sc for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:04:51 -0400 Received: from quad ([82.142.1.74]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MIMOy-1m0jn82TFk-00EPFp; Mon, 21 Jun 2021 13:04:46 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 1/9] linux-user: Set CF_PARALLEL when mapping shared memory Date: Mon, 21 Jun 2021 13:04:37 +0200 Message-Id: <20210621110445.231771-2-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621110445.231771-1-laurent@vivier.eu> References: <20210621110445.231771-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:UFy6xt4K53iFDMglBPtNG7ol1kK5/42StTASrSex5sojzRu7qj8 mG4rI7zJFwLktBXqHCK54Ru/9lw1ZKB1b1WtGnezZWExFG3v4lnw1PmlJn7yVToO0bZ+9Oo wN5d7jxzu/mdKrRlIFKrMdU7yrlBaIF2rnFEzN69xmBBq0w8tFGbGn7MQCbvso8riGXeoHg yHr60vSFjctrzZWkzvgyw== X-UI-Out-Filterresults: notjunk:1;V03:K0:uREM49oludY=:Jgjm4IxxxbKlgMKN/S2go0 azoiuC/5kE0npg7Ew+5M1m9mBNwtcWNwTjrz8V6uYE2NiI2ek9S8ItEg5/5uIbaLcmUu64B8L T3tPzURYVKjmAtSk8C3I1Ufe2J8aDyF288g0hhEeRqiIjPmz7FbGdsOU+AshFaT/HbSWH+NfE Jzyus/Ggh4kHGRcYgnEJey1PA5IgdDQC0/EdEiLtKljxLRLgGyR+yqlb6BcadrSckZx04V6Yz KEL41DqSLrIE/DE55wBJrwcggemmbVN+SDBhJtQFGGFOfUlGi1XUNsq4f3cY3ds27il8wkh6A C/AkaahK+sbXiHgQWBm2fKiPbHfEaiVTbgXrXbSNhquy3y39tGIgF52YnjBvoYW2occ+wJ4le 3JnLKzh0vpTMLG5VZfvFQe7XjvZYNgs2ivG7pMSCRJxLhjzT+akRts5aXViidgRm1aRRFir5m jUX2/w2oMUJcQHGyQcbOKuxkDCdBt4YyxAlshnx5ABuKav6ZrNm/WA5U/++XZ6n0XXCJKy7LD tzT2rQrHVWYd/6WUMrMHb0= Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.126.131; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signal the translator to use host atomic instructions for guest operations, insofar as it is possible. This is the best we can do to allow the guest to interact atomically with other processes. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/121 Signed-off-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Message-Id: <20210612060828.695332-1-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/mmap.c | 14 ++++++++++++++ linux-user/syscall.c | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 7e3b2450368a..0e103859fed8 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -451,6 +451,20 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, i= nt target_prot, goto fail; } =20 + /* + * If we're mapping shared memory, ensure we generate code for parallel + * execution and flush old translations. This will work up to the lev= el + * supported by the host -- anything that requires EXCP_ATOMIC will not + * be atomic with respect to an external process. + */ + if (flags & MAP_SHARED) { + CPUState *cpu =3D thread_cpu; + if (!(cpu->tcg_cflags & CF_PARALLEL)) { + cpu->tcg_cflags |=3D CF_PARALLEL; + tb_flush(cpu); + } + } + real_start =3D start & qemu_host_page_mask; host_offset =3D offset & qemu_host_page_mask; =20 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 974dd46c9a17..54037db8d66d 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4603,6 +4603,7 @@ static inline abi_ulong target_shmlba(CPUArchState *c= pu_env) static inline abi_ulong do_shmat(CPUArchState *cpu_env, int shmid, abi_ulong shmaddr, int shmflg) { + CPUState *cpu =3D env_cpu(cpu_env); abi_long raddr; void *host_raddr; struct shmid_ds shm_info; @@ -4633,6 +4634,17 @@ static inline abi_ulong do_shmat(CPUArchState *cpu_e= nv, =20 mmap_lock(); =20 + /* + * We're mapping shared memory, so ensure we generate code for parallel + * execution and flush old translations. This will work up to the lev= el + * supported by the host -- anything that requires EXCP_ATOMIC will not + * be atomic with respect to an external process. + */ + if (!(cpu->tcg_cflags & CF_PARALLEL)) { + cpu->tcg_cflags |=3D CF_PARALLEL; + tb_flush(cpu); + } + if (shmaddr) host_raddr =3D shmat(shmid, (void *)g2h_untagged(shmaddr), shmflg); else { --=20 2.31.1 From nobody Sat May 4 00:18:22 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624273614827642.1605570369987; Mon, 21 Jun 2021 04:06:54 -0700 (PDT) Received: from localhost ([::1]:43038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvHlU-0005f4-RV for importer2@patchew.org; Mon, 21 Jun 2021 07:06:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHja-0002pl-42 for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:04:54 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:48395) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHjW-0003v1-UH for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:04:53 -0400 Received: from quad ([82.142.1.74]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MVv4X-1lnlLG1xtl-00RpVY; Mon, 21 Jun 2021 13:04:47 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 2/9] linux-user: Disable static assert involving __SIGRTMAX if it is missing Date: Mon, 21 Jun 2021 13:04:38 +0200 Message-Id: <20210621110445.231771-3-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621110445.231771-1-laurent@vivier.eu> References: <20210621110445.231771-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ppuYd3siwGHqD5LvgMYXjrTPiJtZgt4yVWY+2JGZIVRjRDk+7LB CSpG0OBeCZJc4MdldSsW2pKYKl8QSs4kknFSLvNAVi+uVIb4kYrvE52EtGSJcjLbU11ZBTz ZjPOgPs5z5Wk4BNTnMNJDbgR5/f9yiFldlqpA0n349QB3jb0phgTIk5ICn7zZr04AyRAmkT tWE5prrl1OF/SufHnaCyw== X-UI-Out-Filterresults: notjunk:1;V03:K0:hbLzzeU6BSY=:eMuOzvT0uw8CR0+jU0HiQc g6XVdm3lBx6VNj6xRlOCOC43Gib9X1awU5atsWhK67L49qQ6gBP40JAx1OZV7Bf3MZC90uWQn 9HHGCCgaiE8qrWxPt524PRrMf/BMLAARFasR2nm0+YtGGm2M4QGorzfZsYU1KbqnuifjS1G1g QlUNhKbeAc2dQgDYP385EOrL454pcK7Ydl4mqR3Z+fTfLPTxBpBHvZ8xJiEBx56LBKgDkDEfz Q7UytNHdIuolbJAzFsm22YxqvkEE4l2aH0Zb3MoPjaLHfy06Q3W76OJUOWh/ao+pt/SPe2CFm Pla2oTSqjZP3ZRdnT8aYgbrf+mUsCkj+gkLpLfS4qwUEvtF/zwYLpsLEUKXZOmikn/4wyf5cn Tz1R3bahdOrhJoGQZp8Ij15MBbenv52QwxfkBenh6FKv/2OSat9q6WnuBzN71KWqcFOqu8ePM le5V4iNm6JASTf+K1eMZ9MFH4w/bm8TB135HNDnP0npi5tQ2vCG1SDWpzGP3QpBK6yt0BXQ1L oVAxXWLYfqOjDGgfNYBRA4= Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.126.135; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Michael Forney Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Michael Forney This check is to ensure that the loop in signal_table_init() from SIGRTMIN to SIGRTMAX falls within the bounds of host_to_target_signal_table (_NSIG). However, it is not critical, since _NSIG is already defined to be the one larger than the largest signal supported by the system (as specified in the upcoming POSIX revision[0]). musl libc does not define __SIGRTMAX, so disabling this check when it is missing fixes one of the last remaining errors when building qemu. [0] https://www.austingroupbugs.net/view.php?id=3D741 Signed-off-by: Michael Forney Reviewed-by: Laurent Vivier Message-Id: <20210526190203.4255-1-mforney@mforney.org> Signed-off-by: Laurent Vivier --- linux-user/signal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux-user/signal.c b/linux-user/signal.c index 9016896dcda0..0f19c59deee9 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -38,7 +38,9 @@ static void host_signal_handler(int host_signum, siginfo_= t *info, * Signal number 0 is reserved for use as kill(pid, 0), to test whether * a process exists without sending it a signal. */ +#ifdef __SIGRTMAX QEMU_BUILD_BUG_ON(__SIGRTMAX + 1 !=3D _NSIG); +#endif static uint8_t host_to_target_signal_table[_NSIG] =3D { [SIGHUP] =3D TARGET_SIGHUP, [SIGINT] =3D TARGET_SIGINT, --=20 2.31.1 From nobody Sat May 4 00:18:22 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624273745720995.6426291740455; Mon, 21 Jun 2021 04:09:05 -0700 (PDT) Received: from localhost ([::1]:51544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvHnc-0003Sa-Nn for importer2@patchew.org; Mon, 21 Jun 2021 07:09:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHjg-0003Bf-PW for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:05:00 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:39929) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHjf-000420-1F for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:05:00 -0400 Received: from quad ([82.142.1.74]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M6DrU-1lt4oJ3zc8-006g1l; Mon, 21 Jun 2021 13:04:48 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 3/9] linux-user/trace-events: fix minor typo in format string Date: Mon, 21 Jun 2021 13:04:39 +0200 Message-Id: <20210621110445.231771-4-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621110445.231771-1-laurent@vivier.eu> References: <20210621110445.231771-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:4uUQ4qhAiTUM6regz/BsQz/5xgUPwQRDtRX38l9aJh15JYp7eNA BMCVdFFmdE6MJ/tR4sPpZMxW7jmVqwxs9TKoJxQKZUwgBD4kpGv6dc6MaVjSRlpO6W6ZgXL cnl+Agu8nb+7U3/DcXnxQxNexnY4Z/gfMwPICL0PXg1HsF8zvu0yHZscpwX8d1gnrSxyA10 D2qPpfsijv9qTnRL3tvvQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:pfjbblathOc=:KFDgspoNb/g+n7B+UCV/MZ Yoy0aE5cDSUJYYMeq0sxQfViRyqArHXldX7HrQzfqtxWnZXLg0aYI/NMhn+H/JNCURDveESLT anlyy/xduB4UrKHF06YN4MzcfQ+Wlr2vRxWwYE5qxbJuWJ8g65UGo4KZR1w19AhSGYiuLTrtk kvA+yF0uyaELmXm5goI/FWDMI0jRbaOugXLyCcDyeBTJwzd1Q5LaRhwyYTlBmfdGrTiIbx+9S hUfl6rbQ88G4SMh94nNNcV70e3Kt8VhLa5iLgRR7UXA8w7PvpdiXaC7Tm8hK90UERCurEJIhw oyVd9TdxUHrlzg6Ev70UQF4A9WOVMzvxCvd1nhnGTGYvrgh+YupeFz/JOedvfc53eILE8gpEP xnRMVFyhti5zImijxyR3/CYV45TPdsvhdv372vL1poFjYKlE5gnRlp/wtdl5YZluB5LEZlV2M 1Yua8xE5MKAD7mxTE0Gd9U/vPGwUZlmN4KR/oVugzlL7e9rtbIHBpewyHdak+pdE+MPiqoSTX Uw1bgOYXire0WYIteCIFA8= Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.126.134; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" From: Alex Benn=C3=A9e Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Laurent Vivier Message-Id: <20210614144245.17660-1-alex.bennee@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/trace-events | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/trace-events b/linux-user/trace-events index 1ec0d11ee3a9..e7d2f54e9401 100644 --- a/linux-user/trace-events +++ b/linux-user/trace-events @@ -11,7 +11,7 @@ user_do_rt_sigreturn(void *env, uint64_t frame_addr) "env= =3D%p frame_addr=3D0x%"PRIx user_do_sigreturn(void *env, uint64_t frame_addr) "env=3D%p frame_addr=3D0= x%"PRIx64 user_force_sig(void *env, int target_sig, int host_sig) "env=3D%p signal %= d (host %d)" user_handle_signal(void *env, int target_sig) "env=3D%p signal %d" -user_host_signal(void *env, int host_sig, int target_sig) "env=3D%p signal= %d (target %d(" +user_host_signal(void *env, int host_sig, int target_sig) "env=3D%p signal= %d (target %d)" user_queue_signal(void *env, int target_sig) "env=3D%p signal %d" user_s390x_restore_sigregs(void *env, uint64_t sc_psw_addr, uint64_t env_p= sw_addr) "env=3D%p frame psw.addr 0x%"PRIx64 " current psw.addr 0x%"PRIx64 =20 --=20 2.31.1 From nobody Sat May 4 00:18:22 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624273851760980.3643549326129; Mon, 21 Jun 2021 04:10:51 -0700 (PDT) Received: from localhost ([::1]:58728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvHpK-0008G9-Eu for importer2@patchew.org; Mon, 21 Jun 2021 07:10:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHjb-0002rd-0F for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:04:55 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:42093) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHjW-0003v3-Rj for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:04:54 -0400 Received: from quad ([82.142.1.74]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N6Kl7-1lBOFl1aIL-016eQu; Mon, 21 Jun 2021 13:04:48 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 4/9] linux-user: Implement pivot_root Date: Mon, 21 Jun 2021 13:04:40 +0200 Message-Id: <20210621110445.231771-5-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621110445.231771-1-laurent@vivier.eu> References: <20210621110445.231771-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:A6OmCCPgeL2iVyeCA9xuR1w4+28en8+oAcT5AMgj3Sci6Pm/911 CZE1vx7GBgfKOfrZL6DP7Tcx//qV+9bjAkaNItfBKI/zV150Y8pef773H0dD2nMOh675zB6 mZuvCNQyo5Y+tJkIbSLc4wYClKpcTPpEwcbJLTRKPwIZrG4X25VzySnMBd8fT+rj4XkQN9X yA25MjkxWjqi3EP8FHmEw== X-UI-Out-Filterresults: notjunk:1;V03:K0:k4AAAw9JQXg=:NbfgqK2VoSBXRt4Pep7SWG wRPWv7ukQNxiw2ZvNeEb/+4nxlestkfNYre13wlmJo7OqRJXT5N7uVZlqXLWAPK7LfBWKMYoB VzLJFLM016l9oM59wKrbbFZBFDXfmftahFTqcwD16TjcvAnjd/w1NZAfbsrY+8OlmbQho68NT USvAy05JU6JlwRosbXacRkEn1W5eEoI5nT9Y+39dZ3SvKjYeMHj2ppFyHa0hcBc/uKHEy+xj/ nijyERf44ro06wjq9+7dhkj2E6djLMU08aRRZLIhn3Tmqfv89MYHBKQexgvOrzje9FzeaH97m A8wnSUMTjcE9Kpi22ZDhItiss2j0lxZmh1e7ECRAVHAOLsj7H3HKlWh6/ZQJx4Z8xNzUCccTH p3XnCJ/ukR71uki1fhxCCeDDqf6ll0STIJCeBw57IQsRXtrTe6YOArqIaL0XREcYEnJkEZxPM fot+Z/RXAR1jTD5UPcG6docSR7nkvA4cBz76NAHSZm2p9k+hu9cpllrL7pGB369dzaC8bkd9I HsNMfJVHYJGjo5YwKM6vvQ= Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.126.134; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , YAMAMOTO Takashi Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: YAMAMOTO Takashi Used by runc. Signed-off-by: YAMAMOTO Takashi Reviewed-by: Laurent Vivier Message-Id: <20210531055019.10149-6-yamamoto@midokura.com> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 54037db8d66d..723cb02d2a00 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8257,6 +8257,10 @@ static int host_to_target_cpu_mask(const unsigned lo= ng *host_mask, return 0; } =20 +#if defined(TARGET_NR_pivot_root) && defined(__NR_pivot_root) +_syscall2(int, pivot_root, const char *, new_root, const char *, put_old) +#endif + /* This is an internal helper for do_syscall so that it is easier * to have a single return point, so that actions, such as logging * of syscall results, can be performed. @@ -13220,6 +13224,23 @@ static abi_long do_syscall1(void *cpu_env, int num= , abi_long arg1, return ret; #endif =20 +#if defined(TARGET_NR_pivot_root) + case TARGET_NR_pivot_root: + { + void *p2; + p =3D lock_user_string(arg1); /* new_root */ + p2 =3D lock_user_string(arg2); /* put_old */ + if (!p || !p2) { + ret =3D -TARGET_EFAULT; + } else { + ret =3D get_errno(pivot_root(p, p2)); + } + unlock_user(p2, arg2, 0); + unlock_user(p, arg1, 0); + } + return ret; +#endif + default: qemu_log_mask(LOG_UNIMP, "Unsupported syscall: %d\n", num); return -TARGET_ENOSYS; --=20 2.31.1 From nobody Sat May 4 00:18:22 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624273800163965.4565258815795; Mon, 21 Jun 2021 04:10:00 -0700 (PDT) Received: from localhost ([::1]:55904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvHoU-0006M5-Sh for importer2@patchew.org; Mon, 21 Jun 2021 07:09:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHjc-0002vF-0r for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:04:56 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:36345) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHjZ-0003y9-Tg for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:04:55 -0400 Received: from quad ([82.142.1.74]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mw9Dg-1l5f5I3MEW-00s3SL; Mon, 21 Jun 2021 13:04:48 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 5/9] linux-user: Let sigaction query SIGKILL/SIGSTOP Date: Mon, 21 Jun 2021 13:04:41 +0200 Message-Id: <20210621110445.231771-6-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621110445.231771-1-laurent@vivier.eu> References: <20210621110445.231771-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:a/qRH9VHOLe+DUys414DsBiHRDBzjFxCFYoDg9LK6bo9+4I6XI7 fUNdk988LaN2eMJnL5/xvCCAfNT2oLz3Dt4oIi5WxVzzpBk7kSpqCfbRacxuUzjXOrcuJ/m QZwB+GIy2VUp5dR5YxRIRpxVKDiN0srD4mawh6uYjja/4R30iss6jGX+eyFcbcfDYsbVclY Ua7OdNLUKwNL04WfkIcPQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:gZ+0T8e5t7g=:7pWRNYVLzLblI/DJcv81qs obCW6hv/i7VZpZTm4sHyAzgcqcLmsjhbzrwSGB5tXeWmKtaRXqIEawFuCHZWm5Ug5AjMPphmp 2r9oVzx2pUgNVosPpsAVT4AzOPWuWqzz+cJs02QZv16tTJt4Qtj/TO5BF0BnZD70uKpvH2KZP mHjuzILLdCB82Twl9NFoou2yR+gWGg7ULtl3mgs/QnmKmWU3AN890wKUTSGv641k/6+ta6ZNt v+2+cFSGLw23yl3y4ghOJOuB374BDXp0ihbITsLoYdjVaR11pr09D/z4BBSMS3pZ4nqThIqXk w2t2SfK5VzB9dmntJL0nFPGKuMtHdFCcROWjTp8DFdTfPY8RprrmC6jtmY5htiZqtqyxFcD0H 9uvEKVSoRySh1KCL+BM9QjZpp7Fz9MVER582/lmeoydA8z2AECKbx1i2C6pTdop8UI75K5zjJ Pu8HrRo2eMnlwJuA+ROTDMQ5giUpxMYYV+YUu2ggO9TJQ0T5JwchwcpnakS9ZvAokExFkji6j vEg5YDfqMCxcixhXigx+jQ= Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.126.187; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Ilya Leoshkevich Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich The kernel allows doing this, so let's allow this in qemu as well. Valgrind relies on this. Signed-off-by: Ilya Leoshkevich Reviewed-by: Laurent Vivier Message-Id: <20210601145600.3131040-2-iii@linux.ibm.com> Signed-off-by: Laurent Vivier --- linux-user/signal.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index 0f19c59deee9..a8faea6f0909 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -853,7 +853,11 @@ int do_sigaction(int sig, const struct target_sigactio= n *act, =20 trace_signal_do_sigaction_guest(sig, TARGET_NSIG); =20 - if (sig < 1 || sig > TARGET_NSIG || sig =3D=3D TARGET_SIGKILL || sig = =3D=3D TARGET_SIGSTOP) { + if (sig < 1 || sig > TARGET_NSIG) { + return -TARGET_EINVAL; + } + + if (act && (sig =3D=3D TARGET_SIGKILL || sig =3D=3D TARGET_SIGSTOP)) { return -TARGET_EINVAL; } =20 --=20 2.31.1 From nobody Sat May 4 00:18:22 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624274050468461.61467813240415; Mon, 21 Jun 2021 04:14:10 -0700 (PDT) Received: from localhost ([::1]:38560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvHsX-0005To-Fr for importer2@patchew.org; Mon, 21 Jun 2021 07:14:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHoR-0007fg-EC for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:09:55 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:47379) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHoP-000744-ER for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:09:55 -0400 Received: from quad ([82.142.1.74]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M9nhF-1lsFSW1Bav-005qgK; Mon, 21 Jun 2021 13:04:49 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 6/9] tests/tcg/linux-test: Check that sigaction can query SIGKILL/SIGSTOP Date: Mon, 21 Jun 2021 13:04:42 +0200 Message-Id: <20210621110445.231771-7-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621110445.231771-1-laurent@vivier.eu> References: <20210621110445.231771-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:5lI0GCLZ5dVEZwktP+sjPrNyWICp6tdXiK5ty/e2h7SG887t0zX J8IEnLZHDkI4QBvomXLRlnclVcF3WXOmeKsh21xnaSMzBoQViWkUxgSDPIREv+WG7oyIOYh gBqCeybSBwKaKuzNz9NrtptJKd7nkjFcLkgmn0bePFCto2xiW0RP225bjFjShnooZoaMxo6 NokRhQFS+5+sJI0UpyvdQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:+rln/cO3u+0=:T4fuVEp74cGWKIOKvpptYQ H5PPw0phea2oXBvVIBY5FCIww6xNyjs0rVWjYY4cfsMhOqziuAmrifvOXnGMpv8unBVZu+1uE elH41qAI3MKMoqakM8nDDKUfNezKXrzYjgNheHxquxcUBqf4mEvNeJ7sWwoZfYIfizR6FBolO g+R2yo28OZNeXw4JN/GFFch7SP3dL5g+j9I3jKaAb+MICc2GS+B8ngUXbJwiCQN4Z7LPP0u0/ hybpetPjhrqEMbSmHeWwHBBVWEhl0R7TxhrSJpuuCG4Ig2wdfdd8t1ViG4z4PjeYquF3IHDQh B5g2bp3H8eOw5oNwWQOCXTPKDMTB0omVlSyopJra5UF3NNK3hIFgiFHO3uLkeED0xkcgA4nkG kmvFhPoWLLW9KVPkRl9wGF5OBzvxLCMt/4t5ZahxDdPi4vbQgIrfPT4lKLINKfy8MZ/tFc62T jCDCtjoSi7ud47Q3vwDau2KltR8mdO6xlGuVR0De89zyez/Q87HciFP53zrQLbDT4z42uAq+F Ufi2rvJ1sMHPpBuM/o4Phg= Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.126.135; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Ilya Leoshkevich Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Verify that querying is allowed, but making changes isn't. Signed-off-by: Ilya Leoshkevich Reviewed-by: Laurent Vivier Message-Id: <20210601145600.3131040-3-iii@linux.ibm.com> Signed-off-by: Laurent Vivier --- tests/tcg/multiarch/linux-test.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-t= est.c index 96bbad582318..c8c6aeddeb36 100644 --- a/tests/tcg/multiarch/linux-test.c +++ b/tests/tcg/multiarch/linux-test.c @@ -496,6 +496,15 @@ static void test_signal(void) sigemptyset(&act.sa_mask); act.sa_flags =3D 0; chk_error(sigaction(SIGSEGV, &act, NULL)); + + if (sigaction(SIGKILL, &act, NULL) =3D=3D 0) { + error("sigaction(SIGKILL, &act, NULL) must not succeed"); + } + if (sigaction(SIGSTOP, &act, NULL) =3D=3D 0) { + error("sigaction(SIGSTOP, &act, NULL) must not succeed"); + } + chk_error(sigaction(SIGKILL, NULL, &act)); + chk_error(sigaction(SIGSTOP, NULL, &act)); } =20 #define SHM_SIZE 32768 --=20 2.31.1 From nobody Sat May 4 00:18:22 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162427370550876.18375378737039; Mon, 21 Jun 2021 04:08:25 -0700 (PDT) Received: from localhost ([::1]:47368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvHmy-0000IZ-Ea for importer2@patchew.org; Mon, 21 Jun 2021 07:08:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHjb-0002tp-Ko for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:04:55 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:47679) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHjZ-0003xf-Ir for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:04:55 -0400 Received: from quad ([82.142.1.74]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MsqMq-1l6lY13DNQ-00t9uv; Mon, 21 Jun 2021 13:04:49 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 7/9] linux-user: Check for ieee128 fpbits in PPC64 HWCAP2 feature list Date: Mon, 21 Jun 2021 13:04:43 +0200 Message-Id: <20210621110445.231771-8-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621110445.231771-1-laurent@vivier.eu> References: <20210621110445.231771-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:PIwb6DNOfopOaQrbAnvm93XkwkVVkcGckwDMH0vcWJdJkm2Tnbq KuGwqD/CrQR8TYyxcFdKdWxlRgqvdTPR3B3MgDlKF4sWUPAxfQKKzyzkedaHjz2N3kQauKk 07m52XWAP/XJSJUbdsMvtiWJsektEQGSjYknq21iuST+uGokHgJGIYTs9Cg50QbWjyQImGw fk4xu5HyKuL8/Q+14P9nQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:38uxI1WHtSw=:dXl0vNMatlCPs/7fs4v/jk oeYWYqzHcn//08K1NtAvLbpUFxCKilkUXjNaN6TDbdapjzMkX/OGPPcQA8c/y5+YRNtgBCBki euDmED4ucBVCUOXRKK73LOI6hN2lkW5MhOGX7WbletrfjHkBPe2s1xYuXnnTlQRW2OWOui7Qb BEZEInYG3HdEN5zRGf7JhBC1dMEpll7C5gozsZRxfBHjI+tteJpJEbtzLa34/rcQfH4p7VwzM +zPBiGYEuBGVqsFNFTMTxrfhm2dJ9XRkCOuEUPD9TtJjcfnJrj3gTnaMmqZ/YV1JqYu8xLYGy bgp6+dNSExw7mb/vqIQNL1kdtUu/QHqqzjnrChQ1kSBragScyhXNjY5L0FNoKnwZH0K8l2DIG I2dJsSJARvu7IF/zc5LxKRRAnMFZ5t1ifPSg4VZwqXaa1a+tsyK3KL/KBbrtJhAUr9qLxrXrj LQAjYMR9n92dWVLdpEooBPrGF+ac/kEp4psYEssm4E3r8UkZ7fOIA3CxpLveWDl3M0FoTIl4K xVIX26fzX3D07oEnpVofvc= Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.126.131; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Weimer , Laurent Vivier , Khem Raj Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Khem Raj glibc 2.34 is now checking for this in hwcaps at runtime [1] and failing to run the binary if machine does not support 128bit IEEE fp Fixes Fatal glibc error: CPU lacks float128 support (POWER 9 or later required) [1] https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommitdiff;h=3Dd337345ce1= 45e23c5f3a956f349d924fdf54ce2d;hp=3Deb24865637a271ab7dad13190330105eab0d478d Signed-off-by: Khem Raj Cc: Florian Weimer Reviewed-by: Laurent Vivier Message-Id: <20210614191729.2981488-1-raj.khem@gmail.com> Signed-off-by: Laurent Vivier --- linux-user/elfload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 17ab06f612dd..e7dd18fd40bf 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -830,7 +830,7 @@ static uint32_t get_elf_hwcap2(void) PPC2_ISA207S), QEMU_PPC_FEATURE2_ARCH_2_07 | QEMU_PPC_FEATURE2_VEC_CRYPTO); GET_FEATURE2(PPC2_ISA300, QEMU_PPC_FEATURE2_ARCH_3_00 | - QEMU_PPC_FEATURE2_DARN); + QEMU_PPC_FEATURE2_DARN | QEMU_PPC_FEATURE2_HAS_IEEE128); =20 #undef GET_FEATURE #undef GET_FEATURE2 --=20 2.31.1 From nobody Sat May 4 00:18:22 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624273746157203.33518728048944; Mon, 21 Jun 2021 04:09:06 -0700 (PDT) Received: from localhost ([::1]:51606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvHnd-0003VW-3P for importer2@patchew.org; Mon, 21 Jun 2021 07:09:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHjb-0002t3-E2 for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:04:55 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:44539) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHjY-0003wv-Qo for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:04:55 -0400 Received: from quad ([82.142.1.74]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MYvse-1lhxuk0puK-00Upe1; Mon, 21 Jun 2021 13:04:50 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 8/9] linux-user: Fix incorrect use of feature-test-macros Date: Mon, 21 Jun 2021 13:04:44 +0200 Message-Id: <20210621110445.231771-9-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621110445.231771-1-laurent@vivier.eu> References: <20210621110445.231771-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:iJOuoai8zlHM3G2C8arjc8DtVhc4Sgk6kf0zndvkIcBDWZpUeqy q+fzE68UTJ/8ugXje9Gzif+AVqj2MSNA/jcZaD6+Ui2F7P8Pvdr31qbvfXWe+6ozfVgPYHp 9Lm7za9gRcf3M2/Bkm+hRk8tlUVdnujT4HZ8Es2RX/PgUGJ2QdaSIdFkHvoMBOIJGHk4UXQ /LXEa9m/sVvChdqJfieWA== X-UI-Out-Filterresults: notjunk:1;V03:K0:fGBeoc+FZeY=:1pCgfkimJ4wlL0jIRxhLAz a2+13758T63+cPqz2i9GIb1W+VHJcmcujSn4tKy5EhSXny0di107qdA89Sc/vj18Px5msZqFn rQQ7Sfv1qjPtNYSh1RQlmW5td4d3ZaknYERHRxMnbyAHNrfKyordG0fQsN9ruzxnRBmDOuCVq Ueff1TkOp9n+R7VjfeASJ4WQJjv6KxCqLyMrBZUcuo0o2E47+MbqXhuWwEFqu7ge+wn2FGZ47 GChvEM6kVqeIAi4GYi2qoAqPXs9MLQZDQbO/UzZAQY5qOPT7ZB4QLGBYKVH/9s8vP+1J2hEyF 4RDAPYq989MNgpkGOCSwSI1lopCCUj/lxjJ3SMSFzhTBAIF73qFh3KoPh5OK6cjpfG8g74iBe qrLurKa1CjplmbhdVJ7Fo2wy9zUBtJITFt0o/goQJPF88R2tmwKLWtU1xhf+lkrqQ3cObMT52 Sp8D7z/i6lfPeKYP8fW82KZprFOg1jQq79H+k/5WNG0krfwexatD7wZcUmQOBR7FxekQtOcQt BNbHtBwBIPGN2sxefr5SIA= Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.126.187; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Michael Forney Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Michael Forney The _POSIX_C_SOURCE and _XOPEN_SOURCE macros are used by the application to indicate to libc which declarations it should expose. Since qemu does not define them anywhere, it does not make sense to check their value. Instead, since the intent is to determine whether the host struct stat supports the st_*tim fields, use the configure test result which does exactly that. Signed-off-by: Michael Forney Reviewed-by: Laurent Vivier Message-Id: <20210526035531.7871-1-mforney@mforney.org> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 723cb02d2a00..70ae8884ee54 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7482,7 +7482,7 @@ static inline abi_long host_to_target_stat64(void *cp= u_env, __put_user(host_st->st_atime, &target_st->target_st_atime); __put_user(host_st->st_mtime, &target_st->target_st_mtime); __put_user(host_st->st_ctime, &target_st->target_st_ctime); -#if _POSIX_C_SOURCE >=3D 200809L || _XOPEN_SOURCE >=3D 700 +#ifdef HAVE_STRUCT_STAT_ST_ATIM __put_user(host_st->st_atim.tv_nsec, &target_st->target_st_atime_n= sec); __put_user(host_st->st_mtim.tv_nsec, &target_st->target_st_mtime_n= sec); __put_user(host_st->st_ctim.tv_nsec, &target_st->target_st_ctime_n= sec); @@ -7517,7 +7517,7 @@ static inline abi_long host_to_target_stat64(void *cp= u_env, __put_user(host_st->st_atime, &target_st->target_st_atime); __put_user(host_st->st_mtime, &target_st->target_st_mtime); __put_user(host_st->st_ctime, &target_st->target_st_ctime); -#if _POSIX_C_SOURCE >=3D 200809L || _XOPEN_SOURCE >=3D 700 +#ifdef HAVE_STRUCT_STAT_ST_ATIM __put_user(host_st->st_atim.tv_nsec, &target_st->target_st_atime_n= sec); __put_user(host_st->st_mtim.tv_nsec, &target_st->target_st_mtime_n= sec); __put_user(host_st->st_ctim.tv_nsec, &target_st->target_st_ctime_n= sec); @@ -10072,8 +10072,7 @@ static abi_long do_syscall1(void *cpu_env, int num,= abi_long arg1, __put_user(st.st_atime, &target_st->target_st_atime); __put_user(st.st_mtime, &target_st->target_st_mtime); __put_user(st.st_ctime, &target_st->target_st_ctime); -#if (_POSIX_C_SOURCE >=3D 200809L || _XOPEN_SOURCE >=3D 700) && \ - defined(TARGET_STAT_HAVE_NSEC) +#if defined(HAVE_STRUCT_STAT_ST_ATIM) && defined(TARGET_STAT_HAVE_NSEC) __put_user(st.st_atim.tv_nsec, &target_st->target_st_atime_nsec); __put_user(st.st_mtim.tv_nsec, --=20 2.31.1 From nobody Sat May 4 00:18:22 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162427386861511.375870797829407; Mon, 21 Jun 2021 04:11:08 -0700 (PDT) Received: from localhost ([::1]:59182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvHpb-000076-KO for importer2@patchew.org; Mon, 21 Jun 2021 07:11:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHjc-0002xy-Oo for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:04:56 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:42353) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvHjZ-0003xk-J2 for qemu-devel@nongnu.org; Mon, 21 Jun 2021 07:04:56 -0400 Received: from quad ([82.142.1.74]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MnaTt-1lWN3H2ULd-00jdPM; Mon, 21 Jun 2021 13:04:50 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 9/9] linux-user: Use public sigev_notify_thread_id member if available Date: Mon, 21 Jun 2021 13:04:45 +0200 Message-Id: <20210621110445.231771-10-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621110445.231771-1-laurent@vivier.eu> References: <20210621110445.231771-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:OSHs+dmDvEn0uZhXqdH2sKalijNwm9KPwS72P9Dh0esovpuDgP+ +2E55s5DBda97yjDRSuffBKaZh1A2ZBxCtYBFGwK85sVGndJN9hblTwIrNFuVOcefTXrmMc CGEyzdaVVo9R0o/vv9wWQU0mL5yEu/RJhtUDVJ+OkXMUy6EP6t5q0jQ4MZFs2fFvZSZx0uh df7JTDC5Ne5XsoI1UGdUw== X-UI-Out-Filterresults: notjunk:1;V03:K0:rmNylIgJ/1E=:GDCgYbkT7iUMcpRivFHIEO xAdVPqrPmvr3wG6/Xv8eQu5OJPVteYF4B47jIRJp1oYXx8ntT7T73Fle5mGbtgQADj25VCDFO L0InN4WIA3lStPz8KylsT4ndF72K29DZEIIS/FcCPMN6sIqT1Pczz0dZIDLOsH9HkIp7r6zE+ QgG0yRyTFwpvS/R96N1H8bqka9IpvHu9bcQjYhxugSAQqzQ7fnDu7oKR0Zn0P0ClA6OZ0F1Yu rgBLADPteS+QFZFpOQqnGomDeKV7RWVd7iOpo3apGjcK9DVlAm91HfbiDUAi8rB+Wa5Nw0JXv GlwzfEg6/HZi8zKn81KJlI2YpdGev+tMeH58ejI+15IRcwwXlRkbXR+92B1XN6RaWfhA+XV6X Tg2Vu3e9ncXtfaeiQaZmi9IxVaPrxgB21jhf/gtgjpISWhCgjbtFnPZs21WdC9/imuHJK6RYd 6Uf2UYwrD2h6aRD5V4eTkSAWclYl1cADzqU3xReRZCN9Klhygm5015jHxyCVeMkzPPDycYlql Z1sce5rD6WlLFJHl30akq0= Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.126.131; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Michael Forney Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Michael Forney _sigev_un._tid is an internal glibc field and is not available on musl libc. The sigevent(7) man page and Linux UAPI headers both use sigev_notify_thread_id as a public way to access this field. musl libc supports this field since 1.2.2[0], and glibc plans to add support as well[1][2]. If sigev_notify_thread_id is not available, fall back to _sigev_un._tid as before. [0] http://git.musl-libc.org/cgit/musl/commit/?id=3D7c71792e87691451f2a6b76= 348e83ad1889f1dcb [1] https://www.openwall.com/lists/musl/2019/08/01/5 [2] https://sourceware.org/bugzilla/show_bug.cgi?id=3D27417 Signed-off-by: Michael Forney Reviewed-by: Laurent Vivier Message-Id: <20210526035556.7931-1-mforney@mforney.org> Signed-off-by: Laurent Vivier --- configure | 16 ++++++++++++++++ linux-user/syscall.c | 6 +++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 8dcb9965b24e..942c531cce63 100755 --- a/configure +++ b/configure @@ -4440,6 +4440,19 @@ if compile_prog "" "" ; then st_atim=3Dyes fi =20 +########################################## +# check if we have sigev_notify_thread_id + +sigev_notify_thread_id=3Dno +cat > $TMPC << EOF +#include +#include +int main(void) { return offsetof(struct sigevent, sigev_notify_thread_id);= } +EOF +if compile_prog "" "" ; then + sigev_notify_thread_id=3Dyes +fi + ########################################## # check if trace backend exists =20 @@ -5692,6 +5705,9 @@ fi if test "$st_atim" =3D "yes" ; then echo "HAVE_STRUCT_STAT_ST_ATIM=3Dy" >> $config_host_mak fi +if test "$sigev_notify_thread_id" =3D "yes" ; then + echo "HAVE_SIGEV_NOTIFY_THREAD_ID=3Dy" >> $config_host_mak +fi if test "$byteswap_h" =3D "yes" ; then echo "CONFIG_BYTESWAP_H=3Dy" >> $config_host_mak fi diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 70ae8884ee54..64bbf331b282 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7405,6 +7405,10 @@ static inline abi_long host_to_target_timex64(abi_lo= ng target_addr, } #endif =20 +#ifndef HAVE_SIGEV_NOTIFY_THREAD_ID +#define sigev_notify_thread_id _sigev_un._tid +#endif + static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp, abi_ulong target_addr) { @@ -7425,7 +7429,7 @@ static inline abi_long target_to_host_sigevent(struct= sigevent *host_sevp, host_sevp->sigev_signo =3D target_to_host_signal(tswap32(target_sevp->sigev_signo)); host_sevp->sigev_notify =3D tswap32(target_sevp->sigev_notify); - host_sevp->_sigev_un._tid =3D tswap32(target_sevp->_sigev_un._tid); + host_sevp->sigev_notify_thread_id =3D tswap32(target_sevp->_sigev_un._= tid); =20 unlock_user_struct(target_sevp, target_addr, 1); return 0; --=20 2.31.1