qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sean Bruno <sbruno@ignoranthack.me>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 05/10 v4] bsd-user: Implement new syscall print_sysarch and add strace support
Date: Sun, 15 Jun 2014 08:33:50 -0700	[thread overview]
Message-ID: <1402846430.2347.4.camel@bruno> (raw)
In-Reply-To: <CAFEAcA_eXWnyrssqKyXpBoAjiduWvODCFL8iky=RfmDWJwbedw@mail.gmail.com>

On Tue, 2014-06-10 at 23:53 +0100, Peter Maydell wrote:
> On 8 June 2014 17:57, Sean Bruno <sbruno@freebsd.org> wrote:
> > Signed-off-by: Sean Bruno <sbruno@freebsd.org>
> > ---
> >  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.

<more comments below>

> > --- /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 <http://www.gnu.org/licenses/>.
> > + */
> > +
> > +#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.

  parent reply	other threads:[~2014-06-15 15:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-08 16:57 [Qemu-devel] [PATCH 00/10 v4] bsd-user: update strace syscalls and breakout BSD distros Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 01/10 v4] bsd-user: add HOST_VARIANT_DIR for various *BSD dependent code Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 02/10 v4] bsd-user: GPL v2 attribution update and style Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 03/10 v4] bsd-user: Implement strace support for print_sysctl syscall Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 04/10 v4] bsd-user: Implement strace support for print_ioctl syscall Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 05/10 v4] bsd-user: Implement new syscall print_sysarch and add strace support Sean Bruno
2014-06-10 22:53   ` Peter Maydell
2014-06-11 18:52     ` Sean Bruno
2014-06-15 15:33     ` Sean Bruno [this message]
2014-06-15 19:20       ` Peter Maydell
2014-06-15 19:30         ` Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 06/10 v4] bsd-user: Implement strace support for __acl_* syscalls Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 07/10 v4] bsd-user: Implement strace support for extattr_* syscalls Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 08/10 v4] bsd-user: Implement strace support for thr_* syscalls Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 09/10 v4] bsd-user: Fix syscall format, add strace support for more syscalls Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 10/10 v4] bsd-user: Add TARGET_HW_MACHINE TARGET_HW_MACHINE_ARCH for future use Sean Bruno
2014-06-10 23:00   ` Peter Maydell
2014-06-10 23:29 ` [Qemu-devel] [PATCH 00/10 v4] bsd-user: update strace syscalls and breakout BSD distros Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402846430.2347.4.camel@bruno \
    --to=sbruno@ignoranthack.me \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sbruno@freebsd.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).