From: "Tian, Kevin" Subject: RE: [PATCH 1/2] Make physdev_op common Date: Sat, 29 Apr 2006 10:45:48 +0800 Message-ID: <571ACEFD467F7749BC50E0A98C17CDD8094E7BBC@pdsmsx403> Mime-Version: 1.0 Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: quoted-printable Return-path: Content-class: urn:content-classes:message List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel List-Id: xen-devel@lists.xenproject.org >From: Keir Fraser [mailto:Keir.Fraser@cl.cam.ac.uk] >Sent: 2006=C4=EA4=D4=C228=C8=D5 22:13 >Hmmm, actually now I think about this some more I'm not so sure it's a >good idea after all. Firstly, other architectures (e.g., ppc) may not >want all of the physdev operations that you have chosen to make >common. >Secondly, it's not exactly a lot of code to duplicate in arch/ia64 -- >it's only a switch statement with some very basic argument checking >(which, even so, we may want to change in future for x86) and then >calls out to arch-specific functions that actually do the work. So >there's an argument for simply duplicating this hypercall code. > >I guess maybe it might make sense if we were to try and pull out some >common elements of guest IRQ handling. Then at least the physdev ops >concerned with irq management might arguably be common. But even >then, >having an arch-specific hypercall calling out to code in common/ is >okay. > >What do you think? > > -- Keir You're right, simply duplicating switch statements seem not that = helpful. After thinking more, unfortunately there're not much meaningful code=20 for specific physdev ops can be easily shared even between x86 and=20 ia64. Guest ioapic r/w is obvious different. Guest IRQ handling is=20 possibly to be shared. However xen/ia64 has simpler logic. For example, there's no need for ACKTYPE_EOI on xen/ia64 since IA64 arch defines=20 separate LSAPIC EOI and IOSAPIC EOI. So the requirement to make=20 this part common is also not that urgent or necessary. So I'll hold back = this patch and resend the 2nd one in another mail. :-) Thanks, Kevin