* [PATCH 4/10] Trivial: Make decode_register() static
[not found] ` <1184678129.10380.10.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2007-07-17 13:16 ` Rusty Russell
[not found] ` <1184678171.10380.12.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Rusty Russell @ 2007-07-17 13:16 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm-devel
I have shied away from touching x86_emulate.c (it could definitely use
some love, but it is forked from the Xen code, and it would be more
productive to cross-merge fixes).
Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>
diff -r c7348ac9677f drivers/kvm/x86_emulate.c
--- a/drivers/kvm/x86_emulate.c Tue Jul 17 13:33:39 2007 +1000
+++ b/drivers/kvm/x86_emulate.c Tue Jul 17 13:35:19 2007 +1000
@@ -443,8 +443,13 @@ struct operand {
(((reg) + _inc) & ((1UL << (ad_bytes << 3)) - 1)); \
} while (0)
-void *decode_register(u8 modrm_reg, unsigned long *regs,
- int highbyte_regs)
+/*
+ * Given the 'reg' portion of a ModRM byte, and a register block, return a
+ * pointer into the block that addresses the relevant register.
+ * @highbyte_regs specifies whether to decode AH,CH,DH,BH.
+ */
+static void *decode_register(u8 modrm_reg, unsigned long *regs,
+ int highbyte_regs)
{
void *p;
diff -r c7348ac9677f drivers/kvm/x86_emulate.h
--- a/drivers/kvm/x86_emulate.h Tue Jul 17 13:33:39 2007 +1000
+++ b/drivers/kvm/x86_emulate.h Tue Jul 17 13:35:06 2007 +1000
@@ -152,12 +152,4 @@ int x86_emulate_memop(struct x86_emulate
int x86_emulate_memop(struct x86_emulate_ctxt *ctxt,
struct x86_emulate_ops *ops);
-/*
- * Given the 'reg' portion of a ModRM byte, and a register block, return a
- * pointer into the block that addresses the relevant register.
- * @highbyte_regs specifies whether to decode AH,CH,DH,BH.
- */
-void *decode_register(u8 modrm_reg, unsigned long *regs,
- int highbyte_regs);
-
#endif /* __X86_EMULATE_H__ */
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 4/10] Trivial: Make decode_register() static
@ 2007-07-17 13:27 Gregory Haskins
[not found] ` <469C8B870200005A00027AE6-Igcdv/6uVdMHoYOw/+koYqIwWpluYiW7@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Gregory Haskins @ 2007-07-17 13:27 UTC (permalink / raw)
To: rusty-8n+1lVoiYb80n/F98K4Iww; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Tue, 2007-07-17 at 23:16 +1000, Rusty Russell wrote:
> I have shied away from touching x86_emulate.c (it could definitely use
> some love, but it is forked from the Xen code, and it would be more
> productive to cross-merge fixes).
On this topic, here's an idea I have been kicking around for a while:
If the x86_emulate code is so buggy/incomplete, and the QEMU one seems
to be able to generally handle most situations...could we simply exit to
userspace and use the qemu emulator somehow? I realize the overhead is
greater, but slow+working is > fast+broken in my book ;)
Perhaps a hybrid solution would work? E.g. exit to qemu emulator when
the in-kernel stuff hits a mis-emulation point (do we realize this
consciously in the code, or only after the guest crashes?)
I'm not really sure if this is plausible. Its just something I was
thinking about.
Regards,
-Greg
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 4/10] Trivial: Make decode_register() static
[not found] ` <1184678171.10380.12.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2007-07-17 13:29 ` Avi Kivity
0 siblings, 0 replies; 7+ messages in thread
From: Avi Kivity @ 2007-07-17 13:29 UTC (permalink / raw)
To: Rusty Russell; +Cc: kvm-devel
Rusty Russell wrote:
> I have shied away from touching x86_emulate.c (it could definitely use
> some love, but it is forked from the Xen code, and it would be more
> productive to cross-merge fixes).
>
>
Applied, thanks.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 4/10] Trivial: Make decode_register() static
[not found] ` <469C8B870200005A00027AE6-Igcdv/6uVdMHoYOw/+koYqIwWpluYiW7@public.gmane.org>
@ 2007-07-17 13:38 ` Dor Laor
2007-07-17 13:41 ` Anthony Liguori
2007-07-17 13:43 ` [PATCH 4/10] " Avi Kivity
2 siblings, 0 replies; 7+ messages in thread
From: Dor Laor @ 2007-07-17 13:38 UTC (permalink / raw)
To: Gregory Haskins, rusty-8n+1lVoiYb80n/F98K4Iww
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
>> I have shied away from touching x86_emulate.c (it could definitely
use
>> some love, but it is forked from the Xen code, and it would be more
>> productive to cross-merge fixes).
>
>On this topic, here's an idea I have been kicking around for a while:
>
>If the x86_emulate code is so buggy/incomplete, and the QEMU one seems
>to be able to generally handle most situations...could we simply exit
to
>userspace and use the qemu emulator somehow? I realize the overhead is
>greater, but slow+working is > fast+broken in my book ;)
>
>Perhaps a hybrid solution would work? E.g. exit to qemu emulator when
>the in-kernel stuff hits a mis-emulation point (do we realize this
>consciously in the code, or only after the guest crashes?)
>
>I'm not really sure if this is plausible. Its just something I was
>thinking about.
Actually this is how the first generation of KVM worked.
Since Avi & Yaniv had bad experience with serializing the cpu state with
qemu
they droped this direction.
Basically it could have been nice, Xen though of doing V2E migrations
(virtual to emulate).
I don't know if they implemented that.
Anyway Nitin A Kamble works for finishing the in-kernel emulator.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 4/10] Trivial: Make decode_register() static
[not found] ` <469C8B870200005A00027AE6-Igcdv/6uVdMHoYOw/+koYqIwWpluYiW7@public.gmane.org>
2007-07-17 13:38 ` Dor Laor
@ 2007-07-17 13:41 ` Anthony Liguori
[not found] ` <469CC6FB.9050308-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-07-17 13:43 ` [PATCH 4/10] " Avi Kivity
2 siblings, 1 reply; 7+ messages in thread
From: Anthony Liguori @ 2007-07-17 13:41 UTC (permalink / raw)
To: Gregory Haskins; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Gregory Haskins wrote:
> On Tue, 2007-07-17 at 23:16 +1000, Rusty Russell wrote:
>
>> I have shied away from touching x86_emulate.c (it could definitely use
>> some love, but it is forked from the Xen code, and it would be more
>> productive to cross-merge fixes).
>>
>
> On this topic, here's an idea I have been kicking around for a while:
>
> If the x86_emulate code is so buggy/incomplete, and the QEMU one seems
> to be able to generally handle most situations...could we simply exit to
> userspace and use the qemu emulator somehow? I realize the overhead is
> greater, but slow+working is > fast+broken in my book ;)
>
> Perhaps a hybrid solution would work? E.g. exit to qemu emulator when
> the in-kernel stuff hits a mis-emulation point (do we realize this
> consciously in the code, or only after the guest crashes?)
>
SMP is really tricky in this environment. The code that QEMU generates
doesn't guarantee atomicity of instructions so if you have one CPU
running in QEMU and another running on bare metal and they both were
attempting to access a spin lock things would break down pretty quickly.
Regards,
Anthony Liguori
> I'm not really sure if this is plausible. Its just something I was
> thinking about.
>
> Regards,
> -Greg
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 4/10] Trivial: Make decode_register() static
[not found] ` <469C8B870200005A00027AE6-Igcdv/6uVdMHoYOw/+koYqIwWpluYiW7@public.gmane.org>
2007-07-17 13:38 ` Dor Laor
2007-07-17 13:41 ` Anthony Liguori
@ 2007-07-17 13:43 ` Avi Kivity
2 siblings, 0 replies; 7+ messages in thread
From: Avi Kivity @ 2007-07-17 13:43 UTC (permalink / raw)
To: Gregory Haskins; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Gregory Haskins wrote:
> On Tue, 2007-07-17 at 23:16 +1000, Rusty Russell wrote:
>
>> I have shied away from touching x86_emulate.c (it could definitely use
>> some love, but it is forked from the Xen code, and it would be more
>> productive to cross-merge fixes).
>>
>
> On this topic, here's an idea I have been kicking around for a while:
>
> If the x86_emulate code is so buggy/incomplete, and the QEMU one seems
> to be able to generally handle most situations...could we simply exit to
> userspace and use the qemu emulator somehow? I realize the overhead is
> greater, but slow+working is > fast+broken in my book ;)
>
> Perhaps a hybrid solution would work? E.g. exit to qemu emulator when
> the in-kernel stuff hits a mis-emulation point (do we realize this
> consciously in the code, or only after the guest crashes?)
>
> I'm not really sure if this is plausible. Its just something I was
> thinking about.
>
>
It was once done that way (we started by having qemu emulate 32- and 16-
bit code, then just 16-, then nothing). However, I'd like kvm to be
independent of an external emulator, so that all cpu emulation is done
in kernel.
Of course we have to have an in-kernel emulator, for page tables and for
in-kernel mmio, so having a partial emulator in kernel and a full
emulator in userspace seems messy.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Trivial: Make decode_register() static
[not found] ` <469CC6FB.9050308-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
@ 2007-07-17 13:53 ` Mike Day
0 siblings, 0 replies; 7+ messages in thread
From: Mike Day @ 2007-07-17 13:53 UTC (permalink / raw)
To: Anthony Liguori; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On 17/07/07 08:41 -0500, Anthony Liguori wrote:
>Gregory Haskins wrote:
>> On Tue, 2007-07-17 at 23:16 +1000, Rusty Russell wrote:
>>
>>> I have shied away from touching x86_emulate.c (it could definitely use
>>> some love, but it is forked from the Xen code, and it would be more
>>> productive to cross-merge fixes).
>>>
>>
>> On this topic, here's an idea I have been kicking around for a while:
>>
>> If the x86_emulate code is so buggy/incomplete, and the QEMU one seems
>> to be able to generally handle most situations...could we simply exit to
>> userspace and use the qemu emulator somehow? I realize the overhead is
>> greater, but slow+working is > fast+broken in my book ;)
>>
>> Perhaps a hybrid solution would work? E.g. exit to qemu emulator when
>> the in-kernel stuff hits a mis-emulation point (do we realize this
>> consciously in the code, or only after the guest crashes?)
>>
>
>SMP is really tricky in this environment. The code that QEMU generates
>doesn't guarantee atomicity of instructions so if you have one CPU
>running in QEMU and another running on bare metal and they both were
>attempting to access a spin lock things would break down pretty quickly.
Another possibility is pulling x86_emulate into its own library that
is shared by xen, kvm, and available for use by any other project. making
it into an emulation library.
Mike
--
Mike Day
http://www.ncultra.org
AIM: ncmikeday | Yahoo IM: ultra.runner
PGP key: http://www.ncultra.org/ncmike/pubkey.asc
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-07-17 13:53 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-17 13:27 [PATCH 4/10] Trivial: Make decode_register() static Gregory Haskins
[not found] ` <469C8B870200005A00027AE6-Igcdv/6uVdMHoYOw/+koYqIwWpluYiW7@public.gmane.org>
2007-07-17 13:38 ` Dor Laor
2007-07-17 13:41 ` Anthony Liguori
[not found] ` <469CC6FB.9050308-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-07-17 13:53 ` Mike Day
2007-07-17 13:43 ` [PATCH 4/10] " Avi Kivity
-- strict thread matches above, loose matches on Subject: below --
2007-07-17 13:12 [PATCH 1/10] Trivial: /dev/kvm interface is no longer experimental Rusty Russell
2007-07-17 13:14 ` [PATCH 2/10] Trivial: Remove KVM_IRQ_BITMAP macro Rusty Russell
2007-07-17 13:15 ` [PATCH 3/10] Trivial: Remove unused struct cpu_user_regs declaration Rusty Russell
[not found] ` <1184678129.10380.10.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-17 13:16 ` [PATCH 4/10] Trivial: Make decode_register() static Rusty Russell
[not found] ` <1184678171.10380.12.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-17 13:29 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox