[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH RFC 19/31] tools/libxc: Sanitise guest featuresets



On Wed, 2015-12-16 at 21:24 +0000, Andrew Cooper wrote:
> When generating a VM featureset, clearing individual features is
> problematic
> if a feature has dependent features.
> 
> Instead of disabling individual features, collect all disabling together
> in
> sanitise_featureset(), and perform deep dependency removal on the result,
> to
> remove all impacted features.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> CC: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
> CC: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
> CC: Wei Liu <wei.liu2@xxxxxxxxxx>
> ---
> Âtools/libxc/xc_cpuid_x86.c | 144 +++++++++++++++++++++----------------
> --------
> Â1 file changed, 67 insertions(+), 77 deletions(-)
> 
> diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
> index 3f39306..6c8995f 100644
> --- a/tools/libxc/xc_cpuid_x86.c
> +++ b/tools/libxc/xc_cpuid_x86.c
> @@ -21,14 +21,15 @@
> Â
> Â#include <stdlib.h>
> Â#include <stdbool.h>
> +#include <limits.h>
> Â#include "xc_private.h"
> -#include <xen/arch-x86/featureset.h>
> +#include "cpuid-private.h"
> Â#include <xen/hvm/params.h>
> Â#include <xen/sysctl.h>
> Â
> Â#define bitmaskof(idx)ÂÂÂÂÂÂ(1u << ((idx) & 31))
> -#define clear_bit(idx, dst) ((dst) &= ~bitmaskof(idx))
> -#define set_bit(idx, dst)ÂÂÂ((dst) |=ÂÂbitmaskof(idx))
> +#define clear_feature(idx, dst) ((dst) &= ~bitmaskof(idx))
> +#define set_feature(idx, dst)ÂÂÂ((dst) |=ÂÂbitmaskof(idx))

Heh.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.