All of lore.kernel.org
 help / color / mirror / Atom feed
* Using EPT to map guest MMIO to host MMIO
@ 2011-08-05  7:20 Cyclonus J
  2011-08-05  7:41 ` Jan Kiszka
  0 siblings, 1 reply; 5+ messages in thread
From: Cyclonus J @ 2011-08-05  7:20 UTC (permalink / raw)
  To: kvm

hi,

I am wondering if it is possible to map guest MMIO to host MMIO, the
purpose is to reduce VM_EXIT as the page tables will be setup before
MMIO accessing from guest. Here is what I have in mind:

qemu_map_guest_mmio(guest_phys_addr, host_phys_addr, flags) -->
kvm_ioctl_map_guest_mmio_region(...)

Inside function kvm_ioctl_map_guest_mmio_region, it needs to setup
mappings for EPT to map guest_phys_addr(MMIO) to host_phys_addr(MMIO).

The first host_phys_addr inside QEMU function will be provided by the
para-virtualized guest.

Thanks,
CJ

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

* Re: Using EPT to map guest MMIO to host MMIO
  2011-08-05  7:20 Using EPT to map guest MMIO to host MMIO Cyclonus J
@ 2011-08-05  7:41 ` Jan Kiszka
  2011-08-05  8:40   ` Cyclonus J
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2011-08-05  7:41 UTC (permalink / raw)
  To: Cyclonus J; +Cc: kvm

On 2011-08-05 09:20, Cyclonus J wrote:
> hi,
> 
> I am wondering if it is possible to map guest MMIO to host MMIO, the
> purpose is to reduce VM_EXIT as the page tables will be setup before
> MMIO accessing from guest. Here is what I have in mind:

This is already the case if you pass through devices AND aligment&size
of the MMIO resource allows this.

What MMIOs do you see that are not mapped 1:1? For what kind of devices?

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

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

* Re: Using EPT to map guest MMIO to host MMIO
  2011-08-05  7:41 ` Jan Kiszka
@ 2011-08-05  8:40   ` Cyclonus J
  2011-08-05  9:08     ` Jan Kiszka
  0 siblings, 1 reply; 5+ messages in thread
From: Cyclonus J @ 2011-08-05  8:40 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: kvm

On Fri, Aug 5, 2011 at 12:41 AM, Jan Kiszka <jan.kiszka@siemens.com> wrote:
> On 2011-08-05 09:20, Cyclonus J wrote:
>> hi,
>>
>> I am wondering if it is possible to map guest MMIO to host MMIO, the
>> purpose is to reduce VM_EXIT as the page tables will be setup before
>> MMIO accessing from guest. Here is what I have in mind:
>
> This is already the case if you pass through devices AND aligment&size
> of the MMIO resource allows this.

I assume here pass through means using VT-d? Unfortunately, I can't
use it for my case and I need to para-virtualize guest OS as well.

Thanks,
CJ

>
> What MMIOs do you see that are not mapped 1:1? For what kind of devices?
>
> Jan
>
> --
> Siemens AG, Corporate Technology, CT T DE IT 1
> Corporate Competence Center Embedded Linux
>

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

* Re: Using EPT to map guest MMIO to host MMIO
  2011-08-05  8:40   ` Cyclonus J
@ 2011-08-05  9:08     ` Jan Kiszka
  2011-08-12  8:05       ` Cyclonus J
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2011-08-05  9:08 UTC (permalink / raw)
  To: Cyclonus J; +Cc: kvm

On 2011-08-05 10:40, Cyclonus J wrote:
> On Fri, Aug 5, 2011 at 12:41 AM, Jan Kiszka <jan.kiszka@siemens.com> wrote:
>> On 2011-08-05 09:20, Cyclonus J wrote:
>>> hi,
>>>
>>> I am wondering if it is possible to map guest MMIO to host MMIO, the
>>> purpose is to reduce VM_EXIT as the page tables will be setup before
>>> MMIO accessing from guest. Here is what I have in mind:
>>
>> This is already the case if you pass through devices AND aligment&size
>> of the MMIO resource allows this.
> 
> I assume here pass through means using VT-d?

...or AMD IOMMU. Yes.

> Unfortunately, I can't
> use it for my case and I need to para-virtualize guest OS as well.

Even with PV, you can't avoid VM exits if the IO access has side
effects, ie. is supposed to trigger some device activity. Or if it is
backed by some logic.

You can only avoid exits if MMIO behaves like RAM. But then it's better
to use RAM directly, like virtio but also real devices do for request data.

Again my question what device you want to optimize precisely.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

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

* Re: Using EPT to map guest MMIO to host MMIO
  2011-08-05  9:08     ` Jan Kiszka
@ 2011-08-12  8:05       ` Cyclonus J
  0 siblings, 0 replies; 5+ messages in thread
From: Cyclonus J @ 2011-08-12  8:05 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: kvm

On Fri, Aug 5, 2011 at 2:08 AM, Jan Kiszka <jan.kiszka@siemens.com> wrote:
> On 2011-08-05 10:40, Cyclonus J wrote:
>> On Fri, Aug 5, 2011 at 12:41 AM, Jan Kiszka <jan.kiszka@siemens.com> wrote:
>>> On 2011-08-05 09:20, Cyclonus J wrote:
>>>> hi,
>>>>
>>>> I am wondering if it is possible to map guest MMIO to host MMIO, the
>>>> purpose is to reduce VM_EXIT as the page tables will be setup before
>>>> MMIO accessing from guest. Here is what I have in mind:
>>>
>>> This is already the case if you pass through devices AND aligment&size
>>> of the MMIO resource allows this.
>>
>> I assume here pass through means using VT-d?
>
> ...or AMD IOMMU. Yes.
>
>> Unfortunately, I can't
>> use it for my case and I need to para-virtualize guest OS as well.
>
> Even with PV, you can't avoid VM exits if the IO access has side
> effects, ie. is supposed to trigger some device activity. Or if it is
> backed by some logic.
>
> You can only avoid exits if MMIO behaves like RAM. But then it's better
> to use RAM directly, like virtio but also real devices do for request data.
>
> Again my question what device you want to optimize precisely.

This is for graphic card. Currently, every MMIO access with take a
VM_EXIT which is too expensive I think.

CJ

>
> Jan
>
> --
> Siemens AG, Corporate Technology, CT T DE IT 1
> Corporate Competence Center Embedded Linux
>

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

end of thread, other threads:[~2011-08-12  8:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-05  7:20 Using EPT to map guest MMIO to host MMIO Cyclonus J
2011-08-05  7:41 ` Jan Kiszka
2011-08-05  8:40   ` Cyclonus J
2011-08-05  9:08     ` Jan Kiszka
2011-08-12  8:05       ` Cyclonus J

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.