qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: Blue Swirl <blauwirbel@gmail.com>, Alexander Graf <agraf@suse.de>,
	Paul Mackerras <paulus@samba.org>,
	"qemu-devel@nongnu.org List" <qemu-devel@nongnu.org>,
	anton@samba.org
Subject: Re: [Qemu-devel] Re: [PATCH 15/15] Implement the bus structure for PAPR virtual IO
Date: Sun, 13 Feb 2011 09:08:22 -0600	[thread overview]
Message-ID: <4D57F3E6.10504@codemonkey.ws> (raw)
In-Reply-To: <20110213111245.GC18294@yookeroo>

On 02/13/2011 05:12 AM, David Gibson wrote:
> On Sun, Feb 13, 2011 at 10:08:23AM +0200, Blue Swirl wrote:
>    
>> On Sun, Feb 13, 2011 at 1:15 AM, Benjamin Herrenschmidt
>> <benh@kernel.crashing.org>  wrote:
>>      
>>> On Sun, 2011-02-13 at 00:52 +0200, Blue Swirl wrote:
>>>        
>>>> On Sat, Feb 12, 2011 at 11:00 PM, Benjamin Herrenschmidt
>>>> <benh@kernel.crashing.org>  wrote:
>>>>          
>>>>> On Sat, 2011-02-12 at 18:59 +0200, Blue Swirl wrote:
>>>>>            
>>>>>> Actually I don't quite understand the need for vty layer, why not use
>>>>>> the chardev here directly?
>>>>>>              
>>>>> I'm not sure what you mean here...
>>>>>            
>>>> Maybe it would be reasonable to leave h_put_term_char to spapr_hcall.c
>>>> instead of moving those to a separate file.
>>>>          
>>> Well, the VIO device instance gives the chardev instance which is all
>>> nicely encapsulated inside spapr-vty... Also VIO devices tend to have
>>> dedicated hcalls, not only VTY, so it makes a lot of sense to keep them
>>> close to the rest of the VIO driver they belong to don't you think ?
>>>
>>> (Actually veth does, vscsi uses the more "generic" CRQ stuff which we've
>>> added to the core VIO but you'll see that when we get those patches
>>> ready, hopefully soon).
>>>        
>> This is a bit of a special case, much like semihosting modes for m68k
>> or ARM, or like MOL hacks which were removed recently. From QEMU point
>> of view, the most natural way of handling this would be hypervisor
>> implemented in the guest side (for example BIOS). Then the hypervisor
>> would use normal IO (or virtio) to communicate with the host. If
>> inside QEMU, the interface of the hypervisor to the devices needs some
>> thought. We'd like to avoid ugly interfaces like vmmouse where a
>> device probes CPU registers directly or spaghetti interfaces like
>> APIC.
>>      
> I really don't follow what you're saying here.  Running the hypervisor
> in the guest, rather than emulating its effect in qemu seems like an
> awful lot of complexity for no clear reason.
>    

In KVM for x86, instead of using a secondary interface (like 
vmmcall/vmcall), we do all of our paravirtualization using native 
hardware interfaces that we can trap (PIO/MMIO).

IIUC, on Power, trapping MMIO is not possible due to the MMU mode that 
is currently used (PFs are delivered directly to the guest).

So it's not really possible to switch from using hypercalls to using MMIO.

What I would suggest is modelling hypercalls as another I/O address 
space for the processor.  So instead of having a function pointer in the 
CPUState, introduce a:

typedef void (HypercallFunc)(CPUState *env, void *opaque);

/* register a hypercall handler */
void register_hypercall(target_ulong index, HypercallFunc *handler, void 
*opaque);
void unregister_hypercall(target_ulong index);

/* dispatch a hypercall */
void cpu_hypercall(CPUState *env, target_ulong index);

This interface could also be used to implement hypercall based 
interfaces on s390 and x86.

The arguments will have to be extracted from the CPU state but I don't 
think we'll really ever have common hypercall implementations anyway so 
that's not a huge problem.

>> on real HW?
>>      
> The interface already exists on real HW.  It's described in the PAPR
> document we keep mentioning.
>    

Another thing to note is that the hypercall based I/O devices the 
interfaces that the current Power hypervisor uses so implementing this 
interface is necessary to support existing guests.

Regards,

Anthony Liguori

  parent reply	other threads:[~2011-02-13 15:08 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-12 14:54 [Qemu-devel] RFC: Implement emulation of pSeries logical partitions David Gibson
2011-02-12 14:54 ` [Qemu-devel] [PATCH 01/15] Add TAGS and *~ to .gitignore David Gibson
2011-02-12 14:54 ` [Qemu-devel] [PATCH 02/15] Clean up PowerPC SLB handling code David Gibson
2011-02-12 15:17   ` [Qemu-devel] " Alexander Graf
2011-02-12 14:54 ` [Qemu-devel] [PATCH 03/15] Allow qemu_devtree_setprop() to take arbitrary values David Gibson
2011-02-12 15:18   ` [Qemu-devel] " Alexander Graf
2011-02-12 14:54 ` [Qemu-devel] [PATCH 04/15] Add a hook to allow hypercalls to be emulated on PowerPC David Gibson
2011-02-12 15:19   ` [Qemu-devel] " Alexander Graf
2011-02-12 14:54 ` [Qemu-devel] [PATCH 05/15] Implement PowerPC slbmfee and slbmfev instructions David Gibson
2011-02-12 15:23   ` [Qemu-devel] " Alexander Graf
2011-02-13 12:46     ` David Gibson
2011-02-12 14:54 ` [Qemu-devel] [PATCH 06/15] Implement missing parts of the logic for the POWER PURR David Gibson
2011-02-12 15:25   ` [Qemu-devel] " Alexander Graf
2011-02-12 14:54 ` [Qemu-devel] [PATCH 07/15] Correct ppc popcntb logic, implement popcntw and popcntd David Gibson
2011-02-12 15:27   ` [Qemu-devel] " Alexander Graf
2011-02-12 14:54 ` [Qemu-devel] [PATCH 08/15] Clean up slb_lookup() function David Gibson
2011-02-12 15:30   ` [Qemu-devel] " Alexander Graf
2011-02-12 14:54 ` [Qemu-devel] [PATCH 09/15] Parse SDR1 on mtspr instead of at translate time David Gibson
2011-02-12 15:37   ` [Qemu-devel] " Alexander Graf
2011-02-13  9:02     ` David Gibson
2011-02-13 12:33       ` Alexander Graf
2011-02-13 12:52         ` David Gibson
2011-02-12 14:54 ` [Qemu-devel] [PATCH 10/15] Use "hash" more consistently in ppc mmu code David Gibson
2011-02-12 15:47   ` [Qemu-devel] " Alexander Graf
2011-02-12 14:54 ` [Qemu-devel] [PATCH 11/15] Better factor the ppc hash translation path David Gibson
2011-02-12 15:52   ` [Qemu-devel] " Alexander Graf
2011-02-12 14:54 ` [Qemu-devel] [PATCH 12/15] Support 1T segments on ppc David Gibson
2011-02-12 15:57   ` [Qemu-devel] " Alexander Graf
2011-02-13  9:34     ` David Gibson
2011-02-13 12:37       ` Alexander Graf
2011-02-13 13:38         ` David Gibson
2011-02-12 14:54 ` [Qemu-devel] [PATCH 13/15] Add POWER7 support for ppc David Gibson
2011-02-12 16:09   ` [Qemu-devel] " Alexander Graf
2011-02-13  9:39     ` David Gibson
2011-02-13 12:37       ` Alexander Graf
2011-02-12 14:54 ` [Qemu-devel] [PATCH 14/15] Start implementing pSeries logical partition machine David Gibson
2011-02-12 16:23   ` [Qemu-devel] " Alexander Graf
2011-02-12 16:40     ` Blue Swirl
2011-02-12 20:54       ` Benjamin Herrenschmidt
2011-02-12 14:54 ` [Qemu-devel] [PATCH 15/15] Implement the bus structure for PAPR virtual IO David Gibson
2011-02-12 16:47   ` [Qemu-devel] " Alexander Graf
2011-02-12 16:59     ` Blue Swirl
2011-02-12 21:00       ` Benjamin Herrenschmidt
2011-02-12 22:52         ` Blue Swirl
2011-02-12 23:15           ` Benjamin Herrenschmidt
2011-02-13  8:08             ` Blue Swirl
2011-02-13 11:12               ` David Gibson
2011-02-13 12:15                 ` Blue Swirl
2011-02-13 16:12                   ` Benjamin Herrenschmidt
2011-02-13 15:08                 ` Anthony Liguori [this message]
2011-02-13 15:56                   ` Alexander Graf
2011-02-13 16:46                     ` Anthony Liguori
2011-02-13 18:29                   ` Blue Swirl
2011-02-13 19:32                     ` Anthony Liguori
2011-02-13 23:33                     ` David Gibson
2011-02-13 23:30                   ` David Gibson
2011-02-13 12:31               ` Alexander Graf
2011-02-13 12:59                 ` Blue Swirl
2011-02-13 16:07               ` Benjamin Herrenschmidt
2011-02-13 16:48                 ` Anthony Liguori
2011-02-13 18:19                   ` Benjamin Herrenschmidt
2011-02-13 11:14             ` David Gibson
2011-02-13 12:40               ` Alexander Graf
2011-02-13 12:44                 ` David Gibson
2011-02-13 13:09                   ` Alexander Graf
2011-02-13 15:14                 ` Anthony Liguori
2011-02-13 16:17                 ` Benjamin Herrenschmidt
2011-02-13 16:52                   ` Anthony Liguori
2011-02-13 18:21                     ` Benjamin Herrenschmidt
2011-02-13 11:09     ` David Gibson
2011-02-13 12:38       ` Alexander Graf
2011-02-14  4:16 ` [Qemu-devel] RFC: Implement emulation of pSeries logical partitions FUJITA Tomonori

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=4D57F3E6.10504@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=agraf@suse.de \
    --cc=anton@samba.org \
    --cc=blauwirbel@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).