Make physdev_op common
Quoted 19 lines
From: Keir Fraser [mailto:[email protected]]
Sent: 2006年4月28日 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 inarch/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.
Quoted 3 lines
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 for specific physdev ops can be easily shared even between x86 and ia64. Guest ioapic r/w is obvious different. Guest IRQ handling is 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 separate LSAPIC EOI and IOSAPIC EOI. So the requirement to make 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