Seeing many cases of uses like #ifdef CONFIG_XEN_PRIVILEGED_GUEST if (is_initial_xendomain()) { ... } #endif I''m wondering if it wasn''t nice to eliminate the preprocessor conditionals (which appear to be there only to cut down on code size) by doing the conditional in a single place instead: #ifdef CONFIG_XEN_PRIVILEGED_GUEST #define is_initial_xendomain() (xen_start_info->flags & SIF_INITDOMAIN) #else #define is_initial_xendomain() 0 #endif If that is acceptable, I''m ready to create a respective patch (but I''d like to avoid spending time on it if there are objections). Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> #ifdef CONFIG_XEN_PRIVILEGED_GUEST > #define is_initial_xendomain() (xen_start_info->flags &SIF_INITDOMAIN)> #else > #define is_initial_xendomain() 0 > #endif > > If that is acceptable, I''m ready to create a respective patch > (but I''d like to avoid spending time on it if there are objections).Personally, I''d like to see CONFIG_XEN_PRIVILEGED_GUEST disappear altogether. The code size saving is small, and most people use the -xen kernel rather than -xen0/-xenU anyway. Ian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Pratt wrote:>> #ifdef CONFIG_XEN_PRIVILEGED_GUEST >> #define is_initial_xendomain() (xen_start_info->flags & > SIF_INITDOMAIN) >> #else >> #define is_initial_xendomain() 0 >> #endif >> >> If that is acceptable, I''m ready to create a respective patch >> (but I''d like to avoid spending time on it if there are objections). > > Personally, I''d like to see CONFIG_XEN_PRIVILEGED_GUEST disappear > altogether. The code size saving is small, and most people use the -xen > kernel rather than -xen0/-xenU anyway.For development it''s handy to have a separate xenU kernel, for both build time and size. Most size savings come from dropping all the drivers though, not CONFIG_XEN_PRIVILEGED_GUEST. And gcc should be clever enougth to optimize away "if (0) { code block }", so you get the size savings even with CONFIG_XEN_PRIVILEGED_GUEST being hidden in some header file as listed above. cheers, Gerd -- Gerd Hoffmann <kraxel@suse.de> http://www.suse.de/~kraxel/julika-dora.jpeg _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 18/8/06 8:56 am, "Ian Pratt" <m+Ian.Pratt@cl.cam.ac.uk> wrote:>> #ifdef CONFIG_XEN_PRIVILEGED_GUEST >> #define is_initial_xendomain() (xen_start_info->flags & > SIF_INITDOMAIN) >> #else >> #define is_initial_xendomain() 0 >> #endif >> >> If that is acceptable, I''m ready to create a respective patch >> (but I''d like to avoid spending time on it if there are objections). > > Personally, I''d like to see CONFIG_XEN_PRIVILEGED_GUEST disappear > altogether. The code size saving is small, and most people use the -xen > kernel rather than -xen0/-xenU anyway.A partial cull based on initial_xendomain() would be a good first step. We''ll certainly take the patch if you make one, Jan. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Okay, here''s the patch, leaving just a single occurrence of CONFIG_XEN_PRIVILEGED_GUEST. (Testing was done on 2.6.18-rc4, and I hope there''s nothing wrong with the patch as adapted to 2.6.16.13). Signed-off-by: Jan Beulich <jbeulich@novell.com>>>> Keir Fraser <Keir.Fraser@cl.cam.ac.uk> 18.08.06 10:57 >>>On 18/8/06 8:56 am, "Ian Pratt" <m+Ian.Pratt@cl.cam.ac.uk> wrote:>> #ifdef CONFIG_XEN_PRIVILEGED_GUEST >> #define is_initial_xendomain() (xen_start_info->flags & > SIF_INITDOMAIN) >> #else >> #define is_initial_xendomain() 0 >> #endif >> >> If that is acceptable, I''m ready to create a respective patch >> (but I''d like to avoid spending time on it if there are objections). > > Personally, I''d like to see CONFIG_XEN_PRIVILEGED_GUEST disappear > altogether. The code size saving is small, and most people use the -xen > kernel rather than -xen0/-xenU anyway.A partial cull based on initial_xendomain() would be a good first step. We''ll certainly take the patch if you make one, Jan. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Fri, 2006-08-18 at 14:15 +0200, Jan Beulich wrote:> Okay, here''s the patch, leaving just a single occurrence of CONFIG_XEN_PRIVILEGED_GUEST. > (Testing was done on 2.6.18-rc4, and I hope there''s nothing wrong with the patch as adapted > to 2.6.16.13).Unfortunately the changes to arch/x86_64/kernel/genapic_xen.c broke the -xenU build. I''ve reverted just that bit for now until we/I figure out the correct fix. Perhaps we want to remove the dependence of CONFIG_X86_LOCAL_APIC on ! XEN_UNPRIVILEGED_GUEST and make sure we correctly gate the relevant functions with is_initial_xendomain()? The same goes for x86/32 as well but it was saved from the build breakage by the mach-xen subarch thing. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel