[PATCH 1/3] powerpc: Split user/kernel definitions of struct pt_regs

Michael Ellerman mpe at ellerman.id.au
Tue Oct 16 21:50:37 AEDT 2018


Madhavan Srinivasan <maddy at linux.vnet.ibm.com> writes:
> On Monday 15 October 2018 04:38 PM, Michael Ellerman wrote:
>> Madhavan Srinivasan <maddy at linux.vnet.ibm.com> writes:
>>
>>> On Saturday 13 October 2018 04:26 PM, Michael Ellerman wrote:
...
>>>> At the moment they're still identical, and we check that at build
>>>> time. That's because we have code (in ptrace etc.) that assumes that
>>>> they are the same. We will fix that code in future patches, and then
>>>> we can break the strict symmetry between the two structs.
>>> Nice and awesome. But just trying to understand. What will
>>> *regs will point to in the "struct sigcontext".
>>
>> It should always point to a user_pt_regs.
...
>>
>> I think it's not actually broken at the moment, because it's just a
>> pointer, and we don't do anything based on the sizeof() the type.
>
> yes. This clarifies. But still perf/perf_regs.c needs changes.
> Because perf support dumping user_space regs and interrupt regs.
> Once again, we dont use any sizeof(), but need to handle the
> user_pt_regs changes.
>
> I will have a look at that in the morning.

I did look at that and convinced myself that it was OK, but maybe I'm
wrong :D

My reasoning was that the regs we're using there are always the
in-kernel regs for the process at the point it took the PMU interrupt.
And the regs values aren't exported directly as a struct but rather via
regs_get_register().

But we may still want to change it to make things clearer.

cheers


More information about the Linuxppc-dev mailing list