From: Pavel Machek Subject: Re: [RFC PATCH 28/35] add support for Xen feature queries Date: Fri, 12 May 2006 21:56:45 +0000 Message-ID: <20060512215645.GA4491@ucw.cz> References: <20060509084945.373541000@sous-sol.org> <20060509085158.933866000@sous-sol.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20060509085158.933866000@sous-sol.org> Sender: linux-kernel-owner@vger.kernel.org To: Chris Wright Cc: linux-kernel@vger.kernel.org, virtualization@lists.osdl.org, xen-devel@lists.xensource.com, Ian Pratt , Christian Limpach List-Id: xen-devel@lists.xenproject.org Hi! > Add support for parsing and interpreting hypervisor feature > flags. These allow the kernel to determine what features are provided > by the underlying hypervisor. For example, whether page tables need to > be write protected explicitly by the kernel, and whether the kernel > (appears to) run in ring 0 rather than ring 1. This information allows > the kernel to improve performance by avoiding unnecessary actions. > --- /dev/null > +++ linus-2.6/include/xen/features.h > @@ -0,0 +1,20 @@ > +/****************************************************************************** > + * features.h > + * > + * Query the features reported by Xen. > + * > + * Copyright (c) 2006, Ian Campbell > + */ > + > +#ifndef __ASM_XEN_FEATURES_H__ > +#define __ASM_XEN_FEATURES_H__ > + > +#include > + > +extern void setup_xen_features(void); > + > +extern u8 xen_features[XENFEAT_NR_SUBMAPS * 32]; 32 bytes per submap? Why not use __test_bit & friends and make the bitmap compact? > +#define xen_feature(flag) (xen_features[flag]) Perhaps this kind of indirection is not neccessary? > --- /dev/null > +++ linus-2.6/drivers/xen/core/features.c > @@ -0,0 +1,29 @@ > +/****************************************************************************** > + * features.c > + * > + * Xen feature flags. > + * > + * Copyright (c) 2006, Ian Campbell, XenSource Inc. GPL? Pavel -- Thanks for all the (sleeping) penguins.