Skip to content

Commit cb55738

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull KVM updates from Paolo Bonzini: "Loongarch: - Add more CPUCFG mask bits - Improve feature detection - Add lazy load support for FPU and binary translation (LBT) register state - Fix return value for memory reads from and writes to in-kernel devices - Add support for detecting preemption from within a guest - Add KVM steal time test case to tools/selftests ARM: - Add support for FEAT_IDST, allowing ID registers that are not implemented to be reported as a normal trap rather than as an UNDEF exception - Add sanitisation of the VTCR_EL2 register, fixing a number of UXN/PXN/XN bugs in the process - Full handling of RESx bits, instead of only RES0, and resulting in SCTLR_EL2 being added to the list of sanitised registers - More pKVM fixes for features that are not supposed to be exposed to guests - Make sure that MTE being disabled on the pKVM host doesn't give it the ability to attack the hypervisor - Allow pKVM's host stage-2 mappings to use the Force Write Back version of the memory attributes by using the "pass-through' encoding - Fix trapping of ICC_DIR_EL1 on GICv5 hosts emulating GICv3 for the guest - Preliminary work for guest GICv5 support - A bunch of debugfs fixes, removing pointless custom iterators stored in guest data structures - A small set of FPSIMD cleanups - Selftest fixes addressing the incorrect alignment of page allocation - Other assorted low-impact fixes and spelling fixes RISC-V: - Fixes for issues discoverd by KVM API fuzzing in kvm_riscv_aia_imsic_has_attr(), kvm_riscv_aia_imsic_rw_attr(), and kvm_riscv_vcpu_aia_imsic_update() - Allow Zalasr, Zilsd and Zclsd extensions for Guest/VM - Transparent huge page support for hypervisor page tables - Adjust the number of available guest irq files based on MMIO register sizes found in the device tree or the ACPI tables - Add RISC-V specific paging modes to KVM selftests - Detect paging mode at runtime for selftests s390: - Performance improvement for vSIE (aka nested virtualization) - Completely new memory management. s390 was a special snowflake that enlisted help from the architecture's page table management to build hypervisor page tables, in particular enabling sharing the last level of page tables. This however was a lot of code (~3K lines) in order to support KVM, and also blocked several features. The biggest advantages is that the page size of userspace is completely independent of the page size used by the guest: userspace can mix normal pages, THPs and hugetlbfs as it sees fit, and in fact transparent hugepages were not possible before. It's also now possible to have nested guests and guests with huge pages running on the same host - Maintainership change for s390 vfio-pci - Small quality of life improvement for protected guests x86: - Add support for giving the guest full ownership of PMU hardware (contexted switched around the fastpath run loop) and allowing direct access to data MSRs and PMCs (restricted by the vPMU model). KVM still intercepts access to control registers, e.g. to enforce event filtering and to prevent the guest from profiling sensitive host state. This is more accurate, since it has no risk of contention and thus dropped events, and also has significantly less overhead. For more information, see the commit message for merge commit bf2c313 ("Merge tag 'kvm-x86-pmu-6.20' ...") - Disallow changing the virtual CPU model if L2 is active, for all the same reasons KVM disallows change the model after the first KVM_RUN - Fix a bug where KVM would incorrectly reject host accesses to PV MSRs when running with KVM_CAP_ENFORCE_PV_FEATURE_CPUID enabled, even if those were advertised as supported to userspace, - Fix a bug with protected guest state (SEV-ES/SNP and TDX) VMs, where KVM would attempt to read CR3 configuring an async #PF entry - Fail the build if EXPORT_SYMBOL_GPL or EXPORT_SYMBOL is used in KVM (for x86 only) to enforce usage of EXPORT_SYMBOL_FOR_KVM_INTERNAL. Only a few exports that are intended for external usage, and those are allowed explicitly - When checking nested events after a vCPU is unblocked, ignore -EBUSY instead of WARNing. Userspace can sometimes put the vCPU into what should be an impossible state, and spurious exit to userspace on -EBUSY does not really do anything to solve the issue - Also throw in the towel and drop the WARN on INIT/SIPI being blocked when vCPU is in Wait-For-SIPI, which also resulted in playing whack-a-mole with syzkaller stuffing architecturally impossible states into KVM - Add support for new Intel instructions that don't require anything beyond enumerating feature flags to userspace - Grab SRCU when reading PDPTRs in KVM_GET_SREGS2 - Add WARNs to guard against modifying KVM's CPU caps outside of the intended setup flow, as nested VMX in particular is sensitive to unexpected changes in KVM's golden configuration - Add a quirk to allow userspace to opt-in to actually suppress EOI broadcasts when the suppression feature is enabled by the guest (currently limited to split IRQCHIP, i.e. userspace I/O APIC). Sadly, simply fixing KVM to honor Suppress EOI Broadcasts isn't an option as some userspaces have come to rely on KVM's buggy behavior (KVM advertises Supress EOI Broadcast irrespective of whether or not userspace I/O APIC supports Directed EOIs) - Clean up KVM's handling of marking mapped vCPU pages dirty - Drop a pile of *ancient* sanity checks hidden behind in KVM's unused ASSERT() macro, most of which could be trivially triggered by the guest and/or user, and all of which were useless - Fold "struct dest_map" into its sole user, "struct rtc_status", to make it more obvious what the weird parameter is used for, and to allow fropping these RTC shenanigans if CONFIG_KVM_IOAPIC=n - Bury all of ioapic.h, i8254.h and related ioctls (including KVM_CREATE_IRQCHIP) behind CONFIG_KVM_IOAPIC=y - Add a regression test for recent APICv update fixes - Handle "hardware APIC ISR", a.k.a. SVI, updates in kvm_apic_update_apicv() to consolidate the updates, and to co-locate SVI updates with the updates for KVM's own cache of ISR information - Drop a dead function declaration - Minor cleanups x86 (Intel): - Rework KVM's handling of VMCS updates while L2 is active to temporarily switch to vmcs01 instead of deferring the update until the next nested VM-Exit. The deferred updates approach directly contributed to several bugs, was proving to be a maintenance burden due to the difficulty in auditing the correctness of deferred updates, and was polluting "struct nested_vmx" with a growing pile of booleans - Fix an SGX bug where KVM would incorrectly try to handle EPCM page faults, and instead always reflect them into the guest. Since KVM doesn't shadow EPCM entries, EPCM violations cannot be due to KVM interference and can't be resolved by KVM - Fix a bug where KVM would register its posted interrupt wakeup handler even if loading kvm-intel.ko ultimately failed - Disallow access to vmcb12 fields that aren't fully supported, mostly to avoid weirdness and complexity for FRED and other features, where KVM wants enable VMCS shadowing for fields that conditionally exist - Print out the "bad" offsets and values if kvm-intel.ko refuses to load (or refuses to online a CPU) due to a VMCS config mismatch x86 (AMD): - Drop a user-triggerable WARN on nested_svm_load_cr3() failure - Add support for virtualizing ERAPS. Note, correct virtualization of ERAPS relies on an upcoming, publicly announced change in the APM to reduce the set of conditions where hardware (i.e. KVM) *must* flush the RAP - Ignore nSVM intercepts for instructions that are not supported according to L1's virtual CPU model - Add support for expedited writes to the fast MMIO bus, a la VMX's fastpath for EPT Misconfig - Don't set GIF when clearing EFER.SVME, as GIF exists independently of SVM, and allow userspace to restore nested state with GIF=0 - Treat exit_code as an unsigned 64-bit value through all of KVM - Add support for fetching SNP certificates from userspace - Fix a bug where KVM would use vmcb02 instead of vmcb01 when emulating VMLOAD or VMSAVE on behalf of L2 - Misc fixes and cleanups x86 selftests: - Add a regression test for TPR<=>CR8 synchronization and IRQ masking - Overhaul selftest's MMU infrastructure to genericize stage-2 MMU support, and extend x86's infrastructure to support EPT and NPT (for L2 guests) - Extend several nested VMX tests to also cover nested SVM - Add a selftest for nested VMLOAD/VMSAVE - Rework the nested dirty log test, originally added as a regression test for PML where KVM logged L2 GPAs instead of L1 GPAs, to improve test coverage and to hopefully make the test easier to understand and maintain guest_memfd: - Remove kvm_gmem_populate()'s preparation tracking and half-baked hugepage handling. SEV/SNP was the only user of the tracking and it can do it via the RMP - Retroactively document and enforce (for SNP) that KVM_SEV_SNP_LAUNCH_UPDATE and KVM_TDX_INIT_MEM_REGION require the source page to be 4KiB aligned, to avoid non-trivial complexity for something that no known VMM seems to be doing and to avoid an API special case for in-place conversion, which simply can't support unaligned sources - When populating guest_memfd memory, GUP the source page in common code and pass the refcounted page to the vendor callback, instead of letting vendor code do the heavy lifting. Doing so avoids a looming deadlock bug with in-place due an AB-BA conflict betwee mmap_lock and guest_memfd's filemap invalidate lock Generic: - Fix a bug where KVM would ignore the vCPU's selected address space when creating a vCPU-specific mapping of guest memory. Actually this bug could not be hit even on x86, the only architecture with multiple address spaces, but it's a bug nevertheless" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (267 commits) KVM: s390: Increase permitted SE header size to 1 MiB MAINTAINERS: Replace backup for s390 vfio-pci KVM: s390: vsie: Fix race in acquire_gmap_shadow() KVM: s390: vsie: Fix race in walk_guest_tables() KVM: s390: Use guest address to mark guest page dirty irqchip/riscv-imsic: Adjust the number of available guest irq files RISC-V: KVM: Transparent huge page support RISC-V: KVM: selftests: Add Zalasr extensions to get-reg-list test RISC-V: KVM: Allow Zalasr extensions for Guest/VM KVM: riscv: selftests: Add riscv vm satp modes KVM: riscv: selftests: add Zilsd and Zclsd extension to get-reg-list test riscv: KVM: allow Zilsd and Zclsd extensions for Guest/VM RISC-V: KVM: Skip IMSIC update if vCPU IMSIC state is not initialized RISC-V: KVM: Fix null pointer dereference in kvm_riscv_aia_imsic_rw_attr() RISC-V: KVM: Fix null pointer dereference in kvm_riscv_aia_imsic_has_attr() RISC-V: KVM: Remove unnecessary 'ret' assignment KVM: s390: Add explicit padding to struct kvm_s390_keyop KVM: LoongArch: selftests: Add steal time test case LoongArch: KVM: Add paravirt vcpu_is_preempted() support in guest side LoongArch: KVM: Add paravirt preempt feature in hypervisor side ...
2 parents c87c793 + b119518 commit cb55738

212 files changed

Lines changed: 11524 additions & 7817 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3100,6 +3100,26 @@ Kernel parameters
31003100

31013101
Default is Y (on).
31023102

3103+
kvm.enable_pmu=[KVM,X86]
3104+
If enabled, KVM will virtualize PMU functionality based
3105+
on the virtual CPU model defined by userspace. This
3106+
can be overridden on a per-VM basis via
3107+
KVM_CAP_PMU_CAPABILITY.
3108+
3109+
If disabled, KVM will not virtualize PMU functionality,
3110+
e.g. MSRs, PMCs, PMIs, etc., even if userspace defines
3111+
a virtual CPU model that contains PMU assets.
3112+
3113+
Note, KVM's vPMU support implicitly requires running
3114+
with an in-kernel local APIC, e.g. to deliver PMIs to
3115+
the guest. Running without an in-kernel local APIC is
3116+
not supported, though KVM will allow such a combination
3117+
(with severely degraded functionality).
3118+
3119+
See also enable_mediated_pmu.
3120+
3121+
Default is Y (on).
3122+
31033123
kvm.enable_virt_at_load=[KVM,ARM64,LOONGARCH,MIPS,RISCV,X86]
31043124
If enabled, KVM will enable virtualization in hardware
31053125
when KVM is loaded, and disable virtualization when KVM
@@ -3146,6 +3166,35 @@ Kernel parameters
31463166
If the value is 0 (the default), KVM will pick a period based
31473167
on the ratio, such that a page is zapped after 1 hour on average.
31483168

3169+
kvm-{amd,intel}.enable_mediated_pmu=[KVM,AMD,INTEL]
3170+
If enabled, KVM will provide a mediated virtual PMU,
3171+
instead of the default perf-based virtual PMU (if
3172+
kvm.enable_pmu is true and PMU is enumerated via the
3173+
virtual CPU model).
3174+
3175+
With a perf-based vPMU, KVM operates as a user of perf,
3176+
i.e. emulates guest PMU counters using perf events.
3177+
KVM-created perf events are managed by perf as regular
3178+
(guest-only) events, e.g. are scheduled in/out, contend
3179+
for hardware resources, etc. Using a perf-based vPMU
3180+
allows guest and host usage of the PMU to co-exist, but
3181+
incurs non-trivial overhead and can result in silently
3182+
dropped guest events (due to resource contention).
3183+
3184+
With a mediated vPMU, hardware PMU state is context
3185+
switched around the world switch to/from the guest.
3186+
KVM mediates which events the guest can utilize, but
3187+
gives the guest direct access to all other PMU assets
3188+
when possible (KVM may intercept some accesses if the
3189+
virtual CPU model provides a subset of hardware PMU
3190+
functionality). Using a mediated vPMU significantly
3191+
reduces PMU virtualization overhead and eliminates lost
3192+
guest events, but is mutually exclusive with using perf
3193+
to profile KVM guests and adds latency to most VM-Exits
3194+
(to context switch PMU state).
3195+
3196+
Default is N (off).
3197+
31493198
kvm-amd.nested= [KVM,AMD] Control nested virtualization feature in
31503199
KVM/SVM. Default is 1 (enabled).
31513200

Documentation/virt/kvm/api.rst

Lines changed: 112 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6518,6 +6518,40 @@ the capability to be present.
65186518

65196519
`flags` must currently be zero.
65206520

6521+
4.144 KVM_S390_KEYOP
6522+
--------------------
6523+
6524+
:Capability: KVM_CAP_S390_KEYOP
6525+
:Architectures: s390
6526+
:Type: vm ioctl
6527+
:Parameters: struct kvm_s390_keyop (in/out)
6528+
:Returns: 0 in case of success, < 0 on error
6529+
6530+
The specified key operation is performed on the given guest address. The
6531+
previous storage key (or the relevant part thereof) will be returned in
6532+
`key`.
6533+
6534+
::
6535+
6536+
struct kvm_s390_keyop {
6537+
__u64 guest_addr;
6538+
__u8 key;
6539+
__u8 operation;
6540+
};
6541+
6542+
Currently supported values for ``operation``:
6543+
6544+
KVM_S390_KEYOP_ISKE
6545+
Returns the storage key for the guest address ``guest_addr`` in ``key``.
6546+
6547+
KVM_S390_KEYOP_RRBE
6548+
Resets the reference bit for the guest address ``guest_addr``, returning the
6549+
R and C bits of the old storage key in ``key``; the remaining fields of
6550+
the storage key will be set to 0.
6551+
6552+
KVM_S390_KEYOP_SSKE
6553+
Sets the storage key for the guest address ``guest_addr`` to the key
6554+
specified in ``key``, returning the previous value in ``key``.
65216555

65226556
.. _kvm_run:
65236557

@@ -7382,6 +7416,50 @@ Please note that the kernel is allowed to use the kvm_run structure as the
73827416
primary storage for certain register types. Therefore, the kernel may use the
73837417
values in kvm_run even if the corresponding bit in kvm_dirty_regs is not set.
73847418

7419+
::
7420+
7421+
/* KVM_EXIT_SNP_REQ_CERTS */
7422+
struct kvm_exit_snp_req_certs {
7423+
__u64 gpa;
7424+
__u64 npages;
7425+
__u64 ret;
7426+
};
7427+
7428+
KVM_EXIT_SNP_REQ_CERTS indicates an SEV-SNP guest with certificate-fetching
7429+
enabled (see KVM_SEV_SNP_ENABLE_REQ_CERTS) has generated an Extended Guest
7430+
Request NAE #VMGEXIT (SNP_GUEST_REQUEST) with message type MSG_REPORT_REQ,
7431+
i.e. has requested an attestation report from firmware, and would like the
7432+
certificate data corresponding to the attestation report signature to be
7433+
provided by the hypervisor as part of the request.
7434+
7435+
To allow for userspace to provide the certificate, the 'gpa' and 'npages'
7436+
are forwarded verbatim from the guest request (the RAX and RBX GHCB fields
7437+
respectively). 'ret' is not an "output" from KVM, and is always '0' on
7438+
exit. KVM verifies the 'gpa' is 4KiB aligned prior to exiting to userspace,
7439+
but otherwise the information from the guest isn't validated.
7440+
7441+
Upon the next KVM_RUN, e.g. after userspace has serviced the request (or not),
7442+
KVM will complete the #VMGEXIT, using the 'ret' field to determine whether to
7443+
signal success or failure to the guest, and on failure, what reason code will
7444+
be communicated via SW_EXITINFO2. If 'ret' is set to an unsupported value (see
7445+
the table below), KVM_RUN will fail with -EINVAL. For a 'ret' of 'ENOSPC', KVM
7446+
also consumes the 'npages' field, i.e. userspace can use the field to inform
7447+
the guest of the number of pages needed to hold all the certificate data.
7448+
7449+
The supported 'ret' values and their respective SW_EXITINFO2 encodings:
7450+
7451+
====== =============================================================
7452+
0 0x0, i.e. success. KVM will emit an SNP_GUEST_REQUEST command
7453+
to SNP firmware.
7454+
ENOSPC 0x0000000100000000, i.e. not enough guest pages to hold the
7455+
certificate table and certificate data. KVM will also set the
7456+
RBX field in the GHBC to 'npages'.
7457+
EAGAIN 0x0000000200000000, i.e. the host is busy and the guest should
7458+
retry the request.
7459+
EIO 0xffffffff00000000, for all other errors (this return code is
7460+
a KVM-defined hypervisor value, as allowed by the GHCB)
7461+
====== =============================================================
7462+
73857463

73867464
.. _cap_enable:
73877465

@@ -7864,8 +7942,10 @@ Will return -EBUSY if a VCPU has already been created.
78647942

78657943
Valid feature flags in args[0] are::
78667944

7867-
#define KVM_X2APIC_API_USE_32BIT_IDS (1ULL << 0)
7868-
#define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK (1ULL << 1)
7945+
#define KVM_X2APIC_API_USE_32BIT_IDS (1ULL << 0)
7946+
#define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK (1ULL << 1)
7947+
#define KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST (1ULL << 2)
7948+
#define KVM_X2APIC_DISABLE_SUPPRESS_EOI_BROADCAST (1ULL << 3)
78697949

78707950
Enabling KVM_X2APIC_API_USE_32BIT_IDS changes the behavior of
78717951
KVM_SET_GSI_ROUTING, KVM_SIGNAL_MSI, KVM_SET_LAPIC, and KVM_GET_LAPIC,
@@ -7878,6 +7958,28 @@ as a broadcast even in x2APIC mode in order to support physical x2APIC
78787958
without interrupt remapping. This is undesirable in logical mode,
78797959
where 0xff represents CPUs 0-7 in cluster 0.
78807960

7961+
Setting KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST instructs KVM to enable
7962+
Suppress EOI Broadcasts. KVM will advertise support for Suppress EOI
7963+
Broadcast to the guest and suppress LAPIC EOI broadcasts when the guest
7964+
sets the Suppress EOI Broadcast bit in the SPIV register. This flag is
7965+
supported only when using a split IRQCHIP.
7966+
7967+
Setting KVM_X2APIC_DISABLE_SUPPRESS_EOI_BROADCAST disables support for
7968+
Suppress EOI Broadcasts entirely, i.e. instructs KVM to NOT advertise
7969+
support to the guest.
7970+
7971+
Modern VMMs should either enable KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST
7972+
or KVM_X2APIC_DISABLE_SUPPRESS_EOI_BROADCAST. If not, legacy quirky
7973+
behavior will be used by KVM: in split IRQCHIP mode, KVM will advertise
7974+
support for Suppress EOI Broadcasts but not actually suppress EOI
7975+
broadcasts; for in-kernel IRQCHIP mode, KVM will not advertise support for
7976+
Suppress EOI Broadcasts.
7977+
7978+
Setting both KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST and
7979+
KVM_X2APIC_DISABLE_SUPPRESS_EOI_BROADCAST will fail with an EINVAL error,
7980+
as will setting KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST without a split
7981+
IRCHIP.
7982+
78817983
7.8 KVM_CAP_S390_USER_INSTR0
78827984
----------------------------
78837985

@@ -9316,6 +9418,14 @@ The presence of this capability indicates that KVM_RUN will update the
93169418
KVM_RUN_X86_GUEST_MODE bit in kvm_run.flags to indicate whether the
93179419
vCPU was executing nested guest code when it exited.
93189420

9421+
8.46 KVM_CAP_S390_KEYOP
9422+
-----------------------
9423+
9424+
:Architectures: s390
9425+
9426+
The presence of this capability indicates that the KVM_S390_KEYOP ioctl is
9427+
available.
9428+
93199429
KVM exits with the register state of either the L1 or L2 guest
93209430
depending on which executed at the time of an exit. Userspace must
93219431
take care to differentiate between these cases.

Documentation/virt/kvm/x86/amd-memory-encryption.rst

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ Returns: 0 on success, < 0 on error, -EAGAIN if caller should retry
523523

524524
struct kvm_sev_snp_launch_update {
525525
__u64 gfn_start; /* Guest page number to load/encrypt data into. */
526-
__u64 uaddr; /* Userspace address of data to be loaded/encrypted. */
526+
__u64 uaddr; /* 4k-aligned address of data to be loaded/encrypted. */
527527
__u64 len; /* 4k-aligned length in bytes to copy into guest memory.*/
528528
__u8 type; /* The type of the guest pages being initialized. */
529529
__u8 pad0;
@@ -572,18 +572,68 @@ Returns: 0 on success, -negative on error
572572
See SNP_LAUNCH_FINISH in the SEV-SNP specification [snp-fw-abi]_ for further
573573
details on the input parameters in ``struct kvm_sev_snp_launch_finish``.
574574

575+
21. KVM_SEV_SNP_ENABLE_REQ_CERTS
576+
--------------------------------
577+
578+
The KVM_SEV_SNP_ENABLE_REQ_CERTS command will configure KVM to exit to
579+
userspace with a ``KVM_EXIT_SNP_REQ_CERTS`` exit type as part of handling
580+
a guest attestation report, which will to allow userspace to provide a
581+
certificate corresponding to the endorsement key used by firmware to sign
582+
that attestation report.
583+
584+
Returns: 0 on success, -negative on error
585+
586+
NOTE: The endorsement key used by firmware may change as a result of
587+
management activities like updating SEV-SNP firmware or loading new
588+
endorsement keys, so some care should be taken to keep the returned
589+
certificate data in sync with the actual endorsement key in use by
590+
firmware at the time the attestation request is sent to SNP firmware. The
591+
recommended scheme to do this is to use file locking (e.g. via fcntl()'s
592+
F_OFD_SETLK) in the following manner:
593+
594+
- Prior to obtaining/providing certificate data as part of servicing an
595+
exit type of ``KVM_EXIT_SNP_REQ_CERTS``, the VMM should obtain a
596+
shared/read or exclusive/write lock on the certificate blob file before
597+
reading it and returning it to KVM, and continue to hold the lock until
598+
the attestation request is actually sent to firmware. To facilitate
599+
this, the VMM can set the ``immediate_exit`` flag of kvm_run just after
600+
supplying the certificate data, and just before resuming the vCPU.
601+
This will ensure the vCPU will exit again to userspace with ``-EINTR``
602+
after it finishes fetching the attestation request from firmware, at
603+
which point the VMM can safely drop the file lock.
604+
605+
- Tools/libraries that perform updates to SNP firmware TCB values or
606+
endorsement keys (e.g. via /dev/sev interfaces such as ``SNP_COMMIT``,
607+
``SNP_SET_CONFIG``, or ``SNP_VLEK_LOAD``, see
608+
Documentation/virt/coco/sev-guest.rst for more details) in such a way
609+
that the certificate blob needs to be updated, should similarly take an
610+
exclusive lock on the certificate blob for the duration of any updates
611+
to endorsement keys or the certificate blob contents to ensure that
612+
VMMs using the above scheme will not return certificate blob data that
613+
is out of sync with the endorsement key used by firmware at the time
614+
the attestation request is actually issued.
615+
616+
This scheme is recommended so that tools can use a fairly generic/natural
617+
approach to synchronizing firmware/certificate updates via file-locking,
618+
which should make it easier to maintain interoperability across
619+
tools/VMMs/vendors.
620+
575621
Device attribute API
576622
====================
577623

578624
Attributes of the SEV implementation can be retrieved through the
579625
``KVM_HAS_DEVICE_ATTR`` and ``KVM_GET_DEVICE_ATTR`` ioctls on the ``/dev/kvm``
580626
device node, using group ``KVM_X86_GRP_SEV``.
581627

582-
Currently only one attribute is implemented:
628+
The following attributes are currently implemented:
583629

584630
* ``KVM_X86_SEV_VMSA_FEATURES``: return the set of all bits that
585631
are accepted in the ``vmsa_features`` of ``KVM_SEV_INIT2``.
586632

633+
* ``KVM_X86_SEV_SNP_REQ_CERTS``: return a value of 1 if the kernel supports the
634+
``KVM_EXIT_SNP_REQ_CERTS`` exit, which allows for fetching endorsement key
635+
certificates from userspace for each SNP attestation request the guest issues.
636+
587637
Firmware Management
588638
===================
589639

Documentation/virt/kvm/x86/intel-tdx.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ KVM_TDX_INIT_MEM_REGION
156156
:Returns: 0 on success, <0 on error
157157

158158
Initialize @nr_pages TDX guest private memory starting from @gpa with userspace
159-
provided data from @source_addr.
159+
provided data from @source_addr. @source_addr must be PAGE_SIZE-aligned.
160160

161161
Note, before calling this sub command, memory attribute of the range
162162
[gpa, gpa + nr_pages] needs to be private. Userspace can use

MAINTAINERS

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14012,14 +14012,12 @@ L: kvm@vger.kernel.org
1401214012
S: Supported
1401314013
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git
1401414014
F: Documentation/virt/kvm/s390*
14015-
F: arch/s390/include/asm/gmap.h
1401614015
F: arch/s390/include/asm/gmap_helpers.h
1401714016
F: arch/s390/include/asm/kvm*
1401814017
F: arch/s390/include/uapi/asm/kvm*
1401914018
F: arch/s390/include/uapi/asm/uvdevice.h
1402014019
F: arch/s390/kernel/uv.c
1402114020
F: arch/s390/kvm/
14022-
F: arch/s390/mm/gmap.c
1402314021
F: arch/s390/mm/gmap_helpers.c
1402414022
F: drivers/s390/char/uvdevice.c
1402514023
F: tools/testing/selftests/drivers/s390x/uvdevice/
@@ -23300,7 +23298,8 @@ F: include/uapi/linux/vfio_ccw.h
2330023298

2330123299
S390 VFIO-PCI DRIVER
2330223300
M: Matthew Rosato <mjrosato@linux.ibm.com>
23303-
M: Eric Farman <farman@linux.ibm.com>
23301+
M: Farhan Ali <alifm@linux.ibm.com>
23302+
R: Eric Farman <farman@linux.ibm.com>
2330423303
L: linux-s390@vger.kernel.org
2330523304
L: kvm@vger.kernel.org
2330623305
S: Supported

arch/arm64/include/asm/el2_setup.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@
235235
ICH_HFGRTR_EL2_ICC_ICSR_EL1 | \
236236
ICH_HFGRTR_EL2_ICC_PCR_EL1 | \
237237
ICH_HFGRTR_EL2_ICC_HPPIR_EL1 | \
238-
ICH_HFGRTR_EL2_ICC_HAPR_EL1 | \
239238
ICH_HFGRTR_EL2_ICC_CR0_EL1 | \
240239
ICH_HFGRTR_EL2_ICC_IDRn_EL1 | \
241240
ICH_HFGRTR_EL2_ICC_APR_EL1)

0 commit comments

Comments
 (0)