qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] linux-user EFAULT implementation


From: Stuart Anderson
Subject: Re: [Qemu-devel] [PATCH] linux-user EFAULT implementation
Date: Mon, 9 Jul 2007 07:41:34 -0400 (EDT)

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
sockaddr handling case. In short, the two functions for mapping this
structure get renamed

        target_to_host_sockaddr -> copy_from_user_sockaddr
        host_to_target_sockaddr -> copy_to_user_sockaddr

and lose the pg_access parameter as read/write access is determined
by wether we are copying to or from "user space". The macro access_ok()
is used to check the validity of the memory being accessed.

This change also completely drops the notion of locking and unlocking memory,
which was the previous model being used.

Fabrice,

Is this change what you had in mind? Does it cause a problem for anyone
else?



                                Stuart

Stuart R. Anderson                               address@hidden
Network & Software Engineering                   http://www.netsweng.com/
1024D/37A79149:                                  0791 D3B8 9A4C 2CDC A31F
                                                 BD03 0A62 E534 37A7 9149




reply via email to

[Prev in Thread] Current Thread [Next in Thread]