From: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: "Zhang, Xiantao" <xiantao.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Subject: Re: [kvm-ppc-devel] [PATCH 1 of 3] Move x86kvmcallback structure tokvmctl-x86.h header
Date: Sun, 28 Oct 2007 21:56:42 -0500 [thread overview]
Message-ID: <1193626602.17368.35.camel@basalt> (raw)
In-Reply-To: <42DFA526FC41B1429CE7279EF83C6BDC8B528F-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
On Mon, 2007-10-29 at 10:41 +0800, Zhang, Xiantao wrote:
> >>> call + * when it encounters something that cannot be virtualized,
> >>> such as + * accessing hardware devices via MMIO or regular IO. + */
> >>> +struct kvm_callbacks {
> >>> + /// For 8bit IO reads from the guest (Usually when executing
> >>> 'inb') + int (*inb)(void *opaque, uint16_t addr, uint8_t *data);
> >>> + /// For 16bit IO reads from the guest (Usually when executing
> >>> 'inw') + int (*inw)(void *opaque, uint16_t addr, uint16_t *data);
> >>
> >> I don't know the privious story about this thread, but now I can't
> >> understand the move. Why do we move all the structure to
> >> arch-specific ? For IA64 side, almostly we can reuse them directly,
> >> and just see some special fields as arch-specific. So, I think, we
> >> should keep common fields in kvmctl.h.
> >
> > Are you suggesting that kvm_callbacks should be the union of all
> > callbacks used on all architectures, and for any given architecture
> > only a subset are actually used?
>
> No, not a union. I think we should keep some common fields for all
> archs. At least, io_callbacks should be same for all archs.
Really? The *PIO* callbacks are the same? (PowerPC doesn't do PIO at
all, and I'm almost positive that S390 doesn't either.)
> So, we need to split them into two parts, one common and the other one
> is arch-specific. Maybe we should add an filed, such as arch to hold
> arch-specific fields, instead of moving them all to kvmctl-x86.h
Arch-specific code must handle the kernel->user returns anyways, so
having a common/arch-specific data structure split buys us nothing. The
reason we will have that split in the general KVM code (e.g. ioctl
handling) is that there is common *code*, and so it needs to work with
common data structures. That is not the case here.
If your arch has PIO, you're welcome to create PIO callbacks, and you
can even share the implementation of those callbacks by building a
shared pio.c. This can and should be done with completely arch-specific
callback structures.
--
Hollis Blanchard
IBM Linux Technology Center
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
next prev parent reply other threads:[~2007-10-29 2:56 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-29 0:42 [PATCH 0 of 3] kvmctl code refactoring part 1 Jerone Young
2007-10-29 0:42 ` [PATCH 1 of 3] Move x86 kvmcallback structure to kvmctl-x86.h header Jerone Young
2007-10-29 1:13 ` [PATCH 1 of 3] Move x86 kvmcallback structure tokvmctl-x86.h header Zhang, Xiantao
[not found] ` <42DFA526FC41B1429CE7279EF83C6BDC8B51E0-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-10-29 2:04 ` [kvm-ppc-devel] " Hollis Blanchard
2007-10-29 2:17 ` Anthony Liguori
[not found] ` <472542B8.9070105-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-10-29 2:41 ` Zhang, Xiantao
[not found] ` <42DFA526FC41B1429CE7279EF83C6BDC8B5292-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-10-29 3:00 ` Hollis Blanchard
2007-10-29 3:53 ` Anthony Liguori
2007-10-29 2:41 ` [kvm-ppc-devel] [PATCH 1 of 3] Move x86kvmcallback " Zhang, Xiantao
[not found] ` <42DFA526FC41B1429CE7279EF83C6BDC8B528F-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-10-29 2:56 ` Hollis Blanchard [this message]
2007-10-29 2:11 ` [PATCH 1 of 3] Move x86 kvmcallback structure to kvmctl-x86.h header Anthony Liguori
[not found] ` <4725415B.4020601-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-10-29 3:14 ` [kvm-ppc-devel] " Hollis Blanchard
2007-10-29 3:50 ` Anthony Liguori
[not found] ` <47255892.2090308-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-10-29 4:14 ` Hollis Blanchard
2007-10-29 14:12 ` Anthony Liguori
2007-10-30 4:31 ` Avi Kivity
2007-10-29 0:42 ` [PATCH 2 of 3] Move kvm_context structure to kvmctl.h header Jerone Young
2007-10-29 1:28 ` [PATCH 2 of 3] Move kvm_context structure to kvmctl.hheader Zhang, Xiantao
2007-10-29 2:08 ` [PATCH 2 of 3] Move kvm_context structure to kvmctl.h header Anthony Liguori
2007-10-29 7:18 ` Izik Eidus
2007-10-29 0:42 ` [PATCH 3 of 3] Move x86 specific properties of kvm_init to own file Jerone Young
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=1193626602.17368.35.camel@basalt \
--to=hollisb-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
--cc=jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=xiantao.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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