Re: Another issue on RS6000 target. Re: One issue with default implementation of zero_call_used_regs

2020-10-02 Thread Qing Zhao via Gcc-patches
> On Oct 1, 2020, at 11:20 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >> Hi, Richard, >> >> To answer the question, which registers should be included in “ALL”. >> I studied X86 hard register set in more details. And also

Re: Another issue on RS6000 target. Re: One issue with default implementation of zero_call_used_regs

2020-10-01 Thread Qing Zhao via Gcc-patches
Hi, Richard, To answer the question, which registers should be included in “ALL”. I studied X86 hard register set in more details. And also consulted with H.J.Lu, And found: In the current x86 implementation, mask registers, MM0-MM7 registers, and ST0-ST7 registers are not zeroed. The

Re: Another issue on RS6000 target. Re: One issue with default implementation of zero_call_used_regs

2020-09-30 Thread Qing Zhao via Gcc-patches
> On Sep 30, 2020, at 11:25 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >>>> >>>> As I checked, when the FP registers are zeroed, the above failure happened. >>>> >>>> I suspect that the issue still relate to the foll

Re: Another issue on RS6000 target. Re: One issue with default implementation of zero_call_used_regs

2020-09-30 Thread Qing Zhao via Gcc-patches
> On Sep 30, 2020, at 4:21 AM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >> Hi, Richard, >> >> At the same time testing aarch64, I also tested the default implementation >> on rs6000 targ

Another issue on RS6000 target. Re: One issue with default implementation of zero_call_used_regs

2020-09-29 Thread Qing Zhao via Gcc-patches
Hi, Richard, At the same time testing aarch64, I also tested the default implementation on rs6000 target. The default implementation now is: +/* The default hook for TARGET_ZERO_CALL_USED_REGS. */ + +HARD_REG_SET +default_zero_call_used_regs (HARD_REG_SET need_zeroed_hardregs) +{ +

Re: [stage1][PATCH] Change semantics of -frecord-gcc-switches and add -frecord-gcc-switches-format.

2020-09-25 Thread Qing Zhao via Gcc-patches
> On Sep 25, 2020, at 9:55 AM, Martin Liška wrote: > > PING^5 > Thanks a lot for ping this patch again. Hopefully it can be committed into GCC 11 very soon. Qing > On 7/21/20 6:24 PM, Qing Zhao wrote: >> PING^4. >> Our company is waiting for this patch

Re: One issue with default implementation of zero_call_used_regs

2020-09-25 Thread Qing Zhao via Gcc-patches
> On Sep 25, 2020, at 12:31 PM, Richard Sandiford > wrote: > > Qing Zhao writes: >> Last question, in the following code portion: >> >> /* Now we get a hard register set that need to be zeroed, pass it to >> target to generate zeroing sequence.

Re: One issue with default implementation of zero_call_used_regs

2020-09-25 Thread Qing Zhao via Gcc-patches
> On Sep 25, 2020, at 11:58 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >>>> >>>> >>>> Which data structure in GCC should be used here to hold this returned >>>> value as Set of RTX ? >>> >>> A HARD

Re: One issue with default implementation of zero_call_used_regs

2020-09-25 Thread Qing Zhao via Gcc-patches
> On Sep 25, 2020, at 10:28 AM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Sep 25, 2020, at 7:53 AM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao writes: >>>> Hi, Rich

Re: One issue with default implementation of zero_call_used_regs

2020-09-25 Thread Qing Zhao via Gcc-patches
> On Sep 25, 2020, at 7:53 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >> Hi, Richard, >> >> As you suggested, I added a default implementation of the target hook >> “zero_cal_used_regs (HARD_REG_SET)” as following in my latest

One issue with default implementation of zero_call_used_regs

2020-09-24 Thread Qing Zhao via Gcc-patches
Hi, Richard, As you suggested, I added a default implementation of the target hook “zero_cal_used_regs (HARD_REG_SET)” as following in my latest patch /* The default hook for TARGET_ZERO_CALL_USED_REGS. */ void default_zero_call_used_regs (HARD_REG_SET need_zeroed_hardregs) { gcc_assert

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-23 Thread Qing Zhao via Gcc-patches
> On Sep 23, 2020, at 10:21 AM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Sep 23, 2020, at 9:32 AM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao writes: >>>>> On Sep 23,

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-23 Thread Qing Zhao via Gcc-patches
> On Sep 23, 2020, at 9:40 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >>>>> Dropping them is fine with me FWIW. That seems like a natural use >>>>> for the new hook: drop zeroing that isn't actively wrong, but isn't >>>>>

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-23 Thread Qing Zhao via Gcc-patches
> On Sep 23, 2020, at 9:32 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >>> On Sep 23, 2020, at 6:05 AM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao mailto:qing.z...@oracle.com>> writes: >>>&

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-23 Thread Qing Zhao via Gcc-patches
> On Sep 23, 2020, at 9:22 AM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Sep 23, 2020, at 5:43 AM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao writes: >>>>> On Sep 22, 202

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-23 Thread Qing Zhao via Gcc-patches
> On Sep 22, 2020, at 5:37 PM, Segher Boessenkool > wrote: > > Hi! > > On Tue, Sep 22, 2020 at 06:06:30PM +0100, Richard Sandiford wrote: >> Qing Zhao writes: >>> Okay, thanks for the info. >>> then, what’s the current definition of UNSPEC_VOLATI

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-23 Thread Qing Zhao via Gcc-patches
> On Sep 23, 2020, at 6:05 AM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Sep 22, 2020, at 12:06 PM, Richard Sandiford >>> wrote: >>>>>> >>>>>> The following is what I s

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-23 Thread Qing Zhao via Gcc-patches
> On Sep 23, 2020, at 5:43 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >>> On Sep 22, 2020, at 1:35 PM, H.J. Lu wrote: >>> On Tue, Sep 22, 2020 at 11:25 AM Qing Zhao >> <mailto:qing.z...@oracle.com>> wrote: >>>>> O

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-22 Thread Qing Zhao via Gcc-patches
> On Sep 22, 2020, at 12:06 PM, Richard Sandiford > wrote: The following is what I see from i386.md: (I didn’t look at how “UNSPEC_volatile” is used in data flow analysis in GCC yet) ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and ;;

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-22 Thread Qing Zhao via Gcc-patches
> On Sep 22, 2020, at 1:35 PM, H.J. Lu wrote: > > On Tue, Sep 22, 2020 at 11:25 AM Qing Zhao <mailto:qing.z...@oracle.com>> wrote: >> >> Hi, Hongjiu, >> >> >>> On Sep 22, 2020, at 11:31 AM, Richard Sandiford >>> wrote: >>

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-22 Thread Qing Zhao via Gcc-patches
Hi, Hongjiu, > On Sep 22, 2020, at 11:31 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >>> On Sep 21, 2020, at 2:22 PM, Qing Zhao via Gcc-patches >>> wrote: >>> >>> >>> >>>> On Sep 21, 2020, at

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-21 Thread Qing Zhao via Gcc-patches
> On Sep 21, 2020, at 3:34 PM, Segher Boessenkool > wrote: > > On Mon, Sep 21, 2020 at 09:13:58AM -0500, Qing Zhao wrote: >>> On Sep 18, 2020, at 5:51 PM, Segher Boessenkool >>> wrote: >>>> B. Will provide a default definition in middle end to ge

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-21 Thread Qing Zhao via Gcc-patches
> On Sep 21, 2020, at 2:22 PM, Qing Zhao via Gcc-patches > wrote: > > > >> On Sep 21, 2020, at 2:11 PM, Richard Sandiford >> wrote: >> >> Qing Zhao writes: >>>> But in cases where there is no underlying concept that can sens

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-21 Thread Qing Zhao via Gcc-patches
> On Sep 21, 2020, at 2:11 PM, Richard Sandiford > wrote: > > Qing Zhao writes: >>> But in cases where there is no underlying concept that can sensibly >>> be extracted out, it's OK if targets need to override the default >>> to get correc

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-21 Thread Qing Zhao via Gcc-patches
> On Sep 21, 2020, at 10:35 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >> My major concern with the default implementation of the hook is: >> >> If a target has some special registers that should not be zeroed, and we do >> not

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-21 Thread Qing Zhao via Gcc-patches
> On Sep 21, 2020, at 2:23 AM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >> Hi, Richard, >> >> During my implementation of the new version of the patch. I still feel that >> it’s not practical to add a defaul

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-21 Thread Qing Zhao via Gcc-patches
> On Sep 18, 2020, at 5:51 PM, Segher Boessenkool > wrote: > > Hi! > > On Fri, Sep 18, 2020 at 03:31:12PM -0500, Qing Zhao wrote: >> Let me know your opinion: >> >> A. Will not provide default definition in middle end to generate the >>

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-18 Thread Qing Zhao via Gcc-patches
Hi, Richard, During my implementation of the new version of the patch. I still feel that it’s not practical to add a default definition in the middle end to just use move patterns to zero each selected register. The major issues are: There are some target specific information on how to

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-17 Thread Qing Zhao via Gcc-patches
> On Sep 17, 2020, at 11:27 AM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Sep 17, 2020, at 1:17 AM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao writes: >>>> Segher and Richard

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-17 Thread Qing Zhao via Gcc-patches
> On Sep 17, 2020, at 1:17 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >> Segher and Richard, >> >> Now there are two major concerns from the discussion so far: >> >> 1. (From Richard): Inserting zero insns should be done after >&g

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-16 Thread Qing Zhao via Gcc-patches
. X86 backend will implement a special version for “gen_zero_call_used_regs”, and “pro_epilogue_use”. Let me know if you have any more comment on this approach. thanks. Qing > On Sep 16, 2020, at 5:35 AM, Segher Boessenkool > wrote: > > On Tue, Sep 15, 2020 at 08:51:57PM -050

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-15 Thread Qing Zhao via Gcc-patches
> On Sep 15, 2020, at 6:09 PM, Segher Boessenkool > wrote: > > On Tue, Sep 15, 2020 at 05:31:48PM -0500, Qing Zhao wrote: >>> But, scheduling runs *after* that, and then you need to prevent the >>> inserted (zeroing) insns from moving -- if you don't, the c

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-15 Thread Qing Zhao via Gcc-patches
> On Sep 15, 2020, at 2:41 PM, Segher Boessenkool > wrote: > > On Tue, Sep 15, 2020 at 10:11:41AM +0100, Richard Sandiford wrote: >> Qing Zhao writes: >>>> On Sep 14, 2020, at 2:20 PM, Richard Sandiford >>>> wrote: > (Putting correct info

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-15 Thread Qing Zhao via Gcc-patches
> On Sep 15, 2020, at 4:11 AM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Sep 14, 2020, at 2:20 PM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao mailto:qing.z...@oracle.com>> w

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-14 Thread Qing Zhao via Gcc-patches
> On Sep 14, 2020, at 6:09 PM, Segher Boessenkool > wrote: > > On Fri, Sep 11, 2020 at 05:41:47PM -0500, Qing Zhao wrote: >>> On Sep 11, 2020, at 4:51 PM, Segher Boessenkool >>> wrote: >>> It is definitely *not* effective if there are gadgets that se

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-14 Thread Qing Zhao via Gcc-patches
> On Sep 14, 2020, at 2:20 PM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Sep 14, 2020, at 11:33 AM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao writes: >&g

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-14 Thread Qing Zhao via Gcc-patches
> On Sep 14, 2020, at 11:33 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >>> Like I mentioned earlier though, passes that run after >>> pass_thread_prologue_and_epilogue can use call-clobbered registers that >>> weren't previously used. For

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-14 Thread Qing Zhao via Gcc-patches
Hi, Richard, > On Sep 11, 2020, at 5:56 PM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Sep 11, 2020, at 4:44 PM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao writes: >>>>>

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-11 Thread Qing Zhao via Gcc-patches
> On Sep 11, 2020, at 4:51 PM, Segher Boessenkool > wrote: > > On Fri, Sep 11, 2020 at 04:29:16PM -0500, Qing Zhao wrote: >>> On Sep 11, 2020, at 4:03 PM, Segher Boessenkool >>> wrote: >>>> The parameters that are passed to sys call will

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-11 Thread Qing Zhao via Gcc-patches
> On Sep 11, 2020, at 4:44 PM, Richard Sandiford > wrote: > > Qing Zhao writes: >>> On Sep 11, 2020, at 12:32 PM, Richard Sandiford >>> >> If we go for (2), then I think it would be better to do >>> it at the start of pass_late_compilat

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-11 Thread Qing Zhao via Gcc-patches
> On Sep 11, 2020, at 4:03 PM, Segher Boessenkool > wrote: > > Hi! > > On Fri, Sep 11, 2020 at 03:14:57PM -0500, Qing Zhao wrote: >> My understanding of how this scheme helps ROP is: the attacker usually uses >> scratch register to pass > > Help obs

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-11 Thread Qing Zhao via Gcc-patches
> On Sep 11, 2020, at 3:36 PM, Segher Boessenkool > wrote: > > On Fri, Sep 11, 2020 at 03:17:19PM -0500, Qing Zhao wrote: >>> On Sep 11, 2020, at 3:05 PM, Segher Boessenkool >>> wrote: >>> On Fri, Sep 11, 2020 at 02:40:06PM -0500, Qing Zhao wrote: >

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-11 Thread Qing Zhao via Gcc-patches
> On Sep 11, 2020, at 3:05 PM, Segher Boessenkool > wrote: > > On Fri, Sep 11, 2020 at 02:40:06PM -0500, Qing Zhao wrote: >>> On Sep 11, 2020, at 12:13 PM, Segher Boessenkool >>> wrote: >>> On Fri, Sep 11, 2020 at 11:52:29AM -0500, Qing Zhao

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-11 Thread Qing Zhao via Gcc-patches
> On Sep 11, 2020, at 12:32 PM, Richard Sandiford > wrote: > > Qing Zhao writes: >>> On Sep 11, 2020, at 11:14 AM, Segher Boessenkool >>> wrote: >>> >>> On Fri, Sep 11, 2020 at 11:06:03AM +0100, Richard Sandiford wrote: >>>

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-11 Thread Qing Zhao via Gcc-patches
> On Sep 11, 2020, at 12:18 PM, Segher Boessenkool > wrote: > > On Thu, Sep 10, 2020 at 05:50:40PM -0500, Qing Zhao wrote: >>>>>> Shrink-wrapped stuff. Quite important for performance. Not something >>>>>> you can throw away. > >

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-11 Thread Qing Zhao via Gcc-patches
> On Sep 11, 2020, at 12:13 PM, Segher Boessenkool > wrote: > > On Fri, Sep 11, 2020 at 11:52:29AM -0500, Qing Zhao wrote: >> I don’t understand why it’s not correct if we clearing call-clobbered >> registers >> AFTER restoring call-preserved registers? >

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-11 Thread Qing Zhao via Gcc-patches
> On Sep 11, 2020, at 11:14 AM, Segher Boessenkool > wrote: > > On Fri, Sep 11, 2020 at 11:06:03AM +0100, Richard Sandiford wrote: >> This might have already been discussed/answered, sorry, but: >> when there's a choice, is there an obvious winner between: >> >> (1) clearing call-clobbered

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-10 Thread Qing Zhao via Gcc-patches
> On Sep 10, 2020, at 5:05 PM, Segher Boessenkool > wrote: > > On Tue, Sep 08, 2020 at 11:43:30AM -0500, Qing Zhao wrote: >>> On Sep 7, 2020, at 10:58 AM, H.J. Lu wrote: >>> On Mon, Sep 7, 2020 at 7:06 AM Segher Boessenkool >>> mailto:seg...@kernel.cr

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-10 Thread Qing Zhao via Gcc-patches
> On Sep 10, 2020, at 2:07 PM, Kees Cook wrote: > > [tried to clean up quoting...] > > On Tue, Sep 08, 2020 at 10:00:09AM -0500, Qing Zhao wrote: >> >>> On Sep 7, 2020, at 8:06 AM, Rodriguez Bahena, Victor >>> wrote: >>> >>>>

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-10 Thread Qing Zhao via Gcc-patches
Richard, Thank you! > On Sep 10, 2020, at 7:11 AM, Richard Sandiford > wrote: > > Patrick McGehearty via Gcc-patches writes: >> My understanding is this feature/flag is not intended to be "default on". >> It is intended to be used in security sensitive environments such >> as the Linux

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-08 Thread Qing Zhao via Gcc-patches
> On Sep 7, 2020, at 10:58 AM, H.J. Lu wrote: > > On Mon, Sep 7, 2020 at 7:06 AM Segher Boessenkool > mailto:seg...@kernel.crashing.org>> wrote: >> >> On Fri, Sep 04, 2020 at 11:52:13AM -0700, H.J. Lu wrote: >>> On Fri, Sep 4, 2020 at 11:09 AM Segher Boessenkool >>> wrote: On Fri, Sep

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-08 Thread Qing Zhao via Gcc-patches
> On Sep 7, 2020, at 8:06 AM, Rodriguez Bahena, Victor > wrote: > > > > From: Qing Zhao mailto:qing.z...@oracle.com>> > Date: Friday, September 4, 2020 at 9:19 AM > To: "Rodriguez Bahena, Victor" <mailto:victor.rodriguez.bah...@intel.com&

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-08 Thread Qing Zhao via Gcc-patches
> On Sep 7, 2020, at 9:36 AM, Segher Boessenkool > wrote: > > On Fri, Sep 04, 2020 at 02:00:41PM -0500, Qing Zhao wrote: >>>> However, if we only clear USED registers, the worst case is 1.72% on >>>> average. This overhead is very reasonable. >>

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-04 Thread Qing Zhao via Gcc-patches
> On Sep 4, 2020, at 1:04 PM, Segher Boessenkool > wrote: > > On Fri, Sep 04, 2020 at 12:18:12PM -0500, Qing Zhao wrote: >>> I call this very expensive, already, >> >> Yes, I think that 17.56% on average is quite expensive. That’s the data for >> -f

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-04 Thread Qing Zhao via Gcc-patches
> On Sep 4, 2020, at 10:43 AM, Segher Boessenkool > wrote: > > On Thu, Sep 03, 2020 at 10:13:35AM -0700, Kees Cook wrote: >> On Thu, Sep 03, 2020 at 09:29:54AM -0500, Qing Zhao wrote: >>> On average, all the options starting with “used_…” (i.e, only the

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-04 Thread Qing Zhao via Gcc-patches
> On Sep 3, 2020, at 8:23 PM, Rodriguez Bahena, Victor > wrote: > > > > -Original Message- > From: Qing Zhao mailto:qing.z...@oracle.com>> > Date: Thursday, September 3, 2020 at 12:55 PM > To: Kees Cook mailto:keesc...@chromium.org>>

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-03 Thread Qing Zhao via Gcc-patches
> On Sep 3, 2020, at 12:48 PM, Ramana Radhakrishnan > wrote: > > On Thu, Sep 3, 2020 at 6:13 PM Kees Cook via Gcc-patches > wrote: >> >> On Thu, Sep 03, 2020 at 09:29:54AM -0500, Qing Zhao wrote: >>> On average, all the options starting with “us

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-03 Thread Qing Zhao via Gcc-patches
> On Sep 3, 2020, at 12:13 PM, Kees Cook wrote: > > On Thu, Sep 03, 2020 at 09:29:54AM -0500, Qing Zhao wrote: >> On average, all the options starting with “used_…” (i.e, only the registers >> that are used in the routine will be zeroed) have very low runtime >&

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-03 Thread Qing Zhao via Gcc-patches
> On Sep 3, 2020, at 10:08 AM, Qing Zhao via Gcc-patches > wrote: > > > Hi, > > Looks like both attached .csv files were deleted during the email delivery > procedure. Not sure what’s the reason for this. > > Then I have to copy the text file here for you refer

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-03 Thread Qing Zhao via Gcc-patches
p 3, 2020, at 9:29 AM, Qing Zhao via Gcc-patches > wrote: > > Hi, > > Per request, I collected runtime performance data and code size data with > CPU2017 on a X86 platform. > > *** Machine info: > model name>-: Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz &g

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-03 Thread Qing Zhao via Gcc-patches
, at 4:54 PM, Qing Zhao via Gcc-patches > wrote: > > > >> On Aug 24, 2020, at 3:20 PM, Segher Boessenkool >> wrote: >> >> Hi! >> >> On Mon, Aug 24, 2020 at 01:02:03PM -0500, Qing Zhao wrote: >>>> On Aug 24, 2020, at 12:49 PM, Segher

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-28 Thread Qing Zhao via Gcc-patches
> On Aug 28, 2020, at 2:47 AM, Alexandre Oliva wrote: > > On Aug 26, 2020, Qing Zhao wrote: > >> There are two issues I can see with adding a default generator in middle end: > >> 1. In order to determine where a target should not use the generic >>

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-26 Thread Qing Zhao via Gcc-patches
> On Aug 26, 2020, at 7:02 AM, Alexandre Oliva wrote: > > On Aug 25, 2020, Jeff Law mailto:l...@redhat.com>> wrote: > >> On Tue, 2020-08-25 at 02:16 -0300, Alexandre Oliva wrote: >>> On Aug 24, 2020, Richard Biener wrote: >>> since the option is quite elaborate on what (sub-)set of

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-25 Thread Qing Zhao via Gcc-patches
> On Aug 25, 2020, at 9:05 AM, Qing Zhao via Gcc-patches > wrote: > > > >> On Aug 25, 2020, at 1:41 AM, Uros Bizjak wrote: >> >>>> >>>>>> (The other side of the coin is how much this helps prevent exploitation; >>>>

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-25 Thread Qing Zhao via Gcc-patches
> On Aug 24, 2020, at 3:20 PM, Segher Boessenkool > wrote: > > Hi! > > On Mon, Aug 24, 2020 at 01:02:03PM -0500, Qing Zhao wrote: >>> On Aug 24, 2020, at 12:49 PM, Segher Boessenkool >>> wrote: >>> On Wed, Aug 19, 2020 at 06:27:45PM -0500, Qi

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-25 Thread Qing Zhao via Gcc-patches
> On Aug 25, 2020, at 1:41 AM, Uros Bizjak wrote: > >>> > (The other side of the coin is how much this helps prevent exploitation; > numbers on that would be good to see, too.) This can be well showed from the paper: "Clean the Scratch Registers: A Way to

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-24 Thread Qing Zhao via Gcc-patches
> On Aug 24, 2020, at 3:26 PM, Segher Boessenkool > wrote: > > On Mon, Aug 24, 2020 at 01:48:02PM -0500, Qing Zhao wrote: >> >> >>> On Aug 24, 2020, at 12:59 PM, Segher Boessenkool >>> wrote: >>> >>> [ Please quote correctly.

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-24 Thread Qing Zhao via Gcc-patches
> On Aug 24, 2020, at 3:20 PM, Segher Boessenkool > wrote: > > Hi! > > On Mon, Aug 24, 2020 at 01:02:03PM -0500, Qing Zhao wrote: >>> On Aug 24, 2020, at 12:49 PM, Segher Boessenkool >>> wrote: >>> On Wed, Aug 19, 2020 at 06:27:45PM -0500, Qi

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-24 Thread Qing Zhao via Gcc-patches
> On Aug 24, 2020, at 12:59 PM, Segher Boessenkool > wrote: > > [ Please quote correctly. I fixed this up a bit. ] > > On Mon, Aug 24, 2020 at 02:47:22PM +, Rodriguez Bahena, Victor wrote: >>> The call-clobbered regs are the only ones you *can* touch. That does >>> not mean you should

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-24 Thread Qing Zhao via Gcc-patches
> On Aug 24, 2020, at 12:49 PM, Segher Boessenkool > wrote: > > On Wed, Aug 19, 2020 at 06:27:45PM -0500, Qing Zhao wrote: >>> On Aug 19, 2020, at 5:57 PM, Segher Boessenkool >>> wrote: >>> Numbers on how expensive this is (for what arch, in cod

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-24 Thread Qing Zhao via Gcc-patches
> On Aug 24, 2020, at 5:50 AM, Richard Biener wrote: > > On Tue, 11 Aug 2020, Qing Zhao wrote: > >> Hi, Alexandre, >> >> CC’ing Richard for his comments on this. >> >> >>> On Aug 10, 2020, at 9:39 PM, Alexandre Oliva wrote: >>

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-19 Thread Qing Zhao via Gcc-patches
> On Aug 19, 2020, at 5:57 PM, Segher Boessenkool > wrote: > > Hi! > > On Wed, Aug 19, 2020 at 03:05:36PM -0500, Qing Zhao wrote: >> So, cleaning the scratch registers that are used to pass parameters at >> return instructions should >

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-19 Thread Qing Zhao via Gcc-patches
in this patch sanely. > > > Segher zeroing call-used registers for security purpose 8/19/2020 Qing Zhao = **Motivation: There are two purposes of this patch: 1. ROP mitigation: ROP (Return-oriented programming, https://en.wikipedia.org/wiki/Return

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-11 Thread Qing Zhao via Gcc-patches
Hi, Alexandre, CC’ing Richard for his comments on this. > On Aug 10, 2020, at 9:39 PM, Alexandre Oliva wrote: >> I think that moving how to zeroing the registers part to each target >> will be a better solution since each target has >> Better idea on how to use the most efficient insns to do

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-10 Thread Qing Zhao via Gcc-patches
>> >>> If so, I am okay with name “call-clobbered” if this name sounds better. >> >> It's more obvious, at least to me. In the current option list of GCC: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-10 Thread Qing Zhao via Gcc-patches
Hi, > On Aug 7, 2020, at 5:59 PM, Segher Boessenkool > wrote: > >> From my understanding (I am not a security expert though), this patch should >> serve two purpose: >> >> 1. Erase the registers upon return to avoid information leak; > > But only some of the registers. All the call-used

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-07 Thread Qing Zhao via Gcc-patches
Hi, Alexandre, Thank you for the comments and suggestions. > On Aug 7, 2020, at 8:20 AM, Alexandre Oliva wrote: > > On Jul 28, 2020, Qing Zhao via Gcc-patches wrote: > >>> 2. The main code generation part is moved from i386 backend to middle-end; >>> 3. Add 4

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-07 Thread Qing Zhao via Gcc-patches
> On Aug 7, 2020, at 1:21 AM, Richard Biener wrote: > > On Thu, 6 Aug 2020, Kees Cook wrote: > >> On Thu, Aug 06, 2020 at 10:37:43AM +0200, Richard Biener wrote: >>> OK, so -fzero-call-used-regs is a ROP mitigation technique. To me >>> it sounded more like a mitigation against information

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-07 Thread Qing Zhao via Gcc-patches
Hi, Segher, Thanks for your comments. > On Aug 6, 2020, at 6:37 PM, Segher Boessenkool > wrote: > > Hi! > > On Thu, Aug 06, 2020 at 10:31:27AM +0200, Richard Biener wrote: >> Jeff might be, but with the intended purpose (ROP mitigation AFAIU) >> it would be nice for other target maintainers

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-06 Thread Qing Zhao via Gcc-patches
Hi, Richard, > On Aug 5, 2020, at 4:35 PM, Qing Zhao via Gcc-patches > wrote: > > >> >>>>>> + continue; >>>>>> + if (fixed_regs[regno]) >>>>>> + continue; >>>>>> + if (is_live_

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-06 Thread Qing Zhao via Gcc-patches
> On Aug 6, 2020, at 3:37 AM, Richard Biener wrote: > > On Wed, 5 Aug 2020, Qing Zhao wrote: > >>>> >>>> From The SECURE project and GCC in GCC Cauldron 2018: >>>> >>>> Speaker: Graham Markall >>>> >>>&g

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-06 Thread Qing Zhao via Gcc-patches
> On Aug 6, 2020, at 3:31 AM, Richard Biener wrote: > > On Wed, 5 Aug 2020, Qing Zhao wrote: > >> Hi, Richard, >> >> Thanks a lot for your careful review and detailed comments. >> >> >>> On Aug 4, 2020, at 2:35 AM, Richard Biener &g

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-05 Thread Qing Zhao via Gcc-patches
Hi, Richard, Thanks a lot for your careful review and detailed comments. > On Aug 4, 2020, at 2:35 AM, Richard Biener wrote: > > I have a few comments below - I'm not sure I'm qualified to fully > review the rest though. Could you let me know who will be the more qualified person to fully

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-05 Thread Qing Zhao via Gcc-patches
>> >> From The SECURE project and GCC in GCC Cauldron 2018: >> >> Speaker: Graham Markall >> >> The SECURE project is a 15 month program funded by Innovate UK, to >> take well known security techniques from academia and make them >> generally available in standard compilers, specfically GCC and

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-05 Thread Qing Zhao via Gcc-patches
> On Aug 5, 2020, at 9:45 AM, H.J. Lu wrote: > > On Wed, Aug 5, 2020 at 5:34 AM H.J. Lu > wrote: >> >> On Wed, Aug 5, 2020 at 5:31 AM Richard Biener wrote: >>> >>> >>> [PATCH] Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-03 Thread Qing Zhao via Gcc-patches
jul. 2020 je oseba Qing Zhao <mailto:qing.z...@oracle.com>> napisala: > > > > > > Richard and Uros, > > > > Could you please review the change that H.J and I rewrote based on your > > comments in the previous round of discussion? > > > > This

PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-07-28 Thread Qing Zhao via Gcc-patches
> On Jul 14, 2020, at 9:45 AM, Qing Zhao via Gcc-patches > wrote: > > Hi, Gcc team, > > This patch is a follow-up on the previous patch and corresponding discussion: > https://gcc.gnu.org/pipermail/gcc-patches/2020-May/545101.html > <https://gcc.gnu.org/pipermail/gcc-p

Re: [stage1][PATCH] Change semantics of -frecord-gcc-switches and add -frecord-gcc-switches-format.

2020-07-23 Thread Qing Zhao via Gcc-patches
Hi, Thanks a lot for the info. > On Jul 23, 2020, at 5:07 AM, Martin Liška wrote: > > On 7/21/20 6:24 PM, Qing Zhao wrote: >> 4. >> Our company is waiting for this patch to be committed to upstream. > > Hello. > > Please note that patch review can sometimes t

Re: [stage1][PATCH] Change semantics of -frecord-gcc-switches and add -frecord-gcc-switches-format.

2020-07-21 Thread Qing Zhao via Gcc-patches
PING^4. Our company is waiting for this patch to be committed to upstream. Thanks a lot. Qing > On Jun 16, 2020, at 7:49 AM, Martin Liška wrote: > > PING^3 > > On 6/2/20 11:16 AM, Martin Liška wrote: >> PING^2 >> On 5/15/20 11:58 AM, Martin Liška wrote: >>> We're in stage1: PING^1 >>> >>>

[Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-07-14 Thread Qing Zhao via Gcc-patches
any more comment? thanks. Qing gcc/ChangeLog: 2020-07-13 qing zhao mailto:qing.z...@oracle.com>> 2020-07-13 H.J. Lu mailto:hjl.to...@gmail.com>> * common.opt: Add new option -fzero-call-used-regs. * config/i386/i386.c (ix86_z

Re: PING[STAGE 1][PATCH][x86][1/3]: Add -mzero-caller-saved-regs=[skip|used-gpr|all-gpr|used|all]

2020-05-06 Thread Qing Zhao via Gcc-patches
Hi, Kees, > On May 4, 2020, at 1:21 PM, Kees Cook wrote: > > On Mon, May 04, 2020 at 11:51:49AM -0500, Qing Zhao wrote: >> Hi, >> >> This is a PING for this patch for gcc11 stage 1. >> >> https://gcc.gnu.org/pipermail/gcc-patches/2020-April/544058.html

Committed [Version 3][PATCH][gcc][PR94230]provide an option to change the size limitation for -Wmisleading-indent

2020-05-06 Thread Qing Zhao via Gcc-patches
FYI. > On Apr 23, 2020, at 5:13 PM, David Malcolm wrote: > > May need updating to match the hint message. > > [...] > > This is OK for stage 1 with those nits fixed. I committed the updated patch with all the suggestions today to gcc11 stage1 as:

PING[STAGE 1][PATCH][x86][1/3]: Add -mzero-caller-saved-regs=[skip|used-gpr|all-gpr|used|all]

2020-05-04 Thread Qing Zhao via Gcc-patches
Hi, This is a PING for this patch for gcc11 stage 1. https://gcc.gnu.org/pipermail/gcc-patches/2020-April/544058.html <https://gcc.gnu.org/pipermail/gcc-patches/2020-April/544058.html> Please take a look on it. Thanks. Qing > Begin forwarded message: > > From: Qing Zhao

Re: [Version 4][PATCH][gcc][PR94230]provide an option to change the size limitation for -Wmisleading-indent

2020-04-27 Thread Qing Zhao via Gcc-patches
Hi, David, > On Apr 24, 2020, at 5:36 PM, David Malcolm wrote: > > On Fri, 2020-04-24 at 17:22 -0500, Qing Zhao wrote: >> Hi, Dave, >> >> Thanks a lot for the review and comments. >> I just updated the patch with all your suggestions, bootstrapped it >>

[Version 4][PATCH][gcc][PR94230]provide an option to change the size limitation for -Wmisleading-indent

2020-04-24 Thread Qing Zhao via Gcc-patches
. Qing gcc/c-family/ChangeLog: 2020-04-24 qing zhao * c-indentation.c (get_visual_column): Add a hint to use the new -flarge-source-files option. gcc/ChangeLog: 2020-04-24 qing zhao * common.opt: Add -flarge-source-files. * doc/invoke.texi: Document

[Version 3][PATCH][gcc][PR94230]provide an option to change the size limitation for -Wmisleading-indent

2020-04-23 Thread Qing Zhao via Gcc-patches
Hi, Richard, This is the 3rd version of the patch, updated based on your previous comments. Please take a look at it and let me know whether it’s okay to commit? Thanks a lot for all your help. Qing. gcc/ChangeLog: 2020-04-22 qing zhao PR c/94230 * common.opt: Add -flarge

Re: [Version 2][PATCH][gcc][PR94230]provide an option to change the size limitation for -Wmisleading-indent

2020-04-23 Thread Qing Zhao via Gcc-patches
Hi, Richard, > On Apr 23, 2020, at 1:27 PM, Richard Sandiford > wrote: > > Qing Zhao writes: >> --- >> gcc/c-family/c-indentation.c | 3 +++ >> gcc/common.opt |

[Version 2][PATCH][gcc][PR94230]provide an option to change the size limitation for -Wmisleading-indent

2020-04-23 Thread Qing Zhao via Gcc-patches
. Documentation for this new option; 4. Update the testing case location-overflow-test-1.c to include the new hint. Please take a look at this new patch and let me know any new comment. thanks. Qing. gcc/ChangeLog: 2020-04-22 qing zhao PR c/94230 * common.opt: Add -flarge-source-files

Re: PING [PATCH][gcc][PR94230]provide an option to change the size limitation for -Wmisleading-indent

2020-04-22 Thread Qing Zhao via Gcc-patches
Hi, Richard And Dave: Thanks a lot for the review and comments. > On Apr 21, 2020, at 1:46 PM, Richard Sandiford > wrote: > > David Malcolm writes: >> On Tue, 2020-04-21 at 15:04 +0100, Richard Sandiford wrote >>> >>> Please add: >>> >>> PR c/94230 Will do. >>> *

[PATCH][x86][1/3]: Add -mzero-caller-saved-regs=[skip|used-gpr|all-gpr|used|all]

2020-04-17 Thread Qing Zhao via Gcc-patches
Hi, This is a PING for an old patch proposed by H. J. Lu on Oct, 2018: https://gcc.gnu.org/legacy-ml/gcc-patches/2018-10/msg02079.html This is the first patch of the total 3 patches set, which provides the following new feature: -mzero-caller-saved-regs=[skip|used-gpr|all-gpr|used|all]

<    5   6   7   8   9   10   11   12   >