[PATCH 03/18] powerpc: bad_page_fault, do_break get registers from regs

Nicholas Piggin npiggin at gmail.com
Wed Nov 11 17:39:33 AEDT 2020


Excerpts from Nicholas Piggin's message of November 11, 2020 2:46 pm:
> Excerpts from Christophe Leroy's message of November 10, 2020 9:19 pm:
>> 
>> 
>> Le 10/11/2020 à 09:34, Nicholas Piggin a écrit :
>>> Excerpts from Christophe Leroy's message of November 6, 2020 6:14 pm:
>>>>
>>>>
>>>> Le 05/11/2020 à 15:34, Nicholas Piggin a écrit :
>>>>> This also moves the 32s DABR match to C.
>>>>
>>>> Is there a real benefit doing this ?
>>> 
>>> Oh I missed doing it, but yes I think bad_page_fault and do_break should
>>> probably be implemented with the DEFINE_INTERRUT_HANDLER wrappers.
>>> 
>> 
>> Yes, anyway, do we need to do that change ? Can't the dispatch between do_break() and page fault 
>> handling remain in handle_page_fault() ? What's the benefit of going into do_page_fault() and coming 
>> back ?
> 
> You might be right, I'll take another look at it.

For 32-bit, we need to come back to save NV GPRs. Certainly the 64s code 
stays in do_page_fault because it always saves them.

Now I don't think that's the nicest thing to go in and out of the 
interrupt wrappers twice in these cases, but for a first pass I think 
it's okay. Either we could add another type of error-case wrapper that
does some adjustment if it becomes necessary, or we find a nice way to
save NVGPRs from C code.

If we could somehow parse unwind data to find where the NVGPRs are saved 
by the compiler and generate a little code stub to load them out, would
be the ultimate :) Maybe one day...

Thanks,
Nick


More information about the Linuxppc-dev mailing list