All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: peterx@redhat.com, seanjc@google.com
Subject: [PATCH 0/2] kvm: selftests: cleanup PTE definitions
Date: Thu, 21 Apr 2022 12:28:23 -0400	[thread overview]
Message-ID: <20220421162825.1412792-1-pbonzini@redhat.com> (raw)

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


             reply	other threads:[~2022-04-21 16:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 16:28 Paolo Bonzini [this message]
2022-04-21 16:28 ` [PATCH 1/2] kvm: selftests: do not use bitfields larger than 32-bits for PTEs Paolo Bonzini
2022-04-21 16:28 ` [PATCH 2/2] kvm: selftests: introduce and use more page size-related constants Paolo Bonzini
2022-04-21 19:38   ` Peter Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220421162825.1412792-1-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterx@redhat.com \
    --cc=seanjc@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.