linux-brain/arch
Alper Gun a05499b29a KVM: SVM: Call SEV Guest Decommission if ASID binding fails
commit 934002cd660b035b926438244b4294e647507e13 upstream.

Send SEV_CMD_DECOMMISSION command to PSP firmware if ASID binding
fails. If a failure happens after  a successful LAUNCH_START command,
a decommission command should be executed. Otherwise, guest context
will be unfreed inside the AMD SP. After the firmware will not have
memory to allocate more SEV guest context, LAUNCH_START command will
begin to fail with SEV_RET_RESOURCE_LIMIT error.

The existing code calls decommission inside sev_unbind_asid, but it is
not called if a failure happens before guest activation succeeds. If
sev_bind_asid fails, decommission is never called. PSP firmware has a
limit for the number of guests. If sev_asid_binding fails many times,
PSP firmware will not have resources to create another guest context.

Cc: stable@vger.kernel.org
Fixes: 59414c9892 ("KVM: SVM: Add support for KVM_SEV_LAUNCH_START command")
Reported-by: Peter Gonda <pgonda@google.com>
Signed-off-by: Alper Gun <alpergun@google.com>
Reviewed-by: Marc Orr <marcorr@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210610174604.2554090-1-alpergun@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-07-11 12:52:07 +02:00
..
alpha alpha: fix annotation of io{read,write}{16,32}be() 2020-08-26 10:40:58 +02:00
arc ARCv2: save ABI registers across signal handling 2021-06-23 14:41:29 +02:00
arm ARM: 9081/1: fix gcc-10 thumb2-kernel regression 2021-06-30 08:47:43 -04:00
arm64 arm64: link with -z norelro for LLD or aarch64-elf 2021-06-30 08:47:44 -04:00
c6x mm: consolidate pgtable_cache_init() and pgd_cache_init() 2019-09-24 15:54:09 -07:00
csky csky: change a Kconfig symbol name to fix e1000 build error 2021-04-28 13:19:16 +02:00
h8300 h8300: fix PREEMPTION build, TI_PRE_COUNT undefined 2021-02-17 10:35:18 +01:00
hexagon hexagon: define ioremap_uc 2020-05-10 10:31:31 +02:00
ia64 tweewide: Fix most Shebang lines 2021-05-22 11:38:30 +02:00
m68k m68k: mvme147,mvme16x: Don't wipe PCC timer config bits 2021-05-14 09:44:19 +02:00
microblaze microblaze: Prevent the overflow of the start 2020-02-24 08:37:02 +01:00
mips MIPS: generic: Update node names to avoid unit addresses 2021-06-30 08:47:44 -04:00
nds32 nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff 2021-04-14 08:24:10 +02:00
nios2 nios2 update for v5.4-rc1 2019-09-27 13:02:19 -07:00
openrisc openrisc: Define memory barrier mb 2021-06-03 08:59:11 +02:00
parisc parisc: avoid a warning on u8 cast for cmpxchg on u8 pointers 2021-04-14 08:24:11 +02:00
powerpc powerpc/fsl: set fsl,i2c-erratum-a004447 flag for P1010 i2c controllers 2021-06-16 11:59:38 +02:00
riscv riscv: Use -mno-relax when using lld linker 2021-06-18 09:58:58 +02:00
s390 s390/stack: fix possible register corruption with stack switch helper 2021-07-11 12:52:07 +02:00
sh sh: dma: fix kconfig dependency for G2_DMA 2021-01-27 11:47:52 +01:00
sparc sparc64: Fix opcode filtering in handling of no fault loads 2021-03-30 14:35:22 +02:00
um um: Disable CONFIG_GCOV with MODULES 2021-05-22 11:38:28 +02:00
unicore32 mm: treewide: clarify pgtable_page_{ctor,dtor}() naming 2019-09-26 10:10:44 -07:00
x86 KVM: SVM: Call SEV Guest Decommission if ASID binding fails 2021-07-11 12:52:07 +02:00
xtensa xtensa: move coprocessor_flush to the .text section 2021-04-07 14:47:42 +02:00
.gitignore
Kconfig Revert: "ring-buffer: Remove HAVE_64BIT_ALIGNED_ACCESS" 2020-12-30 11:51:47 +01:00