Re: [Qemu-devel] [PATCH v8 02/25] build: Link user-only with crypto random number objects

2019-05-22 Thread Laurent Vivier

On 22/05/2019 12:56, Daniel P. Berrangé wrote:

On Wed, May 22, 2019 at 06:52:45AM -0400, Richard Henderson wrote:

On 5/21/19 11:04 AM, Daniel P. Berrangé wrote:

On Thu, May 16, 2019 at 07:39:01PM -0700, Richard Henderson wrote:

For user-only, we require only the random number bits of the
crypto subsystem.  Rename crypto-aes-obj-y to crypto-user-obj-y,
and add the random number objects, plus init.o to handle any
extra stuff the crypto library requires.


If you pull in my authz patch first:

   https://lists.gnu.org/archive/html/qemu-devel/2019-05/msg04863.html

then we can just kill crypto-aes-obj-y entirely, and make
linux-user reference crypto-obj-y as normal. My patch avoids
pulling in PAM, and your previous patch takes care of the
static linking problem.


You would think so, wouldn't you.  And yet, not.

   CC  authz/base.o
/home/rth/qemu/qemu/authz/base.c:23:10: fatal error: trace.h: No such file or
directory
  #include "trace.h"
   ^
compilation terminated.

We're missing some dependency somewhere, and I have no idea what's missing.

This for

../qemu/configure --static --disable-system --disable-tools

I have a working configuration here in v8.  Can we please leave the bikeshed
unpainted for the moment and you can adjust the makefiles as you see fit 
afterward?


Yep, ok. I'll be away on holiday for a while so don't have time to look
into it now. So lets get this merged as is & I'll investigate further
when I come back.


I thin in Makefile.objs:

  trace-events-subdirs += authz

should be moved out of "ifeq ($(CONFIG_BLOCK),y)".

Thanks,
Laurent




Re: [Qemu-devel] [PATCH v8 02/25] build: Link user-only with crypto random number objects

2019-05-22 Thread Richard Henderson
On 5/22/19 6:56 AM, Daniel P. Berrangé wrote:
>> I have a working configuration here in v8.  Can we please leave the bikeshed
>> unpainted for the moment and you can adjust the makefiles as you see fit 
>> afterward?
> 
> Yep, ok. I'll be away on holiday for a while so don't have time to look
> into it now. So lets get this merged as is & I'll investigate further
> when I come back.

Thanks.


r~




Re: [Qemu-devel] [PATCH v8 02/25] build: Link user-only with crypto random number objects

2019-05-22 Thread Daniel P . Berrangé
On Thu, May 16, 2019 at 07:39:01PM -0700, Richard Henderson wrote:
> For user-only, we require only the random number bits of the
> crypto subsystem.  Rename crypto-aes-obj-y to crypto-user-obj-y,
> and add the random number objects, plus init.o to handle any
> extra stuff the crypto library requires.
> 
> Move the crypto libraries from libs_softmmu and libs_tools to
> LIBS, so that they are universally used.
> 
> Signed-off-by: Richard Henderson 
> ---
>  Makefile |  4 ++--
>  Makefile.objs|  2 +-
>  Makefile.target  |  4 ++--
>  configure|  9 +++--
>  crypto/Makefile.objs | 11 ++-
>  5 files changed, 14 insertions(+), 16 deletions(-)

Reviewed-by: Daniel P. Berrangé 


Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|



Re: [Qemu-devel] [PATCH v8 02/25] build: Link user-only with crypto random number objects

2019-05-22 Thread Daniel P . Berrangé
On Wed, May 22, 2019 at 06:52:45AM -0400, Richard Henderson wrote:
> On 5/21/19 11:04 AM, Daniel P. Berrangé wrote:
> > On Thu, May 16, 2019 at 07:39:01PM -0700, Richard Henderson wrote:
> >> For user-only, we require only the random number bits of the
> >> crypto subsystem.  Rename crypto-aes-obj-y to crypto-user-obj-y,
> >> and add the random number objects, plus init.o to handle any
> >> extra stuff the crypto library requires.
> > 
> > If you pull in my authz patch first:
> > 
> >   https://lists.gnu.org/archive/html/qemu-devel/2019-05/msg04863.html
> > 
> > then we can just kill crypto-aes-obj-y entirely, and make
> > linux-user reference crypto-obj-y as normal. My patch avoids
> > pulling in PAM, and your previous patch takes care of the
> > static linking problem.
> 
> You would think so, wouldn't you.  And yet, not.
> 
>   CC  authz/base.o
> /home/rth/qemu/qemu/authz/base.c:23:10: fatal error: trace.h: No such file or
> directory
>  #include "trace.h"
>   ^
> compilation terminated.
> 
> We're missing some dependency somewhere, and I have no idea what's missing.
> 
> This for
> 
> ../qemu/configure --static --disable-system --disable-tools
> 
> I have a working configuration here in v8.  Can we please leave the bikeshed
> unpainted for the moment and you can adjust the makefiles as you see fit 
> afterward?

Yep, ok. I'll be away on holiday for a while so don't have time to look
into it now. So lets get this merged as is & I'll investigate further
when I come back.

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|



Re: [Qemu-devel] [PATCH v8 02/25] build: Link user-only with crypto random number objects

2019-05-22 Thread Richard Henderson
On 5/21/19 11:04 AM, Daniel P. Berrangé wrote:
> On Thu, May 16, 2019 at 07:39:01PM -0700, Richard Henderson wrote:
>> For user-only, we require only the random number bits of the
>> crypto subsystem.  Rename crypto-aes-obj-y to crypto-user-obj-y,
>> and add the random number objects, plus init.o to handle any
>> extra stuff the crypto library requires.
> 
> If you pull in my authz patch first:
> 
>   https://lists.gnu.org/archive/html/qemu-devel/2019-05/msg04863.html
> 
> then we can just kill crypto-aes-obj-y entirely, and make
> linux-user reference crypto-obj-y as normal. My patch avoids
> pulling in PAM, and your previous patch takes care of the
> static linking problem.

You would think so, wouldn't you.  And yet, not.

  CC  authz/base.o
/home/rth/qemu/qemu/authz/base.c:23:10: fatal error: trace.h: No such file or
directory
 #include "trace.h"
  ^
compilation terminated.

We're missing some dependency somewhere, and I have no idea what's missing.

This for

../qemu/configure --static --disable-system --disable-tools

I have a working configuration here in v8.  Can we please leave the bikeshed
unpainted for the moment and you can adjust the makefiles as you see fit 
afterward?

Otherwise, I'll pass the entire series off to you and leave it at that.


r~



Re: [Qemu-devel] [PATCH v8 02/25] build: Link user-only with crypto random number objects

2019-05-21 Thread Daniel P . Berrangé
On Thu, May 16, 2019 at 07:39:01PM -0700, Richard Henderson wrote:
> For user-only, we require only the random number bits of the
> crypto subsystem.  Rename crypto-aes-obj-y to crypto-user-obj-y,
> and add the random number objects, plus init.o to handle any
> extra stuff the crypto library requires.

If you pull in my authz patch first:

  https://lists.gnu.org/archive/html/qemu-devel/2019-05/msg04863.html

then we can just kill crypto-aes-obj-y entirely, and make
linux-user reference crypto-obj-y as normal. My patch avoids
pulling in PAM, and your previous patch takes care of the
static linking problem.


Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|



[Qemu-devel] [PATCH v8 02/25] build: Link user-only with crypto random number objects

2019-05-16 Thread Richard Henderson
For user-only, we require only the random number bits of the
crypto subsystem.  Rename crypto-aes-obj-y to crypto-user-obj-y,
and add the random number objects, plus init.o to handle any
extra stuff the crypto library requires.

Move the crypto libraries from libs_softmmu and libs_tools to
LIBS, so that they are universally used.

Signed-off-by: Richard Henderson 
---
 Makefile |  4 ++--
 Makefile.objs|  2 +-
 Makefile.target  |  4 ++--
 configure|  9 +++--
 crypto/Makefile.objs | 11 ++-
 5 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/Makefile b/Makefile
index 66d5c65156..8419d759e0 100644
--- a/Makefile
+++ b/Makefile
@@ -410,7 +410,7 @@ dummy := $(call unnest-vars,, \
 block-obj-y \
 block-obj-m \
 crypto-obj-y \
-crypto-aes-obj-y \
+crypto-user-obj-y \
 qom-obj-y \
 io-obj-y \
 common-obj-y \
@@ -483,7 +483,7 @@ subdir-slirp: .git-submodule-status
$(call quiet-command,$(MAKE) -C $(SRC_PATH)/slirp 
BUILD_DIR="$(BUILD_DIR)/slirp" CC="$(CC)" AR="$(AR)" LD="$(LD)" 
RANLIB="$(RANLIB)" CFLAGS="$(QEMU_CFLAGS) $(CFLAGS)" LDFLAGS="$(LDFLAGS)")
 
 $(SUBDIR_RULES): libqemuutil.a $(common-obj-y) $(chardev-obj-y) \
-   $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY))
+   $(qom-obj-y) $(crypto-user-obj-$(CONFIG_USER_ONLY))
 
 ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
 # Only keep -O and -g cflags
diff --git a/Makefile.objs b/Makefile.objs
index cf065de5ed..84fa83ba21 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -25,7 +25,7 @@ block-obj-m = block/
 # crypto-obj-y is code used by both qemu system emulation and qemu-img
 
 crypto-obj-y = crypto/
-crypto-aes-obj-y = crypto/
+crypto-user-obj-y = crypto/
 
 ###
 # qom-obj-y is code used by both qemu system emulation and qemu-img
diff --git a/Makefile.target b/Makefile.target
index ae02495951..bde256436b 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -180,7 +180,7 @@ dummy := $(call unnest-vars,.., \
block-obj-m \
chardev-obj-y \
crypto-obj-y \
-   crypto-aes-obj-y \
+   crypto-user-obj-y \
qom-obj-y \
io-obj-y \
common-obj-y \
@@ -189,7 +189,7 @@ all-obj-y += $(common-obj-y)
 all-obj-y += $(qom-obj-y)
 all-obj-$(CONFIG_SOFTMMU) += $(authz-obj-y)
 all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y) $(chardev-obj-y)
-all-obj-$(CONFIG_USER_ONLY) += $(crypto-aes-obj-y)
+all-obj-$(CONFIG_USER_ONLY) += $(crypto-user-obj-y)
 all-obj-$(CONFIG_SOFTMMU) += $(crypto-obj-y)
 all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y)
 
diff --git a/configure b/configure
index f8345368bf..03e71ef7b6 100755
--- a/configure
+++ b/configure
@@ -2792,8 +2792,7 @@ if test "$gnutls" != "no"; then
 # At least ubuntu 18.04 ships only shared libraries.
 write_c_skeleton
 if compile_prog "" "$gnutls_libs" ; then
-libs_softmmu="$gnutls_libs $libs_softmmu"
-libs_tools="$gnutls_libs $libs_tools"
+LIBS="$gnutls_libs $LIBS"
 QEMU_CFLAGS="$QEMU_CFLAGS $gnutls_cflags"
 pass="yes"
 fi
@@ -2864,8 +2863,7 @@ if test "$nettle" != "no"; then
 # Link test to make sure the given libraries work (e.g for static).
 write_c_skeleton
 if compile_prog "" "$nettle_libs" ; then
-libs_softmmu="$nettle_libs $libs_softmmu"
-libs_tools="$nettle_libs $libs_tools"
+LIBS="$nettle_libs $LIBS"
 QEMU_CFLAGS="$QEMU_CFLAGS $nettle_cflags"
 if test -z "$gcrypt"; then
gcrypt="no"
@@ -2896,8 +2894,7 @@ if test "$gcrypt" != "no"; then
 # Link test to make sure the given libraries work (e.g for static).
 write_c_skeleton
 if compile_prog "" "$gcrypt_libs" ; then
-libs_softmmu="$gcrypt_libs $libs_softmmu"
-libs_tools="$gcrypt_libs $libs_tools"
+LIBS="$gcrypt_libs $LIBS"
 QEMU_CFLAGS="$QEMU_CFLAGS $gcrypt_cflags"
 pass="yes"
 fi
diff --git a/crypto/Makefile.objs b/crypto/Makefile.objs
index 256c9aca1f..7fe2fa9da2 100644
--- a/crypto/Makefile.objs
+++ b/crypto/Makefile.objs
@@ -19,9 +19,10 @@ crypto-obj-y += tlscredspsk.o
 crypto-obj-y += tlscredsx509.o
 crypto-obj-y += tlssession.o
 crypto-obj-y += secret.o
-crypto-obj-$(CONFIG_GCRYPT) += random-gcrypt.o
-crypto-obj-$(if $(CONFIG_GCRYPT),n,$(CONFIG_GNUTLS)) += random-gnutls.o
-crypto-obj-$(if $(CONFIG_GCRYPT),n,$(if $(CONFIG_GNUTLS),n,y)) += 
random-platform.o
+crypto-rng-obj-$(CONFIG_GCRYPT) += random-gcrypt.o
+crypto-rng-obj-$(if $(CONFIG_GCRYPT),n,$(CONFIG_GNUTLS)) += random-gnutls.o
+crypto-rng-obj-$(if $(CONFIG_GCRYPT),n,$(if $(CONFIG_GNUTLS),n,y)) += 
random-platform.o
+crypto-obj-y += $(crypto-rng-obj-y)
 crypto-o