linux-stable/Documentation
Daniel Sneddon dd1241e00a 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-21 12:39:07 +02:00
..
ABI iio: ABI: Fix wrong format of differential capacitance channel ABI. 2022-10-21 12:38:37 +02:00
accounting
admin-guide x86/apic: Don't disable x2APIC if locked 2022-10-21 12:39:07 +02:00
arc
arm SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
arm64 arm64: errata: Add Cortex-A55 to the repeat tlbi list 2022-10-21 12:37:42 +02:00
block Documentation: document ublk 2022-09-02 09:31:15 -06:00
bpf bpf: Update bpf_design_QA.rst to clarify that BTF_ID does not ABIify a function 2022-08-04 13:17:24 -07:00
cdrom
core-api Bitmap patches for v6.0-rc1 2022-08-07 17:52:35 -07:00
cpu-freq
crypto
dev-tools - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
devicetree dt-bindings: i2c: st,stm32-i2c: Document wakeup-source property 2022-10-02 00:34:28 +02:00
doc-guide
driver-api cxl for 6.0 2022-08-10 11:07:26 -07:00
fault-injection SUNRPC: Fix server-side fault injection documentation 2022-07-29 20:08:56 -04:00
fb
features Xtensa updates for v5.20 2022-08-04 15:35:58 -07:00
filesystems fs: record I_DIRTY_TIME even if inode already has I_DIRTY_INODE 2022-10-21 12:37:47 +02:00
firmware-guide Documentation: ACPI: EINJ: Fix obsolete example 2022-07-21 17:05:42 +02:00
firmware_class
fpga
gpu Merge tag 'amd-drm-next-5.20-2022-07-26' of https://gitlab.freedesktop.org/agd5f/linux into drm-next 2022-07-27 09:33:45 +10:00
hid
hwmon This was a moderately busy cycle for documentation, but nothing all that 2022-08-02 19:24:24 -07:00
i2c Documentation: i2c: fix references to other documents 2022-09-16 20:53:58 +01:00
ia64
iio
images
infiniband
input Input: iforce - add support for Boeder Force Feedback Wheel 2022-08-29 11:45:28 -07:00
isdn
kbuild asm goto: eradicate CC_HAS_ASM_GOTO 2022-08-21 10:06:28 -07:00
kernel-hacking docs: process: remove outdated submitting-drivers.rst 2022-07-14 15:03:57 -06:00
leds
litmus-tests
livepatch
locking
loongarch docs/LoongArch: Add I14 description 2022-08-12 13:10:11 +08:00
m68k video: fbdev: atari: Fix inverse handling 2022-07-18 07:56:17 +02:00
maintainer
mhi
mips
misc-devices
mm Documentation/mm: add details about kmap_local_page() and preemption 2022-08-08 18:06:46 -07:00
netlabel
networking netfilter: conntrack: remove nf_conntrack_helper documentation 2022-09-20 23:50:03 +02:00
nios2
nvdimm
openrisc
parisc
PCI Fix of heap data and clang warnings, support for a new Intel NTB device, 2022-08-13 14:00:45 -07:00
pcmcia
peci
power Merge branches 'pm-devfreq', 'pm-qos', 'pm-tools' and 'pm-docs' 2022-07-29 19:46:00 +02:00
powerpc docs: powerpc: add elf_hwcaps to table of contents 2022-07-28 16:19:47 +10:00
process docs: update mediator information in CoC docs 2022-10-12 09:39:04 +02:00
RCU
riscv
s390 s390/docs: fix warnings for vfio_ap driver doc 2022-07-22 13:54:07 +02:00
scheduler
scsi SCSI misc on 20220804 2022-08-04 19:47:37 -07:00
security Documentation: siphash: Fix typo in the name of offsetofend macro 2022-07-13 14:01:22 -06:00
sh
sound
sparc
sphinx docs: kerneldoc-preamble: Test xeCJK.sty before loading 2022-08-18 11:27:55 -06:00
sphinx-static
spi
staging
target
timers
tools rtla: Fix tracer name 2022-08-10 11:43:59 -04:00
trace coresight: docs: Fix a broken reference 2022-10-21 12:38:39 +02:00
translations docs/ja_JP/SubmittingPatches: Remove reference to submitting-drivers.rst 2022-08-19 07:54:08 -06:00
usb usb: gadget: f_mass_storage: forced_eject attribute 2022-07-14 16:06:42 +02:00
userspace-api SCSI misc on 20220804 2022-08-04 19:47:37 -07:00
virt KVM: x86/MMU: properly format KVM_CAP_VM_DISABLE_NX_HUGE_PAGES capability table 2022-08-11 02:35:37 -04:00
w1
watchdog watchdog/pseries-wdt: initial support for H_WATCHDOG-based watchdog timers 2022-07-20 21:57:39 +10:00
x86 dma-mapping updates 2022-08-06 10:56:45 -07:00
xtensa
.gitignore
arch.rst
asm-annotations.rst
atomic_bitops.txt wait_on_bit: add an acquire memory barrier 2022-08-26 09:30:25 -07:00
atomic_t.txt
Changes
CodingStyle
conf.py docs/conf.py: add function attribute '__fix_address' to conf.py 2022-08-26 16:47:13 -06:00
docutils.conf
dontdiff
index.rst
Kconfig
Makefile
memory-barriers.txt
SubmittingPatches