From: Paolo Bonzini <pbonzini@redhat.com>
To: Jue Wang <juew@google.com>,
Sean Christopherson <seanjc@google.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
David Matlack <dmatlack@google.com>
Cc: Tony Luck <tony.luck@intel.com>,
kvm@vger.kernel.org, Greg Thelen <gthelen@google.com>,
Jiaqi Yan <jiaqiyan@google.com>
Subject: Re: [PATCH v5 0/8] KVM: x86: Add CMCI and UCNA emulation
Date: Thu, 23 Jun 2022 19:25:23 +0200 [thread overview]
Message-ID: <5312f6eb-4d82-5bee-b4fa-20e9ba97baa8@redhat.com> (raw)
In-Reply-To: <20220610171134.772566-1-juew@google.com>
On 6/10/22 19:11, Jue Wang wrote:
> This patch series implement emulation for Corrected Machine Check
> Interrupt (CMCI) signaling and UnCorrectable No Action required (UCNA)
> error injection.
>
> UCNA errors signaled via CMCI allow a guest to be notified as soon as
> uncorrectable memory errors get detected by some background threads,
> e.g., threads that migrate guest memory across hosts or threads that
> constantly scan system memory for errors [1].
>
> Upon receiving UCNAs, guest kernel isolates the poisoned pages which may
> still be free, preventing future accesses that may cause fatal MCEs.
>
> 1. https://lore.kernel.org/linux-mm/8eceffc0-01e8-2a55-6eb9-b26faa9e3caf@intel.com/t/
>
>
> Patch 1-3 clean up KVM APIC LVT logic in preparation to adding APIC_LVTCMCI.
>
> Patch 4 adds APIC_LVTCMCI emulation.
>
> Patch 5 updates mce_banks to use array allocation api.
>
> Patch 6 adds emulation for MSR_IA32_MCx_CTL2 registers that provide per
> bank control of CMCI signaling.
>
> Patch 7 enables MCG_CMCI_P and handles injected UCNA errors.
>
> Patch 8 adds a KVM self test that validates UCNA injection and CMCI
> emulation.
>
> v5 changes
> - Incorporate feedback from David Matlack <dmatlack@google.com>
> - Rewrite the change log to be more concise and accurate.
> - Removes several duplicated checks in UCNA injection code.
> - Add test cases that validate CMCI emulation to self test.
>
> v4 changes
> - Incorporate feedback from David Matlack <dmatlack@google.com>
> - Rewrite the change logs to be more descriptive.
> - Add a KVM self test.
>
> v3 changes
> - Incorporate feedback from Sean Christopherson <seanjc@google.com>
> - Split clean up to KVM APIC LVT logic to 3 patches.
> - Put the clean up of mce_array allocation in a separate patch.
> - Base the MCi_CTL2 register emulation on Sean's clean up and fix
> series [2]
> - Fix bugs around MCi_CTL2 register offset validation and the free of
> mci_ctl2_banks array.
> - Rewrite the change log with more details in architectural information
> about CMCI, UCNA and MCG_CMCI_P.
> - Fix various comments and wrapping style.
>
> 2. https://lore.kernel.org/lkml/20220512222716.4112548-1-seanjc@google.com/T/
>
> v2 chanegs
> - Incorporate feedback from Sean Christopherson <seanjc@google.com>
> - Split the single patch into 4:
> 1). clean up KVM APIC LVT logic
> 2). add CMCI emulation to lapic
> 3). add emulation of MSR_IA32_MCx_CTL2
> 4). enable MCG_CMCI_P and handle injected UCNAs
> - Fix various style issues.
>
> Jue Wang (8):
> KVM: x86: Make APIC_VERSION capture only the magic 0x14UL.
> KVM: x86: Fill apic_lvt_mask with enums / explicit entries.
> KVM: x86: Add APIC_LVTx() macro.
> KVM: x86: Add Corrected Machine Check Interrupt (CMCI) emulation to
> lapic.
> KVM: x86: Use kcalloc to allocate the mce_banks array.
> KVM: x86: Add emulation for MSR_IA32_MCx_CTL2 MSRs.
> KVM: x86: Enable CMCI capability by default and handle injected UCNA
> errors
> KVM: selftests: Add a self test for CMCI and UCNA emulations.
>
> arch/x86/include/asm/kvm_host.h | 1 +
> arch/x86/kvm/lapic.c | 66 ++--
> arch/x86/kvm/lapic.h | 16 +-
> arch/x86/kvm/vmx/vmx.c | 1 +
> arch/x86/kvm/x86.c | 178 ++++++---
> tools/testing/selftests/kvm/.gitignore | 1 +
> tools/testing/selftests/kvm/Makefile | 1 +
> .../selftests/kvm/include/x86_64/apic.h | 1 +
> .../selftests/kvm/include/x86_64/mce.h | 25 ++
> .../selftests/kvm/include/x86_64/processor.h | 1 +
> .../selftests/kvm/lib/x86_64/processor.c | 2 +-
> .../kvm/x86_64/ucna_injection_test.c | 347 ++++++++++++++++++
> 12 files changed, 573 insertions(+), 67 deletions(-)
> create mode 100644 tools/testing/selftests/kvm/include/x86_64/mce.h
> create mode 100644 tools/testing/selftests/kvm/x86_64/ucna_injection_test.c
>
Queued, thanks. The test of course required some changes to adapt to
the new API.
Paolo
next prev parent reply other threads:[~2022-06-23 18:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-10 17:11 [PATCH v5 0/8] KVM: x86: Add CMCI and UCNA emulation Jue Wang
2022-06-10 17:11 ` [PATCH v5 1/8] KVM: x86: Make APIC_VERSION capture only the magic 0x14UL Jue Wang
2022-06-10 17:11 ` [PATCH v5 2/8] KVM: x86: Fill apic_lvt_mask with enums / explicit entries Jue Wang
2022-06-10 17:11 ` [PATCH v5 3/8] KVM: x86: Add APIC_LVTx() macro Jue Wang
2022-06-10 17:11 ` [PATCH v5 4/8] KVM: x86: Add Corrected Machine Check Interrupt (CMCI) emulation to lapic Jue Wang
2022-07-01 2:07 ` Xiaoyao Li
2022-07-01 4:40 ` Jue Wang
2022-07-01 16:53 ` Jue Wang
2022-06-10 17:11 ` [PATCH v5 5/8] KVM: x86: Use kcalloc to allocate the mce_banks array Jue Wang
2022-06-10 17:11 ` [PATCH v5 6/8] KVM: x86: Add emulation for MSR_IA32_MCx_CTL2 MSRs Jue Wang
2022-06-10 17:11 ` [PATCH v5 7/8] KVM: x86: Enable CMCI capability by default and handle injected UCNA errors Jue Wang
2022-06-10 17:11 ` [PATCH v5 8/8] KVM: selftests: Add a self test for CMCI and UCNA emulations Jue Wang
2022-06-23 17:25 ` Paolo Bonzini [this message]
2022-06-30 13:48 ` [PATCH v5 0/8] KVM: x86: Add CMCI and UCNA emulation Xiaoyao Li
2022-06-30 14:05 ` Jue Wang
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=5312f6eb-4d82-5bee-b4fa-20e9ba97baa8@redhat.com \
--to=pbonzini@redhat.com \
--cc=dmatlack@google.com \
--cc=gthelen@google.com \
--cc=jiaqiyan@google.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=juew@google.com \
--cc=kvm@vger.kernel.org \
--cc=seanjc@google.com \
--cc=tony.luck@intel.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.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