On Tue, 6 Nov 2007, Paul Brook wrote:
If you're not careful you get double-copying. Once copying the struct from
guest to host space, and then again when converting layout/endianess.
Yes, it would be easy to do that by mistake. The approach that has been
taken has been to use typed
On Tue, 6 Nov 2007, Fabrice Bellard wrote:
Paul Brook wrote:
[...]
Personally I like the locking interface as it allows a zero-copy
implementation. However the kernel uses a copying interface, and my
understanding is that other qemu maintainers also prefer the copying
interface.
At least I
On Sun, 23 Sep 2007, Thiemo Seufer wrote:
Thayne Harbaugh wrote:
This patch adds the utimensat syscall to linux-user.
Doesn't build:
gcc-3.4 -g -Wl,-T,/home/ths/qemu/qemu-work/ppc.ld -o qemu-arm main.o
syscall.o mmap.o signal.o path.o osdep.o thunk.o elfload.o linuxload.o
flatload.o
On Wed, 19 Sep 2007, J. Mayer wrote:
The idea is great but there seem to be a problem in those patches:
you directly cast syscall arguments, which are (or should be)
target_ulong to pointers in the host environment. You should to use the
g2h / h2g macros to get the pointer in the host memory
On Wed, 19 Sep 2007, J. Mayer wrote:
Then, the changes you've done, changing long arguments (which should be
target_long to be correct, you can take a look at the last patch I sent
on the list) to pointers, for example in function prototypes, are
incorrect.
I just went, and looked at the
On Wed, 19 Sep 2007, Paul Brook wrote:
No. We're doing more than most 32-64 syscall thunks. To a first approximation
the syscall thunks can bindly zero extend all values. In qemu we need to know
whether something is a pointer or a value.
Isn't that was the code in do_syscall() does? or am I
Following this message, are the 11 parts of the patch that implements
EFAULT detection in the linux-user mode. Hopefully, this reflects what
was discussed following the first RFC of this patch. Also, hopefully, it
is easier to digest in smaller pieces like this.
In short, the (un)lock_user*()
This first part contains the additions to the existing infrastructure
needed to implement the new interfaces used in the rest of the patch.
In exec.c, page_check_range() has been added to take an address and a
size and and check to see if it is contained in a valid page that
belongs to the
In this section, the functions for reading and writing fdsets, reading
rusage, and reading and writing timevals have been updated to use the
new kernel like interfaces.
Also, places where these function have been used are adjusted to match,
this includes do_select(), and the do_syscall() code
This part contains the changes to teh socket interfaces. This includes
updates to the functions for reading and writing struct sockaddr, as
well as updates and some fixes to do_setsockopt() and do_getsockopt().
The implementations of bind() connect(), accept(), getpeername() and
getsockname()
This part contains the updates for the semaphore IPC syscalls. In
addition to the changes to use the new APIs, there are also fixes for
some of the semop() and semctl() actions.
Stuart
Stuart R. Anderson [EMAIL PROTECTED]
Network
This part contains the changes to the message queue IPC syscalls. The
functions for reading and writing the msqid_ds structure have been
updated to use the kernel-like APIs. Also, additional checking has been
added to the implementations of msgsnd() and msgrecv().
This part contains the changes to write_ldt() to use the newer APIs.
Stuart
Stuart R. Anderson [EMAIL PROTECTED]
Network Software Engineering http://www.netsweng.com/
1024D/37A79149:
This part updates do_fcntl() to use the new kernel-like APIs.
Stuart
Stuart R. Anderson [EMAIL PROTECTED]
Network Software Engineering http://www.netsweng.com/
1024D/37A79149:
Thsi part updates stat(64)fs and fstat(64)fs implementations to use the
new APIs in a more optimal manner.
Stuart
Stuart R. Anderson [EMAIL PROTECTED]
Network Software Engineering http://www.netsweng.com/
This part contains the rest of the updates to do_syscall() that contain
the changes to the new API for several systcalls, including utime(),
sigaction(), rt_sigaction(), rt_sigpending(), sigsuspend(),
rt_sigtimedwait(), rt_sigqueueinfo(), stat() and stat64().
Last, but not least, this part contains the changes to the function that
read and write iovec structures. This part will require one more pass to
eliminate the inner calls to the old API.
Stuart
Stuart R. Anderson [EMAIL PROTECTED]
At least armel implements discreet IPC calls instead of multiplexing
them through a single syscall. This patch adds support for this.
Stuart
Stuart R. Anderson [EMAIL PROTECTED]
Network Software Engineering
On Tue, 10 Jul 2007, Fabrice Bellard wrote:
I confirm that I expected g2h() to be completely removed in case the Linux
user access API is used.
I agree too that it should not be used. I'm testing ARM on x86_64, and
used it in a few places to clean up some warnings. The real fix is to
change
On Fri, 6 Jul 2007, Stuart Anderson wrote:
So, the question is:
Can I simplify this code to assume that guest and
host addresses coexist and use the copy_*_user() or
just the access_ok() interfaces?
Attached is a diff that shows what this will look like for the struct
On Mon, 9 Jul 2007, Stuart Anderson wrote:
Attached is a diff ...
Here's the diff.
Stuart
Stuart R. Anderson [EMAIL PROTECTED]
Network Software Engineering http://www.netsweng.com/
1024D/37A79149
This small patch implements tkill(). It parallels the tgkill() implementation
that was added recently.
Stuart
Stuart R. Anderson [EMAIL PROTECTED]
Network Software Engineering http://www.netsweng.com/
On Fri, 6 Jul 2007, Fabrice Bellard wrote:
Please update page_check_range() (and other related functions) to return
-EFAULT instead of EFAULT in case of error.
Will do.
Moreover, I believe using similar functions as Linux for memory access
(copyfromuser, copytouser, get_user, put_user)
On Fri, 6 Jul 2007, Stuart Anderson wrote:
Moreover, I believe using similar functions as Linux for memory access
(copyfromuser, copytouser, get_user, put_user) would be cleaner.
This makes sense. That code that I sent was based on the idea that I was
just extending the model that was already
On Fri, 1 Jun 2007, Thiemo Seufer wrote:
Stuart Anderson wrote:
This is a refresh (vs 5/28 cvs) of a patch sent several weeks ago. This
patch implments the structure handling for the semaphore IPC related
structures used by semctl().
It produces too many compiler warnings to be comfortable
On Fri, 1 Jun 2007, Thiemo Seufer wrote:
Stuart Anderson wrote:
This is a refresh (vs 5/28 cvs) of a patch sent several weeks ago. This
patch implments the structure handling for the semaphore IPC related
structures used by semctl().
This was tested using LTP on an ARM target.
Were
On Fri, 1 Jun 2007, Thiemo Seufer wrote:
Stuart Anderson wrote:
This is a refresh (vs 05/28 cvs) of a patch sent several weeks ago. This
patch implements the structure handling for the structures used by the
Message queue IPC interfaces msgctl(), msgrcv() and msgsnd().
This was tested using
On Thu, 31 May 2007, Thiemo Seufer wrote:
Please clean up the compiler warnings. This one ist just the most obvious,
I also see many more of the form:
Sorry. I missed those in the noise caused by another, yet to be completed
patch, which is also in my patch stack.
Attached is the cleaned up
The linux user code was completely missing the ability to map errnos
from the host to the target. This patch adds this ability, with the
mapping needed for MIPS. With this patch, an appreciable number of the
tests in LTP now PASS (remaining failures are due to other bugs not yet
fixed).
The code that maps struct stat is wrong for MIPS. It uses the wrong
sized calls (16 vs 32) for swapping some of the structure members. A
patch to fix this is attached.
Stuart
Stuart R. Anderson [EMAIL PROTECTED]
Network Software
This is a refresh (vs 5/28 cvs) of a patch sent several weeks ago. This
patch implments the structure handling for the semaphore IPC related
structures used by semctl().
This was tested using LTP on an ARM target.
Were there any objections to this patch?
This is a refresh (vs 05/28 cvs) of a patch sent several weeks ago. This
patch implements the structure handling for the structures used by the
Message queue IPC interfaces msgctl(), msgrcv() and msgsnd().
This was tested using LTP on an ARM target.
Stuart
pipe(2) on MIPS does some funny, non-standard stuff with it's return
data. This patch implments this unusual handling. Without this patch,
bash closes it's own stdin by mistake and therefore exits immediately
after presenting the prompt.
The LTP test results for the pipe() tests are improved
On Thu, 19 Apr 2007, J. Mayer wrote:
And I checked the code generated on my machine.
I got the repz at the end of the op_goto_tb0 and op_goto_tb1 and it
seems to work well here with the bash version I got.
IIrc from yesterday, they ended up in front of lea instuctions, which
I think always
On Tue, 17 Apr 2007, Stuart Anderson wrote:
I've continued to work on this all week, and I still haven't managed to
solve it. I've chased down a lot of paths, but none of them have lead to
a solution. Here is a summary of the situation now.
* programs other than bash will run
* bash --version
On Wed, 18 Apr 2007, J. Mayer wrote:
With this change, both host and target 'stty -a' give the same output.
Thanks. I'll take a better look to this patch then apply. There maybe
the same issue in the ppc64 strucutre ?
Yes, it looks like the same changes it needed in
On Wed, 18 Apr 2007, J. Mayer wrote:
You're right: I think all TLS specific code is located in the glibc.
In my last tracing through qemu.log, I did check for r2 references, and
there was one store near the beginning that looked like what glibc would
do (r2 = ptr+0x700), and the rest of the
On Wed, 18 Apr 2007, Igor Kovalenko wrote:
This should be solved for x86_64 host with -mtune=nocona patch
posted a while ago.
I'll go dig that up.
The problem is with dyngen being confused by repz retq sequence.
That's what caught my attention earlier today. It was only showing up in
two
On Thu, 19 Apr 2007, Igor Kovalenko wrote:
as discussed before, to do this in dyngen you need to know the context
better or you'll skip more than intended; that amounts to moving a
large bit of decoder there as far as I understand that
Yes, it was a quick hack along w/ visual inspection of
Just found a small problem w/ the termios structure as defined for PPC
linux user. It doesn't match the one in include/asm-powerpc/termbits.h.
Index: linux-user/ppc/termbits.h
===
--- linux-user/ppc/termbits.h (revision 44)
+++
On Tue, 10 Apr 2007, Jocelyn Mayer wrote:
PPC:
I am unable to get any executable to run.
projects:~/upstream/qemu# ./ppc-linux-user/qemu-ppc -L /mirror0/chroots/ppc/
/mirror0/chroots/ppc/bin/bash
init_ppc_proc: PVR 0008 mask = 0008
Segmentation fault
I'm trying to test my fixes to the linux-user emulation on some additonal
architectures now, but I'm running into problems. I can debug these some,
but any suggestions or guidence, especially from people more familiar
with the architecture core code, would be appreciated.
The environment is a
On Tue, 10 Apr 2007, Jocelyn Mayer wrote:
Just checked, on an amd64 host with a random powerpc bash version I got
on my hard disk drive:
I also tried to really launch the shell and use it and it worked.
Interesting...
But I think recent builds using glibc with TLS/NPTL would not run.
Ahh.
On Sat, 31 Mar 2007, Thiemo Seufer wrote:
+switch( cmd ) {
+ case GETALL:
+ case SETALL:
+ case IPC_STAT:
+ case IPC_SET:
+ lock_user_struct(target_su, target_addr, 1);
+ target_to_host_semid_ds(ds,target_su-buf);
+ host_su-buf = ds;
+
On Sat, 31 Mar 2007, Thiemo Seufer wrote:
Stuart Anderson wrote:
Even though clone() and fork() are related, they don't seem to be close
enough to allow a single routine to be used to implement both. With this
patch, the LTP tests for clone now pass.
But it still does the same, assuming
This is a refresh of a prior patch to fix the semaphore system calls
sem*() in user-linux mode. Some additional cases have been dealt with,
and a small amount of code re-arrainging to prepare for the EFAULT patch.
Tested using Linux Test Project in the target.
Here is a refresh of the message queue syscall (msg*()) fixes. These
are analgous to the just posted sempahore fixes. Tested with LTP on the
target.
Stuart
Stuart R. Anderson [EMAIL PROTECTED]
Network Software Engineering
Even though clone() and fork() are related, they don't seem to be close
enough to allow a single routine to be used to implement both. With this
patch, the LTP tests for clone now pass.
It may be possible to fold this back into do_fork(), but this just seemed to
be a little bit more
This patch fixes a couple of problems with signals().
The first fix, in cpu-exec.c, is needed for the case where a process
does a kill(SIGSEGV) on itself (as is done in a test suite). This fix
for ARM is similar to what is done for some of the other architectures.
I'm not 100% certain this is
Here is a refresh of the EFAULT patch. This fixes a lot of crashes in
LTP, and presumably in regular applications too. This still needs to
have the checking foldded into lock_user(), but there were a handful
of small fixes since this patch was last sent out.
Here is an updated patch that show more of the changes that are needed
to detect EFAULT situations in linux-user. The areas I focused on are
the socket, semaphore, and message queue family of syscalls as they all
make interesting use of pointers to structures. This patch does sit on
top of the
With a little help from Paul yesterday, I was able to come up with a
scheme for detecting bad pointers passed to system calls in linux-user
mode. This is used to return EFAULT as would be done on a real kernel.
The attached patch is very preliminary, but shows how it can be done.
I'm sending it
Attached is a refreshed patch w/ a couple of additional fixes. This
patch provides an implementation of semaphore interfaces (semget(),
semctl(), semop()) that consists mostly of the structure mapping
needed for 32 bit guest on 64 host such as arm on x86_64.
On Wed, 21 Mar 2007, Kirill A. Shutemov wrote:
Primarily, I also thought that problem is in padding, because, without the
patch F_GETLK, on 32-bit target recognises as F_GETLK64 on 64-bit host.
It's happen because on 64-bit host and 32-bit target F_GETLK == F_GETLK64 ==
TARGET_F_GETLK. So if
On Tue, 20 Mar 2007, Paul Brook wrote:
Now that the dust has settled, I see where the change is probably a
no-op anyway. A quick little test program indicates that on x86_64,
l_start will have an offset of 8 wether the structure is packed or not,
and wether the __pad member is present or not.
Like the semaphore patch a couple of days ago, this patch completes the
implementation of the message queue syscalls. With this patch, most
of the message queue tests in LTP now pass in the guest. The remaining
ones will require fixes in other syscall to fix, or at least eliminate
the noise to
On Tue, 20 Mar 2007, Kirill A. Shutemov wrote:
Kiril,
What 32 bit host and 64 bit host are you using? I'm working on
arm on x86_64, and I'm starting to think that perhaps all of the different
parts of the fix are needed to ensure it works correctly on all target/host
combinations.
On Tue, 20 Mar 2007, Kirill A. Shutemov wrote:
What are you using as a test app?
I got error when runing Debian's apt-get and tried to fix it.
OK, that's what got me started on this one, but I switched to using the
ltp-kernel-test package for a more comprehensive set of tests once I got
On Tue, 20 Mar 2007, Kirill A. Shutemov wrote:
No. Remap is needed:
$ uname -m; echo -e '#include fcntl.h\nF_GETLK64' | cpp | tail -1
x86_64
5
$ uname -m; echo -e '#include fcntl.h\nF_GETLK64' | cpp | tail -1
armv5l
12
Same for F_SETLK64 and F_SETLKW64.
You are right. I had previously
OK, I think I finally have it all sorted out. Sorry if I sounded dense
along the way.. there were multiple variable, which increases the number
of possible combinations quickly.
The patch from Kirill is needed, and makes things better. One thing I
notice with it is that we now handle
On Tue, 20 Mar 2007, Thiemo Seufer wrote:
Still, this part makes no sense to me since it is in a packed struct.
Can you explain why this works better for you?
It worked better, in that it fixed a problem that let me continue on to
fix other issues. After revisiting fcntl() and coming up with
The attached patch is needed to correctly emulate setuid executables.
With this change, and by making qemu be setuid root (and assumming all
of the risks and responsibilites of doing so), executables such as
/bin/su will be able to create the correct environment.
When running ARM EABI binaries on x86_64, the target_eabi_flock64
structure is already padded correct so the padding is not needed.
This patch adds an #ifdef to only include the _pad member on 32-but
hosts.
Stuart
Stuart R. Anderson
On Mon, 19 Mar 2007, Paul Brook wrote:
On Monday 19 March 2007 15:30, Stuart Anderson wrote:
When running ARM EABI binaries on x86_64, the target_eabi_flock64
structure is already padded correct so the padding is not needed.
This patch adds an #ifdef to only include the _pad member on 32
The attached patch finishes adding support for semctl(). This was
verified on ARM using the semctl test from LTP in the target.
Stuart
Stuart R. Anderson [EMAIL PROTECTED]
Network Software Engineering
On Mon, 19 Mar 2007, Stuart Anderson wrote:
I have a debian arm chroot setup.
Just to clarify, this is from the applieddata.net repository, not the
normal debian one (which is not eabi).
Stuart
Stuart R. Anderson [EMAIL
My initial fix was before I started using LTP, and just took care of a
single case that was holding me up. Now I have run the fcntl tests in
LTP on ARM (both oABI and EABI) and there are a lot of failures indicating
that there is a lot more work to be done yet on fcntl().
I'll take a look into
On Mon, 19 Mar 2007, Stuart Anderson wrote:
My initial fix was before I started using LTP, and just took care of a
single case that was holding me up. Now I have run the fcntl tests in
LTP on ARM (both oABI and EABI) and there are a lot of failures indicating
that there is a lot more work
68 matches
Mail list logo