From nobody Tue Feb 10 06:58:32 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1644918036984869.51760555417; Tue, 15 Feb 2022 01:40:36 -0800 (PST) Received: from localhost ([::1]:50024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJuK3-00018e-Jk for importer@patchew.org; Tue, 15 Feb 2022 04:40:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJuCJ-000425-IU for qemu-devel@nongnu.org; Tue, 15 Feb 2022 04:32:35 -0500 Received: from [2a00:1450:4864:20::62d] (port=42826 helo=mail-ej1-x62d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJuCH-0008Qt-6p for qemu-devel@nongnu.org; Tue, 15 Feb 2022 04:32:35 -0500 Received: by mail-ej1-x62d.google.com with SMTP id hw13so14354374ejc.9 for ; Tue, 15 Feb 2022 01:32:32 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id m4sm6634308ejl.45.2022.02.15.01.32.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 01:32:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iCDUNjf44S0gmQlhAow9hp61ImWk+aCFVeZk76vSUJQ=; b=bQCwlqJdhVz6P3Ul3gtWOKMUaGslDym33iRwLonoBhuMC4NV81ZCKZkDjSLHrFZ2PB RCuQA0kVpeTaqT6C5z+Aiy3g4iuL+jceMeP5tD8iBUEUx4kjNV7n6WqufTnB7bWgw4r2 oXrWRHIXGyJmZbE0zuZXmgdxKwWlwZNQ+pknCe4BS5MS6PoGkoMN9cGwW1sZ1hJOlRmq BkYfEc5OhEPH/hPS/6ENGVgnrgJuNRMkrOrKDkPHZwZ97GTs4qgAHjJVFFQKUw2X7XmN itaBhEO6pySBQ/7ru4Wgmk/5PHGeMSBswMVE4Lt+y5kr+ndlGyk/NnmHuJm475CLin8L Jxew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=iCDUNjf44S0gmQlhAow9hp61ImWk+aCFVeZk76vSUJQ=; b=VvRi34asSNkv1bzeGK7dbYwP328oDM73QQ+TmkuCWCJTtadPn1xAqvrZgxOUx3XQm8 M7m7aTX+d0gvVWbmET41lq/xk14ebfHCh9v52B1yyKct2NMZU19DRIaUdWFwLC9uy76U kaqy0aKUpO1xw7WCCuWPGku2txqqkair6M2/8U9/ow2iJJkYpru7s6iWgrZ4woBbJIOR LZDGhnWdTo46aprwC/2YxoFpZU8F6OVjSnXFfDlQ0YcYX+GR7FM6tJ+Q8fbc0mA+LIxY BgvtZs/a2yPNpg6Cp82pCfbud8hYkbj/WdYpioNqhPfKeABFDNLppnVqkxl2boiVdukh 8g8g== X-Gm-Message-State: AOAM532R/roG1DFMFqxJh2S/Fh42nacDM43Hi70CYX18qzlrPry2kVlA Y0Jl9HDcKWSd2+kv1DG1G0pz4tAgcrg= X-Google-Smtp-Source: ABdhPJzHqmgyUf23n5SRSTOecJElrwBAzQFDgwkyQptZR6WVRQU09n5STqTns57I+mUdRo1qKqFAKg== X-Received: by 2002:a17:906:7a09:: with SMTP id d9mr2140163ejo.103.1644917552001; Tue, 15 Feb 2022 01:32:32 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 10/30] configure, meson: move TPM check to meson Date: Tue, 15 Feb 2022 10:32:03 +0100 Message-Id: <20220215093223.110827-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220215093223.110827-1-pbonzini@redhat.com> References: <20220215093223.110827-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::62d (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62d.google.com X-Spam_score_int: 2 X-Spam_score: 0.2 X-Spam_bar: / X-Spam_report: (0.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, PDS_HP_HELO_NORDNS=0.904, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1644918039861100001 Content-Type: text/plain; charset="utf-8" The check is simply for a POSIX system. Signed-off-by: Paolo Bonzini --- backends/tpm/meson.build | 14 ++++++-------- configure | 25 ------------------------- docs/devel/kconfig.rst | 2 +- hw/acpi/meson.build | 4 +++- meson.build | 9 +++++++-- meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ softmmu/meson.build | 5 ++++- 8 files changed, 26 insertions(+), 38 deletions(-) diff --git a/backends/tpm/meson.build b/backends/tpm/meson.build index 857929082e..7f2503f84e 100644 --- a/backends/tpm/meson.build +++ b/backends/tpm/meson.build @@ -1,8 +1,6 @@ -tpm_ss =3D ss.source_set() - -tpm_ss.add(files('tpm_backend.c')) -tpm_ss.add(files('tpm_util.c')) -tpm_ss.add(when: 'CONFIG_TPM_PASSTHROUGH', if_true: files('tpm_passthrough= .c')) -tpm_ss.add(when: 'CONFIG_TPM_EMULATOR', if_true: files('tpm_emulator.c')) - -softmmu_ss.add_all(when: 'CONFIG_TPM', if_true: tpm_ss) +if have_tpm + softmmu_ss.add(files('tpm_backend.c')) + softmmu_ss.add(files('tpm_util.c')) + softmmu_ss.add(when: 'CONFIG_TPM_PASSTHROUGH', if_true: files('tpm_passt= hrough.c')) + softmmu_ss.add(when: 'CONFIG_TPM_EMULATOR', if_true: files('tpm_emulator= .c')) +endif diff --git a/configure b/configure index f536f53106..54eb954296 100755 --- a/configure +++ b/configure @@ -330,7 +330,6 @@ coroutine=3D"" coroutine_pool=3D"$default_feature" debug_stack_usage=3D"no" tls_priority=3D"NORMAL" -tpm=3D"$default_feature" live_block_migration=3D${default_feature:-yes} replication=3D${default_feature:-yes} bochs=3D${default_feature:-yes} @@ -1039,10 +1038,6 @@ for opt do ;; --disable-pvrdma) pvrdma=3D"no" ;; - --disable-tpm) tpm=3D"no" - ;; - --enable-tpm) tpm=3D"yes" - ;; --disable-live-block-migration) live_block_migration=3D"no" ;; --enable-live-block-migration) live_block_migration=3D"yes" @@ -1378,7 +1373,6 @@ cat << EOF vhost-vdpa vhost-vdpa kernel backend support live-block-migration Block migration in the main migration stream coroutine-pool coroutine freelist (better performance) - tpm TPM support replication replication support opengl opengl support qom-cast-debug cast debugging support @@ -2395,21 +2389,6 @@ if test "$modules" =3D yes; then fi fi =20 -########################################## -# TPM emulation is only on POSIX - -if test "$tpm" =3D ""; then - if test "$mingw32" =3D "yes"; then - tpm=3Dno - else - tpm=3Dyes - fi -elif test "$tpm" =3D "yes"; then - if test "$mingw32" =3D "yes" ; then - error_exit "TPM emulation only available on POSIX systems" - fi -fi - ########################################## # fdt probe =20 @@ -3274,10 +3253,6 @@ if test "$live_block_migration" =3D "yes" ; then echo "CONFIG_LIVE_BLOCK_MIGRATION=3Dy" >> $config_host_mak fi =20 -if test "$tpm" =3D "yes"; then - echo 'CONFIG_TPM=3Dy' >> $config_host_mak -fi - if test "$rdma" =3D "yes" ; then echo "CONFIG_RDMA=3Dy" >> $config_host_mak echo "RDMA_LIBS=3D$rdma_libs" >> $config_host_mak diff --git a/docs/devel/kconfig.rst b/docs/devel/kconfig.rst index a1cdbec751..d6b55a6fe0 100644 --- a/docs/devel/kconfig.rst +++ b/docs/devel/kconfig.rst @@ -301,7 +301,7 @@ and also listed as follows in the top-level meson.build= 's host_kconfig variable:: =20 host_kconfig =3D \ - ('CONFIG_TPM' in config_host ? ['CONFIG_TPM=3Dy'] : []) + \ + (have_tpm ? ['CONFIG_TPM=3Dy'] : []) + \ ('CONFIG_SPICE' in config_host ? ['CONFIG_SPICE=3Dy'] : []) + \ (have_ivshmem ? ['CONFIG_IVSHMEM=3Dy'] : []) + \ ... diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build index f5b22983bb..8bea2e6933 100644 --- a/hw/acpi/meson.build +++ b/hw/acpi/meson.build @@ -25,7 +25,9 @@ acpi_ss.add(when: 'CONFIG_ACPI_X86_ICH', if_true: files('= ich9.c', 'tco.c')) acpi_ss.add(when: 'CONFIG_ACPI_ERST', if_true: files('erst.c')) acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files= ('ipmi-stub.c')) acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c')) -acpi_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c')) +if have_tpm + acpi_ss.add(files('tpm.c')) +endif softmmu_ss.add(when: 'CONFIG_ACPI', if_false: files('acpi-stub.c', 'aml-bu= ild-stub.c', 'ghes-stub.c')) softmmu_ss.add_all(when: 'CONFIG_ACPI', if_true: acpi_ss) softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('acpi-stub.c', 'aml-buil= d-stub.c', diff --git a/meson.build b/meson.build index f8b83f64db..02137be91e 100644 --- a/meson.build +++ b/meson.build @@ -276,6 +276,10 @@ multiprocess_allowed =3D get_option('multiprocess') \ .require(targetos =3D=3D 'linux', error_message: 'Multiprocess QEMU is s= upported only on Linux') \ .allowed() =20 +have_tpm =3D get_option('tpm') \ + .require(targetos !=3D 'windows', error_message: 'TPM emulation only ava= ilable on POSIX systems') \ + .allowed() + # Target-specific libraries and flags libm =3D cc.find_library('m', required: false) threads =3D dependency('threads') @@ -1492,6 +1496,7 @@ config_host_data.set('CONFIG_SDL', sdl.found()) config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) config_host_data.set('CONFIG_SECCOMP', seccomp.found()) config_host_data.set('CONFIG_SNAPPY', snappy.found()) +config_host_data.set('CONFIG_TPM', have_tpm) config_host_data.set('CONFIG_USB_LIBUSB', libusb.found()) config_host_data.set('CONFIG_VDE', vde.found()) config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_s= erver) @@ -1942,7 +1947,7 @@ endif have_ivshmem =3D config_host_data.get('CONFIG_EVENTFD') host_kconfig =3D \ (get_option('fuzzing') ? ['CONFIG_FUZZ=3Dy'] : []) + \ - ('CONFIG_TPM' in config_host ? ['CONFIG_TPM=3Dy'] : []) + \ + (have_tpm ? ['CONFIG_TPM=3Dy'] : []) + \ (spice.found() ? ['CONFIG_SPICE=3Dy'] : []) + \ (have_ivshmem ? ['CONFIG_IVSHMEM=3Dy'] : []) + \ ('CONFIG_OPENGL' in config_host ? ['CONFIG_OPENGL=3Dy'] : []) + \ @@ -3556,7 +3561,7 @@ if targetos =3D=3D 'windows' endif summary_info +=3D {'seccomp support': seccomp} summary_info +=3D {'GlusterFS support': glusterfs} -summary_info +=3D {'TPM support': config_host.has_key('CONFIG_TPM')} +summary_info +=3D {'TPM support': have_tpm} summary_info +=3D {'libssh support': libssh} summary_info +=3D {'lzo support': lzo} summary_info +=3D {'snappy support': snappy} diff --git a/meson_options.txt b/meson_options.txt index bb443023b5..1b44b4e666 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -68,6 +68,8 @@ option('multiprocess', type: 'feature', value: 'auto', description: 'Out of process device emulation support') option('dbus_display', type: 'feature', value: 'auto', description: '-display dbus support') +option('tpm', type : 'feature', value : 'auto', + description: 'TPM support') =20 # 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 d46d7181e7..3f107e5724 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -86,6 +86,7 @@ meson_options_help() { printf "%s\n" ' spice Spice server support' printf "%s\n" ' spice-protocol Spice protocol support' printf "%s\n" ' tcg TCG support' + printf "%s\n" ' tpm TPM support' printf "%s\n" ' u2f U2F emulation support' printf "%s\n" ' usb-redir libusbredir support' printf "%s\n" ' vde vde network backend support' @@ -256,6 +257,8 @@ _meson_option_parse() { --disable-tcg) printf "%s" -Dtcg=3Ddisabled ;; --enable-tcg-interpreter) printf "%s" -Dtcg_interpreter=3Dtrue ;; --disable-tcg-interpreter) printf "%s" -Dtcg_interpreter=3Dfalse ;; + --enable-tpm) printf "%s" -Dtpm=3Denabled ;; + --disable-tpm) printf "%s" -Dtpm=3Ddisabled ;; --enable-trace-backends=3D*) quote_sh "-Dtrace_backends=3D$2" ;; --enable-u2f) printf "%s" -Du2f=3Denabled ;; --disable-u2f) printf "%s" -Du2f=3Ddisabled ;; diff --git a/softmmu/meson.build b/softmmu/meson.build index d8e03018ab..39f766ce7c 100644 --- a/softmmu/meson.build +++ b/softmmu/meson.build @@ -27,6 +27,9 @@ softmmu_ss.add(files( 'qdev-monitor.c', ), sdl, libpmem, libdaxctl) =20 -softmmu_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c')) +if have_tpm + softmmu_ss.add(files('tpm.c')) +endif + softmmu_ss.add(when: seccomp, if_true: files('qemu-seccomp.c')) softmmu_ss.add(when: fdt, if_true: files('device_tree.c')) --=20 2.34.1