On Sat, Apr 13, 2013 at 4:59 AM, Terry Hsu <terry.sh...@gmail.com> wrote:
>
> On Fri, Apr 12, 2013 at 1:14 AM, Terry Hsu <terry.sh...@gmail.com> wrote:
>>
>> okay so I looked into the faultinfo structure and was able to obtain the
>> faulting address, error code, and trap number(?). From my understanding the
>> error code is the bottom 3 bits of the exception code. But I see error code
>> "20" sometimes and do not what it means.
>
>
> According to p.6-55 in Intel® 64 and IA-32 Architectures Software
> Developer’s Manual, Volume 3: System Programming Guide, the lower 5 bits are
> Present, Read/Write, User/supervisor, RSVD, and Instruction/Data bit
> respectively. So error code 20 means the fault is caused by an instruction
> read to a non-present page in user mode.
>
> I found the the reason why the fault cannot be fixed by UML. It is probably
> because UML puts the faultinfo in the wrong stub, since I changed the vm
> area pointers of the child process, when the fault happens, UML incorrectly
> finds its parent process's stub pages and puts the faultinfo in it.
> Therefore when the child process tries to access its own skas stub and fix
> the fault, it still cannot find the correct instruction pointers hence the
> fault happens endlessly.

Can you share an example with us which triggers the issue?

> Why does every process that runs in UML need its own stub for page fault
> handling? It seems to me they could've shared the SIGSEGV signal handler and
> the function that invokes mmap, munmap, mprotect. In this way only two pages
> are needed for all the processes.
>
> I am not sure if I understand the whole thing correctly. Please correct me
> if it's not right.

We need a stub per process because the installs a mapping into the
prozess (on the host size).
As mmap() always operates on current, we need a way to make the
prozess call mmap() itself.
The stub does this.

--
Thanks,
//richard

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Reply via email to