/* * Assert that architectural dependency rules are satisfied, e.g. that AVX is * supported if and only if SSE is supported.
*/ #define ASSERT_XFEATURE_DEPENDENCIES(supported_xcr0, xfeatures, dependencies) \ do { \
uint64_t __supported = (supported_xcr0) & ((xfeatures) | (dependencies)); \
\
__GUEST_ASSERT((__supported & (xfeatures)) != (xfeatures) || \
__supported == ((xfeatures) | (dependencies)), \ "supported = 0x%lx, xfeatures = 0x%llx, dependencies = 0x%llx", \
__supported, (xfeatures), (dependencies)); \
} while (0)
/* * Assert that KVM reports a sane, usable as-is XCR0. Architecturally, a CPU * isn't strictly required to _support_ all XFeatures related to a feature, but * at the same time XSETBV will #GP if bundled XFeatures aren't enabled and * disabled coherently. E.g. a CPU can technically enumerate supported for * XTILE_CFG but not XTILE_DATA, but attempting to enable XTILE_CFG without * XTILE_DATA will #GP.
*/ #define ASSERT_ALL_OR_NONE_XFEATURE(supported_xcr0, xfeatures) \ do { \
uint64_t __supported = (supported_xcr0) & (xfeatures); \
\
__GUEST_ASSERT(!__supported || __supported == (xfeatures), \ "supported = 0x%lx, xfeatures = 0x%llx", \
__supported, (xfeatures)); \
} while (0)
staticvoid guest_code(void)
{
uint64_t initial_xcr0;
uint64_t supported_xcr0; int i, vector;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.