[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] x86emul: correct put_fpu()'s segment selector handling
On 07.01.2025 16:37, Andrew Cooper wrote: > On 07/01/2025 2:33 pm, Jan Beulich wrote: >> All selector fields under ctxt->regs are (normally) poisoned in the HVM >> case, and the four ones besides CS and SS are potentially stale for PV. >> Avoid using them in the hypervisor incarnation of the emulator, when >> trying to cover for a missing ->read_segment() hook. >> >> To make sure there's always a valid ->read_segment() handler for all HVM >> cases, add a respective function to shadow code, even if it is not >> expected for FPU insns to be used to update page tables. >> >> Fixes: 0711b59b858a ("x86emul: correct FPU code/data pointers and opcode >> handling") >> Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> >> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> >> --- >> The code comment may want adjusting in the course of FRED work. > > It compiles when displacing my temporary patch in the FRED branch. I've > not got the ABI compatibility in userspace working yet, but > regs->{ds,es,fs,gs} will be staying, so the #else case should be fine > (assuming they're populated properly). > > So, tentatively, Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> Thanks. > That said, I think it would be nicer to see about excluding the FPU in > these cases. Both cases lacking read_segment() hooks are pagetable > emulation, and I'd say it's more likely to be code corruption than there > actually being x87 instructions in the middle of a dual 32bit PAE update. I considered this case, but decided against going this route. We shouldn't be stricter than necessary towards what we permit guests to do, however odd it might look to us. Jan
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |