Re: [PATCH] x86emul: fix SYSENTER/SYSCALL switching into 64-bit mode

2021-02-10 Thread Andrew Cooper
On 10/02/2021 14:18, Jan Beulich wrote: > On 10.02.2021 15:02, Andrew Cooper wrote: >> On 10/02/2021 13:54, Jan Beulich wrote: >>> Just like considered in the post-description >>> remark, we could drop the conditional part from sysexit's >>> setting of _regs.r(ip), and _then_ we would indeed need a

Re: [PATCH] x86emul: fix SYSENTER/SYSCALL switching into 64-bit mode

2021-02-10 Thread Jan Beulich
On 10.02.2021 15:02, Andrew Cooper wrote: > On 10/02/2021 13:54, Jan Beulich wrote: >> On 10.02.2021 13:28, Andrew Cooper wrote: >>> On 10/02/2021 09:57, Jan Beulich wrote: When invoked by compat mode, mode_64bit() will be false at the start of emulation. The logic after complete_insn, ho

Re: [PATCH] x86emul: fix SYSENTER/SYSCALL switching into 64-bit mode

2021-02-10 Thread Andrew Cooper
On 10/02/2021 13:54, Jan Beulich wrote: > On 10.02.2021 13:28, Andrew Cooper wrote: >> On 10/02/2021 09:57, Jan Beulich wrote: >>> When invoked by compat mode, mode_64bit() will be false at the start of >>> emulation. The logic after complete_insn, however, needs to consider the >>> mode switched i

Re: [PATCH] x86emul: fix SYSENTER/SYSCALL switching into 64-bit mode

2021-02-10 Thread Jan Beulich
On 10.02.2021 13:28, Andrew Cooper wrote: > On 10/02/2021 09:57, Jan Beulich wrote: >> When invoked by compat mode, mode_64bit() will be false at the start of >> emulation. The logic after complete_insn, however, needs to consider the >> mode switched into, in particular to avoid truncating RIP. >>

Re: [PATCH] x86emul: fix SYSENTER/SYSCALL switching into 64-bit mode

2021-02-10 Thread Andrew Cooper
On 10/02/2021 09:57, Jan Beulich wrote: > When invoked by compat mode, mode_64bit() will be false at the start of > emulation. The logic after complete_insn, however, needs to consider the > mode switched into, in particular to avoid truncating RIP. > > Inspired by / paralleling and extending Linux

[PATCH] x86emul: fix SYSENTER/SYSCALL switching into 64-bit mode

2021-02-10 Thread Jan Beulich
When invoked by compat mode, mode_64bit() will be false at the start of emulation. The logic after complete_insn, however, needs to consider the mode switched into, in particular to avoid truncating RIP. Inspired by / paralleling and extending Linux commit 943dea8af21b ("KVM: x86: Update emulator