qemu-patch-raspberry4/target/i386
David Gibson aacdb84413 sev: Remove false abstraction of flash encryption
When AMD's SEV memory encryption is in use, flash memory banks (which are
initialed by pc_system_flash_map()) need to be encrypted with the guest's
key, so that the guest can read them.

That's abstracted via the kvm_memcrypt_encrypt_data() callback in the KVM
state.. except, that it doesn't really abstract much at all.

For starters, the only call site is in code specific to the 'pc'
family of machine types, so it's obviously specific to those and to
x86 to begin with.  But it makes a bunch of further assumptions that
need not be true about an arbitrary confidential guest system based on
memory encryption, let alone one based on other mechanisms:

 * it assumes that the flash memory is defined to be encrypted with the
   guest key, rather than being shared with hypervisor
 * it assumes that that hypervisor has some mechanism to encrypt data into
   the guest, even though it can't decrypt it out, since that's the whole
   point
 * the interface assumes that this encrypt can be done in place, which
   implies that the hypervisor can write into a confidential guests's
   memory, even if what it writes isn't meaningful

So really, this "abstraction" is actually pretty specific to the way SEV
works.  So, this patch removes it and instead has the PC flash
initialization code call into a SEV specific callback.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
2021-02-08 16:57:38 +11:00
..
hax accel: replace struct CpusAccel with AccelOpsClass 2021-02-05 10:24:15 -10:00
hvf accel: replace struct CpusAccel with AccelOpsClass 2021-02-05 10:24:15 -10:00
kvm i386: move hyperv_limits initialization to x86_cpu_realizefn() 2020-12-16 14:07:33 -05:00
tcg cpu: tcg_ops: move to tcg-cpu-ops.h, keep a pointer in CPUClass 2021-02-05 10:24:15 -10:00
whpx accel: replace struct CpusAccel with AccelOpsClass 2021-02-05 10:24:15 -10:00
arch_dump.c dump: add kernel_gs_base to QEMU CPU state 2018-07-16 16:13:34 +02:00
arch_memory_mapping.c exec,dump,i386,ppc,s390x: don't include exec/cpu-all.h explicitly 2017-09-19 18:21:33 +02:00
cpu-dump.c i386: move cpu dump out of helper.c into cpu-dump.c 2020-12-16 14:06:53 -05:00
cpu-param.h tcg: Split out target/arch/cpu-param.h 2019-06-10 07:03:34 -07:00
cpu-qom.h qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros 2020-09-18 14:12:32 -04:00
cpu.c qapi: Use QAPI_LIST_APPEND in trivial cases 2021-01-28 08:08:45 +01:00
cpu.h target/i386: Use X86Seg enum for segment registers 2021-01-12 17:05:10 +01:00
gdbstub.c target/i386: Use X86Seg enum for segment registers 2021-01-12 17:05:10 +01:00
helper.c i386: move TCG cpu class initialization to tcg/ 2020-12-16 15:50:33 -05:00
helper.h target/i386: fix IEEE SSE floating-point exception raising 2020-07-10 18:02:17 -04:00
machine.c i386: move kvm accel files into kvm/ 2020-12-16 14:06:52 -05:00
meson.build i386: move cpu dump out of helper.c into cpu-dump.c 2020-12-16 14:06:53 -05:00
monitor.c sev: add sev-inject-launch-secret 2020-12-10 17:33:17 -05:00
ops_sse.h x86 tcg cpus: Fix Lesser GPL version number 2020-11-15 16:41:42 +01:00
ops_sse_header.h x86 tcg cpus: Fix Lesser GPL version number 2020-11-15 16:41:42 +01:00
sev-stub.c sev: Remove false abstraction of flash encryption 2021-02-08 16:57:38 +11:00
sev.c sev: Remove false abstraction of flash encryption 2021-02-08 16:57:38 +11:00
sev_i386.h target/i386: sev: provide proper error reporting for query-sev-capabilities 2020-07-10 18:02:22 -04:00
shift_helper_template.h x86 tcg cpus: Fix Lesser GPL version number 2020-11-15 16:41:42 +01:00
svm.h tcg/svm: use host cr4 during NPT page table walk 2020-07-10 18:02:14 -04:00
trace-events i386: move kvm accel files into kvm/ 2020-12-16 14:06:52 -05:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
xsave_helper.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00