Star64_linux/arch/x86/kernel
Michael Sterritt 1d5379d047 x86/sev: Fix SEV-ES INS/OUTS instructions for word, dword, and qword
Properly type the operands being passed to __put_user()/__get_user().
Otherwise, these routines truncate data for dependent instructions
(e.g., INSW) and only read/write one byte.

This has been tested by sending a string with REP OUTSW to a port and
then reading it back in with REP INSW on the same port.

Previous behavior was to only send and receive the first char of the
size. For example, word operations for "abcd" would only read/write
"ac". With change, the full string is now written and read back.

Fixes: f980f9c31a (x86/sev-es: Compile early handler code into kernel image)
Signed-off-by: Michael Sterritt <sterritt@google.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marc Orr <marcorr@google.com>
Reviewed-by: Peter Gonda <pgonda@google.com>
Reviewed-by: Joerg Roedel <jroedel@suse.de>
Link: https://lkml.kernel.org/r/20211119232757.176201-1-sterritt@google.com
2021-12-03 18:09:30 +01:00
..
acpi
apic
cpu Two X86 fixes: 2021-11-21 11:25:19 -08:00
fpu x86/fpu/signal: Initialize sw_bytes in save_xstate_epilog() 2021-11-30 15:13:47 -08:00
kprobes
.gitignore
alternative.c
amd_gart_64.c
amd_nb.c
aperture_64.c proc/vmcore: convert oldmem_pfn_is_ram callback to more generic vmcore callbacks 2021-11-09 10:02:48 -08:00
apm_32.c
asm-offsets.c
asm-offsets_32.c
asm-offsets_64.c
audit_64.c
bootflag.c
cc_platform.c
check.c
cpuid.c
crash.c
crash_core_32.c
crash_core_64.c
crash_dump_32.c
crash_dump_64.c
devicetree.c Devicetree updates for v5.16: 2021-11-02 22:22:13 -07:00
doublefault_32.c
dumpstack.c
dumpstack_32.c
dumpstack_64.c
e820.c
early-quirks.c
early_printk.c
ebda.c
eisa.c
espfix_64.c
ftrace.c
ftrace_32.S
ftrace_64.S
head32.c
head64.c
head_32.S
head_64.S
hpet.c
hw_breakpoint.c
i8237.c
i8253.c
i8259.c
idt.c
io_delay.c
ioport.c
irq.c
irq_32.c
irq_64.c
irq_work.c
irqflags.S
irqinit.c
itmt.c
jailhouse.c
jump_label.c
kdebugfs.c
kexec-bzimage64.c
kgdb.c
ksysfs.c
kvm.c Merge branch 'kvm-5.16-fixes' into kvm-master 2021-11-11 11:03:05 -05:00
kvmclock.c
ldt.c
machine_kexec_32.c
machine_kexec_64.c
Makefile
mmconf-fam10h_64.c
module.c
mpparse.c
msr.c
nmi.c
nmi_selftest.c
paravirt-spinlocks.c
paravirt.c Merge branch 'kvm-guest-sev-migration' into kvm-master 2021-11-11 07:40:26 -05:00
pci-dma.c
pci-iommu_table.c
pci-swiotlb.c
pcspeaker.c
perf_regs.c
platform-quirks.c
pmem.c
probe_roms.c
process.c x86: Pin task-stack in __get_wchan() 2021-11-19 10:14:57 -08:00
process.h
process_32.c
process_64.c
ptrace.c
pvclock.c
quirks.c
reboot.c
reboot_fixups_32.c
relocate_kernel_32.S
relocate_kernel_64.S
resource.c
rtc.c
setup.c x86/boot: Mark prepare_command_line() __init 2021-11-24 12:20:24 +01:00
setup_percpu.c memblock: use memblock_free for freeing virtual pointers 2021-11-06 13:30:41 -07:00
sev-shared.c
sev.c x86/sev: Fix SEV-ES INS/OUTS instructions for word, dword, and qword 2021-12-03 18:09:30 +01:00
sev_verify_cbit.S
signal.c
signal_compat.c
smp.c
smpboot.c x86/smp: Factor out parts of native_smp_prepare_cpus() 2021-11-11 13:09:32 +01:00
stacktrace.c
static_call.c static_call,x86: Robustify trampoline patching 2021-11-11 13:09:31 +01:00
step.c
sys_ia32.c
sys_x86_64.c
tboot.c
time.c
tls.c
tls.h
topology.c
trace.c
trace_clock.c
tracepoint.c
traps.c
tsc.c x86/tsc: Disable clocksource watchdog for TSC on qualified platorms 2021-12-02 00:40:36 +01:00
tsc_msr.c
tsc_sync.c x86/tsc: Add a timer to make sure TSC_adjust is always checked 2021-12-02 00:40:35 +01:00
umip.c
unwind_frame.c
unwind_guess.c
unwind_orc.c Merge branch 'akpm' (patches from Andrew) 2021-11-09 10:11:53 -08:00
uprobes.c
verify_cpu.S
vm86_32.c signal: Replace force_fatal_sig with force_exit_sig when in doubt 2021-11-19 09:15:58 -06:00
vmlinux.lds.S
vsmp_64.c
x86_init.c