All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabrice Bellard <fabrice-+Yn2HnRVxb5AfugRpC6u6w@public.gmane.org>
To: qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	Paul Brook <paul-qD8j1LwMmJjtCj0u4l0SBw@public.gmane.org>,
	avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH 6/6] QEMU support for the Kernel Virtual Machine interface
Date: Fri, 01 Feb 2008 10:49:08 +0100	[thread overview]
Message-ID: <47A2EB14.8030804@bellard.org> (raw)
In-Reply-To: <1201818980-27534-7-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

Anthony Liguori wrote:
> This patch actually enables KVM support for QEMU.  I apologize that it is so
> large but this was the only sane way to preserve bisectability.
> 
> The goal of this patch is to add KVM support, but not to impact users when
> KVM isn't being used.  It achieves this by using a kvm_enabled() macro that
> evaluates to (0) when KVM support is not enabled.  An if (kvm_enabled()) is
> just as good as using an #ifdef since GCC will eliminate the dead code.
> 
> This patches touches a lot of areas.  For performance reasons, the guest CPU
> state is not kept in sync with CPUState.  This requires an explicit
> synchronization whenever CPUState is required.  KVM also uses it's own main
> loop as it runs each VCPU in it's own thread.
> 
> Trapping VGA updates via MMIO is far too slow when running KVM so there is
> additional logic to allow VGA memory to be accessed as RAM.  We use KVM's
> shadow page tables to keep track of which portions of RAM have been dirtied.
> 
> KVM also supports an in-kernel APIC implementation as a performance
> enhancement.  Finally, KVM supports APIC TPR patching.  This allows TPR
> accesses (which are very frequently for Windows) to be patches into CALL
> instructions to the BIOS (for 32-bit guests).  This results in a very
> sigificant performance improvement for Windows guests.
> 
> While this patch is very large, the new files are only included when KVM
> support is compiled in.  Every change to QEMU is wrapped in an
> if (kvm_enabled()) so the code disappears when KVM support is not compiled in.
> This is done to ensure no regressions are introduced to normal QEMU.

Some questions:

- QEMU already maintains modified page status for VGA memory (and kqemu 
for example fully supports that), so I don't see why KVM needs a new method.

- Why is kvm_cpu_register_physical_memory() needed ? kqemu can work 
without it because there is a remapping between physical memory and RAM 
address. I suggest to add that feature in KVM or to modify 
cpu_register_physical_memory() to hide it.

- If KVM implements its own CPU loop, why are there patches in libqemu.a 
(CPU core) ?

Regards,

Fabrice.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

WARNING: multiple messages have this Message-ID (diff)
From: Fabrice Bellard <fabrice@bellard.org>
To: qemu-devel@nongnu.org
Cc: kvm-devel@lists.sourceforge.net,
	Anthony Liguori <aliguori@us.ibm.com>,
	Paul Brook <paul@codesourcery.com>
Subject: [Qemu-devel] Re: [PATCH 6/6] QEMU support for the Kernel Virtual Machine interface
Date: Fri, 01 Feb 2008 10:49:08 +0100	[thread overview]
Message-ID: <47A2EB14.8030804@bellard.org> (raw)
In-Reply-To: <1201818980-27534-7-git-send-email-aliguori@us.ibm.com>

Anthony Liguori wrote:
> This patch actually enables KVM support for QEMU.  I apologize that it is so
> large but this was the only sane way to preserve bisectability.
> 
> The goal of this patch is to add KVM support, but not to impact users when
> KVM isn't being used.  It achieves this by using a kvm_enabled() macro that
> evaluates to (0) when KVM support is not enabled.  An if (kvm_enabled()) is
> just as good as using an #ifdef since GCC will eliminate the dead code.
> 
> This patches touches a lot of areas.  For performance reasons, the guest CPU
> state is not kept in sync with CPUState.  This requires an explicit
> synchronization whenever CPUState is required.  KVM also uses it's own main
> loop as it runs each VCPU in it's own thread.
> 
> Trapping VGA updates via MMIO is far too slow when running KVM so there is
> additional logic to allow VGA memory to be accessed as RAM.  We use KVM's
> shadow page tables to keep track of which portions of RAM have been dirtied.
> 
> KVM also supports an in-kernel APIC implementation as a performance
> enhancement.  Finally, KVM supports APIC TPR patching.  This allows TPR
> accesses (which are very frequently for Windows) to be patches into CALL
> instructions to the BIOS (for 32-bit guests).  This results in a very
> sigificant performance improvement for Windows guests.
> 
> While this patch is very large, the new files are only included when KVM
> support is compiled in.  Every change to QEMU is wrapped in an
> if (kvm_enabled()) so the code disappears when KVM support is not compiled in.
> This is done to ensure no regressions are introduced to normal QEMU.

Some questions:

- QEMU already maintains modified page status for VGA memory (and kqemu 
for example fully supports that), so I don't see why KVM needs a new method.

- Why is kvm_cpu_register_physical_memory() needed ? kqemu can work 
without it because there is a remapping between physical memory and RAM 
address. I suggest to add that feature in KVM or to modify 
cpu_register_physical_memory() to hide it.

- If KVM implements its own CPU loop, why are there patches in libqemu.a 
(CPU core) ?

Regards,

Fabrice.

  parent reply	other threads:[~2008-02-01  9:49 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-31 22:36 [PATCH 0/6] Support for the Kernel Virtual Machine interface Anthony Liguori
2008-01-31 22:36 ` [Qemu-devel] " Anthony Liguori
     [not found] ` <1201818980-27534-1-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-01-31 22:36   ` [PATCH 1/6] Use correct types to enable > 2G support Anthony Liguori
2008-01-31 22:36     ` [Qemu-devel] " Anthony Liguori
     [not found]     ` <1201818980-27534-2-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-01-31 23:54       ` Paul Brook
2008-01-31 23:54         ` [Qemu-devel] " Paul Brook
     [not found]         ` <200801312354.24382.paul-qD8j1LwMmJjtCj0u4l0SBw@public.gmane.org>
2008-02-01  0:25           ` Anthony Liguori
2008-02-01  0:25             ` [Qemu-devel] " Anthony Liguori
     [not found]             ` <47A26714.4000204-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-02-01  0:37               ` Paul Brook
2008-02-01  0:37                 ` [Qemu-devel] " Paul Brook
     [not found]                 ` <200802010037.30731.paul-qD8j1LwMmJjtCj0u4l0SBw@public.gmane.org>
2008-02-01  0:40                   ` Anthony Liguori
2008-02-01  0:40                     ` [Qemu-devel] " Anthony Liguori
2008-02-01 10:26       ` Fabrice Bellard
2008-02-01 10:26         ` [Qemu-devel] " Fabrice Bellard
     [not found]         ` <47A2F3C7.6060409-+Yn2HnRVxb5AfugRpC6u6w@public.gmane.org>
2008-02-01 14:35           ` Anthony Liguori
2008-02-01 14:35             ` [Qemu-devel] " Anthony Liguori
     [not found]             ` <47A32E40.3000204-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-02-01 15:13               ` Avi Kivity
2008-02-01 15:13                 ` [Qemu-devel] " Avi Kivity
2008-02-01 11:56                 ` Robert William Fuller
2008-02-01 16:09                   ` M. Warner Losh
2008-02-01 16:47                     ` Philip Boulain
2008-02-01 17:35                   ` Jamie Lokier
     [not found]                 ` <47A33721.4020600-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-02-01 15:33                   ` Anthony Liguori
2008-02-01 15:33                     ` [Qemu-devel] Re: [kvm-devel] " Anthony Liguori
     [not found]                     ` <47A33BC6.3060705-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-02-01 15:40                       ` [Qemu-devel] " Ian Jackson
2008-02-01 15:40                         ` [Qemu-devel] Re: [kvm-devel] " Ian Jackson
     [not found]                         ` <18339.15712.411486.395238-msK/Ju9w1zmnROeE8kUsYhEHtJm+Wo+I@public.gmane.org>
2008-02-01 17:53                           ` [Qemu-devel] " Anthony Liguori
2008-02-01 17:53                             ` [kvm-devel] " Anthony Liguori
     [not found]                             ` <47A35C7E.8050309-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2008-02-01 17:57                               ` Daniel P. Berrange
2008-02-01 17:57                                 ` [kvm-devel] " Daniel P. Berrange
     [not found]                                 ` <20080201175750.GD22981-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2008-02-01 20:31                                   ` Anthony Liguori
2008-02-01 20:31                                     ` [kvm-devel] " Anthony Liguori
2008-02-01 21:33                                     ` [kvm-devel] " Paul Brook
2008-02-01 21:33                                       ` [kvm-devel] [Qemu-devel] " Paul Brook
2008-02-01 16:00               ` Paul Brook
2008-02-01 16:00                 ` [Qemu-devel] " Paul Brook
     [not found]                 ` <200802011600.10877.paul-qD8j1LwMmJjtCj0u4l0SBw@public.gmane.org>
2008-02-01 16:21                   ` Fabrice Bellard
2008-02-01 16:21                     ` [Qemu-devel] " Fabrice Bellard
     [not found]                     ` <47A3471B.7030702-+Yn2HnRVxb5AfugRpC6u6w@public.gmane.org>
2008-02-05 11:34                       ` Ian Jackson
2008-02-05 11:34                         ` Ian Jackson
2008-02-01 17:49                 ` [kvm-devel] " Anthony Liguori
2008-02-01 17:49                   ` [Qemu-devel] " Anthony Liguori
2008-02-03  8:58       ` Izik Eidus
2008-02-03  8:58         ` [Qemu-devel] Re: [kvm-devel] " Izik Eidus
2008-01-31 22:36   ` [PATCH 2/6] SCI fixes Anthony Liguori
2008-01-31 22:36     ` [Qemu-devel] " Anthony Liguori
2008-01-31 22:36   ` [PATCH 3/6] Fix daemonize options Anthony Liguori
2008-01-31 22:36     ` [Qemu-devel] " Anthony Liguori
2008-01-31 22:36   ` [PATCH 4/6] Tell BIOS about the number of CPUs Anthony Liguori
2008-01-31 22:36     ` [Qemu-devel] " Anthony Liguori
     [not found]     ` <1201818980-27534-5-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-02-01  0:14       ` Paul Brook
2008-02-01  0:14         ` [Qemu-devel] " Paul Brook
     [not found]         ` <200802010014.07960.paul-qD8j1LwMmJjtCj0u4l0SBw@public.gmane.org>
2008-02-01  0:28           ` Anthony Liguori
2008-02-01  0:28             ` [Qemu-devel] " Anthony Liguori
     [not found]             ` <47A26790.6010609-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-02-01  0:40               ` Paul Brook
2008-02-01  0:40                 ` [Qemu-devel] " Paul Brook
2008-01-31 22:36   ` [PATCH 5/6] Refactor option ROM loading Anthony Liguori
2008-01-31 22:36     ` [Qemu-devel] " Anthony Liguori
2008-01-31 22:36   ` [PATCH 6/6] QEMU support for the Kernel Virtual Machine interface Anthony Liguori
2008-01-31 22:36     ` [Qemu-devel] " Anthony Liguori
     [not found]     ` <1201818980-27534-7-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-02-01  9:49       ` Fabrice Bellard [this message]
2008-02-01  9:49         ` [Qemu-devel] " Fabrice Bellard
     [not found]         ` <47A2EB14.8030804-+Yn2HnRVxb5AfugRpC6u6w@public.gmane.org>
2008-02-01 14:18           ` Anthony Liguori
2008-02-01 14:18             ` [Qemu-devel] " Anthony Liguori
2008-01-31 22:53   ` [qemu-devel] [PATCH 0/6] Support " Anthony Liguori
2008-01-31 22:53     ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47A2EB14.8030804@bellard.org \
    --to=fabrice-+yn2hnrvxb5afugrpc6u6w@public.gmane.org \
    --cc=avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=paul-qD8j1LwMmJjtCj0u4l0SBw@public.gmane.org \
    --cc=qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.