qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

crypto: move common bits for all emulators to libqemuutil

qcrypto_random_*, AES and qcrypto_init do not need to be linked as a whole
and are the only parts that are used by user-mode emulation. Place them
in libqemuutil, so that whatever needs them will pick them up automatically.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

+7 -13
+1 -2
Makefile
··· 436 436 block-obj-y \ 437 437 block-obj-m \ 438 438 crypto-obj-y \ 439 - crypto-user-obj-y \ 440 439 qom-obj-y \ 441 440 io-obj-y \ 442 441 common-obj-y \ ··· 524 523 subdir-slirp: slirp/all 525 524 526 525 $(filter %/all, $(TARGET_DIRS_RULES)): libqemuutil.a $(common-obj-y) \ 527 - $(qom-obj-y) $(crypto-user-obj-$(CONFIG_USER_ONLY)) 526 + $(qom-obj-y) 528 527 529 528 ROM_DIRS = $(addprefix pc-bios/, $(ROMS)) 530 529 ROM_DIRS_RULES=$(foreach t, all clean, $(addsuffix /$(t), $(ROM_DIRS)))
+1 -2
Makefile.objs
··· 1 1 ####################################################################### 2 2 # Common libraries for tools and emulators 3 3 stub-obj-y = stubs/ util/ crypto/ 4 - util-obj-y = util/ qobject/ qapi/ 4 + util-obj-y = crypto/ util/ qobject/ qapi/ 5 5 6 6 chardev-obj-y = chardev/ 7 7 ··· 25 25 # crypto-obj-y is code used by both qemu system emulation and qemu-img 26 26 27 27 crypto-obj-y = crypto/ 28 - crypto-user-obj-y = crypto/ 29 28 30 29 ####################################################################### 31 30 # qom-obj-y is code used by both qemu system emulation and qemu-img
-2
Makefile.target
··· 184 184 block-obj-m \ 185 185 chardev-obj-y \ 186 186 crypto-obj-y \ 187 - crypto-user-obj-y \ 188 187 qom-obj-y \ 189 188 io-obj-y \ 190 189 common-obj-y \ ··· 193 192 all-obj-y += $(qom-obj-y) 194 193 all-obj-$(CONFIG_SOFTMMU) += $(authz-obj-y) 195 194 all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y) $(chardev-obj-y) 196 - all-obj-$(CONFIG_USER_ONLY) += $(crypto-user-obj-y) 197 195 all-obj-$(CONFIG_SOFTMMU) += $(crypto-obj-y) 198 196 all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y) 199 197
+5 -7
crypto/Makefile.objs
··· 19 19 crypto-obj-y += tlscredsx509.o 20 20 crypto-obj-y += tlssession.o 21 21 crypto-obj-y += secret.o 22 - crypto-rng-obj-$(CONFIG_GCRYPT) += random-gcrypt.o 23 - crypto-rng-obj-$(if $(CONFIG_GCRYPT),n,$(CONFIG_GNUTLS)) += random-gnutls.o 24 - crypto-rng-obj-$(if $(CONFIG_GCRYPT),n,$(if $(CONFIG_GNUTLS),n,y)) += random-platform.o 25 - crypto-obj-y += $(crypto-rng-obj-y) 26 22 crypto-obj-y += pbkdf.o 27 23 crypto-obj-$(CONFIG_NETTLE) += pbkdf-nettle.o 28 24 crypto-obj-$(if $(CONFIG_NETTLE),n,$(CONFIG_GCRYPT)) += pbkdf-gcrypt.o ··· 36 32 crypto-obj-y += block-qcow.o 37 33 crypto-obj-y += block-luks.o 38 34 39 - # Let the userspace emulators avoid linking stuff they won't use. 40 - crypto-user-obj-y = aes.o $(crypto-rng-obj-y) init.o 41 - 42 35 stub-obj-y += pbkdf-stub.o 36 + 37 + util-obj-$(CONFIG_GCRYPT) += random-gcrypt.o 38 + util-obj-$(if $(CONFIG_GCRYPT),n,$(CONFIG_GNUTLS)) += random-gnutls.o 39 + util-obj-$(if $(CONFIG_GCRYPT),n,$(if $(CONFIG_GNUTLS),n,y)) += random-platform.o 40 + util-obj-y += aes.o init.o