From nobody Mon Apr 29 15:55:34 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; 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500395460157726.0594951702922; Tue, 18 Jul 2017 09:31:00 -0700 (PDT) Received: from localhost ([::1]:57739 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXVOi-0003vP-7Y for importer@patchew.org; Tue, 18 Jul 2017 12:30:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXVKi-0000ZW-Cz for qemu-devel@nongnu.org; Tue, 18 Jul 2017 12:26:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXVKh-00013I-4T for qemu-devel@nongnu.org; Tue, 18 Jul 2017 12:26:48 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:37654) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dXVKg-0000zb-UE; Tue, 18 Jul 2017 12:26:47 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1dXVKW-000549-0Y; Tue, 18 Jul 2017 17:26:36 +0100 From: Peter Maydell To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Date: Tue, 18 Jul 2017 17:26:31 +0100 Message-Id: <1500395194-21455-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500395194-21455-1-git-send-email-peter.maydell@linaro.org> References: <1500395194-21455-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH for-2.10 1/4] bsd-user/mmap.c: Move __thread attribute to right place 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: patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Avoid a compiler warning on OpenBSD: bsd-user/mmap.c:28:1: warning: '__thread' is not at beginning of declaratio= n [-Wold-style-declaration] by moving the __thread attribute to its proper place. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- bsd-user/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c index 7f2018e..20cd29d 100644 --- a/bsd-user/mmap.c +++ b/bsd-user/mmap.c @@ -25,7 +25,7 @@ //#define DEBUG_MMAP =20 static pthread_mutex_t mmap_mutex =3D PTHREAD_MUTEX_INITIALIZER; -static int __thread mmap_lock_count; +static __thread int mmap_lock_count; =20 void mmap_lock(void) { --=20 2.7.4 From nobody Mon Apr 29 15:55:34 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; 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500395778880566.9232744986969; Tue, 18 Jul 2017 09:36:18 -0700 (PDT) Received: from localhost ([::1]:57765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXVTp-0007rT-Lk for importer@patchew.org; Tue, 18 Jul 2017 12:36:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXVKh-0000YI-Bk for qemu-devel@nongnu.org; Tue, 18 Jul 2017 12:26:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXVKg-00012f-Ay for qemu-devel@nongnu.org; Tue, 18 Jul 2017 12:26:47 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:37654) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dXVKg-0000zb-4f; Tue, 18 Jul 2017 12:26:46 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1dXVKW-00054O-FU; Tue, 18 Jul 2017 17:26:36 +0100 From: Peter Maydell To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Date: Tue, 18 Jul 2017 17:26:32 +0100 Message-Id: <1500395194-21455-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500395194-21455-1-git-send-email-peter.maydell@linaro.org> References: <1500395194-21455-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH for-2.10 2/4] bsd-user/elfload.c: Fix set-but-not-used warnings 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: patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Fix various warnings about set-but-not-used variables on OpenBSD: bsd-user/elfload.c:1158:15: warning: variable 'mapped_addr' set but not use= d [-Wunused-but-set-variable] bsd-user/elfload.c:1165:9: warning: variable 'status' set but not used [-Wu= nused-but-set-variable] bsd-user/elfload.c:1168:15: warning: variable 'elf_stack' set but not used = [-Wunused-but-set-variable] Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- bsd-user/elfload.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index 41a1309..7cccf3e 100644 --- a/bsd-user/elfload.c +++ b/bsd-user/elfload.c @@ -1155,21 +1155,20 @@ int load_elf_binary(struct linux_binprm * bprm, str= uct target_pt_regs * regs, unsigned int interpreter_type =3D INTERPRETER_NONE; unsigned char ibcs2_interpreter; int i; - abi_ulong mapped_addr; struct elf_phdr * elf_ppnt; struct elf_phdr *elf_phdata; abi_ulong elf_bss, k, elf_brk; int retval; char * elf_interpreter; abi_ulong elf_entry, interp_load_addr =3D 0; - int status; abi_ulong start_code, end_code, start_data, end_data; abi_ulong reloc_func_desc =3D 0; - abi_ulong elf_stack; +#ifdef LOW_ELF_STACK + abi_ulong elf_stack =3D ~((abi_ulong)0UL); +#endif char passed_fileno[6]; =20 ibcs2_interpreter =3D 0; - status =3D 0; load_addr =3D 0; load_bias =3D 0; elf_ex =3D *((struct elfhdr *) bprm->buf); /* exec-header */ @@ -1221,7 +1220,6 @@ int load_elf_binary(struct linux_binprm * bprm, struc= t target_pt_regs * regs, elf_brk =3D 0; =20 =20 - elf_stack =3D ~((abi_ulong)0UL); elf_interpreter =3D NULL; start_code =3D ~((abi_ulong)0UL); end_code =3D 0; @@ -1546,7 +1544,7 @@ int load_elf_binary(struct linux_binprm * bprm, struc= t target_pt_regs * regs, and some applications "depend" upon this behavior. Since we do not have the power to recompile these, we emulate the SVr4 behavior. Sigh. */ - mapped_addr =3D target_mmap(0, qemu_host_page_size, PROT_READ = | PROT_EXEC, + target_mmap(0, qemu_host_page_size, PROT_READ | PROT_EXEC, MAP_FIXED | MAP_PRIVATE, -1, 0); } =20 --=20 2.7.4 From nobody Mon Apr 29 15:55:34 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; 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500395334056345.8251038508837; Tue, 18 Jul 2017 09:28:54 -0700 (PDT) Received: from localhost ([::1]:57723 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXVMg-00022u-3O for importer@patchew.org; Tue, 18 Jul 2017 12:28:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXVKg-0000Xb-Gr for qemu-devel@nongnu.org; Tue, 18 Jul 2017 12:26:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXVKf-00012H-Gk for qemu-devel@nongnu.org; Tue, 18 Jul 2017 12:26:46 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:37654) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dXVKf-0000zb-Ap; Tue, 18 Jul 2017 12:26:45 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1dXVKW-00054b-Ts; Tue, 18 Jul 2017 17:26:36 +0100 From: Peter Maydell To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Date: Tue, 18 Jul 2017 17:26:33 +0100 Message-Id: <1500395194-21455-4-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500395194-21455-1-git-send-email-peter.maydell@linaro.org> References: <1500395194-21455-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH for-2.10 3/4] bsd-user/bsdload.c: Remove write-only id_change variable 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: patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" On OpenBSD the compiler complains: bsd-user/bsdload.c:54:17: warning: variable 'id_change' set but not used [-= Wunused-but-set-variable] This is dead code that was originally copied from linux-user. We fixed this in linux-user in commit 331c23b5ca44293d1 in 2011; delete the useless code from bsd-user too. Signed-off-by: Peter Maydell Reviewed-by: Thomas Huth --- bsd-user/bsdload.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c index 94eec36..f38c4fa 100644 --- a/bsd-user/bsdload.c +++ b/bsd-user/bsdload.c @@ -20,22 +20,6 @@ abi_long memcpy_to_target(abi_ulong dest, const void *sr= c, return 0; } =20 -static int in_group_p(gid_t g) -{ - /* return TRUE if we're in the specified group, FALSE otherwise */ - int ngroup; - int i; - gid_t grouplist[TARGET_NGROUPS]; - - ngroup =3D getgroups(TARGET_NGROUPS, grouplist); - for(i =3D 0; i < ngroup; i++) { - if(grouplist[i] =3D=3D g) { - return 1; - } - } - return 0; -} - static int count(char ** vec) { int i; @@ -51,7 +35,7 @@ static int prepare_binprm(struct linux_binprm *bprm) { struct stat st; int mode; - int retval, id_change; + int retval; =20 if(fstat(bprm->fd, &st) < 0) { return(-errno); @@ -67,14 +51,10 @@ static int prepare_binprm(struct linux_binprm *bprm) =20 bprm->e_uid =3D geteuid(); bprm->e_gid =3D getegid(); - id_change =3D 0; =20 /* Set-uid? */ if(mode & S_ISUID) { bprm->e_uid =3D st.st_uid; - if(bprm->e_uid !=3D geteuid()) { - id_change =3D 1; - } } =20 /* Set-gid? */ @@ -85,9 +65,6 @@ static int prepare_binprm(struct linux_binprm *bprm) */ if ((mode & (S_ISGID | S_IXGRP)) =3D=3D (S_ISGID | S_IXGRP)) { bprm->e_gid =3D st.st_gid; - if (!in_group_p(bprm->e_gid)) { - id_change =3D 1; - } } =20 memset(bprm->buf, 0, sizeof(bprm->buf)); --=20 2.7.4 From nobody Mon Apr 29 15:55:34 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; 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15003953170420.12562707813253837; Tue, 18 Jul 2017 09:28:37 -0700 (PDT) Received: from localhost ([::1]:57721 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXVMN-0001nC-3X for importer@patchew.org; Tue, 18 Jul 2017 12:28:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXVKf-0000Wc-Dt for qemu-devel@nongnu.org; Tue, 18 Jul 2017 12:26:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXVKe-00011c-NP for qemu-devel@nongnu.org; Tue, 18 Jul 2017 12:26:45 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:37654) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dXVKe-0000zb-Hq; Tue, 18 Jul 2017 12:26:44 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1dXVKX-00055B-Gy; Tue, 18 Jul 2017 17:26:37 +0100 From: Peter Maydell To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Date: Tue, 18 Jul 2017 17:26:34 +0100 Message-Id: <1500395194-21455-5-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500395194-21455-1-git-send-email-peter.maydell@linaro.org> References: <1500395194-21455-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH for-2.10 4/4] bsd-user/main.c: Fix unused variable warning 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: patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" On OpenBSD the compiler warns: bsd-user/main.c:622:21: warning: variable 'sig' set but not used [-Wunused-= but-set-variable] This is because a lot of the signal delivery code is #if-0'd out as unused. Reshuffle #ifdefs a bit to silence the warning. Signed-off-by: Peter Maydell Reviewed-by: Eric Blake Reviewed-by: Thomas Huth --- bsd-user/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index fa9c012..501e16f 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -619,9 +619,10 @@ void cpu_loop(CPUSPARCState *env) break; case EXCP_DEBUG: { - int sig; - - sig =3D gdb_handlesig(cs, TARGET_SIGTRAP); +#if 0 + int sig =3D +#endif + gdb_handlesig(cs, TARGET_SIGTRAP); #if 0 if (sig) { --=20 2.7.4