bug-libsigsegv
[Top][All Lists]
Advanced

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

Re: [bug-libsigsegv] Re: sigsegv on s390 only giving start address of pa


From: Eric Blake
Subject: Re: [bug-libsigsegv] Re: sigsegv on s390 only giving start address of page in segv handler
Date: Tue, 15 Mar 2011 14:56:06 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

On 03/15/2011 05:04 AM, Christian Borntraeger wrote:
> Am 15.03.2011 10:50, schrieb Bruno Haible:
>> Martin Schwidefsky wrote:
>>> Even with the access-exception-fetch/store-indication facility you'll find
>>> on the latest machine it is not possible to distinguish read from write
>>> faults in all cases ... On older machines the TEID does not carry an
>>> indication if the page translation exception has been for a read or a
>>> write.
>>
>> Oh well then. Thank you for having considered the question.
>>
>> libsigsegv will now offer the page-aligned fault address approximation to
>> userland, together with a C macro that warns the programmer that it is
>> page-aligned.
> 
> Can you give some insights about the other use cases? Userspace page faults 
> can
> be handled just fine with the page address (I have done that for the s390x
> port of valgrind). Would a "works most of the time but might return the page
> address in 10% of the cases" be ok for your other use cases? (e.g. just
> for pretty printing this is certainly ok)

POSIX already documents that for si_addr of a siginfo created for
SIG{ILL,FPE,SEGV,BUS}: "For some implementations, the value of si_addr
may be inaccurate."  So the s390 implementation of returning a
page-aligned fault certainly seems compliant.

For purposes of mapping and permissions, as long as the fault lands in
the right page, you have enough information to resolve the fault.  But
having the extra granularity can let you track faults for multiple
objects that live in one page (temporarily restoring access, do the
instruction, then revert access), whereas page granularity requires one
page boundary per object where you want to rely on faults to detect
boundary overflow, thus chewing through more virtual memory.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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