Re: KVM emulation failure with "movups" instruction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2017-08-10 6:02 GMT+08:00 Anatol Pomozov <anatol.pomozov@xxxxxxxxx>:
> Hello Wanpeng
>
> Unfortunately I do not have a simple test case for this issue. The
> issue I see is with a large non-published project compiled with the
> latest version of clang.
>
> Isn't information provided by QEMU enough? Is there a way to enable
> additional debug log in KVM?

KVM just has basic support to SSE emulation, and it can't emulate the
movups instruction currently, in addition, I can reproduce this by a
small change in kvm-unit-tests/emulator.flat.

Regards,
Wanpeng Li

>
> On Mon, Aug 7, 2017 at 3:00 PM, Wanpeng Li <kernellwp@xxxxxxxxx> wrote:
>> 2017-08-08 2:45 GMT+08:00 Anatol Pomozov <anatol.pomozov@xxxxxxxxx>:
>>> Hi David
>>>
>>> On Mon, Aug 7, 2017 at 9:59 AM, David Matlack <dmatlack@xxxxxxxxxx> wrote:
>>>> Likely this instruction is accessing an MMIO region (probably a VGA
>>>> buffer, given "mov    $0xb8f0e,%ecx"). This will cause a trap to KVM
>>>> and KVM will try to emulate the instruction. The instruction doing the
>>>> MMIO access is an SSE instruction,
>>>
>>> It is correct. The emulation error happens in printf() kernel function
>>> that formats a string and then prints it VGA area. Compilers (both
>>> clang and gcc) think that SSE instructions are more efficient in
>>> dealing with strings and that's why I have SSE instructions here.
>>>
>>>> which KVM does not have support to
>>>> emulate, thus the internal error. If you didn't hand write this
>>>> assembly I would try compiling your kernel with compilation flags to
>>>> disable SSE code generation and see if that fixes your issue.
>>>
>>> Adding "-mno-sse" and removing some floating point functionality in my
>>> kernel make the emulation error go away. So it confirms your thesis.
>>>
>>> Though I need floating point/SSE in my kernel and I can't disable SSE
>>> completely. Instead I would love to understand why KVM can't use SSE
>>> with VGA memory? I tested my kernel binary with bare hardware, KVM,
>>> VMWare, QEMU and only KVM fails.
>>
>> Actually the KVM supports SSE emulation in some degree, please post
>> your testcase here.
>>
>> Regards,
>> Wanpeng Li



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux