qemu-discuss
[Top][All Lists]
Advanced

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

RE: Emulate if x86-64 on x86-64


From: Vadim Idelchuk
Subject: RE: Emulate if x86-64 on x86-64
Date: Tue, 13 Aug 2024 00:58:40 +0300

The solution for you is present – qemu-CPUTYPE:

- qemu-aarch64

- qemu-x86_64

etc

 

 

Best regards

 

Vadim Idelchuk

 

vadim.idelchuk@mail.ru

 

From: qemu-discuss-bounces+vadim.idelchuk=mail.ru@nongnu.org [mailto:qemu-discuss-bounces+vadim.idelchuk=mail.ru@nongnu.org] On Behalf Of Chris Parker
Sent: יום ב 12 אוגוסט 2024 20:47
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-discuss@nongnu.org
Subject: Re: Emulate if x86-64 on x86-64

 

Hi Peter,

 

Yes, I know.  Thank you very much for your response (including the follow-up), which was exactly what I was doing wrong!

 

BTW - I am also experimenting to see if the QEMU User Space emulator would be a better solution for me, since setting up and running a whole (slow) VM just to run one problematic program is overkill and annoying for me anyway. If the proprietary shared libraries that the offending application get executed by QEMU-x86_64, that would be my best solution. I am going to try that later.

 

FYI - I have been interested for some time in making an accelerator that would run in a sort-of hybrid KVM mode, where host-supported instructions are executed by the processor, but unsupported functions are provided by something like the TCG. How feasible that is depends on how new and different the missing instructions are.  For example, this first came up when I wanted to run a x86 32-bit program with SSE2 instructions on a Pentium III which only had SSE instructions; that would be doable in theory since SSE2 only adds new processor instructions, but not any new registers (if it did, that would be a lot more complicated or even impossible to support in this way).  My original idea was to handle the ILLEGAL INSTRUCTION processor exception and examine the offending instruction to see if it was covered in the TCG implementation, and if so execute the TCG and then resume the program, which in theory is totally possible. Now I am facing a similar issue running x64 64-bit SSE4.1 instructions on a 64-bit processor that only supports up to SSE2, so it's like deja vu! I don't know if/when I'll ever get around to coding something like this, but as you can see, the problem isn't going away, and demand for this sort of thing is likely to grow in the coming years as applications and operating systems continue to disregard old hardware and begin to use newer processor features.

 

 

CP

 

On Mon, Aug 12, 2024 at 1:01 PM Peter Maydell <peter.maydell@linaro.org> wrote:

On Mon, 12 Aug 2024 at 14:19, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Mon, 12 Aug 2024 at 14:02, Chris Parker <chris@parkerfamily.name> wrote:
> > For example, I want to run an application that contains SSE4.1 instructions on a host machine that doesn't have support for these. If I try to do it with QEMUt, I'm just given warnings at startup and it doesn't seem that they have been made available?
> >
> > $ qemu-system-x86_64 -enable-kvm -cpu "host,+ssse3,+sse4.1" -m 256M -smp 1 -boot d -cdrom /home/chris/vmware/iso/TinyCorePure64-15.0.iso -vga qxl -device AC97
> > qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.01H:ECX.ssse3 [bit 9]
> > qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.01H:ECX.sse4.1 [bit 19]
> >
> > Is there something I can change in that command line to make this work, or why is this impossible?  I know emulation is going to be inefficient and slow, but my main concern is getting it to actually work at all!
>
> Your command line has "-enable-kvm", which means "don't use emulation,
> use the host CPU's virtualization support to run the guest code directly
> on the host CPU". In this setup, you can only get what the host CPU
> actually has.
>
> If you want pure emulation, then remove the "-enable-kvm" option: the
> default is TCG emulation. You'll also probably need to specify a CPU
> type that isn't "host", because (I think) that CPU type only works
> with KVM.

By the way, just to clarify -- this will mean that absolutely
everything will be emulated: your whole guest OS and every
program running under it. There's no way to have "run fast
using the real CPU for the instructions that it does have,
and emulate only the parts that it is missing" with QEMU.

-- PMM


Никаких вирусов.www.avast.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]