All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: kvm@vger.kernel.org
Cc: zxwang42@gmail.com, marcorr@google.com, seanjc@google.com,
	jroedel@suse.de, varad.gautam@suse.com
Subject: [PATCH kvm-unit-tests 0/2] remove tss_descr, replace with a function
Date: Wed, 20 Oct 2021 12:53:31 -0400	[thread overview]
Message-ID: <20211020165333.953978-1-pbonzini@redhat.com> (raw)

tss_descr is declared as a struct descriptor_table_ptr but it is actualy
pointing to an _entry_ in the GDT.  Also it is different per CPU, but
tss_descr does not recognize that.  Fix both by reusing the code
(already present e.g. in the vmware_backdoors test) that extracts
the base from the GDT entry; and also provide a helper to retrieve
the limit, which is needed in vmx.c.

Patch 1 adjusts the structs for GDT descriptors, so that the same
code works for both 32-bit and 64-bit (apart from the high 32 bits
of the base field).

Paolo

Paolo Bonzini (2):
  unify structs for GDT descriptors
  replace tss_descr global with a function

 lib/x86/desc.c         | 26 +++++++++++--------
 lib/x86/desc.h         | 58 ++++++++++++++++++++++++++++++++++--------
 x86/cstart64.S         |  1 -
 x86/svm_tests.c        | 15 +++--------
 x86/taskswitch.c       |  2 +-
 x86/vmware_backdoors.c | 22 +++++-----------
 x86/vmx.c              |  9 ++++---
 7 files changed, 78 insertions(+), 55 deletions(-)

-- 
2.27.0


             reply	other threads:[~2021-10-20 16:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 16:53 Paolo Bonzini [this message]
2021-10-20 16:53 ` [PATCH kvm-unit-tests 1/2] unify structs for GDT descriptors Paolo Bonzini
2021-10-20 17:58   ` Sean Christopherson
2021-10-20 19:10     ` Paolo Bonzini
2021-10-20 20:05   ` Jim Mattson
2021-10-20 16:53 ` [PATCH kvm-unit-tests 2/2] replace tss_descr global with a function Paolo Bonzini
2021-10-20 18:01   ` Sean Christopherson

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=20211020165333.953978-1-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jroedel@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=marcorr@google.com \
    --cc=seanjc@google.com \
    --cc=varad.gautam@suse.com \
    --cc=zxwang42@gmail.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.