mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: mlevitsk@redhat.com, jmattson@google.com
Subject: [PATCH 2/3] Documentation: KVM: add virtual CPU errata documentation
Date: Tue, 22 Mar 2022 12:07:11 +0100	[thread overview]
Message-ID: <20220322110712.222449-3-pbonzini@redhat.com> (raw)
In-Reply-To: <20220322110712.222449-1-pbonzini@redhat.com>

Add a file to document all the different ways in which the virtual CPU
emulation is imperfect.  Include an example to show how to document
such errata.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Documentation/virt/kvm/x86/errata.rst | 39 +++++++++++++++++++++++++++
 Documentation/virt/kvm/x86/index.rst  |  1 +
 2 files changed, 40 insertions(+)
 create mode 100644 Documentation/virt/kvm/x86/errata.rst

diff --git a/Documentation/virt/kvm/x86/errata.rst b/Documentation/virt/kvm/x86/errata.rst
new file mode 100644
index 000000000000..df394d34a836
--- /dev/null
+++ b/Documentation/virt/kvm/x86/errata.rst
@@ -0,0 +1,39 @@
+
+=======================================
+Known limitations of CPU virtualization
+=======================================
+
+Whenever perfect emulation of a CPU feature is impossible or too hard, KVM
+has to choose between not implementing the feature at all or introducing
+behavioral differences between virtual machines and bare metal systems.
+
+This file documents some of the known limitations that KVM has in
+virtualizing CPU features.
+
+x86
+===
+
+``KVM_GET_SUPPORTED_CPUID`` issues
+----------------------------------
+
+x87 features
+~~~~~~~~~~~~
+
+Unlike most other CPUID feature bits, CPUID[EAX=7,ECX=0]:EBX[6]
+(FDP_EXCPTN_ONLY) and CPUID[EAX=7,ECX=0]:EBX]13] (ZERO_FCS_FDS) are
+clear if the features are present and set if the features are not present.
+
+Clearing these bits in CPUID has no effect on the operation of the guest;
+if these bits are set on hardware, the features will not be present on
+any virtual machine that runs on that hardware.
+
+**Workaround:** It is recommended to always set these bits in guest CPUID.
+Note however that any software (e.g ``WIN87EM.DLL``) expecting these features
+to be present likely predates these CPUID feature bits, and therefore
+doesn't know to check for them anyway.
+
+Nested virtualization features
+------------------------------
+
+TBD
+
diff --git a/Documentation/virt/kvm/x86/index.rst b/Documentation/virt/kvm/x86/index.rst
index 55ede8e070b6..7ff588826b9f 100644
--- a/Documentation/virt/kvm/x86/index.rst
+++ b/Documentation/virt/kvm/x86/index.rst
@@ -9,6 +9,7 @@ KVM for x86 systems
 
    amd-memory-encryption
    cpuid
+   errata
    halt-polling
    hypercalls
    mmu
-- 
2.35.1



  parent reply	other threads:[~2022-03-22 11:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-22 11:07 [PATCH 0/3] Documentation: KVM: add a place to document API quirks and (x86) CPU errata Paolo Bonzini
2022-03-22 11:07 ` [PATCH 1/3] Documentation: KVM: add separate directories for architecture-specific documentation Paolo Bonzini
2022-03-22 11:07 ` Paolo Bonzini [this message]
2022-03-23 16:59   ` [PATCH 2/3] Documentation: KVM: add virtual CPU errata documentation Jim Mattson
2022-03-23 18:07   ` Oliver Upton
2022-03-22 11:07 ` [PATCH 3/3] Documentation: KVM: add API issues section Paolo Bonzini
2022-03-23 18:16   ` Oliver Upton
2022-03-23 21:32     ` Paolo Bonzini
2022-03-24  1:15       ` Oliver Upton

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=20220322110712.222449-3-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlevitsk@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®