From patchwork Wed Jul 7 13:17:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 470801 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5993630jao; Wed, 7 Jul 2021 06:22:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRvF0kyNTbAb6C+I68Ed504yOUGRMaMvwCg+AfI9cFtdNdkOYqp5mBgMbcvIrnVKIfWTk/ X-Received: by 2002:a17:906:7012:: with SMTP id n18mr24319044ejj.236.1625664162787; Wed, 07 Jul 2021 06:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625664162; cv=none; d=google.com; s=arc-20160816; b=VQqgb1hCDTvhcSfweYe4yBc9n6uoWcBIiP8mXAusEaVKq6yOdAyA3fXoClEAQT0fwP 5kJ5KuXxMybCd+b790jctYgK1yn7RFkyuw4iXCwYXtQaJyBW+Hu0m8NhBsNyQXZwnWiE zHZPsahG2Lg6CoT8ZUohagLqK6LXhTlXTCdEgbN8rIZQ5eTz9YyQhCDw22R2/GtWe8ZD nxCOD1BO1kADk+CPNm/4KpMqOHT08VLf/i5y3qnRbrNXnZvp+ollLqAGU3SkHThElcfm OwQlVyJnDMKmsxiTi5+dWK/uErKAuBun9JQzAf1Sf5qyqICUtOeNdOsWGMGRyvM+i3Cg JCXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ZHpWPobIbA03TJUKi0+wCVaCpkuPa8qHe0PT2RSzKRM=; b=Wlaf7vLsJnJH5WVdo8clBeJxpD71ea9tBg/OI0P8RDZcd+Bn5IKgVNPzoilWGv0d2m EXcWK/2FmFdF91lFnOG1Ud/WXwbITYEV1UNTBEx5E1zIJ8fhFE+NbsRZLyXGcqoouyNS 1amEMMcLLojkvJ/W7gHayJ6yXZqkKIE8RKCIdnpaqC+mEC4ysxSbKVx9o3N15sKkTRzG GwrcXKOyaoxhp2KPVIEkGtsbLaBI7SB/bQHmVbfVrSNV3Fcm5kK7HbN7QZ+6E5TzBmLY IbYXY4xIuTf7vf3f3/q+vWMfCvRbDr3yb1kMMFrAjxkWqdkFlCWhgd5NlJaMsH0D3+KR MBng== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="iOw5/qYt"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s26si345325ejr.465.2021.07.07.06.22.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Jul 2021 06:22:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="iOw5/qYt"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:40932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m17Vh-0001vy-P2 for patch@linaro.org; Wed, 07 Jul 2021 09:22:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m17R9-0002f5-Ae for qemu-devel@nongnu.org; Wed, 07 Jul 2021 09:17:59 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:56165) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m17R7-0001gO-Fw for qemu-devel@nongnu.org; Wed, 07 Jul 2021 09:17:59 -0400 Received: by mail-wm1-x336.google.com with SMTP id j34so1820440wms.5 for ; Wed, 07 Jul 2021 06:17:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZHpWPobIbA03TJUKi0+wCVaCpkuPa8qHe0PT2RSzKRM=; b=iOw5/qYtdQWVoxKs5hsyNsr1JfrmLLcWTsMqAwBE384IgVKDG9wQ/+JECuuZnFB1bu uW0SSE5owUdzK1D9jxzfQzVlFEHsksfNQCg2zkreHykrwecsnBCsleeKpFpy8OaNeGCi 7BfOblWz+xl3Mqy4gxoUVp+CRHUCj+GND/I8hw3ytYL8+KVESqJNjXmeZvhGHccflmGx vi+1aRjhqWnueKdrPWcLtDqzQ2/TJLfBefJ8Zgpq2x4NPbx35DcFxdbkcG0UpHc5ieKz dfMlg6rpzvoGYcUsB7z4Y4UsmAjIvNNvTZfxrTff9CXQp3TBAxT/3jLiSJq5Ya/kiVZx jSXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZHpWPobIbA03TJUKi0+wCVaCpkuPa8qHe0PT2RSzKRM=; b=i5a/7NS2fTP7IH888SSgtKubTIAAFIaBQh+rmTtAt3MYhI8eGReMl65pPmk8PtLdFP zJEBC2n9LAk5owmgzvFM3SjwUElfa9xEbyAMhyQh7DyZwc0YZs4+1G2oce7w22mYRXFn JvqaSy8W/hX+Pkce301FJ/ZTlZq4WZytuTH5lbCLwAEXQkx6vYBBgvC8Mh+8fWZbXsKC lwQjny8AlMYb945ovyM7R1jq8CENRnL3t0oHVcznxanaEKx0jCwZcugxiYZ91myENO4K mW1f7CLFXNQqCEFFmQIL9feOk9YOfZN7v2TvVd0rxuUAUE73LuIwUQjvN6aBDSEpIKqX DO0g== X-Gm-Message-State: AOAM533BLLg0um7LPzsJjzzGxM2m/hvrinsVVkQ0l7JZjz4QtifKnC8B J9uRwvd20W25rO5tS2S+mD2aGQ== X-Received: by 2002:a1c:4c06:: with SMTP id z6mr6881544wmf.157.1625663876198; Wed, 07 Jul 2021 06:17:56 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id d17sm19934580wro.93.2021.07.07.06.17.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 06:17:55 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 28D531FF91; Wed, 7 Jul 2021 14:17:45 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, pbonzini@redhat.com Subject: [PATCH v2 5/5] configure: allow the selection of alternate config in the build Date: Wed, 7 Jul 2021 14:17:44 +0100 Message-Id: <20210707131744.26027-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210707131744.26027-1-alex.bennee@linaro.org> References: <20210707131744.26027-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" While the default config works well enough it does end up enabling a lot of stuff. For more minimal builds we can select a different list of devices and let Kconfig work out what we want. For example: ../../configure --without-default-features \ --target-list=arm-softmmu,aarch64-softmmu \ --with-devices-aarch64=minimal will override the aarch64-softmmu default set of devices with a more minimal set of devices that just enables the virt and sbsa-ref models. Signed-off-by: Alex Bennée Cc: Philippe Mathieu-Daudé Cc: Paolo Bonzini Message-Id: <20210621152120.4465-6-alex.bennee@linaro.org> --- v2 - fix ws --- configure | 24 ++++++++++++++++++++- configs/devices/aarch64-softmmu/minimal.mak | 9 ++++++++ meson.build | 3 ++- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 configs/devices/aarch64-softmmu/minimal.mak -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/configure b/configure index 0ed451d9a0..d3942b78e3 100755 --- a/configure +++ b/configure @@ -915,6 +915,18 @@ for opt do ;; --without-default-devices) default_devices="false" ;; + --with-devices-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --with-devices-FOO option" + ;; + --with-devices-*) device_arch=${opt#--with-devices-}; + device_arch=${device_arch%%=*} + cf=$source_path/configs/devices/$device_arch-softmmu/$optarg.mak + if test -f "$cf"; then + device_archs="$device_archs $device_arch" + eval "devices_${device_arch}=\$optarg" + else + error_exit "File $cf does not exist" + fi + ;; --without-default-features) # processed above ;; --enable-gprof) gprof="yes" @@ -1764,7 +1776,8 @@ Advanced options (experts only): --without-default-features default all --enable-* options to "disabled" --without-default-devices do not include any device that is not needed to start the emulator (only use if you are including - desired devices in default-configs/devices/) + desired devices in configs/devices/) + --with-devices-ARCH=NAME override default configs/devices --enable-debug enable common debug build options --enable-sanitizers enable default sanitizers --enable-tsan enable thread sanitizer @@ -5088,6 +5101,15 @@ if test "$skip_meson" = no; then echo "# Automatically generated by configure - do not modify" > $cross echo "[properties]" >> $cross + + # unroll any custom device configs + if test -n "$device_archs"; then + for a in $device_archs; do + eval "c=\$devices_${a}" + echo "${a}-softmmu = '$c'" >> $cross + done + fi + test -z "$cxx" && echo "link_language = 'c'" >> $cross echo "[built-in options]" >> $cross echo "c_args = [${CFLAGS:+$(meson_quote $CFLAGS)}]" >> $cross diff --git a/configs/devices/aarch64-softmmu/minimal.mak b/configs/devices/aarch64-softmmu/minimal.mak new file mode 100644 index 0000000000..0ebc1dca56 --- /dev/null +++ b/configs/devices/aarch64-softmmu/minimal.mak @@ -0,0 +1,9 @@ +# +# A minimal version of the config that only supports only a few +# virtual machines. This avoids bringing in any of numerous legacy +# features from the 32bit platform (although virt still supports 32bit +# itself) +# + +CONFIG_ARM_VIRT=y +CONFIG_SBSA_REF=y diff --git a/meson.build b/meson.build index 283b4d12af..563dddd2b3 100644 --- a/meson.build +++ b/meson.build @@ -1584,9 +1584,10 @@ foreach target : target_dirs configuration: config_target_data)} if target.endswith('-softmmu') + config_input = meson.get_external_property(target, 'default') config_devices_mak = target + '-config-devices.mak' config_devices_mak = configure_file( - input: ['configs/devices' / target / 'default.mak', 'Kconfig'], + input: ['configs/devices' / target / config_input + '.mak', 'Kconfig'], output: config_devices_mak, depfile: config_devices_mak + '.d', capture: true,