All of lore.kernel.org
 help / color / mirror / Atom feed
* VGA address mapping?
@ 2009-07-21 18:13 Saksena, Abhishek
  2009-07-21 23:06 ` Saksena, Abhishek
  0 siblings, 1 reply; 4+ messages in thread
From: Saksena, Abhishek @ 2009-07-21 18:13 UTC (permalink / raw)
  To: kvm@vger.kernel.org

Hi
I am implementing a VGA Device model. The model provides functions to read/write VGA memory space.

Just for testing I want to capture memory reads/writes to addresses 0xA0000->0xC0000 and forward it to my VGA model.


I have used following function to create physical ram

int kvm_create  (       kvm_context_t<file:///C:/Documents%20and%20Settings/asaksena/Desktop/march_onwards/kvmsocket/doc/htmlkvm/structkvm__context.html>       kvm,
                unsigned long   phys_mem_bytes,
                void **         phys_mem
        )

The function comments says that this creates a new virtual machine, maps physical RAM to it, and creates a virtual CPU for it. Memory gets mapped for addresses 0->0xA0000, 0xC0000->phys_mem_bytes.



I was expecting mimio read/write callbacks to capture transactions between 0xA0000->0xC0000  but I don't see that happening.



My question is how I can configure KVM to forward me reads/writes for VGA address space?





Thanks

Abhishek

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

* RE: VGA address mapping?
  2009-07-21 18:13 VGA address mapping? Saksena, Abhishek
@ 2009-07-21 23:06 ` Saksena, Abhishek
  2009-07-22  7:48   ` Gleb Natapov
  0 siblings, 1 reply; 4+ messages in thread
From: Saksena, Abhishek @ 2009-07-21 23:06 UTC (permalink / raw)
  To: Saksena, Abhishek, kvm@vger.kernel.org

Would also like to mention I am not using Qemu and building some basic IO models around KVM (only using libkvm.h)

-Abhishek
________________________________
From: Saksena, Abhishek
Sent: Tuesday, July 21, 2009 11:13 AM
To: kvm@vger.kernel.org
Subject: VGA address mapping?

Hi
I am implementing a VGA Device model. The model provides functions to read/write VGA memory space.

Just for testing I want to capture memory reads/writes to addresses 0xA0000->0xC0000 and forward it to my VGA model.


I have used following function to create physical ram

int kvm_create  (       kvm_context_t<file:///C:/Documents%20and%20Settings/asaksena/Desktop/march_onwards/kvmsocket/doc/htmlkvm/structkvm__context.html>       kvm,
                unsigned long   phys_mem_bytes,
                void **         phys_mem
        )

The function comments says that this creates a new virtual machine, maps physical RAM to it, and creates a virtual CPU for it. Memory gets mapped for addresses 0->0xA0000, 0xC0000->phys_mem_bytes.



I was expecting mimio read/write callbacks to capture transactions between 0xA0000->0xC0000  but I don't see that happening.



My question is how I can configure KVM to forward me reads/writes for VGA address space?





Thanks

Abhishek

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

* Re: VGA address mapping?
  2009-07-21 23:06 ` Saksena, Abhishek
@ 2009-07-22  7:48   ` Gleb Natapov
  2009-07-22  9:24     ` Alexander Graf
  0 siblings, 1 reply; 4+ messages in thread
From: Gleb Natapov @ 2009-07-22  7:48 UTC (permalink / raw)
  To: Saksena, Abhishek; +Cc: kvm@vger.kernel.org

On Tue, Jul 21, 2009 at 04:06:10PM -0700, Saksena, Abhishek wrote:
> Would also like to mention I am not using Qemu and building some basic IO models around KVM (only using libkvm.h)
> 
> -Abhishek
> ________________________________
> From: Saksena, Abhishek
> Sent: Tuesday, July 21, 2009 11:13 AM
> To: kvm@vger.kernel.org
> Subject: VGA address mapping?
> 
> Hi
> I am implementing a VGA Device model. The model provides functions to read/write VGA memory space.
> 
> Just for testing I want to capture memory reads/writes to addresses 0xA0000->0xC0000 and forward it to my VGA model.
> 
> 
> I have used following function to create physical ram
> 
> int kvm_create  (       kvm_context_t<file:///C:/Documents%20and%20Settings/asaksena/Desktop/march_onwards/kvmsocket/doc/htmlkvm/structkvm__context.html>       kvm,
>                 unsigned long   phys_mem_bytes,
>                 void **         phys_mem
>         )
> 
> The function comments says that this creates a new virtual machine, maps physical RAM to it, and creates a virtual CPU for it. Memory gets mapped for addresses 0->0xA0000, 0xC0000->phys_mem_bytes.
> 
This indeed what comment says, but looking at the code I don't see it
using phys_mem_bytes/phys_mem parameters at all.

Look at QEMU code how memory is created.
> 
> 
> I was expecting mimio read/write callbacks to capture transactions between 0xA0000->0xC0000  but I don't see that happening.
> 
> 
> 
> My question is how I can configure KVM to forward me reads/writes for VGA address space?
> 
> 
> 
> 
> 
> Thanks
> 
> Abhishek
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
			Gleb.

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

* Re: VGA address mapping?
  2009-07-22  7:48   ` Gleb Natapov
@ 2009-07-22  9:24     ` Alexander Graf
  0 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2009-07-22  9:24 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: Saksena, Abhishek, kvm@vger.kernel.org


On 22.07.2009, at 09:48, Gleb Natapov wrote:

> On Tue, Jul 21, 2009 at 04:06:10PM -0700, Saksena, Abhishek wrote:
>> Would also like to mention I am not using Qemu and building some  
>> basic IO models around KVM (only using libkvm.h)
>>
>> -Abhishek
>> ________________________________
>> From: Saksena, Abhishek
>> Sent: Tuesday, July 21, 2009 11:13 AM
>> To: kvm@vger.kernel.org
>> Subject: VGA address mapping?
>>
>> Hi
>> I am implementing a VGA Device model. The model provides functions  
>> to read/write VGA memory space.
>>
>> Just for testing I want to capture memory reads/writes to addresses  
>> 0xA0000->0xC0000 and forward it to my VGA model.
>>
>>
>> I have used following function to create physical ram
>>
>> int kvm_create  (       kvm_context_t<file:///C:/Documents%20and%20Settings/asaksena/Desktop/march_onwards/kvmsocket/doc/htmlkvm/structkvm__context.html 
>> >       kvm,
>>                unsigned long   phys_mem_bytes,
>>                void **         phys_mem
>>        )
>>
>> The function comments says that this creates a new virtual machine,  
>> maps physical RAM to it, and creates a virtual CPU for it. Memory  
>> gets mapped for addresses 0->0xA0000, 0xC0000->phys_mem_bytes.
>>
> This indeed what comment says, but looking at the code I don't see it
> using phys_mem_bytes/phys_mem parameters at all.

I'm not sure about libkvm, but the real KVM logic is "memory is not  
mapped -> MMIO". So if you just don't map it, you should get MMIO  
exits on that range.

Keep in mind that there are people out there trying to get rid of  
libkvm :-)

Alex


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

end of thread, other threads:[~2009-07-22  9:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-21 18:13 VGA address mapping? Saksena, Abhishek
2009-07-21 23:06 ` Saksena, Abhishek
2009-07-22  7:48   ` Gleb Natapov
2009-07-22  9:24     ` 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.