Skip to content

Commit

Permalink
Repeat ARCH_XCOMP_GET_PERM if necessary as the relevant bit may be ne…
Browse files Browse the repository at this point in the history
…wly enabled.
  • Loading branch information
khuey authored Jan 24, 2025
1 parent 6ef3252 commit 8254cbc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/x86/arch_prctl_xstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ int main(void) {
ret = syscall(SYS_arch_prctl, ARCH_REQ_XCOMP_PERM, ARCH_XCOMP_TILEDATA);
if ((1 << ARCH_XCOMP_TILEDATA) & *features_perm) {
test_assert(0 == ret);
} else if (0 == ret) {
ret = syscall(SYS_arch_prctl, ARCH_GET_XCOMP_PERM, features_perm);
test_assert(0 == ret);
VERIFY_GUARD(features_perm);
test_assert((1 << ARCH_XCOMP_TILEDATA) & *features_perm);
} else {
test_assert(-1 == ret && errno == EOPNOTSUPP);
}
Expand Down

0 comments on commit 8254cbc

Please sign in to comment.