From patchwork Thu Jul 8 15:17:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 471236 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp412679jao; Thu, 8 Jul 2021 08:51:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw56G4wovBFYZoWdz4VBEzwd6TegDzor9IOTH37LSd4AEVXZhPyDK8ycNRTNyTYOT+HzN0g X-Received: by 2002:a1f:ab08:: with SMTP id u8mr26422256vke.10.1625759518003; Thu, 08 Jul 2021 08:51:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625759517; cv=none; d=google.com; s=arc-20160816; b=WyCUBt0hSDcfBTN8H6gp3W8JRC6/lpJZTPPkNvQszrFD9l7tmnfkly+qIgl6b07ZKZ l39a/Btq+0Dv+8pAR1zfHBnXKFnlevZj4S057DcjzDJG15I2E/WJMsNCdhBJ/R8L+IxB 34T/lGtoW7opZoloD6kLwoVQXaPJYBqqwL3g2PnTrSexO6PcFCUE46kZ68LlESRZZ+XX XJ6/si4ji8Hd7am+Niz/Vr+sfI79mFwdCay9NK+Ubzm15q42qanRyELHWwymeOR2oShp O7A1oDC5WsykvsTvbStYg5nRjj8nc+oYqqyWC0GxVkdeSCb4LufM6oQWGlN6HOLwjXfO NWvA== 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=9xNY7jsPAk0cQr26gLtvkhbqtz1+/luMtYD5+m8UI0k=; b=zKCibcacOFJpYxNITGv4SinX/pz7Din8ll2u5XfRVpJ22s7Q9VZNK2N+K5NNjC4D4c O+yzrNnGcuPms8nZtHCyMvyfDmpfEoENOyaEP5Sp2XjH0Xzcsc7yNWWTv/kHDi/bQ6F7 0dfVXdz1M4v/hR+Iz54+egOg1dKoXDQ8MJKdGkBovAZ2kAZ6bHhfLAV6CcVFINcPecRE 2gtNBNvuo2iYusW/GHWu8MEDpLRtsFjbsG8HF3fblwB87aX0SQ9Vof9Kn3YtzwJvbYkc JpeuGlbCd6TvBc/oQeKRZpajVhteNvDDDwL3zk6Oddw9EbF50bEVO4YKr/cjMHcAf1RH 00gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=nVXcH1wG; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v191si2940038vkv.58.2021.07.08.08.51.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Jul 2021 08:51:57 -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=@gmail.com header.s=20161025 header.b=nVXcH1wG; 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=redhat.com Received: from localhost ([::1]:38926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1WJh-0000wt-Bw for patch@linaro.org; Thu, 08 Jul 2021 11:51:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1VnH-0001Ed-8P for qemu-devel@nongnu.org; Thu, 08 Jul 2021 11:18:27 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:40889) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1VnF-0008Mf-F0 for qemu-devel@nongnu.org; Thu, 08 Jul 2021 11:18:27 -0400 Received: by mail-ej1-x630.google.com with SMTP id o5so10283122ejy.7 for ; Thu, 08 Jul 2021 08:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9xNY7jsPAk0cQr26gLtvkhbqtz1+/luMtYD5+m8UI0k=; b=nVXcH1wGw/T9gUtf53Rp6prO8B/x5euHumYgn7+q6Ncva+YZylUvFcFSE3LCFUfMAX t0Sa0+ZvEdy+J8VDCEBtPC4cnLPeuMWLzPvYN8MTsMy6hQtOMkBwzap+ilCkyIAOlI3i SgFa5KLsZ0K0u1WGhuvtcPlXGRy3cshhRyfc0ay4JjJZtOU7poo2noVRaZhE/5zu1KPB UbtHnXmLQ4tOk54N8qE9m2fZW5+Kfu53n2I+24DlExYGxs+60EKBFmIEyacYwWmSEWGg 8l7F9dPVQCWAM1/BponsiqmIu11XWiVtNXQkkq0frW/AkHwK5vQMHj8pEcLBJ3JHDBco TFCw== 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:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=9xNY7jsPAk0cQr26gLtvkhbqtz1+/luMtYD5+m8UI0k=; b=ToOW5au/B2f5PWphuAehO8ESwdZde1xh4d6GlF9dRdnlrtV6aF8SlNOO9yxnUHd9JC UFJE9d3hF9yLeO5KlFpVxzFRY8GCOmAGl0LqkqKN8/o23AxCAgcSJjyDjmxaQ+ZhkHzt 6l2fqraCBWtZzmSA43Jl0PZTFXPuBq7jGL/nrENFYeVle5qXlpiW97SMwKzm9aLsJBuW GBAm6rxlUTkXEe6wEOgyBQKrXWPtaMj3FW3gdCLRiorE5p/YzKm3txzlLlCVbwYrcXPi Fpdsip5+CczSl12ptb4wfGNnu9rqXtF91GSY8JqRA6BRKfeUMsa4u6CA0uMM+0nwW096 2y9g== X-Gm-Message-State: AOAM5324TNHvt20exb9+n0AQZNdRxDLHEHHb2e7onwX9cuBlmX/R8ztf XNCD54NGDVXD07zqkXY0nmYxlEhFZ+c= X-Received: by 2002:a17:906:30d8:: with SMTP id b24mr9897282ejb.358.1625757503721; Thu, 08 Jul 2021 08:18:23 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id ak16sm1103694ejc.17.2021.07.08.08.18.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 08:18:23 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 48/48] configure: allow the selection of alternate config in the build Date: Thu, 8 Jul 2021 17:17:48 +0200 Message-Id: <20210708151748.408754-49-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210708151748.408754-1-pbonzini@redhat.com> References: <20210708151748.408754-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 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.001, 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: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée 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 Reviewed-by: Richard Henderson Message-Id: <20210707131744.26027-6-alex.bennee@linaro.org> Signed-off-by: Paolo Bonzini --- configs/devices/aarch64-softmmu/minimal.mak | 9 ++++++++ configure | 24 ++++++++++++++++++++- meson.build | 3 ++- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 configs/devices/aarch64-softmmu/minimal.mak -- 2.31.1 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/configure b/configure index 4eba89f823..85db248ac1 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 @@ -5082,6 +5095,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/meson.build b/meson.build index 71c7462e89..651c3b114b 100644 --- a/meson.build +++ b/meson.build @@ -1595,9 +1595,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,