Hi! Attached patch caches current vcpu. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> -- AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Gcc is quite capable of eliminating common subexpressions involving current(), and I don''t think this patch aids code readability (especially the set_debugreg() change -- p==current means more to me than p==v). -- Keir On 29/10/07 15:43, "Christoph Egger" <Christoph.Egger@amd.com> wrote:> > Hi! > > Attached patch caches current vcpu. > > Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
I thought, the changes to register_guest_nmi_callback() and do_set_trap_table() make some sense. The rest is just for consistency. Take what you like, leave the rest :) Christoph On Monday 29 October 2007 18:23:09 Keir Fraser wrote:> Gcc is quite capable of eliminating common subexpressions involving > current(), and I don''t think this patch aids code readability (especially > the set_debugreg() change -- p==current means more to me than p==v). > > -- Keir > > On 29/10/07 15:43, "Christoph Egger" <Christoph.Egger@amd.com> wrote: > > Hi! > > > > Attached patch caches current vcpu. > > > > Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>-- AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
>>> Keir Fraser <Keir.Fraser@cl.cam.ac.uk> 29.10.07 18:23 >>> >Gcc is quite capable of eliminating common subexpressions involving >current(), ...I have to partly disagree here: While gcc is capable of doing this, it cannot do anything about uses of current that have function calls in between, and I also don''t think making get_current() an __attribute__((__pure__)) inline function would be correct. I do agree that in certain places using current is more readable, albeit I think that there are quite a few places where it is already non-obvious that ''v'' denotes ''current'' (perhaps naming might just help here - if ''v'' only ever gets set from ''current'' in a function, renaming it to ''cur'' might be reasonable to consider). Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel