From owner-freebsd-emulation Sun Oct 6 4: 2:50 2002 Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6C1F437B401; Sun, 6 Oct 2002 04:02:49 -0700 (PDT) Received: from baraca.united.net.ua (ns.united.net.ua [193.111.8.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id E3F9643E4A; Sun, 6 Oct 2002 04:02:46 -0700 (PDT) (envelope-from max@vega.com) Received: from vega.vega.com (xDSL-2-2.united.net.ua [193.111.9.226]) by baraca.united.net.ua (8.11.6/8.11.6) with ESMTP id g96B2dp39624; Sun, 6 Oct 2002 14:02:40 +0300 (EEST) (envelope-from max@vega.com) Received: from vega.vega.com (max@localhost [127.0.0.1]) by vega.vega.com (8.12.6/8.12.5) with ESMTP id g96B2jTs071012; Sun, 6 Oct 2002 14:02:45 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Received: (from max@localhost) by vega.vega.com (8.12.6/8.12.5/Submit) id g96B2hEv071011; Sun, 6 Oct 2002 14:02:43 +0300 (EEST) Date: Sun, 6 Oct 2002 14:02:43 +0300 From: Maxim Sobolev To: developers@FreeBSD.org Cc: emulation@FreeBSD.org Subject: Who currently maintains Linuxlator? Message-ID: <20021006110243.GA70993@vega.vega.com> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline User-Agent: Mutt/1.4i Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Folks, I've cooked bunch of patches to make Linux CrossOver plugin working on FreeBSD (Linux IPC_64 syscalls, mmap2(2), ftruncate64(2) and so on). To whom I should send those patches for review, or should I commit them right away? Thanks! -Maxim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Sun Oct 6 13:21:43 2002 Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C196A37B401; Sun, 6 Oct 2002 13:21:41 -0700 (PDT) Received: from leviathan.inethouston.net (leviathan.inethouston.net [66.64.12.249]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B79243E65; Sun, 6 Oct 2002 13:21:41 -0700 (PDT) (envelope-from dwcjr@inethouston.net) Received: by leviathan.inethouston.net (Postfix, from userid 1001) id B91D410DE10; Sun, 6 Oct 2002 15:21:39 -0500 (CDT) Date: Sun, 6 Oct 2002 15:21:39 -0500 From: "David W. Chapman Jr." To: Maxim Sobolev Cc: developers@FreeBSD.org, emulation@FreeBSD.org Subject: Re: Who currently maintains Linuxlator? Message-ID: <20021006202139.GA8490@leviathan.inethouston.net> Reply-To: "David W. Chapman Jr." References: <20021006110243.GA70993@vega.vega.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021006110243.GA70993@vega.vega.com> X-Operating-System: FreeBSD 4.6-STABLE i386 User-Agent: Mutt/1.5.1i Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > I've cooked bunch of patches to make Linux CrossOver plugin working > on FreeBSD (Linux IPC_64 syscalls, mmap2(2), ftruncate64(2) and > so on). To whom I should send those patches for review, or should > I commit them right away? > Marcel would be a good place to start. -- David W. Chapman Jr. dwcjr@inethouston.net Raintree Network Services, Inc. dwcjr@freebsd.org FreeBSD Committer To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Tue Oct 8 4:13:31 2002 Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B184E37B401; Tue, 8 Oct 2002 04:13:06 -0700 (PDT) Received: from baraca.united.net.ua (ns.united.net.ua [193.111.8.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3076A43E75; Tue, 8 Oct 2002 04:13:04 -0700 (PDT) (envelope-from sobomax@FreeBSD.org) Received: from vega.vega.com (xDSL-2-2.united.net.ua [193.111.9.226]) by baraca.united.net.ua (8.11.6/8.11.6) with ESMTP id g98BCjg58183; Tue, 8 Oct 2002 14:12:47 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Received: from FreeBSD.org (big_brother.vega.com [192.168.1.1]) by vega.vega.com (8.12.6/8.12.5) with ESMTP id g98BCcTs078189; Tue, 8 Oct 2002 14:12:38 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Message-ID: <3DA2BE32.BDEC28B5@FreeBSD.org> Date: Tue, 08 Oct 2002 14:14:58 +0300 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U) X-Accept-Language: en,uk,ru MIME-Version: 1.0 To: Alfred Perlstein Cc: emulation@FreeBSD.org, audit@FreeBSD.org, marcel@FreeBSD.org Subject: Linuxlator patches for review [was: Who currently maintains Linuxlator?] References: <20021006110243.GA70993@vega.vega.com> <20021006183650.GY95327@elvis.mu.org> Content-Type: multipart/mixed; boundary="------------2C056B357B94AA92275BD099" Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org This is a multi-part message in MIME format. --------------2C056B357B94AA92275BD099 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit See attached. As it was suggested, I'm also CC'ing marcel, freebsd-audit and freebsd-emulation. I'd like to hear any suggestion or comments. Please note that changes were not tested on alpha, because I don't have any axp hardware. Thanks! -Maxim Alfred Perlstein wrote: > > * Maxim Sobolev [021006 04:02] wrote: > > Folks, > > > > I've cooked bunch of patches to make Linux CrossOver plugin working > > on FreeBSD (Linux IPC_64 syscalls, mmap2(2), ftruncate64(2) and > > so on). To whom I should send those patches for review, or should > > I commit them right away? > > If no one else steps forwward i can look at them. > > > > > Thanks! > > > > -Maxim > > -- > -Alfred Perlstein [alfred@freebsd.org] > 'Instead of asking why a piece of software is using "1970s technology," > start asking why software is ignoring 30 years of accumulated wisdom.' --------------2C056B357B94AA92275BD099 Content-Type: text/plain; charset=koi8-r; name="diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff" ? compat/linux/linux_ipc.c,v ? compat/linux/linux_ipc.h,v ? compat/linux/linux_stats.c,v ? i386/linux/linux_dummy.c,v ? i386/linux/linux_machdep.c,v Index: compat/linux/linux_ioctl.c =================================================================== RCS file: /home/ncvs/src/sys/compat/linux/linux_ioctl.c,v retrieving revision 1.93 diff -d -u -r1.93 linux_ioctl.c --- compat/linux/linux_ioctl.c 20 Sep 2002 19:19:58 -0000 1.93 +++ compat/linux/linux_ioctl.c 8 Oct 2002 10:49:53 -0000 @@ -61,6 +61,7 @@ #include static linux_ioctl_function_t linux_ioctl_cdrom; +static linux_ioctl_function_t linux_ioctl_vfat; static linux_ioctl_function_t linux_ioctl_console; static linux_ioctl_function_t linux_ioctl_disk; static linux_ioctl_function_t linux_ioctl_socket; @@ -71,6 +72,8 @@ static struct linux_ioctl_handler cdrom_handler = { linux_ioctl_cdrom, LINUX_IOCTL_CDROM_MIN, LINUX_IOCTL_CDROM_MAX }; +static struct linux_ioctl_handler vfat_handler = +{ linux_ioctl_vfat, LINUX_IOCTL_VFAT_MIN, LINUX_IOCTL_VFAT_MAX }; static struct linux_ioctl_handler console_handler = { linux_ioctl_console, LINUX_IOCTL_CONSOLE_MIN, LINUX_IOCTL_CONSOLE_MAX }; static struct linux_ioctl_handler disk_handler = @@ -85,6 +88,7 @@ { linux_ioctl_private, LINUX_IOCTL_PRIVATE_MIN, LINUX_IOCTL_PRIVATE_MAX }; DATA_SET(linux_ioctl_handler_set, cdrom_handler); +DATA_SET(linux_ioctl_handler_set, vfat_handler); DATA_SET(linux_ioctl_handler_set, console_handler); DATA_SET(linux_ioctl_handler_set, disk_handler); DATA_SET(linux_ioctl_handler_set, socket_handler); @@ -1473,6 +1477,13 @@ return (error); } +static int +linux_ioctl_vfat(struct thread *td, struct linux_ioctl_args *args) +{ + + return (ENOIOCTL); +} + /* * Sound related ioctls */ @@ -1559,6 +1570,10 @@ int version = linux_get_oss_version(td->td_proc); return (copyout(&version, (caddr_t)args->arg, sizeof(int))); } + + case LINUX_SOUND_MIXER_READ_STEREODEVS: + args->cmd = SOUND_MIXER_READ_STEREODEVS; + return (ioctl(td, (struct ioctl_args *)args)); case LINUX_SOUND_MIXER_READ_DEVMASK: args->cmd = SOUND_MIXER_READ_DEVMASK; Index: compat/linux/linux_ioctl.h =================================================================== RCS file: /home/ncvs/src/sys/compat/linux/linux_ioctl.h,v retrieving revision 1.14 diff -d -u -r1.14 linux_ioctl.h --- compat/linux/linux_ioctl.h 20 Sep 2002 19:19:58 -0000 1.14 +++ compat/linux/linux_ioctl.h 8 Oct 2002 10:49:54 -0000 @@ -120,6 +120,14 @@ #define LINUX_DVD_HOST_SEND_RPC_STATE 11 /* + * VFAT + */ +#define LINUX_VFAT_READDIR_BOTH 0x7201 + +#define LINUX_IOCTL_VFAT_MIN LINUX_VFAT_READDIR_BOTH +#define LINUX_IOCTL_VFAT_MAX LINUX_VFAT_READDIR_BOTH + +/* * console */ #define LINUX_KIOCSOUND 0x4B2F @@ -210,6 +218,7 @@ #define LINUX_SOUND_MIXER_WRITE_LINE2 0x4d0F #define LINUX_SOUND_MIXER_WRITE_LINE3 0x4d10 #define LINUX_OSS_GETVERSION 0x4d76 +#define LINUX_SOUND_MIXER_READ_STEREODEVS 0x4dfb #define LINUX_SOUND_MIXER_READ_DEVMASK 0x4dfe #define LINUX_SOUND_MIXER_WRITE_RECSRC 0x4dff #define LINUX_SNDCTL_DSP_RESET 0x5000 Index: compat/linux/linux_ipc.c =================================================================== RCS file: /home/ncvs/src/sys/compat/linux/linux_ipc.c,v retrieving revision 1.30 diff -d -u -r1.30 linux_ipc.c --- compat/linux/linux_ipc.c 2 Jun 2002 20:05:42 -0000 1.30 +++ compat/linux/linux_ipc.c 8 Oct 2002 10:49:54 -0000 @@ -35,8 +35,11 @@ #include #include +#include + #include #include +#include #include #include @@ -126,6 +129,22 @@ lpp->seq = bpp->seq; } +struct l_msqid_ds { + struct l_ipc_perm msg_perm; + struct l_msg *msg_first; /* first message on queue,unused */ + struct l_msg *msg_last; /* last message in queue,unused */ + l_time_t msg_stime; /* last msgsnd time */ + l_time_t msg_rtime; /* last msgrcv time */ + l_time_t msg_ctime; /* last change time */ + l_ulong msg_lcbytes; /* Reuse junk fields for 32 bit */ + l_ulong msg_lqbytes; /* ditto */ + l_ushort msg_cbytes; /* current number of bytes on queue */ + l_ushort msg_qnum; /* number of messages in queue */ + l_ushort msg_qbytes; /* max number of bytes on queue */ + l_pid_t msg_lspid; /* pid of last msgsnd */ + l_pid_t msg_lrpid; /* last receive pid */ +}; + struct l_semid_ds { struct l_ipc_perm sem_perm; l_time_t sem_otime; @@ -199,6 +218,195 @@ lsp->private3 = bsp->shm_internal; /* this goes (yet) SOS */ } +static void +linux_ipc_perm_to_ipc64_perm(struct l_ipc_perm *in, struct l_ipc64_perm *out) +{ + + /* XXX: do we really need to do something here? */ + out->key = in->key; + out->uid = in->uid; + out->gid = in->gid; + out->cuid = in->cuid; + out->cgid = in->cgid; + out->mode = in->mode; + out->seq = in->seq; +} + +static int +linux_msqid_pullup(l_int ver, struct l_msqid_ds *linux_msqid, caddr_t uaddr) +{ + struct l_msqid64_ds linux_msqid64; + int error; + + if (ver == LINUX_IPC_64) { + error = copyin(uaddr, &linux_msqid64, sizeof(linux_msqid64)); + if (error != 0) + return (error); + + bzero(linux_msqid, sizeof(*linux_msqid)); + + linux_msqid->msg_perm.uid = linux_msqid64.msg_perm.uid; + linux_msqid->msg_perm.gid = linux_msqid64.msg_perm.gid; + linux_msqid->msg_perm.mode = linux_msqid64.msg_perm.mode; + + if (linux_msqid64.msg_qbytes > USHRT_MAX) + linux_msqid->msg_lqbytes = linux_msqid64.msg_qbytes; + else + linux_msqid->msg_qbytes = linux_msqid64.msg_qbytes; + } else { + error = copyin(uaddr, linux_msqid, sizeof(*linux_msqid)); + } + return (error); +} + +static int +linux_msqid_pushdown(l_int ver, struct l_msqid_ds *linux_msqid, caddr_t uaddr) +{ + struct l_msqid64_ds linux_msqid64; + + if (ver == LINUX_IPC_64) { + bzero(&linux_msqid64, sizeof(linux_msqid64)); + + linux_ipc_perm_to_ipc64_perm(&linux_msqid->msg_perm, + &linux_msqid64.msg_perm); + + linux_msqid64.msg_stime = linux_msqid->msg_stime; + linux_msqid64.msg_rtime = linux_msqid->msg_rtime; + linux_msqid64.msg_ctime = linux_msqid->msg_ctime; + + if (linux_msqid->msg_cbytes == 0) + linux_msqid64.msg_cbytes = linux_msqid->msg_lcbytes; + else + linux_msqid64.msg_cbytes = linux_msqid->msg_cbytes; + + linux_msqid64.msg_qnum = linux_msqid->msg_qnum; + + if (linux_msqid->msg_qbytes == 0) + linux_msqid64.msg_qbytes = linux_msqid->msg_lqbytes; + else + linux_msqid64.msg_qbytes = linux_msqid->msg_qbytes; + + linux_msqid64.msg_lspid = linux_msqid->msg_lspid; + linux_msqid64.msg_lrpid = linux_msqid->msg_lrpid; + + return (copyout(&linux_msqid64, uaddr, sizeof(linux_msqid64))); + } else { + return (copyout(linux_msqid, uaddr, sizeof(*linux_msqid))); + } +} + +static int +linux_semid_pullup(l_int ver, struct l_semid_ds *linux_semid, caddr_t uaddr) +{ + struct l_semid64_ds linux_semid64; + int error; + + if (ver == LINUX_IPC_64) { + error = copyin(uaddr, &linux_semid64, sizeof(linux_semid64)); + if (error != 0) + return (error); + + bzero(linux_semid, sizeof(*linux_semid)); + + linux_semid->sem_perm.uid = linux_semid64.sem_perm.uid; + linux_semid->sem_perm.gid = linux_semid64.sem_perm.gid; + linux_semid->sem_perm.mode = linux_semid64.sem_perm.mode; + } else { + error = copyin(uaddr, linux_semid, sizeof(*linux_semid)); + } + return (error); +} + +static int +linux_semid_pushdown(l_int ver, struct l_semid_ds *linux_semid, caddr_t uaddr) +{ + struct l_semid64_ds linux_semid64; + + if (ver == LINUX_IPC_64) { + bzero(&linux_semid64, sizeof(linux_semid64)); + + linux_ipc_perm_to_ipc64_perm(&linux_semid->sem_perm, + &linux_semid64.sem_perm); + + linux_semid64.sem_otime = linux_semid->sem_otime; + linux_semid64.sem_ctime = linux_semid->sem_ctime; + linux_semid64.sem_nsems = linux_semid->sem_nsems; + + return (copyout(&linux_semid64, uaddr, sizeof(linux_semid64))); + } else { + return (copyout(linux_semid, uaddr, sizeof(*linux_semid))); + } +} + +static int +linux_shmid_pullup(l_int ver, struct l_shmid_ds *linux_shmid, caddr_t uaddr) +{ + struct l_shmid64_ds linux_shmid64; + int error; + + if (ver == LINUX_IPC_64) { + error = copyin(uaddr, &linux_shmid64, sizeof(linux_shmid64)); + if (error != 0) + return (error); + + bzero(linux_shmid, sizeof(*linux_shmid)); + + linux_shmid->shm_perm.uid = linux_shmid64.shm_perm.uid; + linux_shmid->shm_perm.gid = linux_shmid64.shm_perm.gid; + linux_shmid->shm_perm.mode = linux_shmid64.shm_perm.mode; + } else { + error = copyin(uaddr, linux_shmid, sizeof(*linux_shmid)); + } + return (error); +} + +static int +linux_shmid_pushdown(l_int ver, struct l_shmid_ds *linux_shmid, caddr_t uaddr) +{ + struct l_shmid64_ds linux_shmid64; + + if (ver == LINUX_IPC_64) { + bzero(&linux_shmid64, sizeof(linux_shmid64)); + + linux_ipc_perm_to_ipc64_perm(&linux_shmid->shm_perm, + &linux_shmid64.shm_perm); + + linux_shmid64.shm_segsz = linux_shmid->shm_segsz; + linux_shmid64.shm_atime = linux_shmid->shm_atime; + linux_shmid64.shm_dtime = linux_shmid->shm_dtime; + linux_shmid64.shm_ctime = linux_shmid->shm_ctime; + linux_shmid64.shm_cpid = linux_shmid->shm_cpid; + linux_shmid64.shm_lpid = linux_shmid->shm_lpid; + linux_shmid64.shm_nattch = linux_shmid->shm_nattch; + + return (copyout(&linux_shmid64, uaddr, sizeof(linux_shmid64))); + } else { + return (copyout(linux_shmid, uaddr, sizeof(*linux_shmid))); + } +} + +static int +linux_shminfo_pushdown(l_int ver, struct l_shminfo *linux_shminfo, + caddr_t uaddr) +{ + struct l_shminfo64 linux_shminfo64; + + if (ver == LINUX_IPC_64) { + bzero(&linux_shminfo64, sizeof(linux_shminfo64)); + + linux_shminfo64.shmmax = linux_shminfo->shmmax; + linux_shminfo64.shmmin = linux_shminfo->shmmin; + linux_shminfo64.shmmni = linux_shminfo->shmmni; + linux_shminfo64.shmseg = linux_shminfo->shmseg; + linux_shminfo64.shmall = linux_shminfo->shmall; + + return (copyout(&linux_shminfo64, uaddr, + sizeof(linux_shminfo64))); + } else { + return (copyout(linux_shminfo, uaddr, sizeof(*linux_shminfo))); + } +} + int linux_semop(struct thread *td, struct linux_semop_args *args) { @@ -254,7 +462,7 @@ bsd_args.semnum = args->semnum; bsd_args.arg = unptr; - switch (args->cmd) { + switch (args->cmd & ~LINUX_IPC_64) { case LINUX_IPC_RMID: bsd_args.cmd = IPC_RMID; break; @@ -275,8 +483,8 @@ break; case LINUX_IPC_SET: bsd_args.cmd = IPC_SET; - error = copyin((caddr_t)args->arg.buf, &linux_semid, - sizeof(linux_semid)); + error = linux_semid_pullup(args->cmd & LINUX_IPC_64, + &linux_semid, (caddr_t)args->arg.buf); if (error) return (error); unptr->buf = stackgap_alloc(&sg, sizeof(struct semid_ds)); @@ -284,7 +492,7 @@ return __semctl(td, &bsd_args); case LINUX_IPC_STAT: case LINUX_SEM_STAT: - if( args->cmd == LINUX_IPC_STAT ) + if((args->cmd & ~LINUX_IPC_64) == LINUX_IPC_STAT) bsd_args.cmd = IPC_STAT; else bsd_args.cmd = SEM_STAT; @@ -295,14 +503,10 @@ td->td_retval[0] = IXSEQ_TO_IPCID(bsd_args.semid, unptr->buf->sem_perm); bsd_to_linux_semid_ds(unptr->buf, &linux_semid); - return copyout(&linux_semid, (caddr_t)args->arg.buf, - sizeof(linux_semid)); + return (linux_semid_pushdown(args->cmd & LINUX_IPC_64, + &linux_semid, (caddr_t)args->arg.buf)); case LINUX_IPC_INFO: case LINUX_SEM_INFO: - error = copyin((caddr_t)args->arg.buf, &linux_seminfo, - sizeof(linux_seminfo) ); - if (error) - return error; bcopy(&seminfo, &linux_seminfo, sizeof(linux_seminfo) ); /* XXX BSD equivalent? #define used_semids 10 @@ -321,7 +525,8 @@ case LINUX_SETALL: /* FALLTHROUGH */ default: - uprintf("linux: 'ipc' typ=%d not implemented\n", args->cmd); + uprintf("linux: 'ipc' typ=%d not implemented\n", + args->cmd & ~LINUX_IPC_64); return EINVAL; } return __semctl(td, &bsd_args); @@ -385,12 +590,28 @@ struct msqid_ds *buf; } */ bsd_args; int error; + caddr_t sg = stackgap_init(); + bsd_args.buf = (struct msqid_ds*)stackgap_alloc(&sg, + sizeof(struct l_msqid_ds)); + error = linux_msqid_pullup(args->cmd & LINUX_IPC_64, + (struct l_msqid_ds *)bsd_args.buf, (caddr_t)args->buf); + if (error != 0) + return (error); bsd_args.msqid = args->msqid; - bsd_args.cmd = args->cmd; - bsd_args.buf = (struct msqid_ds *)args->buf; + bsd_args.cmd = args->cmd & ~LINUX_IPC_64; + error = msgctl(td, &bsd_args); - return ((args->cmd == LINUX_IPC_RMID && error == EINVAL) ? 0 : error); + if (error != 0) + if (bsd_args.cmd != LINUX_IPC_RMID || error != EINVAL) + return (error); + + if (bsd_args.cmd == LINUX_IPC_STAT) { + return (linux_msqid_pushdown(args->cmd & LINUX_IPC_64, + (struct l_msqid_ds *)bsd_args.buf, (caddr_t)args->buf)); + } + + return (0); } int @@ -456,7 +677,7 @@ int error; caddr_t sg = stackgap_init(); - switch (args->cmd) { + switch (args->cmd & ~LINUX_IPC_64) { case LINUX_IPC_INFO: bsd_args.shmid = args->shmid; @@ -465,7 +686,8 @@ if ((error = shmctl(td, &bsd_args))) return error; bsd_to_linux_shminfo( (struct shminfo *)bsd_args.buf, &linux_shminfo ); - return copyout(&linux_shminfo, (caddr_t)args->buf, sizeof(shminfo)); + return (linux_shminfo_pushdown(args->cmd & LINUX_IPC_64, + &linux_shminfo, (caddr_t)args->buf)); case LINUX_SHM_INFO: bsd_args.shmid = args->shmid; @@ -483,7 +705,8 @@ if ((error = shmctl(td, &bsd_args))) return error; bsd_to_linux_shmid_ds(bsd_args.buf, &linux_shmid); - return copyout(&linux_shmid, (caddr_t)args->buf, sizeof(linux_shmid)); + return (linux_shmid_pushdown(args->cmd & LINUX_IPC_64, + &linux_shmid, (caddr_t)args->buf)); case LINUX_SHM_STAT: bsd_args.shmid = args->shmid; @@ -493,11 +716,13 @@ return error; } bsd_to_linux_shmid_ds(bsd_args.buf, &linux_shmid); - return copyout(&linux_shmid, (caddr_t)args->buf, sizeof(linux_shmid)); + return (linux_shmid_pushdown(args->cmd & LINUX_IPC_64, + &linux_shmid, (caddr_t)args->buf)); case LINUX_IPC_SET: - if ((error = copyin((caddr_t)args->buf, &linux_shmid, - sizeof(linux_shmid)))) + error = linux_shmid_pullup(args->cmd & LINUX_IPC_64, + &linux_shmid, (caddr_t)args->buf); + if (error != 0) return error; bsd_args.buf = (struct shmid_ds*)stackgap_alloc(&sg, sizeof(struct shmid_ds)); linux_to_bsd_shmid_ds(&linux_shmid, bsd_args.buf); @@ -511,8 +736,9 @@ if (args->buf == NULL) bsd_args.buf = NULL; else { - if ((error = copyin((caddr_t)args->buf, &linux_shmid, - sizeof(linux_shmid)))) + error = linux_shmid_pullup(args->cmd & LINUX_IPC_64, + &linux_shmid, (caddr_t)args->buf); + if (error != 0) return error; bsd_args.buf = (struct shmid_ds*)stackgap_alloc(&sg, sizeof(struct shmid_ds)); linux_to_bsd_shmid_ds(&linux_shmid, bsd_args.buf); @@ -522,7 +748,8 @@ case LINUX_SHM_LOCK: case LINUX_SHM_UNLOCK: default: - uprintf("linux: 'ipc' typ=%d not implemented\n", args->cmd); + uprintf("linux: 'ipc' typ=%d not implemented\n", + args->cmd & ~LINUX_IPC_64); return EINVAL; } } Index: compat/linux/linux_ipc.h =================================================================== RCS file: /home/ncvs/src/sys/compat/linux/linux_ipc.h,v retrieving revision 1.8 diff -d -u -r1.8 linux_ipc.h --- compat/linux/linux_ipc.h 20 Mar 2002 05:42:02 -0000 1.8 +++ compat/linux/linux_ipc.h 8 Oct 2002 10:49:54 -0000 @@ -31,6 +31,15 @@ #ifndef _LINUX_IPC_H_ #define _LINUX_IPC_H_ +/* + * Version flags for semctl, msgctl, and shmctl commands + * These are passed as bitflags or-ed with the actual command + */ +#define LINUX_IPC_OLD 0 /* Old version (no 32-bit UID support on many + architectures) */ +#define LINUX_IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger + message sizes, etc. */ + #ifdef __i386__ struct linux_msgctl_args Index: i386/linux/linux_dummy.c =================================================================== RCS file: /home/ncvs/src/sys/i386/linux/linux_dummy.c,v retrieving revision 1.34 diff -d -u -r1.34 linux_dummy.c --- i386/linux/linux_dummy.c 2 Jun 2002 20:05:51 -0000 1.34 +++ i386/linux/linux_dummy.c 8 Oct 2002 10:49:54 -0000 @@ -63,9 +63,7 @@ DUMMY(capget); DUMMY(capset); DUMMY(sendfile); -DUMMY(mmap2); DUMMY(truncate64); -DUMMY(ftruncate64); DUMMY(setfsuid); DUMMY(setfsgid); DUMMY(pivot_root); Index: i386/linux/linux_ipc64.h =================================================================== RCS file: i386/linux/linux_ipc64.h diff -N i386/linux/linux_ipc64.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ i386/linux/linux_ipc64.h 8 Oct 2002 10:49:54 -0000 @@ -0,0 +1,145 @@ +/*- + * Copyright (c) 2002 Maxim Sobolev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _I386_LINUX_LINUX_IPC64_H_ +#define _I386_LINUX_LINUX_IPC64_H_ + +/* + * The ipc64_perm structure for i386 architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 32-bit mode_t and seq + * - 2 miscellaneous 32-bit values + */ + +struct l_ipc64_perm +{ + l_key_t key; + l_uid_t uid; + l_gid_t gid; + l_uid_t cuid; + l_gid_t cgid; + l_mode_t mode; + l_ushort __pad1; + l_ushort seq; + l_ushort __pad2; + l_ulong __unused1; + l_ulong __unused2; +}; + +/* + * The msqid64_ds structure for i386 architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 64-bit time_t to solve y2038 problem + * - 2 miscellaneous 32-bit values + */ + +struct l_msqid64_ds { + struct l_ipc64_perm msg_perm; + l_time_t msg_stime; /* last msgsnd time */ + l_ulong __unused1; + l_time_t msg_rtime; /* last msgrcv time */ + l_ulong __unused2; + l_time_t msg_ctime; /* last change time */ + l_ulong __unused3; + l_ulong msg_cbytes; /* current number of bytes on queue */ + l_ulong msg_qnum; /* number of messages in queue */ + l_ulong msg_qbytes; /* max number of bytes on queue */ + l_pid_t msg_lspid; /* pid of last msgsnd */ + l_pid_t msg_lrpid; /* last receive pid */ + l_ulong __unused4; + l_ulong __unused5; +}; + +/* + * The semid64_ds structure for i386 architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 64-bit time_t to solve y2038 problem + * - 2 miscellaneous 32-bit values + */ + +struct l_semid64_ds { + struct l_ipc64_perm sem_perm; /* permissions */ + l_time_t sem_otime; /* last semop time */ + l_ulong __unused1; + l_time_t sem_ctime; /* last change time */ + l_ulong __unused2; + l_ulong sem_nsems; /* no. of semaphores in array */ + l_ulong __unused3; + l_ulong __unused4; +}; + +/* + * The shmid64_ds structure for i386 architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 64-bit time_t to solve y2038 problem + * - 2 miscellaneous 32-bit values + */ + +struct l_shmid64_ds { + struct l_ipc64_perm shm_perm; /* operation perms */ + l_size_t shm_segsz; /* size of segment (bytes) */ + l_time_t shm_atime; /* last attach time */ + l_ulong __unused1; + l_time_t shm_dtime; /* last detach time */ + l_ulong __unused2; + l_time_t shm_ctime; /* last change time */ + l_ulong __unused3; + l_pid_t shm_cpid; /* pid of creator */ + l_pid_t shm_lpid; /* pid of last operator */ + l_ulong shm_nattch; /* no. of current attaches */ + l_ulong __unused4; + l_ulong __unused5; +}; + +struct l_shminfo64 { + l_ulong shmmax; + l_ulong shmmin; + l_ulong shmmni; + l_ulong shmseg; + l_ulong shmall; + l_ulong __unused1; + l_ulong __unused2; + l_ulong __unused3; + l_ulong __unused4; +}; + +#endif /* !_I386_LINUX_LINUX_IPC64_H_ */ Index: i386/linux/linux_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/linux/linux_machdep.c,v retrieving revision 1.30 diff -d -u -r1.30 linux_machdep.c --- i386/linux/linux_machdep.c 2 Oct 2002 07:44:22 -0000 1.30 +++ i386/linux/linux_machdep.c 8 Oct 2002 10:49:54 -0000 @@ -385,19 +385,33 @@ #define STACK_SIZE (2 * 1024 * 1024) #define GUARD_SIZE (4 * PAGE_SIZE) +static int linux_mmap_common(struct thread *, struct l_mmap_argv *); + +int +linux_mmap2(struct thread *td, struct linux_mmap2_args *args) +{ + struct l_mmap_argv linux_args; + +#ifdef DEBUG + if (ldebug(mmap2)) + printf(ARGS(mmap2, "%p, %d, %d, 0x%08x, %d, %d"), + (void *)args->addr, args->len, args->prot, + args->flags, args->fd, args->pgoff); +#endif + + linux_args.addr = (l_caddr_t)args->addr; + linux_args.len = args->len; + linux_args.prot = args->prot; + linux_args.flags = args->flags; + linux_args.fd = args->fd; + linux_args.pos = args->pgoff * PAGE_SIZE; + + return (linux_mmap_common(td, &linux_args)); +} + int linux_mmap(struct thread *td, struct linux_mmap_args *args) { - struct proc *p = td->td_proc; - struct mmap_args /* { - caddr_t addr; - size_t len; - int prot; - int flags; - int fd; - long pad; - off_t pos; - } */ bsd_args; int error; struct l_mmap_argv linux_args; @@ -408,22 +422,39 @@ #ifdef DEBUG if (ldebug(mmap)) printf(ARGS(mmap, "%p, %d, %d, 0x%08x, %d, %d"), - (void *)linux_args.addr, linux_args.len, linux_args.prot, - linux_args.flags, linux_args.fd, linux_args.pos); + (void *)linux_args->addr, linux_args->len, linux_args->prot, + linux_args->flags, linux_args->fd, linux_args->pos); #endif + return (linux_mmap_common(td, &linux_args)); +} + +static int +linux_mmap_common(struct thread *td, struct l_mmap_argv *linux_args) +{ + struct proc *p = td->td_proc; + struct mmap_args /* { + caddr_t addr; + size_t len; + int prot; + int flags; + int fd; + long pad; + off_t pos; + } */ bsd_args; + bsd_args.flags = 0; - if (linux_args.flags & LINUX_MAP_SHARED) + if (linux_args->flags & LINUX_MAP_SHARED) bsd_args.flags |= MAP_SHARED; - if (linux_args.flags & LINUX_MAP_PRIVATE) + if (linux_args->flags & LINUX_MAP_PRIVATE) bsd_args.flags |= MAP_PRIVATE; - if (linux_args.flags & LINUX_MAP_FIXED) + if (linux_args->flags & LINUX_MAP_FIXED) bsd_args.flags |= MAP_FIXED; - if (linux_args.flags & LINUX_MAP_ANON) + if (linux_args->flags & LINUX_MAP_ANON) bsd_args.flags |= MAP_ANON; else bsd_args.flags |= MAP_NOSYNC; - if (linux_args.flags & LINUX_MAP_GROWSDOWN) { + if (linux_args->flags & LINUX_MAP_GROWSDOWN) { bsd_args.flags |= MAP_STACK; /* The linux MAP_GROWSDOWN option does not limit auto @@ -448,7 +479,7 @@ */ /* This gives us TOS */ - bsd_args.addr = linux_args.addr + linux_args.len; + bsd_args.addr = linux_args->addr + linux_args->len; if (bsd_args.addr > p->p_vmspace->vm_maxsaddr) { /* Some linux apps will attempt to mmap @@ -472,8 +503,8 @@ } /* This gives us our maximum stack size */ - if (linux_args.len > STACK_SIZE - GUARD_SIZE) - bsd_args.len = linux_args.len; + if (linux_args->len > STACK_SIZE - GUARD_SIZE) + bsd_args.len = linux_args->len; else bsd_args.len = STACK_SIZE - GUARD_SIZE; @@ -485,16 +516,16 @@ */ bsd_args.addr -= bsd_args.len; } else { - bsd_args.addr = linux_args.addr; - bsd_args.len = linux_args.len; + bsd_args.addr = linux_args->addr; + bsd_args.len = linux_args->len; } - bsd_args.prot = linux_args.prot | PROT_READ; /* always required */ - if (linux_args.flags & LINUX_MAP_ANON) + bsd_args.prot = linux_args->prot | PROT_READ; /* always required */ + if (linux_args->flags & LINUX_MAP_ANON) bsd_args.fd = -1; else - bsd_args.fd = linux_args.fd; - bsd_args.pos = linux_args.pos; + bsd_args.fd = linux_args->fd; + bsd_args.pos = linux_args->pos; bsd_args.pad = 0; #ifdef DEBUG @@ -775,4 +806,20 @@ } return (error); +} + +int +linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args) +{ + struct ftruncate_args sa; + +#ifdef DEBUG + if (ldebug(ftruncate64)) + printf(ARGS(ftruncate64, "%d, %d"), args->fd, args->length); +#endif + + sa.fd = args->fd; + sa.pad = 0; + sa.length = args->length; + return ftruncate(td, &sa); } Index: alpha/linux/linux_ipc64.h =================================================================== RCS file: alpha/linux/linux_ipc64.h diff -N alpha/linux/linux_ipc64.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ alpha/linux/linux_ipc64.h 8 Oct 2002 10:49:54 -0000 @@ -0,0 +1,133 @@ +/*- + * Copyright (c) 2002 Maxim Sobolev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ALPHA_LINUX_LINUX_IPC64_H_ +#define _ALPHA_LINUX_LINUX_IPC64_H_ + +/* + * The ipc64_perm structure for alpha architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 32-bit seq + * - 2 miscellaneous 64-bit values + */ + +struct l_ipc64_perm +{ + l_key_t key; + l_uid_t uid; + l_gid_t gid; + l_uid_t cuid; + l_gid_t cgid; + l_mode_t mode; + l_ushort seq; + l_ushort __pad1; + l_ulong __unused1; + l_ulong __unused2; +}; + +/* + * The msqid64_ds structure for alpha architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 2 miscellaneous 64-bit values + */ + +struct l_msqid64_ds { + struct l_ipc64_perm msg_perm; + l_time_t msg_stime; /* last msgsnd time */ + l_time_t msg_rtime; /* last msgrcv time */ + l_time_t msg_ctime; /* last change time */ + l_ulong msg_cbytes; /* current number of bytes on queue */ + l_ulong msg_qnum; /* number of messages in queue */ + l_ulong msg_qbytes; /* max number of bytes on queue */ + l_pid_t msg_lspid; /* pid of last msgsnd */ + l_pid_t msg_lrpid; /* last receive pid */ + l_ulong __unused1; + l_ulong __unused2; +}; + +/* + * The semid64_ds structure for alpha architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 2 miscellaneous 64-bit values + */ + +struct l_semid64_ds { + struct l_ipc64_perm sem_perm; /* permissions */ + l_time_t sem_otime; /* last semop time */ + l_time_t sem_ctime; /* last change time */ + l_ulong sem_nsems; /* no. of semaphores in array */ + l_ulong __unused1; + l_ulong __unused2; +}; + +/* + * The shmid64_ds structure for alpha architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 2 miscellaneous 64-bit values + */ + +struct l_shmid64_ds { + struct l_ipc64_perm shm_perm; /* operation perms */ + l_size_t shm_segsz; /* size of segment (bytes) */ + l_time_t shm_atime; /* last attach time */ + l_time_t shm_dtime; /* last detach time */ + l_time_t shm_ctime; /* last change time */ + l_pid_t shm_cpid; /* pid of creator */ + l_pid_t shm_lpid; /* pid of last operator */ + l_ulong shm_nattch; /* no. of current attaches */ + l_ulong __unused1; + l_ulong __unused2; +}; + +struct l_shminfo64 { + l_ulong shmmax; + l_ulong shmmin; + l_ulong shmmni; + l_ulong shmseg; + l_ulong shmall; + l_ulong __unused1; + l_ulong __unused2; + l_ulong __unused3; + l_ulong __unused4; +}; + +#endif /* !_ALPHA_LINUX_LINUX_IPC64_H_ */ --------------2C056B357B94AA92275BD099-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Tue Oct 8 18: 1:24 2002 Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2667B37B401; Tue, 8 Oct 2002 18:01:23 -0700 (PDT) Received: from kayak.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id D038F43E65; Tue, 8 Oct 2002 18:01:21 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by kayak.xcllnt.net (8.11.6/8.11.4) with ESMTP id g9911Lt95374; Tue, 8 Oct 2002 18:01:21 -0700 (PDT) (envelope-from marcel@kayak.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.6/8.12.6) with ESMTP id g9913FIS000676; Tue, 8 Oct 2002 18:03:15 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.6/8.12.6/Submit) id g99139ic000675; Tue, 8 Oct 2002 18:03:09 -0700 (PDT) Date: Tue, 8 Oct 2002 18:03:09 -0700 From: Marcel Moolenaar To: Maxim Sobolev Cc: Alfred Perlstein , emulation@FreeBSD.org, audit@FreeBSD.org Subject: Re: Linuxlator patches for review [was: Who currently maintains Linuxlator?] Message-ID: <20021009010309.GA607@dhcp01.pn.xcllnt.net> References: <20021006110243.GA70993@vega.vega.com> <20021006183650.GY95327@elvis.mu.org> <3DA2BE32.BDEC28B5@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3DA2BE32.BDEC28B5@FreeBSD.org> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Tue, Oct 08, 2002 at 02:14:58PM +0300, Maxim Sobolev wrote: > See attached. As it was suggested, I'm also CC'ing marcel, > freebsd-audit and freebsd-emulation. I'd like to hear any suggestion > or comments. Please note that changes were not tested on alpha, > because I don't have any axp hardware. I can test on Alpha, provided the patch is against -current. Do you have some test cases? > /* > + * VFAT > + */ > +#define LINUX_VFAT_READDIR_BOTH 0x7201 > + > +#define LINUX_IOCTL_VFAT_MIN LINUX_VFAT_READDIR_BOTH > +#define LINUX_IOCTL_VFAT_MAX LINUX_VFAT_READDIR_BOTH > + > +/* Silly question: The VFAT ioctl is not implemented. Is there a bigger picture? Also: is it worth having a VFAT handler if there's only 1 ioctl (again, there might be a bigger picture)? > case LINUX_IPC_INFO: > case LINUX_SEM_INFO: > - error = copyin((caddr_t)args->arg.buf, &linux_seminfo, > - sizeof(linux_seminfo) ); > - if (error) > - return error; > bcopy(&seminfo, &linux_seminfo, sizeof(linux_seminfo) ); > /* XXX BSD equivalent? > #define used_semids 10 Should the copyin be replaced with something or was the copyin bogus? Other than that: looks good. I merely skimmed over it, so I may have missed a detail.... -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Wed Oct 9 0:29:55 2002 Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 088BF37B411; Wed, 9 Oct 2002 00:29:51 -0700 (PDT) Received: from baraca.united.net.ua (ns.united.net.ua [193.111.8.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F9A143EAC; Wed, 9 Oct 2002 00:29:43 -0700 (PDT) (envelope-from max@vega.com) Received: from vega.vega.com (xDSL-2-2.united.net.ua [193.111.9.226]) by baraca.united.net.ua (8.11.6/8.11.6) with ESMTP id g997TNg07866; Wed, 9 Oct 2002 10:29:24 +0300 (EEST) (envelope-from max@vega.com) Received: from vega.vega.com (max@localhost [127.0.0.1]) by vega.vega.com (8.12.6/8.12.5) with ESMTP id g997TKTs081308; Wed, 9 Oct 2002 10:29:20 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Received: (from max@localhost) by vega.vega.com (8.12.6/8.12.5/Submit) id g997TG4h081307; Wed, 9 Oct 2002 10:29:16 +0300 (EEST) Date: Wed, 9 Oct 2002 10:29:16 +0300 From: Maxim Sobolev To: Marcel Moolenaar Cc: Alfred Perlstein , emulation@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: Linuxlator patches for review [was: Who currently maintains Linuxlator?] Message-ID: <20021009072916.GA81270@vega.vega.com> References: <20021006110243.GA70993@vega.vega.com> <20021006183650.GY95327@elvis.mu.org> <3DA2BE32.BDEC28B5@FreeBSD.org> <20021009010309.GA607@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20021009010309.GA607@dhcp01.pn.xcllnt.net> User-Agent: Mutt/1.4i Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Tue, Oct 08, 2002 at 06:03:09PM -0700, Marcel Moolenaar wrote: > On Tue, Oct 08, 2002 at 02:14:58PM +0300, Maxim Sobolev wrote: > > See attached. As it was suggested, I'm also CC'ing marcel, > > freebsd-audit and freebsd-emulation. I'd like to hear any suggestion > > or comments. Please note that changes were not tested on alpha, > > because I don't have any axp hardware. > > I can test on Alpha, provided the patch is against -current. Do you > have some test cases? Unfortunately no, I don't have any test cases. However it should be OK to only check that the code actually compiles on alpha and existing apps still work fine. > > /* > > + * VFAT > > + */ > > +#define LINUX_VFAT_READDIR_BOTH 0x7201 > > + > > +#define LINUX_IOCTL_VFAT_MIN LINUX_VFAT_READDIR_BOTH > > +#define LINUX_IOCTL_VFAT_MAX LINUX_VFAT_READDIR_BOTH > > + > > +/* > > Silly question: The VFAT ioctl is not implemented. Is there a bigger > picture? > Also: is it worth having a VFAT handler if there's only 1 ioctl (again, > there might be a bigger picture)? I've added it just to avoid bogus "ioctl not implemented" kernel messages, which slows down a machine quite a bit. It should be OK, because VFAT ioctl doesn't make sense for UFS (on FreeBSD) or extfs (on Linux) anyway. > > > case LINUX_IPC_INFO: > > case LINUX_SEM_INFO: > > - error = copyin((caddr_t)args->arg.buf, &linux_seminfo, > > - sizeof(linux_seminfo) ); > > - if (error) > > - return error; > > bcopy(&seminfo, &linux_seminfo, sizeof(linux_seminfo) ); > > /* XXX BSD equivalent? > > #define used_semids 10 > > > Should the copyin be replaced with something or was the copyin bogus? > > Other than that: looks good. I merely skimmed over it, so I may have > missed a detail.... There is no point to do copyin(), because this particular system call doesn't use information from user supplied buffer, but fills this buffer with information instead. I've figured out this from reading Linux kernel sources. -Maxim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Wed Oct 9 19:11:48 2002 Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA70737B401; Wed, 9 Oct 2002 19:11:46 -0700 (PDT) Received: from kayak.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id A125843E65; Wed, 9 Oct 2002 19:11:45 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by kayak.xcllnt.net (8.12.6/8.12.6) with ESMTP id g9A2Bj0N006634; Wed, 9 Oct 2002 19:11:45 -0700 (PDT) (envelope-from marcel@kayak.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.6/8.12.6) with ESMTP id g9A2Dfj3000727; Wed, 9 Oct 2002 19:13:41 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.6/8.12.6/Submit) id g9A2DeWF000726; Wed, 9 Oct 2002 19:13:40 -0700 (PDT) Date: Wed, 9 Oct 2002 19:13:40 -0700 From: Marcel Moolenaar To: Maxim Sobolev Cc: Alfred Perlstein , emulation@FreeBSD.ORG, audit@FreeBSD.ORG Subject: Re: Linuxlator patches for review [was: Who currently maintains Linuxlator?] Message-ID: <20021010021340.GA656@dhcp01.pn.xcllnt.net> References: <20021006110243.GA70993@vega.vega.com> <20021006183650.GY95327@elvis.mu.org> <3DA2BE32.BDEC28B5@FreeBSD.org> <20021009010309.GA607@dhcp01.pn.xcllnt.net> <20021009072916.GA81270@vega.vega.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021009072916.GA81270@vega.vega.com> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Wed, Oct 09, 2002 at 10:29:16AM +0300, Maxim Sobolev wrote: > On Tue, Oct 08, 2002 at 06:03:09PM -0700, Marcel Moolenaar wrote: > > On Tue, Oct 08, 2002 at 02:14:58PM +0300, Maxim Sobolev wrote: > > > See attached. As it was suggested, I'm also CC'ing marcel, > > > freebsd-audit and freebsd-emulation. I'd like to hear any suggestion > > > or comments. Please note that changes were not tested on alpha, > > > because I don't have any axp hardware. > > > > I can test on Alpha, provided the patch is against -current. Do you > > have some test cases? > > Unfortunately no, I don't have any test cases. However it should be > OK to only check that the code actually compiles on alpha and existing > apps still work fine. It compiles cleanly and loads on Alpha. I'm happy... > > > + * VFAT > > > + */ > > > +#define LINUX_VFAT_READDIR_BOTH 0x7201 > > > + > > > +#define LINUX_IOCTL_VFAT_MIN LINUX_VFAT_READDIR_BOTH > > > +#define LINUX_IOCTL_VFAT_MAX LINUX_VFAT_READDIR_BOTH > > > + > > > +/* > > > > Silly question: The VFAT ioctl is not implemented. Is there a bigger > > picture? > > Also: is it worth having a VFAT handler if there's only 1 ioctl (again, > > there might be a bigger picture)? > > I've added it just to avoid bogus "ioctl not implemented" kernel messages, > which slows down a machine quite a bit. It should be OK, because VFAT ioctl > doesn't make sense for UFS (on FreeBSD) or extfs (on Linux) anyway. Hmmm.... That sort of defeats the purpose of the message and we do have msdosfs (not that it has the support yet). The intend is that people get annoyed enough to actually implement missing functionality... If you keep it, please rename LINUX_VFAT_READDIR_BOTH to LINUX_VFAT_IOCTL_READDIR_BOTH to match the name used in the Linux sources (better cross reference). -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Fri Oct 11 7: 7:23 2002 Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EE7537B408; Fri, 11 Oct 2002 07:07:19 -0700 (PDT) Received: from mail.disney.com (mail.disney.com [204.128.192.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1CC2343E88; Fri, 11 Oct 2002 07:07:19 -0700 (PDT) (envelope-from jim@pirzyk.org) Received: from Hermes10.corp.disney.com (hermes10.corp.disney.com [153.7.110.102]) by mail.disney.com (Switch-2.2.0/Switch-2.2.0) with ESMTP id g9BE75514680; Fri, 11 Oct 2002 07:07:05 -0700 (PDT) Received: from [172.30.50.1] by hermes.corp.disney.com with ESMTP; Fri, 11 Oct 2002 07:06:51 -0700 Received: from hermes.fas.fa.disney.com (hermes.fas.fa.disney.com [153.7.113.1]) by pecos.fa.disney.com (8.11.3/8.11.3) with ESMTP id g9BE70j02267; Fri, 11 Oct 2002 07:07:00 -0700 (PDT) Received: from snoopy.fas.fa.disney.com by hermes.fas.fa.disney.com with ESMTP; Fri, 11 Oct 2002 07:06:59 -0700 Content-Type: text/plain; charset="us-ascii" From: Jim Pirzyk To: freebsd-emulation@freebsd.org Subject: -CURRENT running really slow under vmware2 Date: Fri, 11 Oct 2002 07:07:36 -0700 User-Agent: KMail/1.4.3 Cc: freebsd-current@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200210110707.36650.jim@pirzyk.org> Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Does anyone have experience running a recient -CURRENT as a vmware2 guest OS? I have tried -DP1 and a version from this week and both just die a slow death. I first tried to install a=20 4.6.2-RELEASE, and that worked. Then I tried to upgrade the system to -CURRENT via a make world (mergemaster, etc). and the 'make installworld' has not finished after 24 hours. The load goes up to ~ 5 during the install. I have tried this in multi user mode as well as in single user mode, no difference.=20 When I install -DP1 and reboot, the system does the same thing processing= =20 the /etc/rc* scripts and never makes multi user mode. If I boot single user, the fsck has the same problem. - JimP --=20 --- @(#) $Id: dot.signature,v 1.10 2001/05/17 23:38:49 Jim.Pirzyk Exp $ __o jim@pirzyk.org ----------------------------------------------- _'\<,_ =20 (*)/ (*) =20 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Fri Oct 11 8:17:33 2002 Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2A03537B401 for ; Fri, 11 Oct 2002 08:17:32 -0700 (PDT) Received: from smtp7.andrew.cmu.edu (SMTP7.andrew.cmu.edu [128.2.10.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79C9A43E42 for ; Fri, 11 Oct 2002 08:17:31 -0700 (PDT) (envelope-from spork@nyc.rr.com) Received: from nyc.rr.com (GEOFRONT.RES.cmu.edu [128.2.164.132]) by smtp7.andrew.cmu.edu (8.12.3.Beta2/8.12.3.Beta2) with ESMTP id g9BFHTPA029231 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT); Fri, 11 Oct 2002 11:17:29 -0400 Received: (from spork@localhost) by nyc.rr.com (8.12.6/8.12.3/Submit) id g9BFJA7d039716; Fri, 11 Oct 2002 11:19:10 -0400 (EDT) Date: Fri, 11 Oct 2002 11:19:10 -0400 From: Spike Gronim To: freebsd-emulation@freebsd.org, ak@freenet.co.uk Subject: VMware under FreeBSD Message-ID: <20021011111910.A39700@geofront.res.cmu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I'd like to buy VMware and use it on my FreeBSD box. I used an old version of VMware on FreeBSD years ago, but have not paid attention to current developments. The emulators/vmware port is marked broken; does VMware work? If I buy Workstation 3.2, will it work under FreeBSD? Please CC: me as I'm not subscribed to the list. Thanks. -- --Spike Gronim wwg@andrew.cmu.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Fri Oct 11 11:20:27 2002 Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 54DF237B401; Fri, 11 Oct 2002 11:20:26 -0700 (PDT) Received: from rwcrmhc51.attbi.com (rwcrmhc51.attbi.com [204.127.198.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id 020F643E42; Fri, 11 Oct 2002 11:20:22 -0700 (PDT) (envelope-from julian@elischer.org) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc51.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20021011182021.KRS4193.rwcrmhc51.attbi.com@InterJet.elischer.org>; Fri, 11 Oct 2002 18:20:21 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id LAA58572; Fri, 11 Oct 2002 11:18:46 -0700 (PDT) Date: Fri, 11 Oct 2002 11:18:45 -0700 (PDT) From: Julian Elischer To: Jim Pirzyk Cc: freebsd-emulation@freebsd.org, freebsd-current@freebsd.org Subject: Re: -CURRENT running really slow under vmware2 In-Reply-To: <200210110707.36650.jim@pirzyk.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org define the 386' cpu type. it will make it not use some instructins that are not in the original 386. these instructions are also emulated VERY SLOWLY by vmware so not using them speeds up things.. On Fri, 11 Oct 2002, Jim Pirzyk wrote: > Does anyone have experience running a recient -CURRENT as > a vmware2 guest OS? I have tried -DP1 and a version from this > week and both just die a slow death. I first tried to install a > 4.6.2-RELEASE, and that worked. Then I tried to upgrade the > system to -CURRENT via a make world (mergemaster, etc). and > the 'make installworld' has not finished after 24 hours. The load > goes up to ~ 5 during the install. I have tried this in multi user mode > as well as in single user mode, no difference. > > When I install -DP1 and reboot, the system does the same thing processing > the /etc/rc* scripts and never makes multi user mode. If I boot single > user, the fsck has the same problem. > > - JimP > > -- > --- @(#) $Id: dot.signature,v 1.10 2001/05/17 23:38:49 Jim.Pirzyk Exp $ > __o jim@pirzyk.org ----------------------------------------------- > _'\<,_ > (*)/ (*) > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-emulation" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message