lkml.org 
[lkml]   [2022]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH 0/2] kvm: selftests: cleanup PTE definitions
Date
The width of operations on bit fields greater than 32-bit is
implementation defined, and differs between GCC (which uses the bitfield
precision) and clang (which uses 64-bit arithmetic), so this is a
minefield that is already causing bugs (see patch 1). Remove the bit
fields and using manual masking instead.

Mostly the same as yesterday's patch, but with constants moved to
processor.h and extended to include common idioms such as PAGE_MASK
and PAGE_SIZE.

Paolo

Supersedes: <20220420103624.1143824-1-pbonzini@redhat.com>

Paolo Bonzini (2):
kvm: selftests: do not use bitfields larger than 32-bits for PTEs
kvm: selftests: introduce and use more page size-related constants

.../selftests/kvm/include/x86_64/processor.h | 17 ++
.../selftests/kvm/lib/x86_64/processor.c | 202 +++++++-----------
tools/testing/selftests/kvm/x86_64/amx_test.c | 1 -
.../kvm/x86_64/emulator_error_test.c | 1 -
tools/testing/selftests/kvm/x86_64/smm_test.c | 2 -
.../kvm/x86_64/vmx_tsc_adjust_test.c | 1 -
.../selftests/kvm/x86_64/xen_shinfo_test.c | 1 -
.../selftests/kvm/x86_64/xen_vmcall_test.c | 1 -
8 files changed, 99 insertions(+), 127 deletions(-)

--
2.31.1

\
 
 \ /
  Last update: 2022-04-21 18:32    [W:0.038 / U:1.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site