All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 22/23] Hack in dirty logging for VGA
@ 2009-07-07 14:17 Alexander Graf
  2009-07-07 15:48 ` Avi Kivity
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Alexander Graf @ 2009-07-07 14:17 UTC (permalink / raw)
  To: kvm-ppc

I haven't implemented dirty logging yet, but without things are just way too
slow. So for the time being I hacked in a dummy function that always tells
userspace we're dirty in VGA regions.

Please don't apply this. This patch is for reference only.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/kvm/powerpc.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 0341391..bbb74ad 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -422,7 +422,26 @@ out:
 
 int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log)
 {
-	return -ENOTSUPP;
+	/* XXX clear (and fill?) dirty log */
+	struct kvm_memory_slot *memslot;
+	int i, n;
+
+        if (log->slot >= KVM_MEMORY_SLOTS)
+                return -EINVAL;
+
+        memslot = &kvm->memslots[log->slot];
+
+	/* XXX This is a hack to get VGA updating working for now */
+	if (memslot->base_gfn != 0x8000)
+		return -ENOENT;
+
+	n = ALIGN(memslot->npages, BITS_PER_LONG) / 8;
+	for (i = 0; i < n; i++)
+		memslot->dirty_bitmap[i] = 0;
+
+	memslot->dirty_bitmap[0] = ( 1 << 30 ) - 1;
+
+	return 0;
 }
 
 long kvm_arch_vm_ioctl(struct file *filp,
-- 
1.6.0.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 22/23] Hack in dirty logging for VGA
  2009-07-07 14:17 [PATCH 22/23] Hack in dirty logging for VGA Alexander Graf
@ 2009-07-07 15:48 ` Avi Kivity
  2009-07-07 15:53 ` Alexander Graf
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Avi Kivity @ 2009-07-07 15:48 UTC (permalink / raw)
  To: kvm-ppc

On 07/07/2009 05:17 PM, Alexander Graf wrote:
> I haven't implemented dirty logging yet, but without things are just way too
> slow. So for the time being I hacked in a dummy function that always tells
> userspace we're dirty in VGA regions.
>
> Please don't apply this. This patch is for reference only.
>
>    

ia64 has the same problem; you can deal with this in userspace.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 22/23] Hack in dirty logging for VGA
  2009-07-07 14:17 [PATCH 22/23] Hack in dirty logging for VGA Alexander Graf
  2009-07-07 15:48 ` Avi Kivity
@ 2009-07-07 15:53 ` Alexander Graf
  2009-07-08  6:20 ` Benjamin Herrenschmidt
  2009-07-08  7:39 ` Alexander Graf
  3 siblings, 0 replies; 5+ messages in thread
From: Alexander Graf @ 2009-07-07 15:53 UTC (permalink / raw)
  To: kvm-ppc


On 07.07.2009, at 17:48, Avi Kivity wrote:

> On 07/07/2009 05:17 PM, Alexander Graf wrote:
>> I haven't implemented dirty logging yet, but without things are  
>> just way too
>> slow. So for the time being I hacked in a dummy function that  
>> always tells
>> userspace we're dirty in VGA regions.
>>
>> Please don't apply this. This patch is for reference only.
>>
>>
>
> ia64 has the same problem; you can deal with this in userspace.

Yeah, what a shame IA64 KVM support isn't really in qemu. Last time I  
tried the kvm-userspace powerpc implementation was quite broken.

Alex


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 22/23] Hack in dirty logging for VGA
  2009-07-07 14:17 [PATCH 22/23] Hack in dirty logging for VGA Alexander Graf
  2009-07-07 15:48 ` Avi Kivity
  2009-07-07 15:53 ` Alexander Graf
@ 2009-07-08  6:20 ` Benjamin Herrenschmidt
  2009-07-08  7:39 ` Alexander Graf
  3 siblings, 0 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2009-07-08  6:20 UTC (permalink / raw)
  To: kvm-ppc

On Tue, 2009-07-07 at 18:48 +0300, Avi Kivity wrote:
> On 07/07/2009 05:17 PM, Alexander Graf wrote:
> > I haven't implemented dirty logging yet, but without things are just way too
> > slow. So for the time being I hacked in a dummy function that always tells
> > userspace we're dirty in VGA regions.
> >
> > Please don't apply this. This patch is for reference only.
> >
> >    
> 
> ia64 has the same problem; you can deal with this in userspace.

Well... also depending on what we are trying to emulate it might not be
worth at all presenting some kind of legacy VGA device. For example,
PowerMacs are physically incapable of generating the appropriate cycles
on the bus.

We are probably better off exposing pseudo PCI graphics device that is
reflected by a display node in the device-tree with enough information
populated there for offb to be able to pick it up initially, and then
have the option of paravirt drivers for accelerating it or making it
capable of switching modes etc... That's pretty much what we did with
MacOnLinux in fact.

Also, MOL kept track of dirtied pages in the fb as well to speed up
refresh.

Cheers,
Ben.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 22/23] Hack in dirty logging for VGA
  2009-07-07 14:17 [PATCH 22/23] Hack in dirty logging for VGA Alexander Graf
                   ` (2 preceding siblings ...)
  2009-07-08  6:20 ` Benjamin Herrenschmidt
@ 2009-07-08  7:39 ` Alexander Graf
  3 siblings, 0 replies; 5+ messages in thread
From: Alexander Graf @ 2009-07-08  7:39 UTC (permalink / raw)
  To: kvm-ppc


On 08.07.2009, at 08:20, Benjamin Herrenschmidt wrote:

> On Tue, 2009-07-07 at 18:48 +0300, Avi Kivity wrote:
>> On 07/07/2009 05:17 PM, Alexander Graf wrote:
>>> I haven't implemented dirty logging yet, but without things are  
>>> just way too
>>> slow. So for the time being I hacked in a dummy function that  
>>> always tells
>>> userspace we're dirty in VGA regions.
>>>
>>> Please don't apply this. This patch is for reference only.
>>>
>>>
>>
>> ia64 has the same problem; you can deal with this in userspace.
>
> Well... also depending on what we are trying to emulate it might not  
> be
> worth at all presenting some kind of legacy VGA device. For example,
> PowerMacs are physically incapable of generating the appropriate  
> cycles
> on the bus.
>
> We are probably better off exposing pseudo PCI graphics device that is
> reflected by a display node in the device-tree with enough information
> populated there for offb to be able to pick it up initially, and then
> have the option of paravirt drivers for accelerating it or making it
> capable of switching modes etc... That's pretty much what we did with
> MacOnLinux in fact.
>
> Also, MOL kept track of dirtied pages in the fb as well to speed up
> refresh.

Well, the current code does almost the same. It does emulate a VGA  
card in qemu, but that's simply because it was there. Everything Linux  
sees is a big framebuffer and this patch is about not trapping on  
every MMIO to that framebuffer, but instead keeping it as RAM and only  
telling userspace about the dirty pages.

So yeah, I think we can get away without yet another graphics card  
implementation in qemu :-).

Alex



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-07-08  7:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-07 14:17 [PATCH 22/23] Hack in dirty logging for VGA Alexander Graf
2009-07-07 15:48 ` Avi Kivity
2009-07-07 15:53 ` Alexander Graf
2009-07-08  6:20 ` Benjamin Herrenschmidt
2009-07-08  7:39 ` Alexander Graf

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.