1 // SPDX-License-Identifier: GPL-2.0-only
2 /******************************************************************************
7 * Copyright (c) 2006, Ian Campbell, XenSource Inc.
9 #include <linux/types.h>
10 #include <linux/cache.h>
11 #include <linux/export.h>
13 #include <asm/xen/hypercall.h>
15 #include <xen/interface/xen.h>
16 #include <xen/interface/version.h>
17 #include <xen/features.h>
19 u8 xen_features
[XENFEAT_NR_SUBMAPS
* 32] __read_mostly
;
20 EXPORT_SYMBOL_GPL(xen_features
);
22 void xen_setup_features(void)
24 struct xen_feature_info fi
;
27 for (i
= 0; i
< XENFEAT_NR_SUBMAPS
; i
++) {
29 if (HYPERVISOR_xen_version(XENVER_get_features
, &fi
) < 0)
31 for (j
= 0; j
< 32; j
++)
32 xen_features
[i
* 32 + j
] = !!(fi
.submap
& 1<<j
);