From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHXUX-000235-MJ for qemu-devel@nongnu.org; Wed, 04 May 2011 04:31:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHXUW-00089d-Fj for qemu-devel@nongnu.org; Wed, 04 May 2011 04:31:29 -0400 Received: from thoth.sbs.de ([192.35.17.2]:31644) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHXUW-00089C-4c for qemu-devel@nongnu.org; Wed, 04 May 2011 04:31:28 -0400 Message-ID: <4DC10ED4.7080609@siemens.com> Date: Wed, 04 May 2011 10:31:16 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1302881578-5357-1-git-send-email-agraf@suse.de> <1302881578-5357-6-git-send-email-agraf@suse.de> <20110418183404.GE16178@volta.aurel32.net> <2CD6A68E-9F9D-46A9-8488-D5FE4C2268E8@suse.de> <4DC017D8.7000408@siemens.com> <84F85E83-8C55-4438-806A-0B08A073920D@suse.de> In-Reply-To: <84F85E83-8C55-4438-806A-0B08A073920D@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 05/17] kvm: add kvm stub for arch specific stuff List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Peter Maydell , Richard Henderson , Avi Kivity , Aurelien Jarno , QEMU-devel Developers On 2011-05-04 07:19, Alexander Graf wrote: > > On 03.05.2011, at 16:57, Jan Kiszka wrote: > >> On 2011-05-03 16:17, Alexander Graf wrote: >>> >>> On 18.04.2011, at 20:34, Aurelien Jarno wrote: >>> >>>> On Fri, Apr 15, 2011 at 05:32:46PM +0200, Alexander Graf wrote: >>>>> We have a generic stub architecture for kvm calls, but some architectures >>>>> are different from others. So we do want to be able to have stubs for >>>>> architecture specific functionality as well. >>>>> >>>>> This patch adds kvm stubs for all architectures. >>>>> >>>>> Signed-off-by: Alexander Graf >>>>> --- >>>>> Makefile.target | 2 +- >>>>> target-alpha/kvm-arch-stub.c | 26 +++++++++++++++++++++++++ >>>>> target-arm/kvm-arch-stub.c | 26 +++++++++++++++++++++++++ >>>>> target-cris/kvm-arch-stub.c | 26 +++++++++++++++++++++++++ >>>>> target-i386/kvm-arch-stub.c | 26 +++++++++++++++++++++++++ >>>>> target-lm32/kvm-arch-stub.c | 26 +++++++++++++++++++++++++ >>>>> target-m68k/kvm-arch-stub.c | 26 +++++++++++++++++++++++++ >>>>> target-microblaze/kvm-arch-stub.c | 26 +++++++++++++++++++++++++ >>>>> target-mips/kvm-arch-stub.c | 26 +++++++++++++++++++++++++ >>>>> target-ppc/kvm-arch-stub.c | 26 +++++++++++++++++++++++++ >>>>> target-s390x/kvm-arch-stub.c | 38 +++++++++++++++++++++++++++++++++++++ >>>>> target-sh4/kvm-arch-stub.c | 26 +++++++++++++++++++++++++ >>>>> target-sparc/kvm-arch-stub.c | 26 +++++++++++++++++++++++++ >>>>> target-unicore32/kvm-arch-stub.c | 26 +++++++++++++++++++++++++ >>>>> 14 files changed, 351 insertions(+), 1 deletions(-) >>>>> create mode 100644 target-alpha/kvm-arch-stub.c >>>>> create mode 100644 target-arm/kvm-arch-stub.c >>>>> create mode 100644 target-cris/kvm-arch-stub.c >>>>> create mode 100644 target-i386/kvm-arch-stub.c >>>>> create mode 100644 target-lm32/kvm-arch-stub.c >>>>> create mode 100644 target-m68k/kvm-arch-stub.c >>>>> create mode 100644 target-microblaze/kvm-arch-stub.c >>>>> create mode 100644 target-mips/kvm-arch-stub.c >>>>> create mode 100644 target-ppc/kvm-arch-stub.c >>>>> create mode 100644 target-s390x/kvm-arch-stub.c >>>>> create mode 100644 target-sh4/kvm-arch-stub.c >>>>> create mode 100644 target-sparc/kvm-arch-stub.c >>>>> create mode 100644 target-unicore32/kvm-arch-stub.c >>>> >>>> Do we really want to create so much files on architectures we will never >>>> see KVM support? Actually I know very few things about KVM, so it would >>>> be better to have this patch reviewed by someone else. Avi or Anthony >>>> maybe? >>> >>> Well, the main idea is to be able to have a unified place to put stub functions into. And as it stands with most generalizations, we either make it generic or not :). >>> Maybe there's some Makefile magic to only compile the stub if the file exists? I certainly don't know of any. >> >> This approach looks wrong. >> >> The point of kvm stubs is to allow generic components to be built >> independently of kvm enabled/disabled. But target-specific callbacks >> can't be part of generic components anyway. So there is no need for a >> stub, those bits will be built per-target anyway. >> >> The examples you provided with this patch underline it: >> s390-virtio-bus.c should be built for s390 but nothing else. > > And it is, yes. The point is to not require #ifdefs in device emulation code :). But that's not the purpose of the stubs. They shall avoid building components target specific when just the kvm on/off dependency would force them to. Moreover, I do not see any need for such in infrastructure beyond s390 when considering that case valid. Why not simply define those few functions as static inline in the already s390-specific header depending on #ifdef CONFIG_KVM? Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux