Re: [RFC PATCH] target/i386: Truncate ESP when exiting from long mode

2023-07-31 Thread Ard Biesheuvel
On Wed, 26 Jul 2023 at 17:01, Richard Henderson wrote: > > On 7/26/23 01:17, Ard Biesheuvel wrote: > > While working on some EFI boot changes for Linux/x86, I noticed that TCG > > deviates from > > bare metal when it comes to how it handles the value of the stack pointer > > register RSP > > whe

Re: [RFC PATCH] target/i386: Truncate ESP when exiting from long mode

2023-07-28 Thread Ard Biesheuvel
On Fri, 28 Jul 2023 at 02:17, Richard Henderson wrote: > > On 7/27/23 14:36, Ard Biesheuvel wrote: > > On Thu, 27 Jul 2023 at 19:56, Richard Henderson > > wrote: > >> > >> On 7/26/23 08:01, Richard Henderson wrote: > >>> On 7/26/23 01:17, Ard Biesheuvel wrote: > Hints welcome on where the ar

Re: [RFC PATCH] target/i386: Truncate ESP when exiting from long mode

2023-07-27 Thread Richard Henderson
On 7/27/23 14:36, Ard Biesheuvel wrote: On Thu, 27 Jul 2023 at 19:56, Richard Henderson wrote: On 7/26/23 08:01, Richard Henderson wrote: On 7/26/23 01:17, Ard Biesheuvel wrote: Hints welcome on where the architectural behavior is specified, and in particular, whether or not other 64-bit GP

Re: [RFC PATCH] target/i386: Truncate ESP when exiting from long mode

2023-07-27 Thread Ard Biesheuvel
On Thu, 27 Jul 2023 at 19:56, Richard Henderson wrote: > > On 7/26/23 08:01, Richard Henderson wrote: > > On 7/26/23 01:17, Ard Biesheuvel wrote: > >> Hints welcome on where the architectural behavior is specified, and in > >> particular, > >> whether or not other 64-bit GPRs can be relied upon t

Re: [RFC PATCH] target/i386: Truncate ESP when exiting from long mode

2023-07-27 Thread Richard Henderson
On 7/26/23 08:01, Richard Henderson wrote: On 7/26/23 01:17, Ard Biesheuvel wrote: Hints welcome on where the architectural behavior is specified, and in particular, whether or not other 64-bit GPRs can be relied upon to preserve their full 64-bit length values. No idea about chapter and ver

Re: [RFC PATCH] target/i386: Truncate ESP when exiting from long mode

2023-07-26 Thread Richard Henderson
On 7/26/23 01:17, Ard Biesheuvel wrote: While working on some EFI boot changes for Linux/x86, I noticed that TCG deviates from bare metal when it comes to how it handles the value of the stack pointer register RSP when dropping out of long mode. On bare metal, RSP is truncated to 32 bits, even

[RFC PATCH] target/i386: Truncate ESP when exiting from long mode

2023-07-26 Thread Ard Biesheuvel
While working on some EFI boot changes for Linux/x86, I noticed that TCG deviates from bare metal when it comes to how it handles the value of the stack pointer register RSP when dropping out of long mode. On bare metal, RSP is truncated to 32 bits, even if the code that runs in 32-bit protected m