xref: /kvm-unit-tests/x86/la57.c (revision 4143fbfd524b140b81122286c3984bd1aaac82b7)
1cfe95239SSean Christopherson #include "libcflat.h"
2cfe95239SSean Christopherson #include "processor.h"
3cfe95239SSean Christopherson #include "desc.h"
4cfe95239SSean Christopherson 
5cfe95239SSean Christopherson int main(int ac, char **av)
6cfe95239SSean Christopherson {
7*4143fbfdSSean Christopherson 	int vector = write_cr4_safe(read_cr4() | X86_CR4_LA57);
8cfe95239SSean Christopherson 	int expected = this_cpu_has(X86_FEATURE_LA57) ? 0 : 13;
9cfe95239SSean Christopherson 
10cfe95239SSean Christopherson 	report(vector == expected, "%s when CR4.LA57 %ssupported",
11cfe95239SSean Christopherson 	       expected ? "#GP" : "No fault", expected ? "un" : "");
12cfe95239SSean Christopherson 	return report_summary();
13cfe95239SSean Christopherson }
14