valid and useful representation of the situation
(even if not completely accurate) to avoid consumers missing the action
entirely.
Thanks,
Kyle Evans
+-
bsd-user/signal-common.h | 4 ++--
bsd-user/signal.c | 6 +++---
7 files changed, 11 insertions(+), 11 deletions(-)
Reviewed-by: Kyle Evans
Thanks,
Kyle Evans
On Sat, Feb 11, 2023 at 5:13 PM Richard Henderson
wrote:
>
> On 2/10/23 13:18, Warner Losh wrote:
> > From: Kyle Evans
> >
> > do_freebsd_sysctlbyname needs to translate the 'name' back down to a OID
> > so we can intercept the special ones. Do th
ally linked
bsd-user and I'd go as far as to say that we have no desire to change
that in the future, either -- the benefits are simply not there to
outweigh the pain for our use-cases.
Thanks,
Kyle Evans
LD_SCRIPT = """
> --
I'm afraid I'm not at all familiar with qemu's test setup, but sndio's
a valid pkg name and I can deduce well enough from the context that
these are indeed names that will be more or less passed to `pkg
install` and thus, installed in the respective environments. FWIW:
Reviewed-by: Kyle Evans
sd-proc.h | 43 +++
> bsd-user/freebsd/os-syscall.c | 7 ++
> 2 files changed, 50 insertions(+)
> create mode 100644 bsd-user/bsd-proc.h
>
Reviewed-by: Kyle Evans
> diff --git a/bsd-user/bsd-proc.h b/bsd-user/bsd-proc.h
> new file mo
s of the system call arguments.
>
> Signed-off-by: Warner Losh
> ---
> bsd-user/bsd-file.h | 39 +++
> bsd-user/freebsd/os-syscall.c | 2 ++
> 2 files changed, 41 insertions(+)
> create mode 100644 bsd-user/bsd-file.h
>
Reviewed-b
gt; other diffs that would be needed to make things work on OtherBSD, so it
> doesn't make sense to preseve this one detail today.
>
> Signed-off-by: Warner Losh
> ---
> bsd-user/x86_64/target_arch_thread.h | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
Reviewed-by:
On Tue, Feb 1, 2022 at 5:15 AM Warner Losh wrote:
>
> Releases the references to the iovec created by lock_iovec.
>
> Signed-off-by: Warner Losh
> ---
> bsd-user/freebsd/os-syscall.c | 23 +++
> 1 file changed, 23 insertions(+)
>
Reviewed-by: Kyle Ev
gt; bsd-user/freebsd/os-syscall.c | 92 +++
> 1 file changed, 92 insertions(+)
>
Two typos, otherwise seems to LGTM:
Reviewed-by: Kyle Evans
> diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c
> index 060134a9ecd..c21759ae7c
ince on FreeBSD they are the same on all architectures) along with a
> comment about why it's the identity.
>
> Signed-off-by: Warner Losh
> ---
> bsd-user/freebsd/os-syscall.c | 23 +++
> bsd-user/qemu.h | 3 ++-
> 2 files changed, 25 insertions(+)
>
> Signed-off-by: Stacey Son
> Signed-off-by: Warner Losh
> ---
> bsd-user/qemu.h | 13 +
> 1 file changed, 13 insertions(+)
>
Reviewed-by: Kyle Evans
> diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
> index a9efa807b78..af272c2a802 100644
>
.h | 7 ---
> 2 files changed, 9 deletions(-)
>
Reviewed-by: Kyle Evans
> diff --git a/bsd-user/main.c b/bsd-user/main.c
> index bddb830e99b..88d347d05eb 100644
> --- a/bsd-user/main.c
> +++ b/bsd-user/main.c
> @@ -96,7 +96,6 @@ unsigned long reserved_va;
>
> static const
On Tue, Feb 1, 2022 at 5:15 AM Warner Losh wrote:
>
> Signed-off-by: Warner Losh
> ---
> bsd-user/syscall.c | 516 -
> 1 file changed, 516 deletions(-)
> delete mode 100644 bsd-user/syscall.c
>
Reviewed-by: Kyle Evans
&g
thumb ? 2 : 4;
> +break;
> +}
> +if ((unsigned int)ret >= (unsigned int)(-515)) {
> +ret = -ret;
> +cpsr_write(env, CPSR_C, CPSR_C, CPSRWriteByInstr);
> +env->regs[0] = ret;
> } else {
> -fprintf(stderr, "qemu: bsd_type (= %d) syscall "
> -"not supported\n", bsd_type);
> +cpsr_write(env, 0, CPSR_C, CPSRWriteByInstr);
> +env->regs[0] = ret; /* XXX need to handle lseek()? */
> +/* env->regs[1] = 0; */
> }
> }
> break;
>
We should probably fix the lseek() situation sooner rather than later, but:
Reviewed-by: Kyle Evans
--
> bsd-user/x86_64/target_arch_cpu.h | 27 ---
> 1 file changed, 8 insertions(+), 19 deletions(-)
>
Reviewed-by: Kyle Evans
As a general comment, I'd like to reach out to the others at some
point and gauge interest/ability to participate, but I definitely
agree t
iffs that would be needed to make things work on OtherBSD,
> so it doesn't make sense to preseve this one detail today.
>
> Signed-off-by: Warner Losh
> ---
> bsd-user/arm/target_arch_thread.h | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
Reviewed-by: Kyle
drop it here.
>
> Signed-off-by: Warner Losh
> ---
> bsd-user/i386/target_arch_cpu.h | 84 +++--
> 1 file changed, 37 insertions(+), 47 deletions(-)
>
Reviewed-by: Kyle Evans
> diff --git a/bsd-user/i386/target_arch_cpu.h b/bsd-user/i386/targ
files changed, 64 insertions(+)
> create mode 100644 bsd-user/arm/target.h
> create mode 100644 bsd-user/i386/target.h
> create mode 100644 bsd-user/x86_64/target.h
>
Reviewed-by: Kyle Evans
> diff --git a/bsd-user/arm/target.h b/bsd-user/arm/target.h
> new file mode 1006
arget_arch_cpu.h | 58 ---
> 1 file changed, 58 deletions(-)
>
Reviewed-by: Kyle Evans
> diff --git a/bsd-user/x86_64/target_arch_cpu.h
> b/bsd-user/x86_64/target_arch_cpu.h
> index 0a9c0f08946..9dc52d5afc4 100644
> --- a/bsd-user/x86_64/target_arch_cpu.h
> +++ b/bsd-
t
> + * actions, such as logging of syscall results, can be performed. All errnos
> + * that do_syscall() returns must be -TARGET_.
> + */
> +abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1,
> +abi_long arg2, abi_long arg3, abi_long arg4,
> +abi_long arg5, abi_long arg6, abi_long arg7,
> +abi_long arg8)
> +{
> +return 0;
> +}
> +
> +void syscall_init(void)
> +{
> +}
> --
> 2.33.1
>
Small typo + omission, otherwise:
Reviewed-by: Kyle Evans
t host sigset to target
>> > target_to_host_sigset_internal: convert target sigset to host
>> > target_to_host_sigset: convert target sigset to host
>> >
>> > Signed-off-by: Stacey Son
>> > Signed-off-by: Kyle Evans
>> > Signed-off-by: Warner Losh
seful in the long run if we can more quickly identify
parallels between the two, so changes affecting linux-user that may
benefit bsd-user are more easily identified and exchanged (and
vice-versa).
Thanks,
Kyle Evans
On Fri, Nov 5, 2021 at 10:52 AM Richard Henderson
wrote:
>
> On 11/4/21 11:18 PM, Warner Losh wrote:
> > FreeBSD has dropped support for mips starting with FreeBSD 14. mips
> > support has been removed from the bsd-user fork because updating it for
> > new signal requirements. Remove it here
On Thu, Oct 28, 2021 at 12:25 PM Richard Henderson
wrote:
>
> On 10/19/21 9:44 AM, Warner Losh wrote:
> > +regs->regs[TARGET_REG_PC] = ka->_sa_handler;
>
> Surely there should be some handling of thumb addresses here.
>
Honestly, this wouldn't surprise me- we're kind of a thumb landmine.
The
On Wed, Oct 27, 2021 at 10:35 AM Warner Losh wrote:
>
>
>
> On Tue, Oct 26, 2021 at 12:11 AM Kyle Evans wrote:
>>
>> On Tue, Oct 26, 2021 at 1:01 AM Kyle Evans wrote:
>> >
>> > On Tue, Oct 19, 2021 at 11:45 AM Warner Losh wrote:
>> > >
&
-user and i386-bsd-user, this seems sane
and correct and I'm not aware of any other options that we would need
to consider setting, so let's call it:
Acked-by: Kyle Evans
TARGET_REG_SP] = frame_addr;
> + regs->regs[TARGET_REG_LR] = TARGET_PS_STRINGS - TARGET_SZSIGCODE;
> +
> +return 0;
> +}
> +
> #endif /* !_TARGET_ARCH_SIGNAL_H_ */
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
pregset_t;
> +
> +typedef struct target_mcontext {
> +uint32_t__gregs[TARGET__NGREG];
> +union {
> +target__fpregset_t __fpregs;
> + target__vfpregset_t __vfpregs;
> +} __fpu;
> +} target_mcontext_t;
> +
> #endif /* !_TARGET_ARCH_SIGNAL_H_ */
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
gt;regs[8]);
> +gr[TARGET_REG_R9] = tswap32(regs->regs[9]);
> +gr[TARGET_REG_R10] = tswap32(regs->regs[10]);
> +gr[TARGET_REG_R11] = tswap32(regs->regs[11]);
> +gr[TARGET_REG_R12] = tswap32(regs->regs[12]);
> +
> +gr[TARGET_REG_SP] = tswap32(regs->regs[13])
G_R15
> +
> +#define TARGET_INSN_SIZE4 /* arm instruction size */
> +
> +/* Size of the signal trampolin code. See _sigtramp(). */
> +#define TARGET_SZSIGCODE((abi_ulong)(9 * TARGET_INSN_SIZE))
> +
> +/* compare to arm/include/_limits.h */
> +#define TARGET_MINSIGSTKSZ (1024 * 4) /* min sig stack
> size */
> +#define TARGET_SIGSTKSZ (TARGET_MINSIGSTKSZ + 32768) /* recommended
> size */
> +
> +#endif /* !_TARGET_ARCH_SIGNAL_H_ */
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
psr_read(regs);
> +
> +*target_uc = 0;
> +
> +if ((cpsr & CPSR_M) != ARM_CPU_MODE_USR ||
> +(cpsr & (CPSR_I | CPSR_F)) != 0) {
> +return -TARGET_EINVAL;
> +}
> +
> +*target_uc = target_sf;
> +
> +return 0;
> +}
> +
> #endif /* !_TARGET_ARCH_SIGNAL_H_ */
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
pu_isar_feature(aa32_simd_r32, cpu)) {
> +hwcaps |= ARM_HWCAP_ARM_VFPD32;
> +} else {
> +hwcaps |= ARM_HWCAP_ARM_VFPv3D16;
> +}
> +}
> +GET_FEATURE_ID(aa32_simdfmac, ARM_HWCAP_ARM_VFPv4);
> +
> +return hwcaps;
> +}
> +
> +#undef GET_FEATURE
> +#undef GET_FEATURE_ID
>
> #endif /* _TARGET_ARCH_ELF_H_ */
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
_ARM
> +
> +#define USE_ELF_CORE_DUMP
> +#define ELF_EXEC_PAGESIZE 4096
> +
> +#define ELF_HWCAP 0
> +
> +#endif /* _TARGET_ARCH_ELF_H_ */
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
_SP]);
> +regs->regs[14] = tswap32(gr[TARGET_REG_LR]);
> +regs->regs[15] = tswap32(gr[TARGET_REG_PC]);
> +cpsr = tswap32(gr[TARGET_REG_CPSR]);
> +cpsr_write(regs, cpsr, CPSR_USER | CPSR_EXEC, CPSRWriteByInstr);
> +
> +return err;
> +}
> +
> #endif /* !_TARGET_ARCH_SIGNAL_H_ */
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
> fprintf(stderr, "qemu: unhandled CPU exception 0x%x -
> aborting\n",
> trapnr);
> --
> 2.32.0
>
Modulo typo:
Reviewed-by: Kyle Evans
abi_ulong tf_usr_sp;
> +abi_ulong tf_usr_lr;
> +abi_ulong tf_svc_sp; /* Not used on arm26 */
> +abi_ulong tf_svc_lr; /* Not used on arm26 */
> +abi_ulong tf_pc;
> +};
> +
> #endif /* !_TARGET_ARCH_SIGNAL_H_ */
> --
> 2.32.0
>
I didn't think we actually supported arm26, but I see those comments
also exist verbatim in machine/frame.h; no objection to reflecting
them here, as well.
Reviewed-by: Kyle Evans
On Tue, Oct 26, 2021 at 1:01 AM Kyle Evans wrote:
>
> On Tue, Oct 19, 2021 at 11:45 AM Warner Losh wrote:
> >
> > Implement target_thread_init (to create a thread) and target_set_upcall
> > (to switch to a thread) for arm.
> >
> > Signed-off-by: Stace
On Tue, Oct 19, 2021 at 11:45 AM Warner Losh wrote:
>
> Implement target_thread_init (to create a thread) and target_set_upcall
> (to switch to a thread) for arm.
>
> Signed-off-by: Stacey Son
> Signed-off-by: Klye Evans
> Signed-off-by: Warner Losh
> ---
> bsd-user/arm/target_arch_thread.h |
ine TARGET_VM_MAXUSER_ADDRESS (0xc000 - (512 * MiB))
> +#define TARGET_USRSTACK TARGET_VM_MAXUSER_ADDRESS
> +
> +static inline abi_ulong get_sp_from_cpustate(CPUARMState *state)
> +{
> +return state->regs[13]; /* sp */
> +}
> +
> +static inline void set_second_rval(CPUARMState *state, abi_ulong retval2)
> +{
> +state->regs[1] = retval2;
> +}
> +
> +#endif /* ! _TARGET_ARCH_VMPARAM_H_ */
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
= 0;
> +
> +GET_FEATURE_ID(aa32_aes, ARM_HWCAP2_ARM_AES);
> +GET_FEATURE_ID(aa32_pmull, ARM_HWCAP2_ARM_PMULL);
> +GET_FEATURE_ID(aa32_sha1, ARM_HWCAP2_ARM_SHA1);
> +GET_FEATURE_ID(aa32_sha2, ARM_HWCAP2_ARM_SHA2);
> +GET_FEATURE_ID(aa32_crc32, ARM_HWCAP2_ARM_CRC32);
> +return hwcaps;
> +}
> +
> #undef GET_FEATURE
> #undef GET_FEATURE_ID
>
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
/* 5 */ 0xE59F7008, /* ldr r7, [pc, #8] */
> +/* 6 */ 0xEF00 + sys_exit, /* swi (SYS_exit)*/
> +/* 7 */ 0xEAFA, /* b . -16 */
> +/* 8 */ sys_sigreturn,
> +/* 9 */ sys_exit
> +};
> +
> +for (i = 0; i < 9
+regs->r[i] = tswapreg(env->regs[i + 1]);
> +}
> +regs->r_sp = tswapreg(env->regs[13]);
> +regs->r_lr = tswapreg(env->regs[14]);
> +regs->r_pc = tswapreg(env->regs[15]);
> +regs->r_cpsr = tswapreg(cpsr_read((CPUARMState *)env));
> +}
> +
> +#undef tswapreg
> +
> +#endif /* !_TARGET_ARCH_REG_H_ */
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
t; +info.si_code = 0;
> +info.si_addr = env->exception.vaddress;
> +queue_signal(env, info.si_signo, );
> + break;
> case EXCP_DEBUG:
> {
>
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
trapnr);
> +cpu_dump_state(cs, stderr, 0);
> +abort();
> +} /* switch() */
> +process_pending_signals(env);
> +} /* for (;;) */
> +}
> +
> static inline void target_cpu_clone_regs(CPUARMState *env, target_ulong
> newsp)
> {
> if (newsp) {
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
env->cp15.tpidr_el[0] = newtls;
> +env->cp15.tpidrro_el[0] = newtls;
> +}
> +
> +target_ulong target_cpu_get_tls(CPUARMState *env)
> +{
> +if (access_secure_reg(env)) {
> +return env->cp15.tpidruro_s;
> +}
> +return env->cp15.tpidrro_el[0];
> +}
> --
> 2.32.0
>
Modulo typo:
Reviewed-by: Kyle Evans
*env,
> +struct target_pt_regs *regs)
> +{
> +int i;
> +
> +cpsr_write(env, regs->uregs[16], 0x, CPSRWriteRaw);
> +for (i = 0; i < 16; i++) {
> + env->regs[i] = regs->uregs[i];
> +}
> +}
> +
> +static inline void target_cpu_reset(CPUArchState *cpu)
> +{
> +}
> +
> +#endif /* !_TARGET_ARCH_CPU_H */
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
env->regs[0] = ret;
> +} else {
> +cpsr_write(env, 0, CPSR_C, CPSRWriteByInstr);
> +env->regs[0] = ret; /* XXX need to handle lseek()? */
> +/* env->regs[1] = 0; */
> + }
> +} else {
> +fprintf(stderr, "qemu: bsd_type (= %d) syscall "
> +"not supported\n", bsd_type);
> +}
> +}
> +break;
> case EXCP_INTERRUPT:
> /* just indicate that signals should be handled asap */
> break;
> --
> 2.32.0
>
Modulo typo:
Reviewed-by: Kyle Evans
env,
> }
> }
>
> +static inline void target_cpu_clone_regs(CPUARMState *env, target_ulong
> newsp)
> +{
> +if (newsp) {
> +env->regs[13] = newsp;
> +}
> +env->regs[0] = 0;
> +}
> +
> static inline void target_cpu_reset(CPUArchState *cpu)
> {
> }
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
1,6 +50,6 @@ struct target_pt_regs {
> #define TARGET_FREEBSD_ARM_GET_TP 3
>
> #define TARGET_HW_MACHINE "arm"
> -#define TARGET_HW_MACHINE_ARCH "armv6"
> +#define TARGET_HW_MACHINE_ARCH "armv7"
>
> -#endif /* !BSD_USER_ARCH_SYSCALL_H_ */
> +#endif /* !_TARGET_ARCH_SYSCALL_H_ */
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
arget_syscall.h"
> #include "target_arch.h"
> @@ -75,4 +75,4 @@ static inline void do_freebsd_arch_print_sysarch(
> }
> }
>
> -#endif /*!BSD_USER_ARCH_SYSARCH_H_ */
> +#endif /*!_TARGET_ARCH_SYSARCH_H_ */
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
On Mon, Oct 18, 2021 at 12:02 AM Warner Losh wrote:
>
>
>
> On Sun, Oct 17, 2021 at 10:29 PM Warner Losh wrote:
>>
>>
>>
>> On Sun, Oct 17, 2021 at 9:43 PM Kyle Evans wrote:
>>>
>>> On Fri, Oct 8, 2021 at 6:15 PM Warner Losh wrote:
>>
the virtual CPU as soon as
> + * possible.
> + */
> +void queue_signal(CPUArchState *env, int sig, target_siginfo_t *info)
> +{
> +qemu_log_mask(LOG_UNIMP, "No signal queueing, dropping signal %d\n",
> sig);
> +}
> +
> void signal_init(void)
> {
> }
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
se: we cannot map the file because the offset is not
> * aligned, so we read it
> */
> -if (!(flags & MAP_ANON) &&
> +if (fd != -1 &&
> (offset & ~qemu_host_page_mask) != (start &
> ~qemu_host_page_mask)) {
> /*
> * msync() won't work here, so we return an error if write is
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
ng binaries
> --
> 2.32.0
>
I don't understand the gdbstub.c removal here; don't we still want to
be compiling it in, just only if the appropriate
CONFIG_{BSD,LINUX}_USER knob is set? I note that it doesn't appear to
be added in individual *-user/meson.build, I assume it's uncommon to
add in ../foo.c in meson-land...
Thanks,
Kyle Evans
}
> if (flags & MAP_SHARED) {
> -printf("MAP_SHARED ");
> +qemu_log("MAP_SHARED ");
> }
> if (flags & MAP_NOCORE) {
> -printf("MAP_NOCORE ");
> +qemu_log("MAP_NOCORE ");
> }
> if (flags & MAP_STACK) {
> -printf("MAP_STACK ");
> +qemu_log("MAP_STACK ");
> }
> -printf("fd=%d offset=0x%llx\n", fd, offset);
> +qemu_log("fd=%d offset=0x%lx\n", fd, offset);
> }
> -#endif
>
> if ((flags & MAP_ANON) && fd != -1) {
> errno = EINVAL;
> --
> 2.32.0
>
>
Reviewed-by: Kyle Evans
-user/syscall.c b/bsd-user/syscall.c
> index d3b9f431e2..d3322760f4 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 of
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
4d9 100644
> --- a/bsd-user/qemu.h
> +++ b/bsd-user/qemu.h
> @@ -92,7 +92,6 @@ typedef struct TaskState {
>
> struct TaskState *next;
> struct bsd_binprm *bprm;
> -int used; /* non zero if used */
> struct image_info *info;
>
> struct emulated_sigtable sigtab[TARGET_NSIG];
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
it a/bsd-user/qemu.h b/bsd-user/qemu.h
> index c1170f14d9..cdb85140f4 100644
> --- a/bsd-user/qemu.h
> +++ b/bsd-user/qemu.h
> @@ -103,6 +103,7 @@ typedef struct TaskState {
> } __attribute__((aligned(16))) TaskState;
>
> void init_task_state(TaskState *ts);
> +void stop_all_tasks(void);
> extern const char *qemu_uname_release;
>
> /*
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
struct sigqueue *first_free; /* first free siginfo queue entry */
> +struct qemu_sigqueue sigqueue_table[MAX_SIGQUEUE_SIZE]; /* siginfo queue
> */
> +struct qemu_sigqueue *first_free; /* first free siginfo queue entry */
> int signal_pending; /* non zero if a signal may be pending */
>
> uint8_t stack[];
> --
> 2.32.0
>
Typo noted above in the commit message; otherwise:
Reviewed-by: Kyle Evans
bi_ulong)geteuid());
> NEW_AUX_ENT(AT_GID, (abi_ulong)getgid());
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
gt; -if (put_user(val, parms, abi_ulong))
> -return -TARGET_EFAULT;
> -break;
> -/* XXX handle the others... */
> - default:
> -ret = -TARGET_EINVAL;
> -break;
> -}
> -return ret;
> +do_freebsd_arch_sysarch(env, op, parms);
> }
> #endif
>
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
modifing regs */
> +#define TARGET_ERESTART 255 /* Restart syscall */
> +#define TARGET_ERESTARTSYS TARGET_ERESTART /* Linux compat */
> +
> +#endif /* ! _ERRNO_DEFS_H_ */
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
));
> NEW_AUX_ENT(AT_EGID, (abi_ulong)getegid());
> -features = ELF_HWCAP;
> -NEW_AUX_ENT(FREEBSD_AT_HWCAP, features);
> target_auxents = sp; /* Note where the aux entries are in the target
> */
> #ifdef ARCH_DLINFO
> /*
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
d-user/x86_64/target_arch_signal.h
> @@ -27,8 +27,6 @@
> #define TARGET_MINSIGSTKSZ (512 * 4) /* min sig stack size */
> #define TARGET_SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended size */
>
> -#define TARGET_MC_GET_CLEAR_RET 0x0001
> -
> struct target_sigcontext {
> /* to be added */
> };
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
#define target_to_host_bitmask(x, tbl) (x)
>
> -static inline int is_error(abi_long ret)
> +bool is_error(abi_long ret)
> {
> return (abi_ulong)ret >= (abi_ulong)(-4096);
> }
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
..5172b230f0 100644
> --- a/bsd-user/x86_64/target_arch_cpu.h
> +++ b/bsd-user/x86_64/target_arch_cpu.h
> @@ -23,8 +23,6 @@
>
> #define TARGET_DEFAULT_CPU_MODEL "qemu64"
>
> -#define TARGET_CPU_RESET(cpu)
> -
> static inline void target_cpu_init(CPUX86State *env,
> struct target_pt_regs *regs)
> {
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 90
> int32_t kve_vn_type; /* Vnode type. */
> uint64_t kve_vn_size; /* File size. */
> -#if defined(__FreeBSD_version) && __FreeBSD_version >= 1200031
> uint32_t kve_vn_rdev_freebsd11; /* Device id if device. */
> -#else
> -uint32_t kve_vn_rdev; /* Device id if device. */
> -#endif
> uint16_t kve_vn_mode; /* File mode. */
> uint16_t kve_status; /* Status flags. */
> -#if defined(__FreeBSD_version) && __FreeBSD_version >= 1200031
> #if (__FreeBSD_version >= 1300501 && __FreeBSD_version < 140) ||\
> __FreeBSD_version >= 149
> union {
> @@ -413,13 +322,6 @@ struct target_kinfo_vmentry {
> #endif
> uint64_t kve_vn_rdev; /* Device id if device. */
> int _kve_ispare[8]; /* Space for more stuff. */
> -#else
> -int32_t _kve_ispare[12]; /* Space for more stuff. */
> -#endif
> -#else /* ! __FreeBSD_version >= 90 */
> -int _kve_pad0;
> -int32_t _kve_ispare[16]; /* Space for more stuff. */
> -#endif /* ! __FreeBSD_version >= 90 */
> /* Truncated before copyout in sysctl */
> char kve_path[PATH_MAX]; /* Path to VM obj, if any. */
> };
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
quot;cap_rights_limit", NULL, NULL, NULL },
> @@ -146,9 +138,6 @@
> { TARGET_FREEBSD_NR_freebsd11_kevent, "freebsd11_kevent", NULL, NULL, NULL },
> { TARGET_FREEBSD_NR_kevent, "kevent", NULL, NULL, NULL },
> { TARGET_FREEBSD_NR_kill, "kill", NULL, NULL, NULL },
> -#if defined(__FreeBSD_version) && __FreeBSD_version < 100
> -{ TARGET_FREEBSD_NR_killpg, "killpg", NULL, NULL, NULL },
> -#endif
> { TARGET_FREEBSD_NR_kqueue, "kqueue", NULL, NULL, NULL },
> { TARGET_FREEBSD_NR_ktrace, "ktrace", NULL, NULL, NULL },
> { TARGET_FREEBSD_NR_lchown, "lchown", NULL, NULL, NULL },
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
/* Check for overflows */
> +len = TARGET_PAGE_ALIGN(len);
> +if (len == 0) {
> +errno = ENOMEM;
> +goto fail;
> +}
> +
> real_start = start & qemu_host_page_mask;
> host_offset = offset & qemu_host_page_mask;
>
> --
> 2.32.0
>
>
Reviewed-by: Kyle Evans
p(abi_ulong start, abi_ulong len, int
> prot,
> goto fail;
> }
> }
> -#endif /* MAP_STACK */
> -#ifdef MAP_GUARD
> if ((flags & MAP_GUARD) && (prot != PROT_NONE || fd != -1 ||
> offset != 0 || (flags & (MAP_SHARED | MAP_PRIVATE |
> /* MAP_PREFAULT | */ /* MAP_PREFAULT not in mman.h */
> @@ -462,7 +449,6 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int
> prot,
> errno = EINVAL;
> goto fail;
> }
> -#endif
>
> if (offset & ~TARGET_PAGE_MASK) {
> errno = EINVAL;
> --
> 2.32.0
>
>
Reviewed-by: Kyle Evans
if (ret != 0) {
> -start = ret;
> -goto the_end;
> -}
> +assert(ret == 0);
> }
> goto the_end;
> }
> --
> 2.32.0
>
>
Reviewed-by: Kyle Evans
te start so that it points to the file position at 'offset' */
> @@ -696,8 +696,7 @@ static void mmap_reserve(abi_ulong start, abi_ulong size)
> }
> if (real_start != real_end) {
> mmap(g2h_untagged(real_start), real_end - real_start, PROT_NONE,
> - MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE,
> - -1, 0);
> + MAP_FIXED | MAP_ANON | MAP_PRIVATE, -1, 0);
> }
> }
>
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
t), len, offset) == -1) {
> +goto fail;
> +}
> if (!(prot & PROT_WRITE)) {
> ret = target_mprotect(start, len, prot);
> if (ret != 0) {
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
/
> if (prot_new != prot1) {
> mprotect(host_start, qemu_host_page_size, prot_new);
> }
> +if (prot_new & PROT_WRITE) {
> +memset(g2h_untagged(start), 0, end - start);
> +}
> }
> return 0;
> }
> --
> 2.32.0
>
Reviewed-by: Kyle Evans
three streams
> of patches for 3 more architectures: arm, aarch64 and riscv64.
>
> I'll create a patch for both linux-user and fix in bsd-user as part of the
> signal.c upstreaming I'm working on.
>
> It brings to mind something else... There's times it might be easier
> to refactor between bsd-user and linux-user rather than upstream
> something that's largely copied from linux-user. Is there a good
> way to do that and talk about the design before I sink a ton of time
> into something that's the wrong direction?
>
I had a proposal on this list a long while back to refactor some stuff
into a top-level qemu-user that could be shared between the two,
starting with safe_syscall (which syscall can be substantially
shared), but it hadn't received any traction at that time.
Thanks,
Kyle Evans
create mode 100644 bsd-user/i386/target_arch_signal.h
> create mode 100644 bsd-user/netbsd/target_os_siginfo.h
> create mode 100644 bsd-user/netbsd/target_os_signal.h
> create mode 100644 bsd-user/openbsd/target_os_siginfo.h
> create mode 100644 bsd-user/openbsd/target_os_signal.h
> create mode 100644 bsd-user/x86_64/target_arch_signal.h
>
Reviewed-by: Kyle Evans
gned-off-by: Warner Losh
> Signed-off-by: Stacey Son
> Signed-off-by: Kyle Evans
> Signed-off-by: Justin Hibbits
> Signed-off-by: Alexander Kabaev
> Acked-by: Richard Henderson
> ---
> bsd-user/elfload.c | 191
n
> ---
> bsd-user/main.c | 21 +
> bsd-user/qemu.h | 1 +
> 2 files changed, 22 insertions(+)
>
Reviewed-by: Kyle Evans
_os_thread.h
> create mode 100644 bsd-user/openbsd/target_os_thread.h
> create mode 100644 bsd-user/x86_64/target_arch_thread.h
>
Minor message nits, but otherwise:
Reviewed-by: Kyle Evans
On Thu, Sep 2, 2021 at 6:53 PM wrote:
>
> From: Warner Losh
>
> cpu_model and cpu_type will be used future commits, so move them from
> main() scoped to file scoped.
>
> Signed-off-by: Warner Losh
> Acked-by: Richard Henderson
> ---
> bsd-user/main.c | 4 ++--
> 1 file changed, 2
On Thu, Sep 2, 2021 at 6:54 PM wrote:
>
> From: Warner Losh
>
> Update the debugging code for new features and different targets.
>
> Signed-off-by: Mikaël Urankar
> Signed-off-by: Sean Bruno
> Signed-off-by: Kyle Evans
> Signed-off-by: Warner Losh
> Acked-by: R
> 3 files changed, 162 insertions(+), 208 deletions(-)
> delete mode 100644 bsd-user/bsd-mman.h
>
Reviewed-by: Kyle Evans
--
> bsd-user/elfload.c | 344 +
> 1 file changed, 158 insertions(+), 186 deletions(-)
>
Reviewed-by: Kyle Evans
r Losh
> Acked-by: Richard Henderson
> ---
> bsd-user/freebsd/target_os_user.h | 427 ++
> 1 file changed, 427 insertions(+)
> create mode 100644 bsd-user/freebsd/target_os_user.h
>
Reviewed-by: Kyle Evans
On Thu, Sep 2, 2021 at 6:56 PM wrote:
>
> From: Warner Losh
>
> Signed-off-by: Warner Losh
> Acked-by: Richard Henderson
> ---
> bsd-user/main.c | 17 +
> 1 file changed, 9 insertions(+), 8 deletions(-)
>
Subject nit: s/qemu_log/gemu_log/
Reviewed-by: Kyle Evans
; 3 files changed, 392 insertions(+), 71 deletions(-)
>
Reviewed-by: Kyle Evans
IRC imgact_binmisc will have the resolved path but preserve argv as
it should have been were it not emulated, so we have to re-evaluate
the PATH search here because we try to be faithful to the context.
Thanks,
Kyle Evans
at first that will a very easy standard to make.
>
> The first patch I'll submit will be changing MAINTAINERS to point to me,
> since I'm acting as the point person in this effort. I'll then re-submit some
> other changes that I've submitted in the past, but CC the FreeBSD folks that
> are currently active (they were only CC'd to former developers who lack the
> time to review).
>
Thanks for taking this on!
Kyle Evans
On Mon, Oct 28, 2019 at 7:08 PM Kyle Evans wrote:
>
> Hi,
>
> We're working on improving bsd-user in a local tree and rebasing forward
> to get our work suitable for upstreaming. I'm porting the safe_syscall stuff
> over to bsd-user, and would like to get some design guida
to the diff below.
A full version of this can be found in my tree, currently only available on
GitHub: https://github.com/kevans91/qemu-bsd-user/tree/safe_syscall -- this
is applied to our version, currently based on qemu 3.1.
Thoughts?
Thanks,
Kyle Evans
diff --git a/Makefile.target b
91 matches
Mail list logo