Re: [PATCH 1/2] KVM: x86: emulate fxsave and fxrstor

2016-10-27 Thread Bandan Das
Radim Krčmář writes: > 2016-10-26 20:17-0400, Bandan Das: >> Radim Krčmář writes: >> ... >>> +static int check_fxsr(struct x86_emulate_ctxt *ctxt) >>> +{ >>> + u32 eax = 1, ebx, ecx = 0, edx; >>> + >>> + ctxt->ops->get_cpuid(ctxt, , , , ); >>> + if

Re: [PATCH 1/2] KVM: x86: emulate fxsave and fxrstor

2016-10-27 Thread Bandan Das
Radim Krčmář writes: > 2016-10-26 20:17-0400, Bandan Das: >> Radim Krčmář writes: >> ... >>> +static int check_fxsr(struct x86_emulate_ctxt *ctxt) >>> +{ >>> + u32 eax = 1, ebx, ecx = 0, edx; >>> + >>> + ctxt->ops->get_cpuid(ctxt, , , , ); >>> + if (!(edx & FFL(FXSR))) >>> +

Re: [PATCH 1/2] KVM: x86: emulate fxsave and fxrstor

2016-10-27 Thread Radim Krčmář
2016-10-26 20:17-0400, Bandan Das: > Radim Krčmář writes: > ... >> +static int check_fxsr(struct x86_emulate_ctxt *ctxt) >> +{ >> +u32 eax = 1, ebx, ecx = 0, edx; >> + >> +ctxt->ops->get_cpuid(ctxt, , , , ); >> +if (!(edx & FFL(FXSR))) >> +return

Re: [PATCH 1/2] KVM: x86: emulate fxsave and fxrstor

2016-10-27 Thread Radim Krčmář
2016-10-26 20:17-0400, Bandan Das: > Radim Krčmář writes: > ... >> +static int check_fxsr(struct x86_emulate_ctxt *ctxt) >> +{ >> +u32 eax = 1, ebx, ecx = 0, edx; >> + >> +ctxt->ops->get_cpuid(ctxt, , , , ); >> +if (!(edx & FFL(FXSR))) >> +return emulate_ud(ctxt); >> + >>

Re: [PATCH 1/2] KVM: x86: emulate fxsave and fxrstor

2016-10-26 Thread Bandan Das
Hi Radim, Radim Krčmář writes: ... > static __always_inline int __linearize(struct x86_emulate_ctxt *ctxt, > @@ -704,7 +708,7 @@ static __always_inline int __linearize(struct > x86_emulate_ctxt *ctxt, > } > break; > } > - if

Re: [PATCH 1/2] KVM: x86: emulate fxsave and fxrstor

2016-10-26 Thread Bandan Das
Hi Radim, Radim Krčmář writes: ... > static __always_inline int __linearize(struct x86_emulate_ctxt *ctxt, > @@ -704,7 +708,7 @@ static __always_inline int __linearize(struct > x86_emulate_ctxt *ctxt, > } > break; > } > - if (insn_aligned(ctxt, size) &&

[PATCH 1/2] KVM: x86: emulate fxsave and fxrstor

2016-10-26 Thread Radim Krčmář
Internal errors were reported on 16 bit fxsave and fxrstor with iPXE. Old Intels don't have unrestricted_guest, so we have to emulate them. The patch takes advantage of the hardware implementation. There should be no problem as long as the buffer is aligned. Signed-off-by: Radim Krčmář

[PATCH 1/2] KVM: x86: emulate fxsave and fxrstor

2016-10-26 Thread Radim Krčmář
Internal errors were reported on 16 bit fxsave and fxrstor with iPXE. Old Intels don't have unrestricted_guest, so we have to emulate them. The patch takes advantage of the hardware implementation. There should be no problem as long as the buffer is aligned. Signed-off-by: Radim Krčmář ---