> On Oct 29, 2020, at 1:02 PM, Richard Sandiford <richard.sandif...@arm.com>
> wrote:
>
> Qing Zhao via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
>>>> +Return-Oriented Programming (ROP) or preventing information leak
>>>
>>> leakage
>>>
>>> (FWIW, I'm not sure “mitigating ROP” is really correct usage, but I don't
>>> have any better suggestions.)
>>
>> Do you mean whether “mitigating ROP’ is one of the major purpose of this new
>> feature?
>
> No, I meant just the English usage. E.g., I think you mitigate the
> damage caused by earthquakes rather than mitigate earthquakes themselves.
> But I could be wrong. It's not a word I use very often ;-)
Okay.
I see.
>
>>>> +In order to satisfy users with different security needs and control the
>>>> +run-time overhead at the same time, GCC provides a flexible way to choose
>>>> +the subset of the call-used registers to be zeroed.
>>>
>>> Maybe s/GCC/the @var{choice} parameter/.
>> Okay.
>>>
>>>> +
>>>> +The three basic values of @var{choice} are:
>>>
>>> After which, I think this should be part of the previous paragraph.
>>
>> Don’t understand here, could you explain a little bit more?
>
> I meant:
>
> In order to satisfy users with different security needs and control the
> run-time overhead at the same time, @var{choice} provides a flexible way
> to choose the subset of the call-used registers to be zeroed. The three
> basic values of @var{choice} are:
>
Oh. :-)
>>>> + /* If gpr_only is true, only zero call-used registers that are
>>>> + general-purpose registers; if used_only is true, only zero
>>>> + call-used registers that are used in the current function;
>>>> + if arg_only is true, only zero call-used registers that pass
>>>> + parameters defined by the flatform's calling conversion. */
>>>> +
>>>> + gpr_only = crtl->zero_call_used_regs & ONLY_GPR;
>>>> + used_only = crtl->zero_call_used_regs & ONLY_USED;
>>>> + arg_only = crtl->zero_call_used_regs & ONLY_ARG;
>>>
>>> Guess it would be nice to be consistent about which side the “only”
>>> goes on. FWIW, I don't mind which way: GPR_ONLY etc. would be
>>> OK with me if you prefer that.
>> The current names are okay for me.
>
> OK. But I think one of them should change to match the other.
> E.g. either the local variable should be “only_gpr” or the
> flag should be “GPR_ONLY”.
Okay, I see what you mean, will make them consistent.
Qing
>
> Thanks,
> Richard