[PATCH v5 01/16] meson: Add optional dependency on IGVM library

Roy Hopkins posted 16 patches 3 months, 1 week ago
There is a newer version of this series
[PATCH v5 01/16] meson: Add optional dependency on IGVM library
Posted by Roy Hopkins via 3 months, 1 week ago
The IGVM library allows Independent Guest Virtual Machine files to be
parsed and processed. IGVM files are used to configure guest memory
layout, initial processor state and other configuration pertaining to
secure virtual machines.

This adds the --enable-igvm configure option, enabled by default, which
attempts to locate and link against the IGVM library via pkgconfig and
sets CONFIG_IGVM if found.

The library is added to the system_ss target in backends/meson.build
where the IGVM parsing will be performed by the ConfidentialGuestSupport
object.

Signed-off-by: Roy Hopkins <roy.hopkins@suse.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
---
 backends/meson.build          | 3 +++
 meson.build                   | 8 ++++++++
 meson_options.txt             | 2 ++
 scripts/meson-buildoptions.sh | 3 +++
 4 files changed, 16 insertions(+)

diff --git a/backends/meson.build b/backends/meson.build
index da714b93d1..b092a19efc 100644
--- a/backends/meson.build
+++ b/backends/meson.build
@@ -32,6 +32,9 @@ if have_vhost_user_crypto
 endif
 system_ss.add(when: gio, if_true: files('dbus-vmstate.c'))
 system_ss.add(when: 'CONFIG_SGX', if_true: files('hostmem-epc.c'))
+if igvm.found()
+  system_ss.add(igvm)
+endif
 
 system_ss.add(when: 'CONFIG_SPDM_SOCKET', if_true: files('spdm-socket.c'))
 
diff --git a/meson.build b/meson.build
index c2a050b844..11976674ff 100644
--- a/meson.build
+++ b/meson.build
@@ -1289,6 +1289,12 @@ if host_os == 'linux' and (have_system or have_tools)
                        method: 'pkg-config',
                        required: get_option('libudev'))
 endif
+igvm = not_found
+if not get_option('igvm').auto() or have_system
+  igvm = dependency('igvm', version: '>= 0.3.0',
+                    method: 'pkg-config',
+                    required: get_option('igvm'))
+endif
 
 mpathlibs = [libudev]
 mpathpersist = not_found
@@ -2420,6 +2426,7 @@ config_host_data.set('CONFIG_CFI', get_option('cfi'))
 config_host_data.set('CONFIG_SELINUX', selinux.found())
 config_host_data.set('CONFIG_XEN_BACKEND', xen.found())
 config_host_data.set('CONFIG_LIBDW', libdw.found())
+config_host_data.set('CONFIG_IGVM', igvm.found())
 if xen.found()
   # protect from xen.version() having less than three components
   xen_version = xen.version().split('.') + ['0', '0']
@@ -4520,6 +4527,7 @@ summary_info += {'seccomp support':   seccomp}
 summary_info += {'GlusterFS support': glusterfs}
 summary_info += {'hv-balloon support': hv_balloon}
 summary_info += {'TPM support':       have_tpm}
+summary_info += {'IGVM support':      igvm}
 summary_info += {'libssh support':    libssh}
 summary_info += {'lzo support':       lzo}
 summary_info += {'snappy support':    snappy}
diff --git a/meson_options.txt b/meson_options.txt
index 0269fa0f16..0b09c152dc 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -111,6 +111,8 @@ option('dbus_display', type: 'feature', value: 'auto',
        description: '-display dbus support')
 option('tpm', type : 'feature', value : 'auto',
        description: 'TPM support')
+option('igvm', type: 'feature', value: 'auto',
+       description: 'Independent Guest Virtual Machine (IGVM) file support')
 
 # Do not enable it by default even for Mingw32, because it doesn't
 # work on Wine.
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index c97079a38c..264e46dd4a 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -128,6 +128,7 @@ meson_options_help() {
   printf "%s\n" '  hv-balloon      hv-balloon driver (requires Glib 2.68+ GTree API)'
   printf "%s\n" '  hvf             HVF acceleration support'
   printf "%s\n" '  iconv           Font glyph conversion support'
+  printf "%s\n" '  igvm            IGVM file support'
   printf "%s\n" '  jack            JACK sound support'
   printf "%s\n" '  keyring         Linux keyring support'
   printf "%s\n" '  kvm             KVM acceleration support'
@@ -343,6 +344,8 @@ _meson_option_parse() {
     --iasl=*) quote_sh "-Diasl=$2" ;;
     --enable-iconv) printf "%s" -Diconv=enabled ;;
     --disable-iconv) printf "%s" -Diconv=disabled ;;
+    --enable-igvm) printf "%s" -Digvm=enabled ;;
+    --disable-igvm) printf "%s" -Digvm=disabled ;;
     --includedir=*) quote_sh "-Dincludedir=$2" ;;
     --enable-install-blobs) printf "%s" -Dinstall_blobs=true ;;
     --disable-install-blobs) printf "%s" -Dinstall_blobs=false ;;
-- 
2.43.0
Re: [PATCH v5 01/16] meson: Add optional dependency on IGVM library
Posted by Stefano Garzarella 2 months, 3 weeks ago
On Tue, Aug 13, 2024 at 04:01:03PM GMT, Roy Hopkins wrote:
>The IGVM library allows Independent Guest Virtual Machine files to be
>parsed and processed. IGVM files are used to configure guest memory
>layout, initial processor state and other configuration pertaining to
>secure virtual machines.
>
>This adds the --enable-igvm configure option, enabled by default, which
>attempts to locate and link against the IGVM library via pkgconfig and
>sets CONFIG_IGVM if found.
>
>The library is added to the system_ss target in backends/meson.build
>where the IGVM parsing will be performed by the ConfidentialGuestSupport
>object.
>
>Signed-off-by: Roy Hopkins <roy.hopkins@suse.com>
>Acked-by: Michael S. Tsirkin <mst@redhat.com>
>---
> backends/meson.build          | 3 +++
> meson.build                   | 8 ++++++++
> meson_options.txt             | 2 ++
> scripts/meson-buildoptions.sh | 3 +++
> 4 files changed, 16 insertions(+)

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

>
>diff --git a/backends/meson.build b/backends/meson.build
>index da714b93d1..b092a19efc 100644
>--- a/backends/meson.build
>+++ b/backends/meson.build
>@@ -32,6 +32,9 @@ if have_vhost_user_crypto
> endif
> system_ss.add(when: gio, if_true: files('dbus-vmstate.c'))
> system_ss.add(when: 'CONFIG_SGX', if_true: files('hostmem-epc.c'))
>+if igvm.found()
>+  system_ss.add(igvm)
>+endif
>
> system_ss.add(when: 'CONFIG_SPDM_SOCKET', if_true: files('spdm-socket.c'))
>
>diff --git a/meson.build b/meson.build
>index c2a050b844..11976674ff 100644
>--- a/meson.build
>+++ b/meson.build
>@@ -1289,6 +1289,12 @@ if host_os == 'linux' and (have_system or have_tools)
>                        method: 'pkg-config',
>                        required: get_option('libudev'))
> endif
>+igvm = not_found
>+if not get_option('igvm').auto() or have_system
>+  igvm = dependency('igvm', version: '>= 0.3.0',
>+                    method: 'pkg-config',
>+                    required: get_option('igvm'))
>+endif
>
> mpathlibs = [libudev]
> mpathpersist = not_found
>@@ -2420,6 +2426,7 @@ config_host_data.set('CONFIG_CFI', get_option('cfi'))
> config_host_data.set('CONFIG_SELINUX', selinux.found())
> config_host_data.set('CONFIG_XEN_BACKEND', xen.found())
> config_host_data.set('CONFIG_LIBDW', libdw.found())
>+config_host_data.set('CONFIG_IGVM', igvm.found())
> if xen.found()
>   # protect from xen.version() having less than three components
>   xen_version = xen.version().split('.') + ['0', '0']
>@@ -4520,6 +4527,7 @@ summary_info += {'seccomp support':   seccomp}
> summary_info += {'GlusterFS support': glusterfs}
> summary_info += {'hv-balloon support': hv_balloon}
> summary_info += {'TPM support':       have_tpm}
>+summary_info += {'IGVM support':      igvm}
> summary_info += {'libssh support':    libssh}
> summary_info += {'lzo support':       lzo}
> summary_info += {'snappy support':    snappy}
>diff --git a/meson_options.txt b/meson_options.txt
>index 0269fa0f16..0b09c152dc 100644
>--- a/meson_options.txt
>+++ b/meson_options.txt
>@@ -111,6 +111,8 @@ option('dbus_display', type: 'feature', value: 'auto',
>        description: '-display dbus support')
> option('tpm', type : 'feature', value : 'auto',
>        description: 'TPM support')
>+option('igvm', type: 'feature', value: 'auto',
>+       description: 'Independent Guest Virtual Machine (IGVM) file support')
>
> # Do not enable it by default even for Mingw32, because it doesn't
> # work on Wine.
>diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
>index c97079a38c..264e46dd4a 100644
>--- a/scripts/meson-buildoptions.sh
>+++ b/scripts/meson-buildoptions.sh
>@@ -128,6 +128,7 @@ meson_options_help() {
>   printf "%s\n" '  hv-balloon      hv-balloon driver (requires Glib 2.68+ GTree API)'
>   printf "%s\n" '  hvf             HVF acceleration support'
>   printf "%s\n" '  iconv           Font glyph conversion support'
>+  printf "%s\n" '  igvm            IGVM file support'
>   printf "%s\n" '  jack            JACK sound support'
>   printf "%s\n" '  keyring         Linux keyring support'
>   printf "%s\n" '  kvm             KVM acceleration support'
>@@ -343,6 +344,8 @@ _meson_option_parse() {
>     --iasl=*) quote_sh "-Diasl=$2" ;;
>     --enable-iconv) printf "%s" -Diconv=enabled ;;
>     --disable-iconv) printf "%s" -Diconv=disabled ;;
>+    --enable-igvm) printf "%s" -Digvm=enabled ;;
>+    --disable-igvm) printf "%s" -Digvm=disabled ;;
>     --includedir=*) quote_sh "-Dincludedir=$2" ;;
>     --enable-install-blobs) printf "%s" -Dinstall_blobs=true ;;
>     --disable-install-blobs) printf "%s" -Dinstall_blobs=false ;;
>-- 
>2.43.0
>
Re: [PATCH v5 01/16] meson: Add optional dependency on IGVM library
Posted by Daniel P. Berrangé 3 months ago
On Tue, Aug 13, 2024 at 04:01:03PM +0100, Roy Hopkins wrote:
> The IGVM library allows Independent Guest Virtual Machine files to be
> parsed and processed. IGVM files are used to configure guest memory
> layout, initial processor state and other configuration pertaining to
> secure virtual machines.
> 
> This adds the --enable-igvm configure option, enabled by default, which
> attempts to locate and link against the IGVM library via pkgconfig and
> sets CONFIG_IGVM if found.
> 
> The library is added to the system_ss target in backends/meson.build
> where the IGVM parsing will be performed by the ConfidentialGuestSupport
> object.
> 
> Signed-off-by: Roy Hopkins <roy.hopkins@suse.com>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  backends/meson.build          | 3 +++
>  meson.build                   | 8 ++++++++
>  meson_options.txt             | 2 ++
>  scripts/meson-buildoptions.sh | 3 +++
>  4 files changed, 16 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With 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 :|