From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [Xen-devel] [PATCH 1/3] PAD helper for native and paravirt platform Date: Sun, 19 Feb 2012 13:23:39 -0500 Message-ID: <20120219182339.GA11882@phenom.dumpdata.com> References: <20120217142909.GA29110@phenom.dumpdata.com> <20120217144742.GA29454@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from rcsinet15.oracle.com ([148.87.113.117]:34670 "EHLO rcsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753998Ab2BSTgx (ORCPT ); Sun, 19 Feb 2012 14:36:53 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: "Liu, Jinsong" Cc: "xen-devel@lists.xensource.com" , Kernel development list , "linux-acpi@vger.kernel.org" , "keir.xen@gmail.com" , Jan Beulich , "Li, Shaohua" , "lenb@kernel.org" > >>> +struct pv_pad_ops { > >>> + int (*acpi_pad_init)(void); > >>> + void (*acpi_pad_exit)(void); > >>> +}; > >>> + > > > > Looking at this a bit closer I am not sure why you choose the paravirt > > interface for this? There is another one - the x86 that could have > > been > > choosen. Or introduce a new one that is specific to ACPI. > > > > I am curious - what was the reason for using the paravirt interface? > > I understand it does get the job done, but it seems a bit overkill > > when something simple could have been used? > > > > It uses paravirt interface to avoid some code like 'xen_...' in native code path (acpi_pad.c). > I'm not quite sure what does 'x86' here mean? Adding 2 fields (acpi_pad_init/exit) in arch/x86/xen/enlighten.c --> xen_cpu_ops? seems it's much simpler. arch/x86/include/asm/x86_init.h But before you go that way let me ask you another question - can ACPI PAD be used on ARM or IA64? If so, wouldn't this fail compilation as this pvops structure is not defined on IA64? The other thing I am not comfortable about is that the pvops structure are used for low-level code. Not for higher up, like ACPI. For that another structure seems more prudent. Perhaps something like the x86 one, but specific to ACPI?