From patchwork Wed Dec 16 15:02:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1417221 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=XjdT140v; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cwz5k2JgJz9s1l for ; Thu, 17 Dec 2020 02:08:10 +1100 (AEDT) Received: from localhost ([::1]:50538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpYPQ-0002vB-Am for incoming@patchwork.ozlabs.org; Wed, 16 Dec 2020 10:08:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpYJm-0004Tv-QW for qemu-devel@nongnu.org; Wed, 16 Dec 2020 10:02:18 -0500 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:34809) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kpYJk-0007Uv-PX for qemu-devel@nongnu.org; Wed, 16 Dec 2020 10:02:18 -0500 Received: by mail-ed1-x531.google.com with SMTP id dk8so25164340edb.1 for ; Wed, 16 Dec 2020 07:02:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u8na5XyV6Q3dO/cfg5nIyrTRUkt6ipTXcWtK/AtR680=; b=XjdT140veIHbDnUh68U383NqDK8WbjrIsTFEzntPeDXUbZdPhCXEXaMyVKQGxEwa5g 29VComgQ/PTlODR+cT6cH0Kr5cis4rLnezu3wvf1b8jq8HEjbtgpeec776oqfXb2zHLJ ZGpIrFj572bsximEepVj8DfDgxXHS6JVAOAA6yRJb7MymM7Gp1SS+6iY7irS+KNZ0gPT P3kTnS57uthHJmDcR2WG4iZO3NV5fiQaEHSWywVysxsrq72zvPtJ+X49imIyU5sqPlFX 9RKEjhmwPBDelrIzKWf2VWDafp230PqRV8Dl5nM6qam1zqokaA+7M44b1n2nsBnuUj7r AzUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=u8na5XyV6Q3dO/cfg5nIyrTRUkt6ipTXcWtK/AtR680=; b=elSN2pkHPmRSuQGo5mvNSJWf+LpniTVt9HauEac2EBucQ5lYLscjOOBcDrSmVFXlTH dVhQYmlL2DE3DnPy6ezsub+uo28hVKba7h/Ml/HmBGrGNMWIEZqrKRUpYsnUrlC4JdLb lxIYVTtulrQZGZh+ynQEcstQt6bdq4/yhUR49jgBcSNFEF4CQn1xN3FN6AtommpwIEQ+ Kn12qza+Y3kXGn9Gwu1oNADMe4xJjmWkN9193qv4mtZQLLQtd6ud62gL5whjbr5l0fBQ ruhu2t5k0J1Eu7oEoS/kB55aTIjcEF66+J7pRupjBFe/c3P+AL2zs+1E8+xTWvwLRQ8e tZ9w== X-Gm-Message-State: AOAM533y0uSIg3JASDJClBqlEL+HD0Ak3EPQgSCAQicuCmyUVGE6Vi4F Rzmq0WBJMo9doYvqaYB5CsdhFamVqlw= X-Google-Smtp-Source: ABdhPJypoEZMpy+xv1/nYL5KXlf/qk7Z3ANhBlK2VAjTPkwwUCZsIegGqODQQURIdPE2d8QjaY9sGA== X-Received: by 2002:a05:6402:1692:: with SMTP id a18mr33592189edv.321.1608130935367; Wed, 16 Dec 2020 07:02:15 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v24sm21397059edw.23.2020.12.16.07.02.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 07:02:14 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 7/7] meson: cleanup Kconfig.host handling Date: Wed, 16 Dec 2020 16:02:07 +0100 Message-Id: <20201216150207.431437-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201216150207.431437-1-pbonzini@redhat.com> References: <20201216150207.431437-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x531.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Build the array of command line arguments coming from config_host once for all targets. Add all accelerators to accel/Kconfig so that the command line arguments for accelerators can be computed easily in the existing "foreach sym: accelerators" loop. Signed-off-by: Paolo Bonzini --- accel/Kconfig | 9 +++++++++ docs/devel/kconfig.rst | 19 +++++++++---------- meson.build | 43 +++++++++++++++++------------------------- 3 files changed, 35 insertions(+), 36 deletions(-) diff --git a/accel/Kconfig b/accel/Kconfig index 2ad94a3839..461104c771 100644 --- a/accel/Kconfig +++ b/accel/Kconfig @@ -1,3 +1,12 @@ +config WHPX + bool + +config HAX + bool + +config HVF + bool + config TCG bool diff --git a/docs/devel/kconfig.rst b/docs/devel/kconfig.rst index 336ba0e8e5..cb2d7ffac0 100644 --- a/docs/devel/kconfig.rst +++ b/docs/devel/kconfig.rst @@ -288,21 +288,20 @@ they will include all these symbols and some help text on what they do. ---------------- In some special cases, a configurable element depends on host features -that are detected by QEMU's configure script; for example some devices -depend on the availability of KVM or on the presence of a library on -the host. +that are detected by QEMU's configure or ``meson.build`` scripts; for +example some devices depend on the availability of KVM or on the presence +of a library on the host. These symbols should be listed in ``Kconfig.host`` like this:: - config KVM + config TPM bool -and also listed as follows in the top-level Makefile's ``MINIKCONF_ARGS`` +and also listed as follows in the top-level meson.build's host_kconfig variable:: - MINIKCONF_ARGS = \ - $@ $*/config-devices.mak.d $< $(MINIKCONF_INPUTS) \ - CONFIG_KVM=$(CONFIG_KVM) \ - CONFIG_SPICE=$(CONFIG_SPICE) \ - CONFIG_TPM=$(CONFIG_TPM) \ + host_kconfig = \ + ('CONFIG_TPM' in config_host ? ['CONFIG_TPM=y'] : []) + \ + ('CONFIG_SPICE' in config_host ? ['CONFIG_SPICE=y'] : []) + \ + ('CONFIG_IVSHMEM' in config_host ? ['CONFIG_IVSHMEM=y'] : []) + \ ... diff --git a/meson.build b/meson.build index 0b36fb38f1..bb198f792a 100644 --- a/meson.build +++ b/meson.build @@ -954,21 +954,19 @@ if link_language == 'cpp' } endif -kconfig_external_symbols = [ - 'CONFIG_KVM', - 'CONFIG_XEN', - 'CONFIG_TPM', - 'CONFIG_SPICE', - 'CONFIG_IVSHMEM', - 'CONFIG_OPENGL', - 'CONFIG_X11', - 'CONFIG_VHOST_USER', - 'CONFIG_VHOST_VDPA', - 'CONFIG_VHOST_KERNEL', - 'CONFIG_VIRTFS', - 'CONFIG_LINUX', - 'CONFIG_PVRDMA', -] +host_kconfig = \ + ('CONFIG_TPM' in config_host ? ['CONFIG_TPM=y'] : []) + \ + ('CONFIG_SPICE' in config_host ? ['CONFIG_SPICE=y'] : []) + \ + ('CONFIG_IVSHMEM' in config_host ? ['CONFIG_IVSHMEM=y'] : []) + \ + ('CONFIG_OPENGL' in config_host ? ['CONFIG_OPENGL=y'] : []) + \ + ('CONFIG_X11' in config_host ? ['CONFIG_X11=y'] : []) + \ + ('CONFIG_VHOST_USER' in config_host ? ['CONFIG_VHOST_USER=y'] : []) + \ + ('CONFIG_VHOST_VDPA' in config_host ? ['CONFIG_VHOST_VDPA=y'] : []) + \ + ('CONFIG_VHOST_KERNEL' in config_host ? ['CONFIG_VHOST_KERNEL=y'] : []) + \ + ('CONFIG_VIRTFS' in config_host ? ['CONFIG_VIRTFS=y'] : []) + \ + ('CONFIG_LINUX' in config_host ? ['CONFIG_LINUX=y'] : []) + \ + ('CONFIG_PVRDMA' in config_host ? ['CONFIG_PVRDMA=y'] : []) + ignored = [ 'TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_ARCH' ] default_targets = 'CONFIG_DEFAULT_TARGETS' in config_host @@ -1003,7 +1001,7 @@ foreach target : target_dirs } endif - have_accel = false + accel_kconfig = [] foreach sym: accelerators if sym == 'CONFIG_TCG' or target in accelerator_targets.get(sym, []) config_target += { sym: 'y' } @@ -1011,10 +1009,10 @@ foreach target : target_dirs if sym == 'CONFIG_XEN' and have_xen_pci_passthrough config_target += { 'CONFIG_XEN_PCI_PASSTHROUGH': 'y' } endif - have_accel = true + accel_kconfig += [ sym + '=y' ] endif endforeach - if not have_accel + if accel_kconfig.length() == 0 if default_targets continue endif @@ -1068,13 +1066,6 @@ foreach target : target_dirs configuration: config_target_data)} if target.endswith('-softmmu') - base_kconfig = [] - foreach sym : kconfig_external_symbols - if sym in config_target or sym in config_host - base_kconfig += '@0@=y'.format(sym) - endif - endforeach - config_devices_mak = target + '-config-devices.mak' config_devices_mak = configure_file( input: ['default-configs/devices' / target + '.mak', 'Kconfig'], @@ -1083,7 +1074,7 @@ foreach target : target_dirs capture: true, command: [minikconf, config_host['CONFIG_MINIKCONF_MODE'], config_devices_mak, '@DEPFILE@', '@INPUT@', - base_kconfig]) + host_kconfig, accel_kconfig]) config_devices_data = configuration_data() config_devices = keyval.load(config_devices_mak)