Page MenuHomePhabricator

YangKeao (YangKeao)
User

Projects

User does not belong to any projects.

User Details

User Since
Mar 17 2021, 12:29 AM (8 w, 3 d)

Recent Activity

Mon, Apr 26

YangKeao added a comment to D99585: [X86] add dwarf information for loop stack probe.

Does anyone know why the unit test doesn't pass?

Mon, Apr 26, 7:49 AM · Restricted Project
YangKeao added a comment to D99585: [X86] add dwarf information for loop stack probe.

Oops. Sorry, it doesn't matter. The stack probing part will never be a parent frame of anything, so it would still be nice as it's the first frame to unwind. This patch is still good 🍻 .

Mon, Apr 26, 7:06 AM · Restricted Project
YangKeao added a comment to D99585: [X86] add dwarf information for loop stack probe.

Please correct me if I'm wrong. I realize that generating a DWARF message based on r11d doesn't help the unwinder to get a correct backtrace.

Mon, Apr 26, 7:04 AM · Restricted Project

Wed, Apr 21

YangKeao added a comment to D99585: [X86] add dwarf information for loop stack probe.

Better to rebase it since many changes had committed with D99579.

Wed, Apr 21, 11:02 AM · Restricted Project
YangKeao updated the diff for D99585: [X86] add dwarf information for loop stack probe.

rebase origin/main

Wed, Apr 21, 10:57 AM · Restricted Project

Apr 15 2021

YangKeao abandoned D98789: [PEI] add dwarf information for stack probe.

Stack probing with loop should be discussed further in D99585.

Apr 15 2021, 11:02 AM · Restricted Project

Mar 31 2021

YangKeao added a comment to D99579: [X86] add dwarf annotation for inline stack probe.

Landed this, thank you!

Mar 31 2021, 8:52 PM · Restricted Project

Mar 30 2021

YangKeao added a comment to D99579: [X86] add dwarf annotation for inline stack probe.

Do you have ability to commit this yourself, or would you need somebody to do it for you?

Mar 30 2021, 5:35 PM · Restricted Project
YangKeao updated subscribers of D99585: [X86] add dwarf information for loop stack probe.

@nagisa This is another part of D98789, and is only implemented for 64-bit platform.

Mar 30 2021, 6:03 AM · Restricted Project
YangKeao requested review of D99585: [X86] add dwarf information for loop stack probe.
Mar 30 2021, 6:02 AM · Restricted Project
YangKeao added a comment to D99579: [X86] add dwarf annotation for inline stack probe.

I installed clang-format later, and nothing found (there is no lint message). How could I update this patch and remove the "clang-format not found in user's PATH; not linting file." warning? (or just left it here 😋 )

Mar 30 2021, 5:13 AM · Restricted Project
YangKeao updated subscribers of D99579: [X86] add dwarf annotation for inline stack probe.

@nagisa This is the inline part of D98789 😋 .

Mar 30 2021, 5:08 AM · Restricted Project
YangKeao requested review of D99579: [X86] add dwarf annotation for inline stack probe.
Mar 30 2021, 5:02 AM · Restricted Project

Mar 29 2021

YangKeao added a comment to D98789: [PEI] add dwarf information for stack probe.

@YangKeao Will you be pursuing this further? Should I take over this for you?

Mar 29 2021, 10:09 PM · Restricted Project

Mar 19 2021

YangKeao added a comment to D98789: [PEI] add dwarf information for stack probe.

btw I prototyped a D98906: [X86] Improve lowering of the unrolled inline-asm probing yesterday as an alternative approach towards improving the unrolled case.

Mar 19 2021, 4:46 AM · Restricted Project
YangKeao updated the diff for D98789: [PEI] add dwarf information for stack probe.

left comments about 32bit

Mar 19 2021, 12:13 AM · Restricted Project

Mar 18 2021

YangKeao updated the diff for D98789: [PEI] add dwarf information for stack probe.

Remove dwarf information for 32bit and use R11 as the iterate bound / dwarf register

Mar 18 2021, 11:59 PM · Restricted Project
YangKeao added a comment to D98789: [PEI] add dwarf information for stack probe.

Normally, I'd expect some register is naturally free in the prologue, but you could get into weird situations. On 32-bit specifically, consider compiling with -mregparm=3; I think there are no registers which are unconditionally safe in that case. One possibility is to always use EAX, and just save/restore it if necessary. See isEAXAlive in X86FrameLowering::emitPrologue.

Alternatively, you could ensure that some callee-save GPR is spilled, and explicitly use that register. This is taking advantage of the fact this is part of the prologue: there can't be any other uses of callee-save registers at that point. (In theory, it might be possibly for an exotic calling convention to have no callee-save registers, but I don't think there are any in practice.)

Mar 18 2021, 10:49 PM · Restricted Project
YangKeao added inline comments to D98789: [PEI] add dwarf information for stack probe.
Mar 18 2021, 10:39 PM · Restricted Project
YangKeao added a comment to D98789: [PEI] add dwarf information for stack probe.

A care must be taken to not overwrite the arguments as well. For instance on SysV x86_64 ABI rdi, rsi, rdx, rcx, r8, r9 are used to pass in integer arguments. For functions with a small number of arguments one of these could be reused, but if a function happens to use all of them, unconditional use of rdx would clobber the argument.

Mar 18 2021, 10:39 AM · Restricted Project
YangKeao updated the diff for D98789: [PEI] add dwarf information for stack probe.

Use RAX/EAX as the iterate register, as RDX/EDX is used as arguments under systemv

Mar 18 2021, 10:38 AM · Restricted Project
YangKeao updated the diff for D98789: [PEI] add dwarf information for stack probe.

Use RDX/EDX instead of RDI/EDI, as RDI/EDI is callee saved on Win64 calling convension

Mar 18 2021, 9:08 AM · Restricted Project
YangKeao added a comment to D98789: [PEI] add dwarf information for stack probe.

What registers can be used? I did a quick search and couldn't find anything.

Mar 18 2021, 8:45 AM · Restricted Project
YangKeao updated the diff for D98789: [PEI] add dwarf information for stack probe.

reformat the code

Mar 18 2021, 3:21 AM · Restricted Project
YangKeao added inline comments to D98789: [PEI] add dwarf information for stack probe.
Mar 18 2021, 12:44 AM · Restricted Project
YangKeao updated the diff for D98789: [PEI] add dwarf information for stack probe.
  • Use rdi to represent the stack bound and CFA
  • Remove extra tailing offset adjust
Mar 18 2021, 12:40 AM · Restricted Project

Mar 17 2021

YangKeao added a comment to D98789: [PEI] add dwarf information for stack probe.

To clarify, I've done some more reading now, and figured out where I went wrong. For a long time, LLVM did not emit accurate unwind info to describe the prologue/epilogue (and still doesn't on some targets), so I was under the impression it wasn't possible. Clearly, it is, and it's implemented on x86.


The change to use r11 isn't implemented correctly: we can't adjust the stack pointer until *after* we've probed the relevant pages. It'll appear to work, but it won't actually provide complete protection if a signal handler triggers at the wrong time.

Mar 17 2021, 10:22 PM · Restricted Project
YangKeao added a comment to D98789: [PEI] add dwarf information for stack probe.

There has been a bug report for this on bugzilla. A more "downstream" context for this feature is discussed in rust#83139.

Mar 17 2021, 9:22 AM · Restricted Project
YangKeao requested review of D98789: [PEI] add dwarf information for stack probe.
Mar 17 2021, 9:14 AM · Restricted Project