Skip to contentSkip to conversation

qemu-fast kernel patch question

Qemu-devel Lindsay Mathieson 4 participants 8 messages Jul 24, 2004 – Jul 26, 2004

lore
Share & tools
lore
#0 lore raw

Hi All - great project, have managed to instal win98 and its usable under linux - thats a miracle.

I'm using qemu 0.6.0 (website binaries) and Mandrake Official 10, kernel 2.6.3-15mdk and want to modify it for the fast option. I have include/asm/page.h, which looks slightly different to what is described but essentially the same. However there is no vmlinux.lds anywhere to modify.

Any suggestions ?

Thanks - Lindsay

#1 lore raw
Quoted 1 line · Lindsay Mathieson

I'm using qemu 0.6.0 (website binaries) and Mandrake Official 10, kernel 2.6.3-15mdk and want to modify it for the fast option. I have include/asm/page.h, which looks slightly different to what is described but essentially the same. However there is no vmlinux.lds anywhere to modify.

I think I figured it out - I'm meant to apply the linux-2.6-qemu-fast.patch patch ? am compiling it now, we'll see if it works in a couple of hours ....

Which lead to my next dumb question - the fast patch for the 2.6 kernel, I'm assuming its to allow qemu-fast to run under linux 2.6, not for linux 2.6 to be used as a guest under qemu-fast, the docs seemed a bit ambigous on this.

Thanks - lindsay

#2 lore raw

Hello

Quoted 4 lines

Which lead to my next dumb question - the fast patch for the 2.6 kernel, I'm assuming its to allow qemu-fast to run under linux 2.6, not for linux 2.6 to be used as a guest under qemu-fast, the docs seemed a bit ambigous on this.

The correct meaning is...the "qemu-fast patch" means to be applied on guest kernel so the guest's kernel memory layout won't introduce any conflict when qemu-fast is doing direct MMU operation on host

Hope it helps

regards

Mulyadi

#3 lore raw
Quoted 11 lines · Mulyadi Santosa

Hello

Quoted 6 lines

Which lead to my next dumb question - the fast patch for the 2.6 kernel, I'm assuming its to allow qemu-fast to run under linux 2.6, not for linux 2.6 to be used as a guest under qemu-fast, the docs seemed a bit ambigous on this.

Quoted 6 lines

The correct meaning is...the "qemu-fast patch" means to be applied on guest kernel so the guest's kernel memory layout won't introduce any conflict when qemu-fast is doing direct MMU operation on host

Hope it helps

Yup, thanks - I don't need to patch my host kernel to run qemu-fast then.

Should qemu-fast with with Win98 then ?

Thanks - Lindsay

#4 lore raw

Hello

Quoted 2 lines

Yup, thanks - I don't need to patch my host kernel to run qemu-fast then. Should qemu-fast with with Win98 then ?

Do you mean:
1. applying qemu-fast patch to Win98 guest? --> Not a chance :-)
2. running qemu-fast on top of Win98 host? Well, I haven't tried it personally. But, if you can run qemu-fast on Win98 host, I doubt if qemu-fast can do direct MMU access. The reason is: to do direct MMU access, the developers need to know to request that into host kernel. On Linux or other open source kernel, we can find it out, but on closed kernel, this would be difficult.....

The conclusion: just run the usual "qemu" on top of Win98 host

regards

Mulyadi

#5 lore raw

Hi,

Quoted 10 lines · Mulyadi Santosa

Do you mean:
1. applying qemu-fast patch to Win98 guest? --> Not a chance :-)
2. running qemu-fast on top of Win98 host? Well, I haven't tried it personally. But, if you can run qemu-fast on Win98 host, I doubt if qemu-fast can do direct MMU access. The reason is: to do direct MMU access, the developers need to know to request that into host kernel. On Linux or other open source kernel, we can find it out, but on closed kernel, this would be difficult.....

The conclusion: just run the usual "qemu" on top of Win98 host

Here's a quote from qemu-tech.html:
---
2.10 MMU emulation

For system emulation, QEMU uses the mmap() system call to emulate the target CPU MMU. It works as long the emulated OS does not use an area reserved by the host OS (such as the area above 0xc0000000 on x86 Linux).
---

As far as I understand this, the qemu kernel patch makes the guest kernel use a different reserved area than the linux host. So it shouldn't matter which kernel I apply the patch to, right? If I patch the (linux) host kernel, I should be able to boot any unpatched (linux) guest kernel, if I don't patch the (linux) host kernel, I have to patch my (linux) guest kernels. Or do we need a patch-aware qemy-fast to run on a patched host?

Assuming that OS XYZ does not use the area around 0xc0000000, it should work inside qemu-fast, right? And if it does use that area, it should work inside qemu-fast on a patched host?

Maybe one of the wizards could clarify this...

Thanks
Johannes

#6 lore raw
Quoted 19 lines · Johannes Martin

Hi,

Here's a quote from qemu-tech.html:
---
2.10 MMU emulation

For system emulation, QEMU uses the mmap() system call to emulate the target CPU MMU. It works as long the emulated OS does not use an area reserved by the host OS (such as the area above 0xc0000000 on x86 Linux).
---

As far as I understand this, the qemu kernel patch makes the guest kernel use a different reserved area than the linux host. So it shouldn't matter which kernel I apply the patch to, right? If I patch the (linux) host kernel, I should be able to boot any unpatched (linux) guest kernel, if I don't patch the (linux) host kernel, I have to patch my (linux) guest kernels. Or do we need a patch-aware qemy-fast to run on a patched host?

Quoted 9 lines

Assuming that OS XYZ does not use the area around 0xc0000000, it should work inside qemu-fast, right? And if it does use that area, it should work inside qemu-fast on a patched host?

Maybe one of the wizards could clarify this...

Thanks
Johannes

You could patch the host not to use that area, but then it would have to use another area ... thus you'd have to patch the guest anyways, regardless of the host.

Fabrice has said that the eventual idea is to have qemu-fast detect which areas are not accessable via mmap() and use the softmmu to emulate for only those areas. The rest would be accessed via the faster mmap(). So, if you patch qemu-fast in the right way, you might not have to patch the guest or the host. :)

Quoted 6 lines

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Signature · 2 lines
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
#7 lore raw

Hello Jim :-)

First thank you to help correcting my logics :-)

Quoted 3 lines

You could patch the host not to use that area, but then it would have to use another area ... thus you'd have to patch the guest anyways, regardless of the host.

Agree....why I don't think in such a logic before...hrrrrrr :-)

Quoted 5 lines

Fabrice has said that the eventual idea is to have qemu-fast detect which areas are not accessable via mmap() and use the softmmu to emulate for only those areas. The rest would be accessed via the faster mmap(). So, if you patch qemu-fast in the right way, you might not have to patch the guest or the host. :)

So, that would be running mmap() scanning on early boot of Qemu, am I right? from there, Qemu can take decision which area is free and which is already taken by host....Hm....looks like Qemu needs additional kernel module inserted to host's kernel to help Qemu on "memory layout" negotiation....:-)

regards

Mulyadi