Re: [PATCH 4/5] x86/asm/entry/32: Replace RESTORE_RSI_RDI[_RDX] with open-coded 32-bit reads

Ingo Molnar
2015-06-14T08:41:14Z

* Denys Vlasenko <dvlasenk@redhat.com> wrote:

> +8b 74 24 68 mov 0x68(%rsp),%esi
> +8b 7c 24 70 mov 0x70(%rsp),%edi
> +8b 54 24 60 mov 0x60(%rsp),%edx

Btw., could you (in another patch) order the restoration properly, by pt_regs
memory order, where possible?

So this:

> + movl RSI(%rsp), %esi
> + movl RDI(%rsp), %edi
> + movl RDX(%rsp), %edx
> movl RIP(%rsp), %ecx
> movl EFLAGS(%rsp), %r11d

would become:

movl RDX(%rsp), %edx
movl RSI(%rsp), %esi
movl RDI(%rsp), %edi
movl RIP(%rsp), %ecx
movl EFLAGS(%rsp), %r11d

... or so.

In fact I'd suggest we structure movl based restoration precisely after the field
order in the structure, and comment on cases where we depart from what's in
pt_regs - to make it all easier to verify.

Thanks,

Ingo