linux-stable/Documentation
Daniel Sneddon 05785ba834 x86/apic: Don't disable x2APIC if locked
[ Upstream commit b8d1d16360 ]

The APIC supports two modes, legacy APIC (or xAPIC), and Extended APIC
(or x2APIC).  X2APIC mode is mostly compatible with legacy APIC, but
it disables the memory-mapped APIC interface in favor of one that uses
MSRs.  The APIC mode is controlled by the EXT bit in the APIC MSR.

The MMIO/xAPIC interface has some problems, most notably the APIC LEAK
[1].  This bug allows an attacker to use the APIC MMIO interface to
extract data from the SGX enclave.

Introduce support for a new feature that will allow the BIOS to lock
the APIC in x2APIC mode.  If the APIC is locked in x2APIC mode and the
kernel tries to disable the APIC or revert to legacy APIC mode a GP
fault will occur.

Introduce support for a new MSR (IA32_XAPIC_DISABLE_STATUS) and handle
the new locked mode when the LEGACY_XAPIC_DISABLED bit is set by
preventing the kernel from trying to disable the x2APIC.

On platforms with the IA32_XAPIC_DISABLE_STATUS MSR, if SGX or TDX are
enabled the LEGACY_XAPIC_DISABLED will be set by the BIOS.  If
legacy APIC is required, then it SGX and TDX need to be disabled in the
BIOS.

[1]: https://aepicleak.com/aepicleak.pdf

Signed-off-by: Daniel Sneddon <daniel.sneddon@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Tested-by: Neelima Krishnan <neelima.krishnan@intel.com>
Link: https://lkml.kernel.org/r/20220816231943.1152579-1-daniel.sneddon@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-24 09:58:12 +02:00
..
ABI iio: ABI: Fix wrong format of differential capacitance channel ABI. 2022-10-24 09:57:47 +02:00
PCI
RCU Merge branch 'exp.2022.05.11a' into HEAD 2022-05-11 11:49:35 -07:00
accounting delayacct: track delays from write-protect copy 2022-06-01 15:55:25 -07:00
admin-guide x86/apic: Don't disable x2APIC if locked 2022-10-24 09:58:12 +02:00
arc
arm docs: arm: tcm: Fix typo in description of TCM and MMU usage 2022-06-09 12:56:33 -06:00
arm64 arm64: errata: Add Cortex-A55 to the repeat tlbi list 2022-10-24 09:56:48 +02:00
block
bpf
cdrom It was a moderately busy cycle for documentation; highlights include: 2022-05-25 11:17:41 -07:00
core-api doc: module: update file references 2022-07-01 14:50:01 -07:00
cpu-freq
crypto
dev-tools Yang Shi has improved the behaviour of khugepaged collapsing of readonly 2022-05-26 12:32:41 -07:00
devicetree ARM: dts: fix Moxa SDIO 'compatible', remove 'sdhci' misnomer 2022-10-12 09:51:24 +02:00
doc-guide Documentation/process: use scripts/get_maintainer.pl on patches 2022-05-09 16:12:16 -06:00
driver-api A NULL pointer dereference fix for vc4, and 3 patches to improve the 2022-07-01 09:27:55 +10:00
fault-injection
fb
features Documentation/features: Update the arch support status files 2022-06-09 09:35:57 -06:00
filesystems fs: record I_DIRTY_TIME even if inode already has I_DIRTY_INODE 2022-10-24 09:56:52 +02:00
firmware-guide Documentation: ACPI: EINJ: Fix obsolete example 2022-08-25 11:45:11 +02:00
firmware_class
fpga Documentation: fpga: dfl: add link address of feature id table 2022-05-10 16:05:27 +08:00
gpu
hid
hwmon hwmon: (asus-ec-sensors) add definitions for ROG ZENITH II EXTREME 2022-09-15 10:47:20 +02:00
i2c
ia64
iio
images docs: add SVG version of the Linux logo 2022-06-01 09:32:45 -06:00
infiniband
input Input: iforce - add support for Boeder Force Feedback Wheel 2022-09-20 12:43:48 +02:00
isdn
kbuild Documentation/llvm: Update Supported Arch table 2022-06-20 08:21:29 +09:00
kernel-hacking
leds leds: qcom-lpg: Require pattern to follow documentation 2022-05-24 22:08:10 +02:00
litmus-tests
livepatch doc: module: update file references 2022-07-01 14:50:01 -07:00
locking
loongarch docs/LoongArch: Fix notes rendering by using reST directives 2022-06-17 22:09:05 +08:00
m68k
maintainer
mhi
mips
misc-devices Documentation: Wire Oxford Semiconductor PCIe (Tornado) 950 2022-05-19 18:24:22 +02:00
netlabel
networking Documentation: fix sctp_wmem in ip-sysctl.rst 2022-07-24 21:41:58 +01:00
nios2
nvdimm
openrisc
parisc
pcmcia
peci
power
powerpc powerpc: Enable the DAWR on POWER9 DD2.3 and above 2022-05-22 15:59:53 +10:00
process docs: update mediator information in CoC docs 2022-10-12 09:51:23 +02:00
riscv Documentation: riscv: Add sv48 description to VM layout 2022-06-01 20:38:34 -07:00
s390
scheduler
scsi
security integrity-v5.19 2022-05-24 13:50:39 -07:00
sh
sound ASoC: doc: Capitalize RESET line name 2022-07-07 17:16:30 +01:00
sparc
sphinx docs: kerneldoc-preamble: Test xeCJK.sty before loading 2022-09-05 10:31:26 +02:00
sphinx-static
spi
staging
target
timers
tools rtla: Fix tracer name 2022-09-05 10:31:31 +02:00
trace tracing/timerlat: Print stacktrace in the IRQ handler if needed 2022-05-26 21:13:00 -04:00
translations doc: module: update file references 2022-07-01 14:50:01 -07:00
usb docs: usb: fix literal block marker in usbmon verification example 2022-06-09 09:50:03 -06:00
userspace-api media: uapi: HEVC: Change pic_order_cnt definition in v4l2_hevc_dpb_entry 2022-08-17 15:14:50 +02:00
virt KVM: stats: Fix value for KVM_STATS_UNIT_MAX for boolean stats 2022-07-19 08:54:11 -04:00
vm mm/memory-failure: disable unpoison once hw error happens 2022-06-16 19:11:32 -07:00
w1
watchdog
x86 It was a moderately busy cycle for documentation; highlights include: 2022-05-25 11:17:41 -07:00
xtensa
.gitignore
Changes
CodingStyle
Kconfig
Makefile
SubmittingPatches
arch.rst Documentation: LoongArch: Add basic documentations 2022-06-03 20:09:27 +08:00
asm-annotations.rst
atomic_bitops.txt locking/atomic: Make test_and_*_bit() ordered on failure 2022-08-25 11:45:06 +02:00
atomic_t.txt
conf.py docs/conf.py: Cope with removal of language=None in Sphinx 5.0.0 2022-06-01 09:26:05 -06:00
docutils.conf
dontdiff
index.rst docs: Move the HTE documentation to driver-api/ 2022-06-09 10:02:47 -06:00
memory-barriers.txt