From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwCRU-00041C-R1 for qemu-devel@nongnu.org; Sun, 15 Jun 2014 11:34:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwCRO-0000yp-TJ for qemu-devel@nongnu.org; Sun, 15 Jun 2014 11:34:00 -0400 Received: from ignoranthack.me ([199.102.79.106]:53970 helo=mail.ignoranthack.me) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwCRO-0000yg-MG for qemu-devel@nongnu.org; Sun, 15 Jun 2014 11:33:54 -0400 From: Sean Bruno In-Reply-To: References: <1402246651-71099-1-git-send-email-sbruno@freebsd.org> <1402246651-71099-6-git-send-email-sbruno@freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sun, 15 Jun 2014 08:33:50 -0700 Message-ID: <1402846430.2347.4.camel@bruno> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 05/10 v4] bsd-user: Implement new syscall print_sysarch and add strace support Reply-To: sbruno@freebsd.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers On Tue, 2014-06-10 at 23:53 +0100, Peter Maydell wrote: > On 8 June 2014 17:57, Sean Bruno wrote: > > Signed-off-by: Sean Bruno > > --- > > bsd-user/freebsd/os-strace.h | 29 +++++++++++++ > > bsd-user/freebsd/strace.list | 2 +- > > bsd-user/i386/syscall.h | 21 +++++++++ > > bsd-user/i386/target_arch_sysarch.h | 78 ++++++++++++++++++++++++++++++++++ > > bsd-user/netbsd/os-strace.h | 1 + > > bsd-user/openbsd/os-strace.h | 1 + > > bsd-user/sparc/syscall.h | 27 +++++++++++- > > bsd-user/sparc/target_arch_sysarch.h | 52 +++++++++++++++++++++++ > > bsd-user/sparc64/syscall.h | 26 +++++++++++- > > bsd-user/sparc64/target_arch_sysarch.h | 52 +++++++++++++++++++++++ > > bsd-user/strace.c | 10 +++++ > > bsd-user/x86_64/syscall.h | 24 ++++++++++- > > bsd-user/x86_64/target_arch_sysarch.h | 76 +++++++++++++++++++++++++++++++++ > > 13 files changed, 395 insertions(+), 4 deletions(-) > > create mode 100644 bsd-user/freebsd/os-strace.h > > create mode 100644 bsd-user/i386/target_arch_sysarch.h > > create mode 100644 bsd-user/netbsd/os-strace.h > > create mode 100644 bsd-user/openbsd/os-strace.h > > create mode 100644 bsd-user/sparc/target_arch_sysarch.h > > create mode 100644 bsd-user/sparc64/target_arch_sysarch.h > > create mode 100644 bsd-user/x86_64/target_arch_sysarch.h > > Unfortunately this breaks build of bsd-user on OpenBSD > and NetBSD, because they don't provide a do_os_print_sysarch(). > Right, I've stubbed out a no-op function and tested on open/netbsd. I'll send an update today. > > --- /dev/null > > +++ b/bsd-user/i386/target_arch_sysarch.h > > @@ -0,0 +1,78 @@ > > +/* > > + * i386 sysarch system call emulation > > + * > > + * Copyright (c) 2013 Stacey D. Son > > + * > > + * This program is free software; you can redistribute it and/or modify > > + * it under the terms of the GNU General Public License as published by > > + * the Free Software Foundation; either version 2 of the License, or > > + * (at your option) any later version. > > + * > > + * This program is distributed in the hope that it will be useful, > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > + * GNU General Public License for more details. > > + * > > + * You should have received a copy of the GNU General Public License > > + * along with this program; if not, see . > > + */ > > + > > +#ifndef __ARCH_SYSARCH_H_ > > +#define __ARCH_SYSARCH_H_ > > + > > +#include "syscall.h" > > + > > +static inline abi_long do_freebsd_arch_sysarch(CPUX86State *env, int op, > > + abi_ulong parms) > > +{ > > + abi_long ret = 0; > > + abi_ulong val; > > + int idx; > > + > > + switch (op) { > > + case TARGET_FREEBSD_I386_SET_GSBASE: > > + case TARGET_FREEBSD_I386_SET_FSBASE: > > Something's wrong here too -- this patch adds these functions > for each architecture, but it doesn't add the code that calls them, > and it doesn't delete the copies of this code from syscall.c. > > thanks > -- PMM > Digging through this for the last couple of days. Sorry for the slow response, lots of code flow to follow here. I think there's some confusion between the strace support for the new print_sysarch() and the existing syscall do_freebsd_sysarch(). If I follow the code, the existing do_freebsd_sysarch() syscall is a programtical way of figuring out what arch is running. Whereas print_sysarch() spams the arch into your strace output. Bearing that in mind, I think that the changes here are indeed correct for this patchset.