All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerhard Wiesinger <lists@wiesinger.com>
To: Avi Kivity <avi@redhat.com>
Cc: Jamie Lokier <jamie@shareable.org>,
	qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] Re: QEMU-KVM and video performance
Date: Thu, 22 Apr 2010 07:37:11 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1004220726170.8616@bbs.intern> (raw)
In-Reply-To: <4BCF64E9.4090909@redhat.com>

On Wed, 21 Apr 2010, Avi Kivity wrote:

> On 04/21/2010 09:14 PM, Gerhard Wiesinger wrote:
>> 
>> Can you explain which code files/functions of KVM is involved in handling 
>> VGA memory window and page switching through the port write to the VGA 
>> window register (or is that part handled through QEMU), so a little bit 
>> architecture explaination would be nice?
>
> qemu hw/vga.c and hw/cirrus_vga.c.  Boring functions like 
> vbe_ioport_write_data() and vga_ioport_write().
>

Yes, I was already in that code part and that are very simple functions as 
already explained and are therefore in QEMU only very fast. But I ment: 
How is the calling path from KVM guest OS to hw/vga.c for memory and I/O 
accesses, and which parts are done in hardware directly (to understand the 
speed gap and maybe to find a solution)?

>> 
>> BTW: In which KVM code parts is decided where "direct code" or an "emulated 
>> device code" is used?
>> 
>
> Same place.  Look for calls to cpu_register_physical_memory().  If the last 
> argument was obtained by a call to cpu_register_io_memory(), then all writes 
> trap.  Otherwise, it was obtained by qemu_ram_alloc() and writes will not 
> trap (except the first write to a page in a 30ms window, used to note that 
> the page is dirty and needs redrawing).

Ok, that finally ends in:
cpu_register_physical_memory_offset()
...
// 0.12.3
     if (kvm_enabled())
         kvm_set_phys_mem(start_addr, size, phys_offset);
// KVM
     cpu_notify_set_memory(start_addr, size, phys_offset);
...

I/O is always done through:
cpu_register_io_memory => cpu_register_io_memory_fixed
cpu_register_io_memory_fixed()
...
No call to KVM?
...

Where is the trap from KVM to QEMU?

Thnx.

Ciao,
Gerhard

--
http://www.wiesinger.com/

WARNING: multiple messages have this Message-ID (diff)
From: Gerhard Wiesinger <lists@wiesinger.com>
To: Avi Kivity <avi@redhat.com>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] Re: QEMU-KVM and video performance
Date: Thu, 22 Apr 2010 07:37:11 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1004220726170.8616@bbs.intern> (raw)
In-Reply-To: <4BCF64E9.4090909@redhat.com>

On Wed, 21 Apr 2010, Avi Kivity wrote:

> On 04/21/2010 09:14 PM, Gerhard Wiesinger wrote:
>> 
>> Can you explain which code files/functions of KVM is involved in handling 
>> VGA memory window and page switching through the port write to the VGA 
>> window register (or is that part handled through QEMU), so a little bit 
>> architecture explaination would be nice?
>
> qemu hw/vga.c and hw/cirrus_vga.c.  Boring functions like 
> vbe_ioport_write_data() and vga_ioport_write().
>

Yes, I was already in that code part and that are very simple functions as 
already explained and are therefore in QEMU only very fast. But I ment: 
How is the calling path from KVM guest OS to hw/vga.c for memory and I/O 
accesses, and which parts are done in hardware directly (to understand the 
speed gap and maybe to find a solution)?

>> 
>> BTW: In which KVM code parts is decided where "direct code" or an "emulated 
>> device code" is used?
>> 
>
> Same place.  Look for calls to cpu_register_physical_memory().  If the last 
> argument was obtained by a call to cpu_register_io_memory(), then all writes 
> trap.  Otherwise, it was obtained by qemu_ram_alloc() and writes will not 
> trap (except the first write to a page in a 30ms window, used to note that 
> the page is dirty and needs redrawing).

Ok, that finally ends in:
cpu_register_physical_memory_offset()
...
// 0.12.3
     if (kvm_enabled())
         kvm_set_phys_mem(start_addr, size, phys_offset);
// KVM
     cpu_notify_set_memory(start_addr, size, phys_offset);
...

I/O is always done through:
cpu_register_io_memory => cpu_register_io_memory_fixed
cpu_register_io_memory_fixed()
...
No call to KVM?
...

Where is the trap from KVM to QEMU?

Thnx.

Ciao,
Gerhard

--
http://www.wiesinger.com/

  reply	other threads:[~2010-04-22  5:37 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-19 19:14 QEMU-KVM and video performance Gerhard Wiesinger
2010-04-19 19:14 ` [Qemu-devel] " Gerhard Wiesinger
2010-04-21  8:59 ` Avi Kivity
2010-04-21  8:59   ` [Qemu-devel] " Avi Kivity
2010-04-21 10:08   ` Jamie Lokier
2010-04-21 10:49     ` Avi Kivity
2010-04-21 18:14       ` Gerhard Wiesinger
2010-04-21 18:14         ` [Qemu-devel] " Gerhard Wiesinger
2010-04-21 20:49         ` Avi Kivity
2010-04-21 20:49           ` Avi Kivity
2010-04-22  5:37           ` Gerhard Wiesinger [this message]
2010-04-22  5:37             ` Gerhard Wiesinger
2010-04-22  6:57             ` Avi Kivity
2010-04-22  6:57               ` Avi Kivity
2010-04-21 18:39       ` Jamie Lokier
2010-04-21 20:51         ` Avi Kivity
2010-04-21 21:19           ` Jamie Lokier
2010-04-22  5:44           ` Gerhard Wiesinger
2010-04-22  5:44             ` Gerhard Wiesinger
2010-05-12 10:34             ` Jamie Lokier
2010-05-12 10:34               ` Jamie Lokier
2010-04-21 18:09   ` Gerhard Wiesinger
2010-04-21 18:33     ` Jamie Lokier
2010-04-21 18:33       ` Jamie Lokier
2010-04-21 18:50       ` Gerhard Wiesinger
2010-04-21 18:50         ` Gerhard Wiesinger
2010-04-21 18:53         ` Jamie Lokier
2010-04-21 18:53           ` Jamie Lokier
2010-04-21 19:08           ` Gerhard Wiesinger
2010-04-21 19:08             ` Gerhard Wiesinger
2010-04-21 21:30             ` Jamie Lokier
2010-04-21 21:30               ` Jamie Lokier
2010-04-22  6:12               ` Gerhard Wiesinger
2010-04-22  6:12                 ` Gerhard Wiesinger
2010-05-12 10:23                 ` Jamie Lokier
2010-05-12 10:23                   ` Jamie Lokier
2010-04-21 20:56         ` Avi Kivity
2010-04-21 20:56           ` Avi Kivity
2010-04-22  6:04           ` Gerhard Wiesinger
2010-04-22  6:04             ` Gerhard Wiesinger
2010-04-22  7:03             ` Avi Kivity
2010-04-22  7:03               ` Avi Kivity
2010-05-09 19:35               ` Gerhard Wiesinger
2010-05-09 19:35                 ` Gerhard Wiesinger
2010-05-10  7:32                 ` Avi Kivity
2010-05-10  7:32                   ` Avi Kivity
2010-05-12  6:14                   ` Gerhard Wiesinger
2010-05-12  6:14                     ` [Qemu-devel] " Gerhard Wiesinger
2010-05-12  6:39                     ` Avi Kivity
2010-05-12  6:39                       ` Avi Kivity
2011-02-18  7:32                       ` [Qemu-devel] Re: QEMU-KVM and video performance - Update Gerhard Wiesinger
2011-02-18  7:32                         ` Gerhard Wiesinger

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=alpine.LFD.2.00.1004220726170.8616@bbs.intern \
    --to=lists@wiesinger.com \
    --cc=avi@redhat.com \
    --cc=jamie@shareable.org \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.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.