Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit dfcfce7

Browse files
committed
Merge 4083235 ("Merge tag 'x86_sev_for_v6.11_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip") into android-mainline
Steps on the way to v6.11-rc1 Signed-off-by: Lee Jones <joneslee@google.com> Change-Id: I2687ed6ce46ba4b7397a6adb2a104c2c90fd975b
2 parents 7f3997c + 4083235 commit dfcfce7

File tree

125 files changed

+5125
-2629
lines changed

Some content is hidden

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

125 files changed

+5125
-2629
lines changed

Documentation/ABI/testing/configfs-tsm

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ Description:
3131
Standardization v2.03 Section 4.1.8.1 MSG_REPORT_REQ.
3232
https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/specifications/56421.pdf
3333

34+
What: /sys/kernel/config/tsm/report/$name/manifestblob
35+
Date: January, 2024
36+
KernelVersion: v6.10
37+
Contact: linux-coco@lists.linux.dev
38+
Description:
39+
(RO) Optional supplemental data that a TSM may emit, visibility
40+
of this attribute depends on TSM, and may be empty if no
41+
manifest data is available.
42+
43+
See 'service_provider' for information on the format of the
44+
manifest blob.
45+
3446
What: /sys/kernel/config/tsm/report/$name/provider
3547
Date: September, 2023
3648
KernelVersion: v6.7
@@ -80,3 +92,54 @@ Contact: linux-coco@lists.linux.dev
8092
Description:
8193
(RO) Indicates the minimum permissible value that can be written
8294
to @privlevel.
95+
96+
What: /sys/kernel/config/tsm/report/$name/service_provider
97+
Date: January, 2024
98+
KernelVersion: v6.10
99+
Contact: linux-coco@lists.linux.dev
100+
Description:
101+
(WO) Attribute is visible if a TSM implementation provider
102+
supports the concept of attestation reports from a service
103+
provider for TVMs, like SEV-SNP running under an SVSM.
104+
Specifying the service provider via this attribute will create
105+
an attestation report as specified by the service provider.
106+
The only currently supported service provider is "svsm".
107+
108+
For the "svsm" service provider, see the Secure VM Service Module
109+
for SEV-SNP Guests v1.00 Section 7. For the doc, search for
110+
"site:amd.com "Secure VM Service Module for SEV-SNP
111+
Guests", docID: 58019"
112+
113+
What: /sys/kernel/config/tsm/report/$name/service_guid
114+
Date: January, 2024
115+
KernelVersion: v6.10
116+
Contact: linux-coco@lists.linux.dev
117+
Description:
118+
(WO) Attribute is visible if a TSM implementation provider
119+
supports the concept of attestation reports from a service
120+
provider for TVMs, like SEV-SNP running under an SVSM.
121+
Specifying an empty/null GUID (00000000-0000-0000-0000-000000)
122+
requests all active services within the service provider be
123+
part of the attestation report. Specifying a GUID request
124+
an attestation report of just the specified service using the
125+
manifest form specified by the service_manifest_version
126+
attribute.
127+
128+
See 'service_provider' for information on the format of the
129+
service guid.
130+
131+
What: /sys/kernel/config/tsm/report/$name/service_manifest_version
132+
Date: January, 2024
133+
KernelVersion: v6.10
134+
Contact: linux-coco@lists.linux.dev
135+
Description:
136+
(WO) Attribute is visible if a TSM implementation provider
137+
supports the concept of attestation reports from a service
138+
provider for TVMs, like SEV-SNP running under an SVSM.
139+
Indicates the service manifest version requested for the
140+
attestation report (default 0). If this field is not set by
141+
the user, the default manifest version of the service (the
142+
service's initial/first manifest version) is returned.
143+
144+
See 'service_provider' for information on the format of the
145+
service manifest version.

Documentation/ABI/testing/sysfs-devices-system-cpu

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,18 @@ Description: Umwait control
605605
Note that a value of zero means there is no limit.
606606
Low order two bits must be zero.
607607

608+
What: /sys/devices/system/cpu/sev
609+
/sys/devices/system/cpu/sev/vmpl
610+
Date: May 2024
611+
Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
612+
Description: Secure Encrypted Virtualization (SEV) information
613+
614+
This directory is only present when running as an SEV-SNP guest.
615+
616+
vmpl: Reports the Virtual Machine Privilege Level (VMPL) at which
617+
the SEV-SNP guest is running.
618+
619+
608620
What: /sys/devices/system/cpu/svm
609621
Date: August 2019
610622
Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>

Documentation/admin-guide/hw-vuln/spectre.rst

Lines changed: 10 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -592,85 +592,19 @@ Spectre variant 2
592592
Mitigation control on the kernel command line
593593
---------------------------------------------
594594

595-
Spectre variant 2 mitigation can be disabled or force enabled at the
596-
kernel command line.
595+
In general the kernel selects reasonable default mitigations for the
596+
current CPU.
597597

598-
nospectre_v1
598+
Spectre default mitigations can be disabled or changed at the kernel
599+
command line with the following options:
599600

600-
[X86,PPC] Disable mitigations for Spectre Variant 1
601-
(bounds check bypass). With this option data leaks are
602-
possible in the system.
601+
- nospectre_v1
602+
- nospectre_v2
603+
- spectre_v2={option}
604+
- spectre_v2_user={option}
605+
- spectre_bhi={option}
603606

604-
nospectre_v2
605-
606-
[X86] Disable all mitigations for the Spectre variant 2
607-
(indirect branch prediction) vulnerability. System may
608-
allow data leaks with this option, which is equivalent
609-
to spectre_v2=off.
610-
611-
612-
spectre_v2=
613-
614-
[X86] Control mitigation of Spectre variant 2
615-
(indirect branch speculation) vulnerability.
616-
The default operation protects the kernel from
617-
user space attacks.
618-
619-
on
620-
unconditionally enable, implies
621-
spectre_v2_user=on
622-
off
623-
unconditionally disable, implies
624-
spectre_v2_user=off
625-
auto
626-
kernel detects whether your CPU model is
627-
vulnerable
628-
629-
Selecting 'on' will, and 'auto' may, choose a
630-
mitigation method at run time according to the
631-
CPU, the available microcode, the setting of the
632-
CONFIG_MITIGATION_RETPOLINE configuration option,
633-
and the compiler with which the kernel was built.
634-
635-
Selecting 'on' will also enable the mitigation
636-
against user space to user space task attacks.
637-
638-
Selecting 'off' will disable both the kernel and
639-
the user space protections.
640-
641-
Specific mitigations can also be selected manually:
642-
643-
retpoline auto pick between generic,lfence
644-
retpoline,generic Retpolines
645-
retpoline,lfence LFENCE; indirect branch
646-
retpoline,amd alias for retpoline,lfence
647-
eibrs Enhanced/Auto IBRS
648-
eibrs,retpoline Enhanced/Auto IBRS + Retpolines
649-
eibrs,lfence Enhanced/Auto IBRS + LFENCE
650-
ibrs use IBRS to protect kernel
651-
652-
Not specifying this option is equivalent to
653-
spectre_v2=auto.
654-
655-
In general the kernel by default selects
656-
reasonable mitigations for the current CPU. To
657-
disable Spectre variant 2 mitigations, boot with
658-
spectre_v2=off. Spectre variant 1 mitigations
659-
cannot be disabled.
660-
661-
spectre_bhi=
662-
663-
[X86] Control mitigation of Branch History Injection
664-
(BHI) vulnerability. This setting affects the deployment
665-
of the HW BHI control and the SW BHB clearing sequence.
666-
667-
on
668-
(default) Enable the HW or SW mitigation as
669-
needed.
670-
off
671-
Disable the mitigation.
672-
673-
For spectre_v2_user see Documentation/admin-guide/kernel-parameters.txt
607+
For more details on the available options, refer to Documentation/admin-guide/kernel-parameters.txt
674608

675609
Mitigation selection guide
676610
--------------------------

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3412,10 +3412,6 @@
34123412
deep - Suspend-To-RAM or equivalent (if supported)
34133413
See Documentation/admin-guide/pm/sleep-states.rst.
34143414

3415-
mfgpt_irq= [IA-32] Specify the IRQ to use for the
3416-
Multi-Function General Purpose Timers on AMD Geode
3417-
platforms.
3418-
34193415
mfgptfix [X86-32] Fix MFGPT timers on AMD Geode platforms when
34203416
the BIOS has incorrectly applied a workaround. TinyBIOS
34213417
version 0.98 is known to be affected, 0.99 fixes the
@@ -6148,9 +6144,15 @@
61486144
deployment of the HW BHI control and the SW BHB
61496145
clearing sequence.
61506146

6151-
on - (default) Enable the HW or SW mitigation
6152-
as needed.
6153-
off - Disable the mitigation.
6147+
on - (default) Enable the HW or SW mitigation as
6148+
needed. This protects the kernel from
6149+
both syscalls and VMs.
6150+
vmexit - On systems which don't have the HW mitigation
6151+
available, enable the SW mitigation on vmexit
6152+
ONLY. On such systems, the host kernel is
6153+
protected from VM-originated BHI attacks, but
6154+
may still be vulnerable to syscall attacks.
6155+
off - Disable the mitigation.
61546156

61556157
spectre_v2= [X86,EARLY] Control mitigation of Spectre variant 2
61566158
(indirect branch speculation) vulnerability.

Documentation/arch/x86/amd-memory-encryption.rst

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,31 @@ SNP feature support.
130130

131131
More details in AMD64 APM[1] Vol 2: 15.34.10 SEV_STATUS MSR
132132

133-
[1] https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/programmer-references/24593.pdf
133+
Secure VM Service Module (SVSM)
134+
===============================
135+
SNP provides a feature called Virtual Machine Privilege Levels (VMPL) which
136+
defines four privilege levels at which guest software can run. The most
137+
privileged level is 0 and numerically higher numbers have lesser privileges.
138+
More details in the AMD64 APM Vol 2, section "15.35.7 Virtual Machine
139+
Privilege Levels", docID: 24593.
140+
141+
When using that feature, different services can run at different protection
142+
levels, apart from the guest OS but still within the secure SNP environment.
143+
They can provide services to the guest, like a vTPM, for example.
144+
145+
When a guest is not running at VMPL0, it needs to communicate with the software
146+
running at VMPL0 to perform privileged operations or to interact with secure
147+
services. An example fur such a privileged operation is PVALIDATE which is
148+
*required* to be executed at VMPL0.
149+
150+
In this scenario, the software running at VMPL0 is usually called a Secure VM
151+
Service Module (SVSM). Discovery of an SVSM and the API used to communicate
152+
with it is documented in "Secure VM Service Module for SEV-SNP Guests", docID:
153+
58019.
154+
155+
(Latest versions of the above-mentioned documents can be found by using
156+
a search engine like duckduckgo.com and typing in:
157+
158+
site:amd.com "Secure VM Service Module for SEV-SNP Guests", docID: 58019
159+
160+
for example.)

Documentation/arch/x86/resctrl.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,10 @@ When monitoring is enabled all MON groups will also contain:
375375
all tasks in the group. In CTRL_MON groups these files provide
376376
the sum for all tasks in the CTRL_MON group and all tasks in
377377
MON groups. Please see example section for more details on usage.
378+
On systems with Sub-NUMA Cluster (SNC) enabled there are extra
379+
directories for each node (located within the "mon_L3_XX" directory
380+
for the L3 cache they occupy). These are named "mon_sub_L3_YY"
381+
where "YY" is the node number.
378382

379383
"mon_hw_id":
380384
Available only with debug option. The identifier used by hardware
@@ -484,6 +488,29 @@ if non-contiguous 1s value is supported. On a system with a 20-bit mask
484488
each bit represents 5% of the capacity of the cache. You could partition
485489
the cache into four equal parts with masks: 0x1f, 0x3e0, 0x7c00, 0xf8000.
486490

491+
Notes on Sub-NUMA Cluster mode
492+
==============================
493+
When SNC mode is enabled, Linux may load balance tasks between Sub-NUMA
494+
nodes much more readily than between regular NUMA nodes since the CPUs
495+
on Sub-NUMA nodes share the same L3 cache and the system may report
496+
the NUMA distance between Sub-NUMA nodes with a lower value than used
497+
for regular NUMA nodes.
498+
499+
The top-level monitoring files in each "mon_L3_XX" directory provide
500+
the sum of data across all SNC nodes sharing an L3 cache instance.
501+
Users who bind tasks to the CPUs of a specific Sub-NUMA node can read
502+
the "llc_occupancy", "mbm_total_bytes", and "mbm_local_bytes" in the
503+
"mon_sub_L3_YY" directories to get node local data.
504+
505+
Memory bandwidth allocation is still performed at the L3 cache
506+
level. I.e. throttling controls are applied to all SNC nodes.
507+
508+
L3 cache allocation bitmaps also apply to all SNC nodes. But note that
509+
the amount of L3 cache represented by each bit is divided by the number
510+
of SNC nodes per L3 cache. E.g. with a 100MB cache on a system with 10-bit
511+
allocation masks each bit normally represents 10MB. With SNC mode enabled
512+
with two SNC nodes per L3 cache, each bit only represents 5MB.
513+
487514
Memory bandwidth Allocation and monitoring
488515
==========================================
489516

Documentation/virt/coco/sev-guest.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,17 @@ has taken care to make use of the SEV-SNP CPUID throughout all stages of boot.
204204
Otherwise, guest owner attestation provides no assurance that the kernel wasn't
205205
fed incorrect values at some point during boot.
206206

207+
4. SEV Guest Driver Communication Key
208+
=====================================
209+
210+
Communication between an SEV guest and the SEV firmware in the AMD Secure
211+
Processor (ASP, aka PSP) is protected by a VM Platform Communication Key
212+
(VMPCK). By default, the sev-guest driver uses the VMPCK associated with the
213+
VM Privilege Level (VMPL) at which the guest is running. Should this key be
214+
wiped by the sev-guest driver (see the driver for reasons why a VMPCK can be
215+
wiped), a different key can be used by reloading the sev-guest driver and
216+
specifying the desired key using the vmpck_id module parameter.
217+
207218

208219
Reference
209220
---------

arch/arm/tools/syscall.tbl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
12
#
23
# Linux system call numbers and entry vectors
34
#

arch/x86/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,13 @@ config X86_LOCAL_APIC
11181118
depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC || PCI_MSI
11191119
select IRQ_DOMAIN_HIERARCHY
11201120

1121+
config ACPI_MADT_WAKEUP
1122+
def_bool y
1123+
depends on X86_64
1124+
depends on ACPI
1125+
depends on SMP
1126+
depends on X86_LOCAL_APIC
1127+
11211128
config X86_IO_APIC
11221129
def_bool y
11231130
depends on X86_LOCAL_APIC || X86_UP_IOAPIC

arch/x86/Kconfig.assembler

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ config AS_VPCLMULQDQ
3636
Supported by binutils >= 2.30 and LLVM integrated assembler
3737

3838
config AS_WRUSS
39-
def_bool $(as-instr,wrussq %rax$(comma)(%rbx))
39+
def_bool $(as-instr64,wrussq %rax$(comma)(%rbx))
4040
help
4141
Supported by binutils >= 2.31 and LLVM integrated assembler

0 commit comments

Comments
 (0)