From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DEA8C433F5 for ; Sun, 26 Sep 2021 17:24:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B42E560FC2 for ; Sun, 26 Sep 2021 17:24:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B42E560FC2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:33888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUXtY-0004IA-S5 for qemu-devel@archiver.kernel.org; Sun, 26 Sep 2021 13:24:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUXqG-0001W1-Nd for qemu-devel@nongnu.org; Sun, 26 Sep 2021 13:21:33 -0400 Received: from mail-ua1-x934.google.com ([2607:f8b0:4864:20::934]:39631) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUXqE-00035r-TO for qemu-devel@nongnu.org; Sun, 26 Sep 2021 13:21:32 -0400 Received: by mail-ua1-x934.google.com with SMTP id 20so2418436uaj.6 for ; Sun, 26 Sep 2021 10:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vw3Wjn1UFMN46k8RAfv3FNLnBes/UjS5POs9K9FPzAU=; b=jVgAJ31bNs70JhfZgs5zregTDnPeudisWiVGj7AugG+OlQQSRayO5McCnWlKvXehrZ e6hzBYnyYRCUoezavbvfuqdQV8l9s+EDMWL5EIxce40kT0aMcn/ZIewxbctEaargVTL2 rlOnSQXJqnAkHeVnlxNVTG98VSf3wLoCfvVxuZM/vI0tZ97nPLV5i+Np3//5zrveY6K+ G1feWFudlFjgP+zKiaRgwRsp8bBYILECA+whz+QZBC7U769my7HG+3YRBZ4d4LUAv3tO J5Tqi2Z2KuQNnt45uEKLKAZhqmF4DOVt8/CtDMWySmG7yiNS+izVEmhRoxGVeBgoyM64 kkMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vw3Wjn1UFMN46k8RAfv3FNLnBes/UjS5POs9K9FPzAU=; b=Dg7WJpvtgVXc0Vaj6foiCZHkU3Wqij/HVoTFIs1YlbmWfWNARCq7zubVSx+iBm0cNr 0cRdyzh02w0KeU928NqpcJPOgBpZJhvWsTEicQYOv2ndVgHOnFrEV1qZ3SfbIpm2/p+f Wk+8f74ONjeu1q15JYF8pJzDbQ28JEVMrPvXyGVCRJwI2l/7X+2FXJSRjuZnBNRpQIEq ApPKM+yO0ow9JUDYPnuelBwib7WBQHmMSrexYiZrxrLBG/nX+EXOArVbD8XkMaprQ2PD BhIsWUwtfJYqH56OQ+Ge5iFZIuuRRjHtJSFAomKtiKKFWtBFlxSXs2RCc9mHRfoFGl1G b+hw== X-Gm-Message-State: AOAM533EA+6or4bxVICrP4lOSFjFDk/zywlH9W+4OzBEIrZvB4YOPy5U 27+WVylRbdJRpo+CfdPbTuFxotkpqmkly6Xya9ulyw== X-Google-Smtp-Source: ABdhPJz7YbIzbO+Hnr6Zo26Ev/3trZwJYzc+c5aUyBpZR6dQ9qHpE3ZtQep43vttdSDYs/F40654QpFGkjLLl48bDBs= X-Received: by 2002:ab0:471d:: with SMTP id h29mr16010447uac.11.1632676889667; Sun, 26 Sep 2021 10:21:29 -0700 (PDT) MIME-Version: 1.0 References: <20210922061438.27645-1-imp@bsdimp.com> <20210922061438.27645-13-imp@bsdimp.com> <64e8f0f5-1239-fc04-1c58-189421212f2c@amsat.org> In-Reply-To: <64e8f0f5-1239-fc04-1c58-189421212f2c@amsat.org> From: Warner Losh Date: Sun, 26 Sep 2021 11:21:18 -0600 Message-ID: Subject: Re: [PATCH 12/14] bsd-user/sysarch: Provide a per-arch framework for sysarch syscall To: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Content-Type: multipart/alternative; boundary="0000000000000abcc805cce93654" Received-SPF: none client-ip=2607:f8b0:4864:20::934; envelope-from=wlosh@bsdimp.com; helo=mail-ua1-x934.google.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, 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: Kyle Evans , Richard Henderson , QEMU Developers , Stacey Son Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --0000000000000abcc805cce93654 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Sep 25, 2021 at 4:46 AM Philippe Mathieu-Daud=C3=A9 wrote: > Hi Warner, > > On 9/22/21 08:14, Warner Losh wrote: > > Add the missing glue to pull in do_freebsd_sysarch to call > > do_freebsd_arch_sysarch. Put it in os-sys.c, which will be used for > > sysctl and sysarch system calls because they are mostly arch specific. > > > > Signed-off-by: Stacey Son > > Signed-off-by: Warner Losh > > --- > > bsd-user/freebsd/meson.build | 3 +++ > > bsd-user/freebsd/os-sys.c | 28 ++++++++++++++++++++++++++++ > > bsd-user/meson.build | 6 ++++++ > > bsd-user/qemu.h | 3 +++ > > bsd-user/syscall.c | 7 ------- > > 5 files changed, 40 insertions(+), 7 deletions(-) > > create mode 100644 bsd-user/freebsd/meson.build > > create mode 100644 bsd-user/freebsd/os-sys.c > > > +/* sysarch() is architecture dependent. */ > > +abi_long do_freebsd_sysarch(void *cpu_env, abi_long arg1, abi_long arg= 2) > > +{ > > + > > + return do_freebsd_arch_sysarch(cpu_env, arg1, arg2); > > +} > > diff --git a/bsd-user/meson.build b/bsd-user/meson.build > > index 0369549340..561913de05 100644 > > --- a/bsd-user/meson.build > > +++ b/bsd-user/meson.build > > @@ -8,3 +8,9 @@ bsd_user_ss.add(files( > > 'syscall.c', > > 'uaccess.c', > > )) > > + > > +# Pull in the OS-specific build glue, if any > > +if fs.exists(targetos) > > + subdir(targetos) > > I am a bit confused here, we have an optional implementation ... > > > +endif > > + > > diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h > > index 4ee57b91f0..3dde381d5d 100644 > > --- a/bsd-user/qemu.h > > +++ b/bsd-user/qemu.h > > @@ -239,6 +239,9 @@ extern unsigned long target_sgrowsiz; > > abi_long get_errno(abi_long ret); > > int is_error(abi_long ret); > > > > +/* os-sys.c */ > > +abi_long do_freebsd_sysarch(void *cpu_env, abi_long arg1, abi_long > arg2); > > ... that is declared as non-optional. > > In fact it is called by do_freebsd_syscall(), not restricted to > TARGET_I386. > > This shouldn't be (meson) optional IMO. > I made it optional because we descend into this directory even for linux targets when building linux-user on at least ubuntu (and I think all linux targets). Your comment suggests that I need to have a different meson fix for this situation... Warner > > + > > /* user access */ > > > > #define VERIFY_READ PAGE_READ > > diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c > > index 9bc72501b2..9f51563abd 100644 > > --- a/bsd-user/syscall.c > > +++ b/bsd-user/syscall.c > > @@ -88,13 +88,6 @@ static abi_long do_obreak(abi_ulong new_brk) > > return 0; > > } > > > > -#if defined(TARGET_I386) > > -static abi_long do_freebsd_sysarch(CPUX86State *env, int op, abi_ulong > parms) > > -{ > > - do_freebsd_arch_sysarch(env, op, parms); > > -} > > -#endif > > - > > #ifdef __FreeBSD__ > > /* > > * XXX this uses the undocumented oidfmt interface to find the kind o= f > > > --0000000000000abcc805cce93654 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sat, Sep 25, 2021 at 4:46 AM Phili= ppe Mathieu-Daud=C3=A9 <f4bug@amsat.o= rg> wrote:
imp@bsdimp.com>
> ---
>=C2=A0 =C2=A0bsd-user/freebsd/meson.build |=C2=A0 3 +++
>=C2=A0 =C2=A0bsd-user/freebsd/os-sys.c=C2=A0 =C2=A0 | 28 ++++++++++++++= ++++++++++++++
>=C2=A0 =C2=A0bsd-user/meson.build=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2= =A0 6 ++++++
>=C2=A0 =C2=A0bsd-user/qemu.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 |=C2=A0 3 +++
>=C2=A0 =C2=A0bsd-user/syscall.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0|=C2=A0 7 -------
>=C2=A0 =C2=A05 files changed, 40 insertions(+), 7 deletions(-)
>=C2=A0 =C2=A0create mode 100644 bsd-user/freebsd/meson.build
>=C2=A0 =C2=A0create mode 100644 bsd-user/freebsd/os-sys.c

> +/* sysarch() is architecture dependent. */
> +abi_long do_freebsd_sysarch(void *cpu_env, abi_long arg1, abi_long ar= g2)
> +{
> +
> +=C2=A0 =C2=A0 return do_freebsd_arch_sysarch(cpu_env, arg1, arg2); > +}
> diff --git a/bsd-user/meson.build b/bsd-user/meson.build
> index 0369549340..561913de05 100644
> --- a/bsd-user/meson.build
> +++ b/bsd-user/meson.build
> @@ -8,3 +8,9 @@ bsd_user_ss.add(files(
>=C2=A0 =C2=A0 =C2=A0'syscall.c',
>=C2=A0 =C2=A0 =C2=A0'uaccess.c',
>=C2=A0 =C2=A0))
> +
> +# Pull in the OS-specific build glue, if any
> +if fs.exists(targetos)
> +=C2=A0 =C2=A0subdir(targetos)

I am a bit confused here, we have an optional implementation ...

> +endif
> +
> diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
> index 4ee57b91f0..3dde381d5d 100644
> --- a/bsd-user/qemu.h
> +++ b/bsd-user/qemu.h
> @@ -239,6 +239,9 @@ extern unsigned long target_sgrowsiz;
>=C2=A0 =C2=A0abi_long get_errno(abi_long ret);
>=C2=A0 =C2=A0int is_error(abi_long ret);
>=C2=A0 =C2=A0
> +/* os-sys.c */
> +abi_long do_freebsd_sysarch(void *cpu_env, abi_long arg1, abi_long ar= g2);

... that is declared as non-optional.

In fact it is called by do_freebsd_syscall(), not restricted to TARGET_I386= .

This shouldn't be (meson) optional IMO.

=
I made it optional because we descend into this directory even
for linux targets when building linux-user on at least ubuntu (and
=
I think all linux targets).

Your comment sugg= ests that I need to have a different meson fix
for this situation= ...

Warner
=C2=A0
> +
>=C2=A0 =C2=A0/* user access */
>=C2=A0 =C2=A0
>=C2=A0 =C2=A0#define VERIFY_READ=C2=A0 PAGE_READ
> diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c
> index 9bc72501b2..9f51563abd 100644
> --- a/bsd-user/syscall.c
> +++ b/bsd-user/syscall.c
> @@ -88,13 +88,6 @@ static abi_long do_obreak(abi_ulong new_brk)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
>=C2=A0 =C2=A0}
>=C2=A0 =C2=A0
> -#if defined(TARGET_I386)
> -static abi_long do_freebsd_sysarch(CPUX86State *env, int op, abi_ulon= g parms)
> -{
> -=C2=A0 =C2=A0 do_freebsd_arch_sysarch(env, op, parms);
> -}
> -#endif
> -
>=C2=A0 =C2=A0#ifdef __FreeBSD__
>=C2=A0 =C2=A0/*
>=C2=A0 =C2=A0 * XXX this uses the undocumented oidfmt interface to find= the kind of
>
--0000000000000abcc805cce93654--