From patchwork Tue Jul 6 10:01:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360251 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34BC1C07E96 for ; Tue, 6 Jul 2021 10:19:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BF566619A1 for ; Tue, 6 Jul 2021 10:19:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF566619A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:52564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iAi-0006Zq-Jd for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:19:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htr-0000mk-L1 for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:56 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:46847) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0hti-0002CJ-Gd for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:55 -0400 Received: by mail-wm1-x332.google.com with SMTP id k16-20020a05600c1c90b02901f4ed0fcfe7so1822660wms.5 for ; Tue, 06 Jul 2021 03:01:45 -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=RLB71cALHzaVGNk6QtPugAUl4gfKx/zT8Th8yldtu5Q=; b=tThiL1v5NqZ+a68FATmOeJ2nZR6CMHZD0tCrjcj0Co9FGEE4OHJgBqIFbvxMEu82cc aN15VzDrUC3wQr/Xu6SH8nw7Nbw/EYs4LrCZjqnz6PE57xgrbR+2usZE3uFsvKXQEOyB r2UdiW6+x25CeqdCZq16Wet4sLKBNQe787b0BJxr/XinAhhlb9p0472U4KC2Rkw2Mihm 9A1vYXuRDRf86Z1J8E7ombHd9kTNUTsYqESajFz6lEm8WGMJUEHckqkzbkfclX2oVUfd cyT9s/BxkI3HkPwHazhvZZn0F3Ja+lST2dS4uum697C59QUAZUfk78Su5lIG75r46sT5 cI9w== 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=RLB71cALHzaVGNk6QtPugAUl4gfKx/zT8Th8yldtu5Q=; b=lyn2YTuN7LwR8eDGTvzEq0IloVJoq2diOlK2CxQQWrMEGME/sAiwL1Qt7GADZtjSDi q4WbjkSir9wo4ClfsNThUhdZEwujEtunV7iOERHGOxc0OKD2E0J8kUVUD8xp6pdua8j6 PTdWpQAKy/nllzdLZFvyjOQtWH9bBp4gDEZmDbRLpCjBOD8lBdif+zJUvQLJpvRZGiYg l0DthKw+AUHFvaqMQ48HE8Am6C7HF1Y7z9V72+SVGl+rhMdDyiUcZqDrIGmgfeRrxBtn OAOysakeB/eZx6tAbvOmqv+6p7zXOjiCIkJ3/rC5Ie6f6SUR3MTzo8gpk25YysFOGcz1 NC4g== X-Gm-Message-State: AOAM533hCy1TT9D5YpNszQL7Sw31IVHVPhaTU5u4kebNB1y/NA84wAlF fpaKOYjRA3GaDnCDVkYxXhePfvf9/Do= X-Google-Smtp-Source: ABdhPJzlbvbSS9z7mC+qruyDH2fy7FE0riZAAAXq3mziLBCbM3TuvJm/p5j/DNymmikTeHF3E1eWQw== X-Received: by 2002:a05:600c:19d2:: with SMTP id u18mr3361583wmq.21.1625565703727; Tue, 06 Jul 2021 03:01:43 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:43 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 01/40] Makefile: Remove /usr/bin/env wrapper from the SHELL variable Date: Tue, 6 Jul 2021 12:01:02 +0200 Message-Id: <20210706100141.303960-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x332.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.25, 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: , Cc: Richard Zak , Thomas Huth , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth The wrapper should not be needed here (it's not the shebang line of a shell script), and it is causing trouble on Haiku where "env" resides in a different directory. Reported-by: Richard Zak Signed-off-by: Thomas Huth Reviewed-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210705082542.936856-1-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 30f19d33bb..6c36330eef 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ SRC_PATH=. # we have explicit rules for everything MAKEFLAGS += -rR -SHELL = /usr/bin/env bash -o pipefail +SHELL = bash -o pipefail # Usage: $(call quiet-command,command and args,"NAME","args to print") # This will run "command and args", and either: From patchwork Tue Jul 6 10:01:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360237 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BAE1C07E96 for ; Tue, 6 Jul 2021 10:14:30 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BB67D619A1 for ; Tue, 6 Jul 2021 10:14:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB67D619A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:35112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0i60-0003FE-Qj for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:14:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hto-0000bM-4N for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:52 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:42804) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0hti-0002Co-H0 for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:51 -0400 Received: by mail-wr1-x433.google.com with SMTP id t6so15430828wrm.9 for ; Tue, 06 Jul 2021 03:01:45 -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=WYTvUd/0OGFtsl7VV7tTq8ZwqHW9D0vhcKkcr6GsaXM=; b=atjm79B91UvIWbBp479x7sMKj+hbO3JQYX79Uypq1wDVdb3hp6fQ7JnFWido0Ow1KL QL/11qNpQmOzOktx8FtYT/vdQl0IsXQytBxWUoE8R1xZl6Lc83eFsvG0m+Yl/2ARD+NM Z6WwUfaifbUuw9aJC9hUR9CBqxidRu7bvEuR7h+9ryy/goCqleQsz7sbGIqufDH794ut /36wfLHkt3fq0C+d/CKNqFOON+B12G/llXdxEpaLsaOxdE+U37lmZmDmzp/HnykWSKQ0 Eosn/sw22VS6Kkm3zKUOISaqI7f0OH8U5B8gxyMIFJ07yAZoF0byJpEG3traEqdtlq3S VDlA== 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=WYTvUd/0OGFtsl7VV7tTq8ZwqHW9D0vhcKkcr6GsaXM=; b=olTqjZJKVG3MIjTTW0KP8oLrzRS6NI9JregUaqZKayDFMFHYY9IUJ2cYWOErzXfmw3 wQu/fQl7VtxgW9wuqvW842T/Cu4c5XknKV1xneFv6MhvILEGD02bjz2dZgfOL2dc99lA qSWIKFeCcinAe2WvTyvk65H3zQW9Tir7sDEuwEA9WWRVTK4ccTE9kzAaN2vt8TID3tYS 1QjreTULf79v1IMNsCVmgxaXYnXTJBYSMTx2Cgd3E4z7SErsHWjdTJrPUpTSZSWE1oz6 PBjbW2HUgx3aBSKRgjBWwa8UateMtt/XwbtmSxZ3AjLbxoMX9tyScvg3041QYCl3HEvQ O6NQ== X-Gm-Message-State: AOAM533VK8N+Jh91CJDNDAneYPoDuliQaBOHZEtOMgBaje2H2KETfIX/ KJOE7i/TBX6BW/c4gYzX8lzek5AZk74= X-Google-Smtp-Source: ABdhPJy4u/WmSQb0DXYRrb5CKy+SuKxGjV4TnF8YVPoVlwQqQnIIENQvGej/qLmpeoH7urg7klxvSw== X-Received: by 2002:adf:d08b:: with SMTP id y11mr20944420wrh.295.1625565704321; Tue, 06 Jul 2021 03:01:44 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 02/40] softmmu/vl: Remove obsolete comment about the "frame" parameter Date: Tue, 6 Jul 2021 12:01:03 +0200 Message-Id: <20210706100141.303960-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x433.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.25, 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: , Cc: Thomas Huth Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth The frame parameter has been removed along with the support for SDL 1.2. Fixes: 09bd7ba9f5 ("Remove deprecated -no-frame option") Signed-off-by: Thomas Huth Message-Id: <20210630163231.467987-2-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index d99e2cbdbf..cee6339580 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1062,8 +1062,6 @@ static void parse_display(const char *p) * sdl DisplayType needs hand-crafted parser instead of * parse_display_qapi() due to some options not in * DisplayOptions, specifically: - * - frame - * Already deprecated. * - ctrl_grab + alt_grab * Not clear yet what happens to them long-term. Should * replaced by something better or deprecated and dropped. From patchwork Tue Jul 6 10:01:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360177 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B494CC07E96 for ; Tue, 6 Jul 2021 10:09:26 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7967C6199E for ; Tue, 6 Jul 2021 10:09:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7967C6199E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0i17-0008Uv-DL for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:09:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hto-0000cW-DQ for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:52 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:38427) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0hti-0002DP-HL for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:52 -0400 Received: by mail-wm1-x331.google.com with SMTP id b14-20020a1c1b0e0000b02901fc3a62af78so1263826wmb.3 for ; Tue, 06 Jul 2021 03:01:45 -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=um8VQ+njAfw+9zAEGI7WhCAEvKOVGqmdmlXLxx6mEsQ=; b=EEhnl4qkIU1oOvRLouB0uEZtCBDOYsDZaj9fr2+fobOXGTeGUTffvbakU2EmjsozrU VQ3lA495V53fAMIg/jKR2sVeZ4mF0RX5uDMgFhvfynCGH/0olIs6gCaNDP2MAdHD5Xxq xNKMyd2QGHGlHgq+GyNyn/XIkudBpwu1UNVttKQCOOe8mEK8MASqLF9JcDnzOoe0LbI1 /iaooLm5qt1ACJ4EJJtnN89Ma1SLUq9qzOiBnPqrAfn/ML/GunokB0TbH58nTN3mhdWE jk0ngGP1IO9yDbvv+qtUZKm+5XNgnuWtBgW+7/rDQNhFHVzTY/2GNOcWKhkW3mQyltVz SZPg== 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=um8VQ+njAfw+9zAEGI7WhCAEvKOVGqmdmlXLxx6mEsQ=; b=r0vqWZGVvcel1G2izK5b4xutf4zcelax8OUrPxoGhwk0J4iEG0YclB0nQibPZ1bRfa snGLYU+HPw4m0iRnFez7Db22KJIcDUubUu6lqWPvyiBEtHIMxSYSMAeMDONUsQNnFWxb m3ixnUsb4TKkBSVcuKd33ysZ66RhrZ2ry8yczll9MT2aR4MoqrvCQ5EYk60UUbuamBpW EV+CfHc7iaP2vRtgNJJ3qUgq8q8x7RVW0Pra0wJyjHuaEx7uezYWrbOZdUczxNozlkKt iIh3walUaNCkP+y0zLbE/AJvaufdHnzxwtg492KVFVLq7uilLZfSOu70gMhiucfQML8l abjg== X-Gm-Message-State: AOAM532maoTQ+Ho77/emJ1z7FxcGxcF4ayP8f0Jn7KthNUZNU/+UkyRZ XN1pz/SGEWyHIhYCQzqAOjt+/9cge9c= X-Google-Smtp-Source: ABdhPJxVG6oefHfwOCkh7Sga60e9M5gBAlnIoOwQRxSFwClwa+I34RXkTfOMVflTkSSFIVqxfQSW/w== X-Received: by 2002:a1c:730d:: with SMTP id d13mr3980456wmb.129.1625565704911; Tue, 06 Jul 2021 03:01:44 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 03/40] ui: Fix the "-display sdl,window_close=..." parameter Date: Tue, 6 Jul 2021 12:01:04 +0200 Message-Id: <20210706100141.303960-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x331.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.25, 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: , Cc: Thomas Huth Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth According to the QAPI schema, there is a "-" and not a "_" between "window" and "close", and we're also talking about "window-close" in the long parameter description in qemu-options.hx, so we should make sure that we rather use the variant with the "-" by default instead of only allowing the one with the "_" here. The old way still stays enabled for compatibility, but we deprecate it, so that we can switch to a QAPIfied parameter one day more easily. Signed-off-by: Thomas Huth Message-Id: <20210630163231.467987-3-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- docs/system/deprecated.rst | 6 ++++++ qemu-options.hx | 2 +- softmmu/vl.c | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst index e2e0090878..bb624d3170 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -126,6 +126,12 @@ other options have been processed. This will either have no effect (if if they were not given. The property is therefore useless and should not be specified. +``-display sdl,window_close=...`` (since 6.1) +''''''''''''''''''''''''''''''''''''''''''''' + +Use ``-display sdl,window-close=...`` instead (i.e. with a minus instead of +an underscore between "window" and "close"). + QEMU Machine Protocol (QMP) commands ------------------------------------ diff --git a/qemu-options.hx b/qemu-options.hx index ba3ca9da1d..ae56fa4f28 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1784,7 +1784,7 @@ DEF("display", HAS_ARG, QEMU_OPTION_display, #endif #if defined(CONFIG_SDL) "-display sdl[,alt_grab=on|off][,ctrl_grab=on|off]\n" - " [,window_close=on|off][,gl=on|core|es|off]\n" + " [,window-close=on|off][,gl=on|core|es|off]\n" #endif #if defined(CONFIG_GTK) "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n" diff --git a/softmmu/vl.c b/softmmu/vl.c index cee6339580..36b761677d 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1089,7 +1089,12 @@ static void parse_display(const char *p) } else { goto invalid_sdl_args; } - } else if (strstart(opts, ",window_close=", &nextopt)) { + } else if (strstart(opts, ",window_close=", &nextopt) || + strstart(opts, ",window-close=", &nextopt)) { + if (strstart(opts, ",window_close=", NULL)) { + warn_report("window_close with an underscore is deprecated," + " please use window-close instead."); + } opts = nextopt; dpy.has_window_close = true; if (strstart(opts, "on", &nextopt)) { From patchwork Tue Jul 6 10:01:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360243 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 675EBC07E9C for ; Tue, 6 Jul 2021 10:16:45 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 268AD619A1 for ; Tue, 6 Jul 2021 10:16:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 268AD619A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0i8C-0000ik-85 for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:16:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hto-0000bo-7g for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:52 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:39445) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0hti-0002DV-Pi for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:51 -0400 Received: by mail-wm1-x32b.google.com with SMTP id l18-20020a1ced120000b029014c1adff1edso1268444wmh.4 for ; Tue, 06 Jul 2021 03:01:46 -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=xqkpOzXNDVoioE/wzcKHpmpI16VQA1KtqPlT6A2EvBI=; b=Q6PYb1UH/xRmXdZ9EuaLHe1tMHgm6hooCUsJ2NsqgLpDFPvPK169OgWOm4s4up0iuD BGK8Nl26eIT8a2zh0QEpQ8SoqX0F07dzd9bL2HN5LZHXjHZ7S9NAGRnXfPd4Z6o0Ur7N 5ftiU3ECwizikcjG8YjwoLNCsIfMKonWCNEMvOJbNftp18L26foIn2BG1XbH3B3EqLA9 2Z7rmBeqJScWw9pQLC9b9Hsyr+xZExVHIdRgcv1d8j8sU3DOockI/+bXwWZCC2yC399w ktWVIf/AMA7qCev2L9h0qtGozx3s6ZqkMQ6puuAnXVRf1mWdv7pN6D8app6L0MZlLF08 D/Gw== 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=xqkpOzXNDVoioE/wzcKHpmpI16VQA1KtqPlT6A2EvBI=; b=VBNF7v4CBiySk+6qdc5QuI+J/3A32oVzggFKJmMayuu4gGzwYsm5ctjDrxmZHO6yyb KLZAtQmbB6PwdWhimBUjTcIhehgfKUfZ7UfxorHo3+/XxLjoJAVTmqSoGH/W2RUKRbkB iUZy/A73+Go/Zwti6xuVGhzj2u3ful6ax4hTP1PxtZAl9aYilH4ESfWB88Ka/O+NVl1I k4hNCtVBiSq1PTb8d35b5UkJCoD3mN751WMaLs+pBzuQRtVMEVZ1ZD2tWFqZZQ5vpBF2 kKSuyF08lhEaHppSQquiHIPSK3bueZ4vQb3Urn6MqHKxPfgUh0yzWgBwnHj6T5WDZG33 XVyA== X-Gm-Message-State: AOAM533YlNuX5yQAfWm0T72o/sn3j+fVQIhUB2Ley+J60wxjj+4bjIy1 dWbbeEBChi6OZ3MsINRQZA/ysp4nPBI= X-Google-Smtp-Source: ABdhPJwyhqXY+ZYmdKAa7Kl/oQfvmmfl7s0hsbcpzUReRqm/p2zbfb4a1KQUSQu0tZHUgGQ8wpEYDA== X-Received: by 2002:a05:600c:4304:: with SMTP id p4mr3762183wme.43.1625565705528; Tue, 06 Jul 2021 03:01:45 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 04/40] ui: Mark the '-no-quit' option as deprecated Date: Tue, 6 Jul 2021 12:01:05 +0200 Message-Id: <20210706100141.303960-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32b.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.25, 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: , Cc: Thomas Huth , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth It's just a wrapper around the -display ...,window-close=off parameter, and the name "no-quit" is rather confusing compared to "window-close" (since there are still other means to quit the emulator), so we should rather tell our users to use the "window-close" parameter instead. While we're at it, update the documentation to state that "-no-quit" is available for GTK, too, not only for SDL. Reviewed-by: Daniel P. Berrangé Signed-off-by: Thomas Huth Message-Id: <20210630163231.467987-4-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- docs/system/deprecated.rst | 6 ++++++ qemu-options.hx | 5 +++-- softmmu/vl.c | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst index bb624d3170..70e08baff6 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -132,6 +132,12 @@ specified. Use ``-display sdl,window-close=...`` instead (i.e. with a minus instead of an underscore between "window" and "close"). +``-no-quit`` (since 6.1) +'''''''''''''''''''''''' + +The ``-no-quit`` is a synonym for ``-display ...,window-close=off`` which +should be used instead. + QEMU Machine Protocol (QMP) commands ------------------------------------ diff --git a/qemu-options.hx b/qemu-options.hx index ae56fa4f28..c862f1fa57 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1910,10 +1910,11 @@ SRST ERST DEF("no-quit", 0, QEMU_OPTION_no_quit, - "-no-quit disable SDL window close capability\n", QEMU_ARCH_ALL) + "-no-quit disable SDL/GTK window close capability (deprecated)\n", QEMU_ARCH_ALL) SRST ``-no-quit`` - Disable SDL window close capability. + Disable window close capability (SDL and GTK only). This option is + deprecated, please use ``-display ...,window-close=off`` instead. ERST DEF("sdl", 0, QEMU_OPTION_sdl, diff --git a/softmmu/vl.c b/softmmu/vl.c index 36b761677d..7dd2d72d0b 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -3237,6 +3237,8 @@ void qemu_init(int argc, char **argv, char **envp) case QEMU_OPTION_no_quit: dpy.has_window_close = true; dpy.window_close = false; + warn_report("-no-quit is deprecated, please use " + "-display ...,window-close=off instead."); break; case QEMU_OPTION_sdl: #ifdef CONFIG_SDL From patchwork Tue Jul 6 10:01:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360245 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3B69C07E96 for ; Tue, 6 Jul 2021 10:16:48 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7C092619A1 for ; Tue, 6 Jul 2021 10:16:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C092619A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0i8F-0000o0-FV for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:16:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htp-0000hI-OD for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:53 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:40628) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htj-0002Da-Ds for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:53 -0400 Received: by mail-wm1-x32d.google.com with SMTP id h18-20020a05600c3512b029020e4ceb9588so1270584wmq.5 for ; Tue, 06 Jul 2021 03:01:47 -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=H6aNxwHF6FfhNTM323fnYbaSoWg5caXXq9HNel1YVE4=; b=d+J7booXGchAryftWsorImLf0CNSQqiSs04Azw9J0lruH0QvPWn2QEIs2SRQh8Mdm4 fL/OC9QbAP9ApJLl1QEv4iqoe7NMjuazCfc0t0AB2QLSHOl3wi6ayEdPkL8Vihr6Gb3Y 87+k6dHCWJbYSq3iIbOvASuBKmlmradQccbm+0aFqS7ARYjPT53BbDAVuHrRjzWh05S4 aWDl2Vg07Ae2QyCzCr87xdSEUPMdI1PTf+bQSgoCrGC9ZMkBgFMTwY3mdQQRsmLbgHxM TuZOrRsgY6yskXb4IMLgJU+o7ti14LCmOcMhkne40btwUvDVuk12VWVFXXD5L7/SxzVw gGeQ== 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=H6aNxwHF6FfhNTM323fnYbaSoWg5caXXq9HNel1YVE4=; b=EJMhUYotrQlA+AoN5C1xk6wBKRRpjeUaXouR1EMGVJ3Zn+7Rk9NOafak2nvUzP6kEh 5nTpTNBJcOMauOC2+HfjSQ0KKPKixLVWcicf9ze2vRJU4LcJeeW2tf6UPUS+qSfWbiwL w9a3T1B+CMUqhHsio3tnbqs5gQrd7iPq/8JQX2Pusgi4hZaAcgPKkaDS4wvAufi7ZHsF fgRybqapFRPv2/4EEnxDvBpK1p73N1okA5gbzKMTBf/QEvrEfY8nci+C+qw24F1pmG6O hT9/P5L4mz/HaziceGglxQ4jD+q46OHuFRCW4EIb19+N5HW6PdGvhlHMtno8RIRqvHW9 w6qw== X-Gm-Message-State: AOAM533gK6si8KWc3XnUtZtrLwQlF/a3ctHEMVb4r8zbhGWgsJZD0XBk V0RCkdSPOawCe7wVaZsoT7u8JekcVt0= X-Google-Smtp-Source: ABdhPJzV+N/6+TKIyAKVefvMQwwW6974dcYE2SFNyArYTiM4k3Sdf6S9jZfSFR8Te8VGocWgIc6RIg== X-Received: by 2002:a1c:f206:: with SMTP id s6mr19048018wmc.102.1625565706118; Tue, 06 Jul 2021 03:01:46 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 05/40] qemu-options: Improve the documentation of the -display options Date: Tue, 6 Jul 2021 12:01:06 +0200 Message-Id: <20210706100141.303960-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32d.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.25, 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: , Cc: Thomas Huth Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth The sdl and gtk display options support more parameters than currently documented. Also the "vnc" option got lost during a recent commit, add it again. Fixes: ddc717581c ("Add display suboptions to man pages") Signed-off-by: Thomas Huth Message-Id: <20210630163231.467987-5-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- qemu-options.hx | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index c862f1fa57..8965dabc83 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1783,11 +1783,12 @@ DEF("display", HAS_ARG, QEMU_OPTION_display, "-display spice-app[,gl=on|off]\n" #endif #if defined(CONFIG_SDL) - "-display sdl[,alt_grab=on|off][,ctrl_grab=on|off]\n" - " [,window-close=on|off][,gl=on|core|es|off]\n" + "-display sdl[,alt_grab=on|off][,ctrl_grab=on|off][,gl=on|core|es|off]\n" + " [,show-cursor=on|off][,window-close=on|off]\n" #endif #if defined(CONFIG_GTK) - "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n" + "-display gtk[,full-screen=on|off][,gl=on|off][,grab-on-hover=on|off]\n" + " [,show-cursor=on|off][,window-close=on|off]\n" #endif #if defined(CONFIG_VNC) "-display vnc=[,]\n" @@ -1824,17 +1825,37 @@ SRST application. The Spice server will redirect the serial consoles and QEMU monitors. (Since 4.0) - ``sdl[,window-close=on|off][,gl=on|core|es|off]`` - + ``sdl`` Display video output via SDL (usually in a separate graphics window; see the SDL documentation for other possibilities). + Valid parameters are: - ``gtk[,grab-on-hover=on|off][,gl=on|off]`` + ``alt_grab=on|off`` : Use Control+Alt+Shift-g to toggle mouse grabbing + + ``ctrl_grab=on|off`` : Use Right-Control-g to toggle mouse grabbing + + ``gl=on|off|core|es`` : Use OpenGL for displaying + + ``show-cursor=on|off`` : Force showing the mouse cursor + + ``window-close=on|off`` : Allow to quit qemu with window close button + + ``gtk`` Display video output in a GTK window. This interface provides drop-down menus and other UI elements to configure and control - the VM during runtime. + the VM during runtime. Valid parameters are: - ``curses [,charset=]`` + ``full-screen=on|off`` : Start in fullscreen mode + + ``gl=on|off`` : Use OpenGL for displaying + + ``grab-on-hover=on|off`` : Grab keyboard input on mouse hover + + ``show-cursor=on|off`` : Force showing the mouse cursor + + ``window-close=on|off`` : Allow to quit qemu with window close button + + ``curses[,charset=]`` Display video output via curses. For graphics device models which support a text mode, QEMU can display this output using a curses/ncurses interface. Nothing is displayed when the graphics @@ -1845,11 +1866,14 @@ SRST ``charset=CP850`` for IBM CP850 encoding. The default is ``CP437``. - ``egl-headless[,rendernode]`` + ``egl-headless[,rendernode=]`` Offload all OpenGL operations to a local DRI device. For any graphical display, this display needs to be paired with either VNC or SPICE displays. + ``vnc=`` + Start a VNC server on display + ``none`` Do not display video output. The guest will still see an emulated graphics card, but its output will not be displayed to @@ -1857,9 +1881,6 @@ SRST that it only affects what is done with video output; -nographic also changes the destination of the serial and parallel port data. - - - ERST DEF("nographic", 0, QEMU_OPTION_nographic, From patchwork Tue Jul 6 10:01:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360255 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A33C6C07E96 for ; Tue, 6 Jul 2021 10:21:08 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4897F61103 for ; Tue, 6 Jul 2021 10:21:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4897F61103 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iCR-00024x-D1 for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:21:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htp-0000gI-Cf for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:53 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:40630) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htk-0002Dv-39 for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:53 -0400 Received: by mail-wm1-x32f.google.com with SMTP id h18-20020a05600c3512b029020e4ceb9588so1270605wmq.5 for ; Tue, 06 Jul 2021 03:01:47 -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=DltMAJn7Q0ptmA1Qj+5OdFlt7D/C8DwnHW3YDzOE8GQ=; b=lmVyUanRz8APjx7NuAy7WF3JOlcFFC/VHj2apOy9X1htN+ZxomRXRAKKIDQW9OIGvp 4jUBqIlaZ5qcmbxwfqJxQqAdmgxY3FOTkguJkiwshnI+qLh7O28e6nvXe7LNAcgVismu hCnmnjRY2OCt4ZhfT1uzEJV+4HesFnmSws6zL2+uKQwXj80581awgKMHH0j535qflBNr bbgAC19xfRu1noVISj/r0pkmXD7O2AguYiD/o1Wm7ixTkQmwg6tN8+Pfpuq707J78ZqQ cwPdtToj3qlGKd+IrVjk55p0QkZkTYgU5luXzeoJpNi9zeJ4Zjj24KUQj2FPcFcegiDF nfog== 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=DltMAJn7Q0ptmA1Qj+5OdFlt7D/C8DwnHW3YDzOE8GQ=; b=M5WTkoGivY1PiLb5tQQ1RxKewzLiNkENBn/ghFGzIJAj/6gajNRlGlTgqafQkLU/GZ ySa/FNIQ5aYrotEUSPhNVuWWpN2WO2j5Ln0eCzHGMRjzT64gggv3DXkocTHUzHzkmpsQ 6LbrX1E/OPKIIhH+AjcydH1y3t7cYDmgL8CSHxNOzkLr19qXGe2hLcN02f7HD/rOOxM1 E3AP1WIVMxD4bXSzYOgQxpEJXk2LDxM6prJfKLkYjf+VOMInFMOTpGNWBS8021nW9CRJ Wvneru4MPkDQkX/xNT5t1OPuTJAEdYpzx2QTdkpXkfNFstcshSUwQSh8YfiYzU1dUHfW eKtw== X-Gm-Message-State: AOAM530ubZgeMIge70ketJOcYeJTPb5UGNEZr6530ZkY3aol9Z6yP+lp cGcMAoBSecFwPUqGBMWx75BQ05GCx60= X-Google-Smtp-Source: ABdhPJwajgVSt+KFTYepEufz+PjGwLHy14MuBa9VYqOL+Sj881C3ZgXv57J8jqnGDvNW9vPjBDjjOw== X-Received: by 2002:a7b:c218:: with SMTP id x24mr3841120wmi.177.1625565706784; Tue, 06 Jul 2021 03:01:46 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:46 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 06/40] coverity-scan: Remove lm32 / unicore32 targets Date: Tue, 6 Jul 2021 12:01:07 +0200 Message-Id: <20210706100141.303960-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32f.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.25, 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: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé lm32 has been removed in commit 9d49bcf6992 ("Drop the deprecated lm32 target"), and unicore32 in 4369223902a ("Drop the deprecated unicore32 target"). Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210619091342.3660495-2-f4bug@amsat.org> Signed-off-by: Paolo Bonzini --- scripts/coverity-scan/COMPONENTS.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/coverity-scan/COMPONENTS.md b/scripts/coverity-scan/COMPONENTS.md index 02a3447dab..183f26a32c 100644 --- a/scripts/coverity-scan/COMPONENTS.md +++ b/scripts/coverity-scan/COMPONENTS.md @@ -21,9 +21,6 @@ hppa i386 ~ (/qemu)?((/include)?/hw/i386/.*|/target/i386/.*|/hw/intc/[^/]*apic[^/]*\.c) -lm32 - ~ (/qemu)?((/include)?/hw/lm32/.*|/target/lm32/.*|/hw/.*/(milkymist|lm32).*) - m68k ~ (/qemu)?((/include)?/hw/m68k/.*|/target/m68k/.*|(/include)?/hw(/.*)?/mcf.*) @@ -60,9 +57,6 @@ tilegx tricore ~ (/qemu)?((/include)?/hw/tricore/.*|/target/tricore/.*) -unicore32 - ~ (/qemu)?((/include)?/hw/unicore32/.*|/target/unicore32/.*) - 9pfs ~ (/qemu)?(/hw/9pfs/.*|/fsdev/.*) From patchwork Tue Jul 6 10:01:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360249 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18BFDC07E96 for ; Tue, 6 Jul 2021 10:19:19 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id CD45B61483 for ; Tue, 6 Jul 2021 10:19:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD45B61483 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:52390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iAg-0006T8-0W for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:19:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htp-0000hi-SN for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:53 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:36726) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htk-0002Eb-Qo for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:53 -0400 Received: by mail-wm1-x32f.google.com with SMTP id t14-20020a05600c198eb029020c8aac53d4so3282405wmq.1 for ; Tue, 06 Jul 2021 03:01:48 -0700 (PDT) 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=AST6UUW8k7XqSMCzb7jJhe8TYd/yVI6QztYJ6QIq+q8=; b=imduceKoWO8813UgYR6gM/c/DiRQl+Emr50shCliFWnOo3mYIK6WfGDpiUVfgdPSlB OMfwwQrtoX0UpDLZ3Txa6ZP74Plt/0XfmjBoujxmUGHDiOdAixZqbxfDDA4K1XjMLZmw KysdauNPJ3FduqAW6qRYhv1VzsSwz34tncYrIxWtQTXlvV5HaaHBFjRD3O6pOgtTaoYs VkHcLeyL0wOOfcsEItUta7DJWBaddGneslxPnfak2F4RzCuZ4z5sy80Ye7thC7GsvwqZ Uv+QPmFBVnXY1caAbPQpe7Qk/V2bLV+b4+XtSi9Vy23csJINbZK8dxxTy3BSEYZ+dEAC SS4g== 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=AST6UUW8k7XqSMCzb7jJhe8TYd/yVI6QztYJ6QIq+q8=; b=fAJBExiwEIQ/uCn/FjrbCmh0eDlw9LAgGydmvPV5LeUe5+YfFztIcRGU6ThTHhku0B 3CWZ6h3ydetGtBdIsgHzvrstrgxlMLqf6aa3xGeqgW+cj4w3ds/O4knyT74Gb/hK9cw/ Duzwlqrd6CkmmVIzoK7YPLKHY5DXkZcTg3FGQ2VTwDXj/pGSj/0KKGObRfpT9n7dtO/o RrfXtfPpITBfvI0fuC6XRpFWUohxXJ8QK/a8XRkMQKyMjGvGEved6sMuxKnOfR0lh2ZC eBPHoZ2rjIsBg/HNtkNWrpchEl0ISnFYBG4xhuZTCiloVyjD6iJCrxlzKC3X8/cCSx5E f3zQ== X-Gm-Message-State: AOAM530SA51MJfver47Xdm4KFjjp/LpAbRPu+0Z+Eps/Vv2ijslI/k1N TyzmYVX0vi9qMSwfjcTzHRYpr6TU4PI= X-Google-Smtp-Source: ABdhPJwHwiqO/nraKXwAemz1ohic04gvLt3SutX1Rpz1uBVVAkP94u6VKv3IkMvM9gfOkD2s82qd6A== X-Received: by 2002:a05:600c:3b0b:: with SMTP id m11mr19780256wms.162.1625565707350; Tue, 06 Jul 2021 03:01:47 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 07/40] coverity-scan: switch to vpath build Date: Tue, 6 Jul 2021 12:01:08 +0200 Message-Id: <20210706100141.303960-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32f.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.25, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This is the patch that has been running on the coverity cronjob for a few weeks now. Signed-off-by: Paolo Bonzini --- scripts/coverity-scan/run-coverity-scan | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/coverity-scan/run-coverity-scan b/scripts/coverity-scan/run-coverity-scan index 6eefb4b558..7395bbfad4 100755 --- a/scripts/coverity-scan/run-coverity-scan +++ b/scripts/coverity-scan/run-coverity-scan @@ -380,15 +380,17 @@ export PATH="$TOOLBIN:$PATH" cd "$SRCDIR" -echo "Doing make distclean..." -make distclean +echo "Nuking build directory..." +rm -rf +build +mkdir +build +cd +build echo "Configuring..." # We configure with a fixed set of enables here to ensure that we don't # accidentally reduce the scope of the analysis by doing the build on # the system that's missing a dependency that we need to build part of # the codebase. -./configure --disable-modules --enable-sdl --enable-gtk \ +../configure --disable-modules --enable-sdl --enable-gtk \ --enable-opengl --enable-vte --enable-gnutls \ --enable-nettle --enable-curses --enable-curl \ --audio-drv-list=oss,alsa,sdl,pa --enable-virtfs \ From patchwork Tue Jul 6 10:01:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360273 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5AFDC07E96 for ; Tue, 6 Jul 2021 10:26:45 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8E17A619AA for ; Tue, 6 Jul 2021 10:26:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E17A619AA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iHs-00073O-K4 for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:26:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htu-0000tb-3b for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:58 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:44752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htl-0002F2-BG for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:57 -0400 Received: by mail-wr1-x42c.google.com with SMTP id t15so22009030wry.11 for ; Tue, 06 Jul 2021 03:01:48 -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=XZL4YZ4Qjo2HUlaagvRlRs9NR2x4tz1U3FKjUbVWYIk=; b=Ce6vDQdyzRLDwH6O1f1YmpI/pit9HCOErC9K3O/id1cBF4Wr4Bq93gvQ4WtHrQ+fzW upryTkZBZyZtrp1yMxjTa8hWwpgHYxh03usXB0AetOGQJqK6WtOHzrAAJxDyHUM2ewo6 1ol7fERP/0KLEk28kR+2ULjwVHDrQwXk8WLXdqIYT81ztFaFwvKDikfDFycdoVt+KxXj kOBvRaRwpOreZYxL+IXEblSDCNU3xqfOlje9oY0i0jJTChim70PYdjbPuHnoRcU/D5Ty QlguMLPxUDTy8Z1im6vAYucyE3LK8B2zQUcvw/ZV9keAWBeKbao9T5hjudZ7Q1DuVeKb Nmgw== 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=XZL4YZ4Qjo2HUlaagvRlRs9NR2x4tz1U3FKjUbVWYIk=; b=djl4CntYlvQG5HZGdiwQUhHHeBw1sr/Td/2uRcmhUEWRrFNo2wv3V1072bsrb8XTEq Yj5na/ktLp8De92mV8L6dBpqZaTnsYbJNRIL3wtW7rRT98yNc5d/xbZ6hgkG0jfYr7nQ SUQMoHIiQjrB4U1Dk6GPFDEWJa75dBHfZfHQca76cU1tLlfkRZh7Du0SQaxZXM7SnSyX /iQXDYEEKCY1lgX6E8bIVpia+NqFBKz0U9Y3KAKrT/uz1tPHzJCI2yjPjoMpQbfc3KYs gqz9dShyF8SdNdZnter1R27HtlNT2L+FgH9iVNBLyTs3RagDHNI34AEEfmrrE1GNBGgL oeSA== X-Gm-Message-State: AOAM5334XUxoW2F/By6qyulRzAAeZOcpt1WFah8I1bpCbGG/pmPYkcBa 1U+TCyM9sNUPFNYFFAZp2NV7wJDJBoQ= X-Google-Smtp-Source: ABdhPJzsPnZAoaAz97MY4Iyb2HlnjS5tWvse/G6Cpcg8XFfjbMj1vig7IcAYUP4H5FUDMlbygwtYbA== X-Received: by 2002:a5d:4f10:: with SMTP id c16mr20720972wru.3.1625565708063; Tue, 06 Jul 2021 03:01:48 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 08/40] target/i386: Declare constants for XSAVE offsets Date: Tue, 6 Jul 2021 12:01:09 +0200 Message-Id: <20210706100141.303960-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x42c.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.25, 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: , Cc: David Edmondson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: David Edmondson Declare and use manifest constants for the XSAVE state component offsets. Signed-off-by: David Edmondson Message-Id: <20210705104632.2902400-2-david.edmondson@oracle.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index f7fa5870b1..aedb8f2e01 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1305,6 +1305,22 @@ typedef struct XSavePKRU { uint32_t padding; } XSavePKRU; +#define XSAVE_FCW_FSW_OFFSET 0x000 +#define XSAVE_FTW_FOP_OFFSET 0x004 +#define XSAVE_CWD_RIP_OFFSET 0x008 +#define XSAVE_CWD_RDP_OFFSET 0x010 +#define XSAVE_MXCSR_OFFSET 0x018 +#define XSAVE_ST_SPACE_OFFSET 0x020 +#define XSAVE_XMM_SPACE_OFFSET 0x0a0 +#define XSAVE_XSTATE_BV_OFFSET 0x200 +#define XSAVE_AVX_OFFSET 0x240 +#define XSAVE_BNDREG_OFFSET 0x3c0 +#define XSAVE_BNDCSR_OFFSET 0x400 +#define XSAVE_OPMASK_OFFSET 0x440 +#define XSAVE_ZMM_HI256_OFFSET 0x480 +#define XSAVE_HI16_ZMM_OFFSET 0x680 +#define XSAVE_PKRU_OFFSET 0xa80 + typedef struct X86XSaveArea { X86LegacyXSaveArea legacy; X86XSaveHeader header; @@ -1325,19 +1341,19 @@ typedef struct X86XSaveArea { XSavePKRU pkru_state; } X86XSaveArea; -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, avx_state) != 0x240); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, avx_state) != XSAVE_AVX_OFFSET); QEMU_BUILD_BUG_ON(sizeof(XSaveAVX) != 0x100); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, bndreg_state) != 0x3c0); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, bndreg_state) != XSAVE_BNDREG_OFFSET); QEMU_BUILD_BUG_ON(sizeof(XSaveBNDREG) != 0x40); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, bndcsr_state) != 0x400); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, bndcsr_state) != XSAVE_BNDCSR_OFFSET); QEMU_BUILD_BUG_ON(sizeof(XSaveBNDCSR) != 0x40); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, opmask_state) != 0x440); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, opmask_state) != XSAVE_OPMASK_OFFSET); QEMU_BUILD_BUG_ON(sizeof(XSaveOpmask) != 0x40); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, zmm_hi256_state) != 0x480); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, zmm_hi256_state) != XSAVE_ZMM_HI256_OFFSET); QEMU_BUILD_BUG_ON(sizeof(XSaveZMM_Hi256) != 0x200); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, hi16_zmm_state) != 0x680); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, hi16_zmm_state) != XSAVE_HI16_ZMM_OFFSET); QEMU_BUILD_BUG_ON(sizeof(XSaveHi16_ZMM) != 0x400); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, pkru_state) != 0xA80); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, pkru_state) != XSAVE_PKRU_OFFSET); QEMU_BUILD_BUG_ON(sizeof(XSavePKRU) != 0x8); typedef enum TPRAccess { From patchwork Tue Jul 6 10:01:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360257 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B11BBC07E96 for ; Tue, 6 Jul 2021 10:21:39 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4A688619A2 for ; Tue, 6 Jul 2021 10:21:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4A688619A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:32868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iCw-0003pV-95 for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:21:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htr-0000lP-6Q for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:55 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:53910) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htm-0002Fg-2I for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:54 -0400 Received: by mail-wm1-x32c.google.com with SMTP id w13so13163117wmc.3 for ; Tue, 06 Jul 2021 03:01:49 -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=InVZ8IiIw0iRk9bXE80zEbxFF9vVoh/T2t00rLx4awA=; b=rSqIDFcKM0LWC9IsBs1eZiYM55Idj601G4VhRiNBFObgtgjns6YjtyMJclvuShczCS rVW740FIrje9W7/eGvOcl7kneSYZE+8WcFWNXTXDk05X5SeknqI/nmmnhzp21Hoxxf0p ZRKBnHcsJxLP2/8tSNwk7J/5vWxS5XDC2bgtoEEHbC1bD+3VOO5fPIZl1TMFnXQAnfEn rJRSF6w2jpdHaTIGgYYV7875lr3uTLOp7rg/i8Fws17HwwgEtZvNA+Re0kSnzy6EjGHz jvk07Dr4n9cfNpU8/4EO+B3cs5uL4rr/1n8OuCPs957q8KMZ/dbfLRaZP9tZlC7kUNxB x/YQ== 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=InVZ8IiIw0iRk9bXE80zEbxFF9vVoh/T2t00rLx4awA=; b=KMgUXeamevreHjdxpK/Y2k0ySyF1v4lCcaRE9UDJyb9XMWcVUaao1TREb/NC0oHJ4W jH9dvuG3SqRFLLqc+jBG8kkgYXIAAxMKta2hP8R6PIfAMST9zv649fXKqjXSATLkU9ub mxdnddFRLhjUBFV4cyibGJeJJ6lo6UQKJZBXLYrN7ScuSpWavG//T86kqIqlpORRQ2Qr /EN5UYSlP8zE+bIreBUnrTzEbIgZrXorqHDx97ND58pO5z4GUVEYfLc6WFa16Kl5WcMc QGgNct5O6pbrQojCfvpiuwGvhlGPCjQM5WrFEou6fYG1bOvnOC+fok4bNwpxHjXB13r/ j1vQ== X-Gm-Message-State: AOAM531uFOiHqbDcwil+GTSwaOBJD5QS9+ScFZzbJj7a40omYkfIBPF/ mbPBDh7sfZoff/CmcanZZylQ7g1DOIk= X-Google-Smtp-Source: ABdhPJxRXctQbUMKqAvk2MmZj7qNsN77fA2C0ewoek0B7q2cLvh0ogJCc1WCBW+BZNeD0xKBqhT+0g== X-Received: by 2002:a1c:ac87:: with SMTP id v129mr3964548wme.45.1625565708652; Tue, 06 Jul 2021 03:01:48 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:48 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 09/40] target/i386: Consolidate the X86XSaveArea offset checks Date: Tue, 6 Jul 2021 12:01:10 +0200 Message-Id: <20210706100141.303960-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32c.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.25, 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: , Cc: David Edmondson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: David Edmondson Rather than having similar but different checks in cpu.h and kvm.c, move them all to cpu.h. Message-Id: <20210705104632.2902400-3-david.edmondson@oracle.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 22 +++++++++++++++------- target/i386/kvm/kvm.c | 39 --------------------------------------- 2 files changed, 15 insertions(+), 46 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index aedb8f2e01..6590ad6391 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1341,21 +1341,29 @@ typedef struct X86XSaveArea { XSavePKRU pkru_state; } X86XSaveArea; -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, avx_state) != XSAVE_AVX_OFFSET); QEMU_BUILD_BUG_ON(sizeof(XSaveAVX) != 0x100); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, bndreg_state) != XSAVE_BNDREG_OFFSET); QEMU_BUILD_BUG_ON(sizeof(XSaveBNDREG) != 0x40); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, bndcsr_state) != XSAVE_BNDCSR_OFFSET); QEMU_BUILD_BUG_ON(sizeof(XSaveBNDCSR) != 0x40); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, opmask_state) != XSAVE_OPMASK_OFFSET); QEMU_BUILD_BUG_ON(sizeof(XSaveOpmask) != 0x40); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, zmm_hi256_state) != XSAVE_ZMM_HI256_OFFSET); QEMU_BUILD_BUG_ON(sizeof(XSaveZMM_Hi256) != 0x200); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, hi16_zmm_state) != XSAVE_HI16_ZMM_OFFSET); QEMU_BUILD_BUG_ON(sizeof(XSaveHi16_ZMM) != 0x400); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, pkru_state) != XSAVE_PKRU_OFFSET); QEMU_BUILD_BUG_ON(sizeof(XSavePKRU) != 0x8); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.fcw) != XSAVE_FCW_FSW_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.ftw) != XSAVE_FTW_FOP_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.fpip) != XSAVE_CWD_RIP_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.fpdp) != XSAVE_CWD_RDP_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.mxcsr) != XSAVE_MXCSR_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.fpregs) != XSAVE_ST_SPACE_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.xmm_regs) != XSAVE_XMM_SPACE_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, avx_state) != XSAVE_AVX_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, bndreg_state) != XSAVE_BNDREG_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, bndcsr_state) != XSAVE_BNDCSR_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, opmask_state) != XSAVE_OPMASK_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, zmm_hi256_state) != XSAVE_ZMM_HI256_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, hi16_zmm_state) != XSAVE_HI16_ZMM_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, pkru_state) != XSAVE_PKRU_OFFSET); + typedef enum TPRAccess { TPR_ACCESS_READ, TPR_ACCESS_WRITE, diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 04e4ec063f..3ab1d71775 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -2466,45 +2466,6 @@ static int kvm_put_fpu(X86CPU *cpu) return kvm_vcpu_ioctl(CPU(cpu), KVM_SET_FPU, &fpu); } -#define XSAVE_FCW_FSW 0 -#define XSAVE_FTW_FOP 1 -#define XSAVE_CWD_RIP 2 -#define XSAVE_CWD_RDP 4 -#define XSAVE_MXCSR 6 -#define XSAVE_ST_SPACE 8 -#define XSAVE_XMM_SPACE 40 -#define XSAVE_XSTATE_BV 128 -#define XSAVE_YMMH_SPACE 144 -#define XSAVE_BNDREGS 240 -#define XSAVE_BNDCSR 256 -#define XSAVE_OPMASK 272 -#define XSAVE_ZMM_Hi256 288 -#define XSAVE_Hi16_ZMM 416 -#define XSAVE_PKRU 672 - -#define XSAVE_BYTE_OFFSET(word_offset) \ - ((word_offset) * sizeof_field(struct kvm_xsave, region[0])) - -#define ASSERT_OFFSET(word_offset, field) \ - QEMU_BUILD_BUG_ON(XSAVE_BYTE_OFFSET(word_offset) != \ - offsetof(X86XSaveArea, field)) - -ASSERT_OFFSET(XSAVE_FCW_FSW, legacy.fcw); -ASSERT_OFFSET(XSAVE_FTW_FOP, legacy.ftw); -ASSERT_OFFSET(XSAVE_CWD_RIP, legacy.fpip); -ASSERT_OFFSET(XSAVE_CWD_RDP, legacy.fpdp); -ASSERT_OFFSET(XSAVE_MXCSR, legacy.mxcsr); -ASSERT_OFFSET(XSAVE_ST_SPACE, legacy.fpregs); -ASSERT_OFFSET(XSAVE_XMM_SPACE, legacy.xmm_regs); -ASSERT_OFFSET(XSAVE_XSTATE_BV, header.xstate_bv); -ASSERT_OFFSET(XSAVE_YMMH_SPACE, avx_state); -ASSERT_OFFSET(XSAVE_BNDREGS, bndreg_state); -ASSERT_OFFSET(XSAVE_BNDCSR, bndcsr_state); -ASSERT_OFFSET(XSAVE_OPMASK, opmask_state); -ASSERT_OFFSET(XSAVE_ZMM_Hi256, zmm_hi256_state); -ASSERT_OFFSET(XSAVE_Hi16_ZMM, hi16_zmm_state); -ASSERT_OFFSET(XSAVE_PKRU, pkru_state); - static int kvm_put_xsave(X86CPU *cpu) { CPUX86State *env = &cpu->env; From patchwork Tue Jul 6 10:01:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360265 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5D12C07E96 for ; Tue, 6 Jul 2021 10:23:44 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 60D0761103 for ; Tue, 6 Jul 2021 10:23:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 60D0761103 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iEx-0001Db-FL for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:23:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htr-0000ln-AO for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:55 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:45752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htm-0002Fk-JL for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:54 -0400 Received: by mail-wr1-x434.google.com with SMTP id i8so12482274wrp.12 for ; Tue, 06 Jul 2021 03:01:50 -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=V9YqSZAGqP+3D3GedI76qhcdO4Chs2UmehkI6MPdubc=; b=kiS3ovD6qb6+o3BBBQgBBNeyno7al6+nixmMUE8/yLBx4J9JGNIGYGgdB9X3faPBVj 1fYzjCZzovWMW/0kJkLAX3nuk/42wZnLu1CkiYDRY16QngzYk6xSrtGqHFXUdiNTOPXe 9URjExfsukNnM46yiRiYcuTdZmJ/l8/nrsoBwXmLIBKLgsfyF9wNe4nONy4bkE3Jejuz YunI3qo8IsYelMvThBZ+XvzfDBEGo9IXb24eNgRDI00Bx6t6tLEnY1g636Dhl2yUeDYQ QLGGEhL3ILh6jPG0WubTbVFDiuYKny7bymV2y1EZMmUNwYe6MdE1jC5xQoUuTC/yWh0C Ch9A== 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=V9YqSZAGqP+3D3GedI76qhcdO4Chs2UmehkI6MPdubc=; b=Xpv3LPPLV5vm6F44afLkuiy3u3GFI4tFXggwuZPoTmH4WbBuS1h/FMRDmUXjG4Q1hc dqD9JaA2m7Uli6lyYjy74GDjyWyCAfWZPVjpaurff5P1fl7fOr4U+tGYdQn1V9q8ZzwR uxWu1N32eLwI56SjIsnZWadGE2uO5aEkeae9M0uF9Hy47xGtpSZkm7esQnLjU6TvQ6a1 t55wp2IqQ3V0nooeppQOF2LVaE6pDI950UfQGBdbkIWcWRMXOrci5EjbSwBXcp+Xo+ab 0I40lFFm0aua62XVC5Mc53RvNpShXykMkb6VUeyND7JsbLJo+rEarDcKGcMMk/UP3VVg WH5Q== X-Gm-Message-State: AOAM532q3/oj18Qz19Te7v1nbdmeSt56ezd9vGCxPZgd593PnmrXBZtc KnF0VDBJ4cEq/bdT1siY9C5ahFJnTPU= X-Google-Smtp-Source: ABdhPJxcvMu6AtyKry7ssCufDNxMZtsrL4Dzy2eZHF8MZwtRtPLF6oc60hBnwtuvH+pJT6Mh/JnWxg== X-Received: by 2002:a5d:5985:: with SMTP id n5mr14707147wri.63.1625565709280; Tue, 06 Jul 2021 03:01:49 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:49 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 10/40] target/i386: Clarify the padding requirements of X86XSaveArea Date: Tue, 6 Jul 2021 12:01:11 +0200 Message-Id: <20210706100141.303960-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x434.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.25, 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: , Cc: David Edmondson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: David Edmondson Replace the hard-coded size of offsets or structure elements with defined constants or sizeof(). Signed-off-by: David Edmondson Message-Id: <20210705104632.2902400-4-david.edmondson@oracle.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 6590ad6391..92f9ca264c 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1329,7 +1329,13 @@ typedef struct X86XSaveArea { /* AVX State: */ XSaveAVX avx_state; - uint8_t padding[960 - 576 - sizeof(XSaveAVX)]; + + /* Ensure that XSaveBNDREG is properly aligned. */ + uint8_t padding[XSAVE_BNDREG_OFFSET + - sizeof(X86LegacyXSaveArea) + - sizeof(X86XSaveHeader) + - sizeof(XSaveAVX)]; + /* MPX State: */ XSaveBNDREG bndreg_state; XSaveBNDCSR bndcsr_state; From patchwork Tue Jul 6 10:01:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360263 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09EE6C07E96 for ; Tue, 6 Jul 2021 10:23:16 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 91B88619AF for ; Tue, 6 Jul 2021 10:23:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 91B88619AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iEU-0007tb-Nv for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:23:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htr-0000mi-Jd for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:55 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:37486) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htn-0002Fo-CD for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:55 -0400 Received: by mail-wm1-x32a.google.com with SMTP id r9-20020a7bc0890000b02901f347b31d55so1280543wmh.2 for ; Tue, 06 Jul 2021 03:01:50 -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=XvwNkjs/1U6S6heNgXVDLARM2koZgG1qtNjsRM8HeCY=; b=rz3Le0ZECuxykPJrGcbm5jvcC0hkFQdEPzhCek4BnBnKFTK7qRRq5a8hLg+2C2/owL GR9qn06TZTnexGetVoWfxYaSqe1eCSV/h84dWJSOCnp4jC0FPHEyszqE6e6LDAEOGRqo viD/xxIWL5dN3ZaYqU1YiNwV2CeOJDxcXeh3XLNTojtS6Gb1y8l6ULRNeeJPBkfgFvIX WpVZ56hCRz7okfs5AmdCUKyFmiMh2zuManPn9EDkzBvd1BKLPHcDadQlABzzzU+OUyv1 LFmWxpYLr1ZbdmDgYqEqw1x91EtS3im9imbWZddcy472wosqImuxO8mAA7IqvqfhZdU6 n0MQ== 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=XvwNkjs/1U6S6heNgXVDLARM2koZgG1qtNjsRM8HeCY=; b=IUxeyEI3jSM/wVNnBpTn0LvamtPr+x13woYqFyUZo6oMkzZze2Xwwwx89zxH/cAexC LG6Qos3xyY9Wn9S+LnsjIT+cITqYICWgIWnevkajkRvYYiTaXzgZVYtEB5eI4CuUaWzE NsMhBeRvXXF1Bx3J6k+ieyvvao5ax5lCmCVm8oUYdJE3PplKvE5Ijp5ID8GcU78W1vXj Ft/1a2US+Zt7ygPCsvuGMtzFztVVomjgxxVpLLgL9L9DfzoQ4lS54h6GLjHCReFoJPwi rr5RH0fZzSTxjI9t9kxLXozGI3ictqvboNJlEXJri+FbwfSEVYAAgpP5PgSZN7Bk+hLz mVQg== X-Gm-Message-State: AOAM531oVKglfryt9W5VfX+Jwi/MNVv7/n1/IOYm2pDoN54E5TjOJJiy JR+19/YQXd046fN/0z5f1dsTB3/6rUI= X-Google-Smtp-Source: ABdhPJx2pDjzcdndo3moii8BWqiSMhHViEVdGIsUWf1blgf0c9xJfsd84jckpT8ljhMufR0H/fLy3g== X-Received: by 2002:a05:600c:3648:: with SMTP id y8mr19748624wmq.174.1625565709851; Tue, 06 Jul 2021 03:01:49 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:49 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 11/40] target/i386: Pass buffer and length to XSAVE helper Date: Tue, 6 Jul 2021 12:01:12 +0200 Message-Id: <20210706100141.303960-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32a.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.25, 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: , Cc: David Edmondson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: David Edmondson In preparation for removing assumptions about XSAVE area offsets, pass a buffer pointer and buffer length to the XSAVE helper functions. Signed-off-by: David Edmondson Message-Id: <20210705104632.2902400-5-david.edmondson@oracle.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 5 +++-- target/i386/hvf/hvf.c | 3 ++- target/i386/hvf/x86hvf.c | 19 ++++++++----------- target/i386/kvm/kvm.c | 13 +++++++------ target/i386/xsave_helper.c | 17 +++++++++-------- 5 files changed, 29 insertions(+), 28 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 92f9ca264c..ada2941c6e 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1667,6 +1667,7 @@ typedef struct CPUX86State { uint64_t apic_bus_freq; #if defined(CONFIG_KVM) || defined(CONFIG_HVF) void *xsave_buf; + uint32_t xsave_buf_len; #endif #if defined(CONFIG_KVM) struct kvm_nested_state *nested_state; @@ -2227,8 +2228,8 @@ void x86_cpu_dump_local_apic_state(CPUState *cs, int flags); /* cpu.c */ bool cpu_is_bsp(X86CPU *cpu); -void x86_cpu_xrstor_all_areas(X86CPU *cpu, const X86XSaveArea *buf); -void x86_cpu_xsave_all_areas(X86CPU *cpu, X86XSaveArea *buf); +void x86_cpu_xrstor_all_areas(X86CPU *cpu, const void *buf, uint32_t buflen); +void x86_cpu_xsave_all_areas(X86CPU *cpu, void *buf, uint32_t buflen); void x86_update_hflags(CPUX86State* env); static inline bool hyperv_feat_enabled(X86CPU *cpu, int feat) diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index 346dbcc26f..e62e8df028 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -267,7 +267,8 @@ int hvf_arch_init_vcpu(CPUState *cpu) wvmcs(cpu->hvf->fd, VMCS_TPR_THRESHOLD, 0); x86cpu = X86_CPU(cpu); - x86cpu->env.xsave_buf = qemu_memalign(4096, 4096); + x86cpu->env.xsave_buf_len = 4096; + x86cpu->env.xsave_buf = qemu_memalign(4096, x86cpu->env.xsave_buf_len); hv_vcpu_enable_native_msr(cpu->hvf->fd, MSR_STAR, 1); hv_vcpu_enable_native_msr(cpu->hvf->fd, MSR_LSTAR, 1); diff --git a/target/i386/hvf/x86hvf.c b/target/i386/hvf/x86hvf.c index 2ced2c2478..05ec1bddc4 100644 --- a/target/i386/hvf/x86hvf.c +++ b/target/i386/hvf/x86hvf.c @@ -73,14 +73,12 @@ void hvf_get_segment(SegmentCache *qseg, struct vmx_segment *vmx_seg) void hvf_put_xsave(CPUState *cpu_state) { + void *xsave = X86_CPU(cpu_state)->env.xsave_buf; + uint32_t xsave_len = X86_CPU(cpu_state)->env.xsave_buf_len; - struct X86XSaveArea *xsave; + x86_cpu_xsave_all_areas(X86_CPU(cpu_state), xsave, xsave_len); - xsave = X86_CPU(cpu_state)->env.xsave_buf; - - x86_cpu_xsave_all_areas(X86_CPU(cpu_state), xsave); - - if (hv_vcpu_write_fpstate(cpu_state->hvf->fd, (void*)xsave, 4096)) { + if (hv_vcpu_write_fpstate(cpu_state->hvf->fd, xsave, xsave_len)) { abort(); } } @@ -158,15 +156,14 @@ void hvf_put_msrs(CPUState *cpu_state) void hvf_get_xsave(CPUState *cpu_state) { - struct X86XSaveArea *xsave; + void *xsave = X86_CPU(cpu_state)->env.xsave_buf; + uint32_t xsave_len = X86_CPU(cpu_state)->env.xsave_buf_len; - xsave = X86_CPU(cpu_state)->env.xsave_buf; - - if (hv_vcpu_read_fpstate(cpu_state->hvf->fd, (void*)xsave, 4096)) { + if (hv_vcpu_read_fpstate(cpu_state->hvf->fd, xsave, xsave_len)) { abort(); } - x86_cpu_xrstor_all_areas(X86_CPU(cpu_state), xsave); + x86_cpu_xrstor_all_areas(X86_CPU(cpu_state), xsave, xsave_len); } void hvf_get_segments(CPUState *cpu_state) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 3ab1d71775..41b0764ab7 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -1888,8 +1888,9 @@ int kvm_arch_init_vcpu(CPUState *cs) } if (has_xsave) { - env->xsave_buf = qemu_memalign(4096, sizeof(struct kvm_xsave)); - memset(env->xsave_buf, 0, sizeof(struct kvm_xsave)); + env->xsave_buf_len = sizeof(struct kvm_xsave); + env->xsave_buf = qemu_memalign(4096, env->xsave_buf_len); + memset(env->xsave_buf, 0, env->xsave_buf_len); } max_nested_state_len = kvm_max_nested_state_length(); @@ -2469,12 +2470,12 @@ static int kvm_put_fpu(X86CPU *cpu) static int kvm_put_xsave(X86CPU *cpu) { CPUX86State *env = &cpu->env; - X86XSaveArea *xsave = env->xsave_buf; + void *xsave = env->xsave_buf; if (!has_xsave) { return kvm_put_fpu(cpu); } - x86_cpu_xsave_all_areas(cpu, xsave); + x86_cpu_xsave_all_areas(cpu, xsave, env->xsave_buf_len); return kvm_vcpu_ioctl(CPU(cpu), KVM_SET_XSAVE, xsave); } @@ -3119,7 +3120,7 @@ static int kvm_get_fpu(X86CPU *cpu) static int kvm_get_xsave(X86CPU *cpu) { CPUX86State *env = &cpu->env; - X86XSaveArea *xsave = env->xsave_buf; + void *xsave = env->xsave_buf; int ret; if (!has_xsave) { @@ -3130,7 +3131,7 @@ static int kvm_get_xsave(X86CPU *cpu) if (ret < 0) { return ret; } - x86_cpu_xrstor_all_areas(cpu, xsave); + x86_cpu_xrstor_all_areas(cpu, xsave, env->xsave_buf_len); return 0; } diff --git a/target/i386/xsave_helper.c b/target/i386/xsave_helper.c index 818115e7d2..b16c6ac0fe 100644 --- a/target/i386/xsave_helper.c +++ b/target/i386/xsave_helper.c @@ -6,14 +6,16 @@ #include "cpu.h" -void x86_cpu_xsave_all_areas(X86CPU *cpu, X86XSaveArea *buf) +void x86_cpu_xsave_all_areas(X86CPU *cpu, void *buf, uint32_t buflen) { CPUX86State *env = &cpu->env; X86XSaveArea *xsave = buf; - uint16_t cwd, swd, twd; int i; - memset(xsave, 0, sizeof(X86XSaveArea)); + + assert(buflen >= sizeof(*xsave)); + + memset(xsave, 0, buflen); twd = 0; swd = env->fpus & ~(7 << 11); swd |= (env->fpstt & 7) << 11; @@ -56,17 +58,17 @@ void x86_cpu_xsave_all_areas(X86CPU *cpu, X86XSaveArea *buf) 16 * sizeof env->xmm_regs[16]); memcpy(&xsave->pkru_state, &env->pkru, sizeof env->pkru); #endif - } -void x86_cpu_xrstor_all_areas(X86CPU *cpu, const X86XSaveArea *buf) +void x86_cpu_xrstor_all_areas(X86CPU *cpu, const void *buf, uint32_t buflen) { - CPUX86State *env = &cpu->env; const X86XSaveArea *xsave = buf; - int i; uint16_t cwd, swd, twd; + + assert(buflen >= sizeof(*xsave)); + cwd = xsave->legacy.fcw; swd = xsave->legacy.fsw; twd = xsave->legacy.ftw; @@ -108,5 +110,4 @@ void x86_cpu_xrstor_all_areas(X86CPU *cpu, const X86XSaveArea *buf) 16 * sizeof env->xmm_regs[16]); memcpy(&env->pkru, &xsave->pkru_state, sizeof env->pkru); #endif - } From patchwork Tue Jul 6 10:01:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360185 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FD85C11F67 for ; Tue, 6 Jul 2021 10:12:20 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4886761879 for ; Tue, 6 Jul 2021 10:12:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4886761879 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:54904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0i3v-0005oy-9i for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:12:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hts-0000no-FI for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:56 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:40501) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htn-0002GH-PR for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:56 -0400 Received: by mail-wr1-x435.google.com with SMTP id l5so8616825wrv.7 for ; Tue, 06 Jul 2021 03:01:51 -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=iEcKjaiMM/JbrRRCkkOFDlxCVuzGIDf8YRNE5Qoe0Kc=; b=ZubbF25w7asDQaUUD/8QCZbJqIx5sZPCSdw5Z/h+ZKsCkrvQtg14vxA0WpNW4LczER 8U9B++8eG8m3CX27JjORTEMfSYGW/DXdpJnXZkkKzygVCi3/VEBlqzBuegnhXb5f6i63 dQOoARCMo2p41ZMf0NCT/h9yO3apEuCscVkdxoD5oxpBReq8wsCzW2QRs3lEa5stgFVe I+sBQFiW8ZbL+f8Wh/SrlC2agTi8wequlE3v3SHvWOQjdsrSuFJbYdeOULv3gKr5Suf7 UXv65T0kZHDR+USz+uK0Li0XcRthfdHKIJbHPuVV3fmJoasad5Y+2sazKZEndbrxuG9A CR9g== 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=iEcKjaiMM/JbrRRCkkOFDlxCVuzGIDf8YRNE5Qoe0Kc=; b=anxCMl+Ge7Kd6JSxHdgniR7MSliSIbr6vSs96PFVr7fpRyFtkoWmvUKFIvR+cFuBGY Z79l4w9l+kYa/Nbs5HzRVmVpILGnTsCTdagrtZr2CYRL104CnIsEEcKK0phsfrpZ61qp PipMVXpsMubjTMuy8ygMEmibnrGA9hj787y8l6fH/6EIL6L7vbhonMdelQpHrPgLZ/10 cpIRHuiZRQWm/qZ+/sl1nstg9hI0IMWd+F0cqSPxCXzpOhpYDSmKGZm3+ul60G8DiDKF jk+ntV8ydxM0+a/+tPUP2XxztNR5xIfNxQFoJHBSte/rohUw2tyKJzFwP3YOL5gnNF6J /Erw== X-Gm-Message-State: AOAM533sM3X6a5ay3ueJzhp7qzop++uYh2DFLyFEaWflOfcPHGHemcyM zb+zIWOpb6wgyhXiY5PjC0uwvORWcEI= X-Google-Smtp-Source: ABdhPJwApq6Q8k5/PCuJIGEY5zNl7Tj2Z3ITP/wLZYtDolSPRLju6bLf/BCxI6hVvtXtzgUhbmj61w== X-Received: by 2002:a05:6000:1379:: with SMTP id q25mr20280366wrz.188.1625565710443; Tue, 06 Jul 2021 03:01:50 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:50 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 12/40] target/i386: Make x86_ext_save_areas visible outside cpu.c Date: Tue, 6 Jul 2021 12:01:13 +0200 Message-Id: <20210706100141.303960-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x435.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.25, 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: , Cc: David Edmondson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: David Edmondson Provide visibility of the x86_ext_save_areas array and associated type outside of cpu.c. Signed-off-by: David Edmondson Message-Id: <20210705104632.2902400-6-david.edmondson@oracle.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 7 +------ target/i386/cpu.h | 9 +++++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index d8f3ab3192..13caa0de50 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1304,12 +1304,7 @@ static const X86RegisterInfo32 x86_reg_info_32[CPU_NB_REGS32] = { }; #undef REGISTER -typedef struct ExtSaveArea { - uint32_t feature, bits; - uint32_t offset, size; -} ExtSaveArea; - -static const ExtSaveArea x86_ext_save_areas[] = { +const ExtSaveArea x86_ext_save_areas[XSAVE_STATE_AREA_COUNT] = { [XSTATE_FP_BIT] = { /* x87 FP state component is always enabled if XSAVE is supported */ .feature = FEAT_1_ECX, .bits = CPUID_EXT_XSAVE, diff --git a/target/i386/cpu.h b/target/i386/cpu.h index ada2941c6e..c9c0a34330 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1370,6 +1370,15 @@ QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, zmm_hi256_state) != XSAVE_ZMM_HI256_OFF QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, hi16_zmm_state) != XSAVE_HI16_ZMM_OFFSET); QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, pkru_state) != XSAVE_PKRU_OFFSET); +typedef struct ExtSaveArea { + uint32_t feature, bits; + uint32_t offset, size; +} ExtSaveArea; + +#define XSAVE_STATE_AREA_COUNT (XSTATE_PKRU_BIT + 1) + +extern const ExtSaveArea x86_ext_save_areas[XSAVE_STATE_AREA_COUNT]; + typedef enum TPRAccess { TPR_ACCESS_READ, TPR_ACCESS_WRITE, From patchwork Tue Jul 6 10:01:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360271 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC681C07E96 for ; Tue, 6 Jul 2021 10:25:46 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DFF4C619CB for ; Tue, 6 Jul 2021 10:25:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFF4C619CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iGu-0005OR-PT for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:25:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htt-0000r8-FH for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:57 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:37489) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0hto-0002HH-Qt for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:57 -0400 Received: by mail-wm1-x32d.google.com with SMTP id r9-20020a7bc0890000b02901f347b31d55so1280600wmh.2 for ; Tue, 06 Jul 2021 03:01:52 -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=h26JCKiODGRB2hjkr2CRxRVz06FHkAd+nK2kSLVhu8M=; b=Wd37fgESi4nmy1+w7TgfWXxnIvVuH0gUUNmskX5H29jyhEMfN3vJuPevGoJUy5vmbS tdhEr3WzJGm/qC4BwvdY5+s+zBWJwc8yN59VJXqtNMRTineN7YhA8MpivyFdV3YMCOEP 09Gyhadln3MmqwXhqIrhRj+LvD/LmmXXVWpERf+xq37AFh6s9RRmTiLDvN07+6yLWNAR 0yNxNfXKU4c+YPdQ1HVp3QXR+IJwumYhbOA3Lfz1vImJomrp6Y1WkDbowqLMm0TVTZ2c IYygrDOFBT7t+58SdtcKPVH/7PplWu4dDReHJuIxXFUCYo6P/UKtYMWn9WF07tIhCJei 0stg== 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=h26JCKiODGRB2hjkr2CRxRVz06FHkAd+nK2kSLVhu8M=; b=BuMQ3+bLkpTBe/2KubEqWASaRij3JmbCgZcriLxt9hClJr3FJZrOE6xQD41WOOoDNL o667Bl+iHXxf4ebv7ytuJRi7ZuqSmTz9urDB87Osz8fStbflT38vYLtZ3u8zuYQ/7Bth q2G8byhllIxPCNxWEJT7ZiXdmJxHhp6GSvJ14GLdZSd/o2s2tiEzt3MSgtTsHTN0tOCF GWql9NvI8+GnroMEJe6ZgRwAwd4kR/1dFdydIQc1pcoac93GPu6Q4qSdHEENzOECKQDM 0NaTs3U7NXwy2XNOU2jG2TuAkodJ8YhOSvmwm6JIW2PooIWyL/INv2nOIb+d1rzbEAl2 XI/Q== X-Gm-Message-State: AOAM530fh8nUMX828S/+CLmo9q6cYnt8RbuquExYlV7fVrGix95BMDYz Y2m3u+OXC8DcC7UpjgMqI0OC07uOdmE= X-Google-Smtp-Source: ABdhPJwgB4+2wdN4jjTnbS7O68Nxw5XSUoHKFTDA4022jUBKeLvlr3hWpC0vKxKcwCRizoiNPQyeFA== X-Received: by 2002:a05:600c:3783:: with SMTP id o3mr3874106wmr.123.1625565711149; Tue, 06 Jul 2021 03:01:51 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:50 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 13/40] target/i386: Observe XSAVE state area offsets Date: Tue, 6 Jul 2021 12:01:14 +0200 Message-Id: <20210706100141.303960-14-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32d.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.25, 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: , Cc: David Edmondson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: David Edmondson Rather than relying on the X86XSaveArea structure definition directly, the routines that manipulate the XSAVE state area should observe the offsets declared in the x86_ext_save_areas array. Currently the offsets declared in the array are derived from the structure definition, resulting in no functional change. Signed-off-by: David Edmondson Message-Id: <20210705104632.2902400-7-david.edmondson@oracle.com> Signed-off-by: Paolo Bonzini --- target/i386/xsave_helper.c | 262 ++++++++++++++++++++++++++++--------- 1 file changed, 200 insertions(+), 62 deletions(-) diff --git a/target/i386/xsave_helper.c b/target/i386/xsave_helper.c index b16c6ac0fe..ac61a96344 100644 --- a/target/i386/xsave_helper.c +++ b/target/i386/xsave_helper.c @@ -9,13 +9,20 @@ void x86_cpu_xsave_all_areas(X86CPU *cpu, void *buf, uint32_t buflen) { CPUX86State *env = &cpu->env; - X86XSaveArea *xsave = buf; - uint16_t cwd, swd, twd; + const ExtSaveArea *e, *f; int i; - assert(buflen >= sizeof(*xsave)); + X86LegacyXSaveArea *legacy; + X86XSaveHeader *header; + uint16_t cwd, swd, twd; + + memset(buf, 0, buflen); + + e = &x86_ext_save_areas[XSTATE_FP_BIT]; + + legacy = buf + e->offset; + header = buf + e->offset + sizeof(*legacy); - memset(xsave, 0, buflen); twd = 0; swd = env->fpus & ~(7 << 11); swd |= (env->fpstt & 7) << 11; @@ -23,91 +30,222 @@ void x86_cpu_xsave_all_areas(X86CPU *cpu, void *buf, uint32_t buflen) for (i = 0; i < 8; ++i) { twd |= (!env->fptags[i]) << i; } - xsave->legacy.fcw = cwd; - xsave->legacy.fsw = swd; - xsave->legacy.ftw = twd; - xsave->legacy.fpop = env->fpop; - xsave->legacy.fpip = env->fpip; - xsave->legacy.fpdp = env->fpdp; - memcpy(&xsave->legacy.fpregs, env->fpregs, - sizeof env->fpregs); - xsave->legacy.mxcsr = env->mxcsr; - xsave->header.xstate_bv = env->xstate_bv; - memcpy(&xsave->bndreg_state.bnd_regs, env->bnd_regs, - sizeof env->bnd_regs); - xsave->bndcsr_state.bndcsr = env->bndcs_regs; - memcpy(&xsave->opmask_state.opmask_regs, env->opmask_regs, - sizeof env->opmask_regs); + legacy->fcw = cwd; + legacy->fsw = swd; + legacy->ftw = twd; + legacy->fpop = env->fpop; + legacy->fpip = env->fpip; + legacy->fpdp = env->fpdp; + memcpy(&legacy->fpregs, env->fpregs, + sizeof(env->fpregs)); + legacy->mxcsr = env->mxcsr; for (i = 0; i < CPU_NB_REGS; i++) { - uint8_t *xmm = xsave->legacy.xmm_regs[i]; - uint8_t *ymmh = xsave->avx_state.ymmh[i]; - uint8_t *zmmh = xsave->zmm_hi256_state.zmm_hi256[i]; + uint8_t *xmm = legacy->xmm_regs[i]; + stq_p(xmm, env->xmm_regs[i].ZMM_Q(0)); - stq_p(xmm+8, env->xmm_regs[i].ZMM_Q(1)); - stq_p(ymmh, env->xmm_regs[i].ZMM_Q(2)); - stq_p(ymmh+8, env->xmm_regs[i].ZMM_Q(3)); - stq_p(zmmh, env->xmm_regs[i].ZMM_Q(4)); - stq_p(zmmh+8, env->xmm_regs[i].ZMM_Q(5)); - stq_p(zmmh+16, env->xmm_regs[i].ZMM_Q(6)); - stq_p(zmmh+24, env->xmm_regs[i].ZMM_Q(7)); + stq_p(xmm + 8, env->xmm_regs[i].ZMM_Q(1)); + } + + header->xstate_bv = env->xstate_bv; + + e = &x86_ext_save_areas[XSTATE_YMM_BIT]; + if (e->size && e->offset) { + XSaveAVX *avx; + + avx = buf + e->offset; + + for (i = 0; i < CPU_NB_REGS; i++) { + uint8_t *ymmh = avx->ymmh[i]; + + stq_p(ymmh, env->xmm_regs[i].ZMM_Q(2)); + stq_p(ymmh + 8, env->xmm_regs[i].ZMM_Q(3)); + } + } + + e = &x86_ext_save_areas[XSTATE_BNDREGS_BIT]; + if (e->size && e->offset) { + XSaveBNDREG *bndreg; + XSaveBNDCSR *bndcsr; + + f = &x86_ext_save_areas[XSTATE_BNDCSR_BIT]; + assert(f->size); + assert(f->offset); + + bndreg = buf + e->offset; + bndcsr = buf + f->offset; + + memcpy(&bndreg->bnd_regs, env->bnd_regs, + sizeof(env->bnd_regs)); + bndcsr->bndcsr = env->bndcs_regs; + } + + e = &x86_ext_save_areas[XSTATE_OPMASK_BIT]; + if (e->size && e->offset) { + XSaveOpmask *opmask; + XSaveZMM_Hi256 *zmm_hi256; +#ifdef TARGET_X86_64 + XSaveHi16_ZMM *hi16_zmm; +#endif + + f = &x86_ext_save_areas[XSTATE_ZMM_Hi256_BIT]; + assert(f->size); + assert(f->offset); + + opmask = buf + e->offset; + zmm_hi256 = buf + f->offset; + + memcpy(&opmask->opmask_regs, env->opmask_regs, + sizeof(env->opmask_regs)); + + for (i = 0; i < CPU_NB_REGS; i++) { + uint8_t *zmmh = zmm_hi256->zmm_hi256[i]; + + stq_p(zmmh, env->xmm_regs[i].ZMM_Q(4)); + stq_p(zmmh + 8, env->xmm_regs[i].ZMM_Q(5)); + stq_p(zmmh + 16, env->xmm_regs[i].ZMM_Q(6)); + stq_p(zmmh + 24, env->xmm_regs[i].ZMM_Q(7)); + } + +#ifdef TARGET_X86_64 + f = &x86_ext_save_areas[XSTATE_Hi16_ZMM_BIT]; + assert(f->size); + assert(f->offset); + + hi16_zmm = buf + f->offset; + + memcpy(&hi16_zmm->hi16_zmm, &env->xmm_regs[16], + 16 * sizeof(env->xmm_regs[16])); +#endif } #ifdef TARGET_X86_64 - memcpy(&xsave->hi16_zmm_state.hi16_zmm, &env->xmm_regs[16], - 16 * sizeof env->xmm_regs[16]); - memcpy(&xsave->pkru_state, &env->pkru, sizeof env->pkru); + e = &x86_ext_save_areas[XSTATE_PKRU_BIT]; + if (e->size && e->offset) { + XSavePKRU *pkru = buf + e->offset; + + memcpy(pkru, &env->pkru, sizeof(env->pkru)); + } #endif } void x86_cpu_xrstor_all_areas(X86CPU *cpu, const void *buf, uint32_t buflen) { CPUX86State *env = &cpu->env; - const X86XSaveArea *xsave = buf; + const ExtSaveArea *e, *f, *g; int i; + + const X86LegacyXSaveArea *legacy; + const X86XSaveHeader *header; uint16_t cwd, swd, twd; - assert(buflen >= sizeof(*xsave)); + e = &x86_ext_save_areas[XSTATE_FP_BIT]; - cwd = xsave->legacy.fcw; - swd = xsave->legacy.fsw; - twd = xsave->legacy.ftw; - env->fpop = xsave->legacy.fpop; + legacy = buf + e->offset; + header = buf + e->offset + sizeof(*legacy); + + cwd = legacy->fcw; + swd = legacy->fsw; + twd = legacy->ftw; + env->fpop = legacy->fpop; env->fpstt = (swd >> 11) & 7; env->fpus = swd; env->fpuc = cwd; for (i = 0; i < 8; ++i) { env->fptags[i] = !((twd >> i) & 1); } - env->fpip = xsave->legacy.fpip; - env->fpdp = xsave->legacy.fpdp; - env->mxcsr = xsave->legacy.mxcsr; - memcpy(env->fpregs, &xsave->legacy.fpregs, - sizeof env->fpregs); - env->xstate_bv = xsave->header.xstate_bv; - memcpy(env->bnd_regs, &xsave->bndreg_state.bnd_regs, - sizeof env->bnd_regs); - env->bndcs_regs = xsave->bndcsr_state.bndcsr; - memcpy(env->opmask_regs, &xsave->opmask_state.opmask_regs, - sizeof env->opmask_regs); + env->fpip = legacy->fpip; + env->fpdp = legacy->fpdp; + env->mxcsr = legacy->mxcsr; + memcpy(env->fpregs, &legacy->fpregs, + sizeof(env->fpregs)); for (i = 0; i < CPU_NB_REGS; i++) { - const uint8_t *xmm = xsave->legacy.xmm_regs[i]; - const uint8_t *ymmh = xsave->avx_state.ymmh[i]; - const uint8_t *zmmh = xsave->zmm_hi256_state.zmm_hi256[i]; + const uint8_t *xmm = legacy->xmm_regs[i]; + env->xmm_regs[i].ZMM_Q(0) = ldq_p(xmm); - env->xmm_regs[i].ZMM_Q(1) = ldq_p(xmm+8); - env->xmm_regs[i].ZMM_Q(2) = ldq_p(ymmh); - env->xmm_regs[i].ZMM_Q(3) = ldq_p(ymmh+8); - env->xmm_regs[i].ZMM_Q(4) = ldq_p(zmmh); - env->xmm_regs[i].ZMM_Q(5) = ldq_p(zmmh+8); - env->xmm_regs[i].ZMM_Q(6) = ldq_p(zmmh+16); - env->xmm_regs[i].ZMM_Q(7) = ldq_p(zmmh+24); + env->xmm_regs[i].ZMM_Q(1) = ldq_p(xmm + 8); + } + + env->xstate_bv = header->xstate_bv; + + e = &x86_ext_save_areas[XSTATE_YMM_BIT]; + if (e->size && e->offset) { + const XSaveAVX *avx; + + avx = buf + e->offset; + for (i = 0; i < CPU_NB_REGS; i++) { + const uint8_t *ymmh = avx->ymmh[i]; + + env->xmm_regs[i].ZMM_Q(2) = ldq_p(ymmh); + env->xmm_regs[i].ZMM_Q(3) = ldq_p(ymmh + 8); + } + } + + e = &x86_ext_save_areas[XSTATE_BNDREGS_BIT]; + if (e->size && e->offset) { + const XSaveBNDREG *bndreg; + const XSaveBNDCSR *bndcsr; + + f = &x86_ext_save_areas[XSTATE_BNDCSR_BIT]; + assert(f->size); + assert(f->offset); + + bndreg = buf + e->offset; + bndcsr = buf + f->offset; + + memcpy(env->bnd_regs, &bndreg->bnd_regs, + sizeof(env->bnd_regs)); + env->bndcs_regs = bndcsr->bndcsr; + } + + e = &x86_ext_save_areas[XSTATE_OPMASK_BIT]; + if (e->size && e->offset) { + const XSaveOpmask *opmask; + const XSaveZMM_Hi256 *zmm_hi256; +#ifdef TARGET_X86_64 + const XSaveHi16_ZMM *hi16_zmm; +#endif + + f = &x86_ext_save_areas[XSTATE_ZMM_Hi256_BIT]; + assert(f->size); + assert(f->offset); + + g = &x86_ext_save_areas[XSTATE_Hi16_ZMM_BIT]; + assert(g->size); + assert(g->offset); + + opmask = buf + e->offset; + zmm_hi256 = buf + f->offset; +#ifdef TARGET_X86_64 + hi16_zmm = buf + g->offset; +#endif + + memcpy(env->opmask_regs, &opmask->opmask_regs, + sizeof(env->opmask_regs)); + + for (i = 0; i < CPU_NB_REGS; i++) { + const uint8_t *zmmh = zmm_hi256->zmm_hi256[i]; + + env->xmm_regs[i].ZMM_Q(4) = ldq_p(zmmh); + env->xmm_regs[i].ZMM_Q(5) = ldq_p(zmmh + 8); + env->xmm_regs[i].ZMM_Q(6) = ldq_p(zmmh + 16); + env->xmm_regs[i].ZMM_Q(7) = ldq_p(zmmh + 24); + } + +#ifdef TARGET_X86_64 + memcpy(&env->xmm_regs[16], &hi16_zmm->hi16_zmm, + 16 * sizeof(env->xmm_regs[16])); +#endif } #ifdef TARGET_X86_64 - memcpy(&env->xmm_regs[16], &xsave->hi16_zmm_state.hi16_zmm, - 16 * sizeof env->xmm_regs[16]); - memcpy(&env->pkru, &xsave->pkru_state, sizeof env->pkru); + e = &x86_ext_save_areas[XSTATE_PKRU_BIT]; + if (e->size && e->offset) { + const XSavePKRU *pkru; + + pkru = buf + e->offset; + memcpy(&env->pkru, pkru, sizeof(env->pkru)); + } #endif } From patchwork Tue Jul 6 10:01:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360259 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66F0EC07E9B for ; Tue, 6 Jul 2021 10:21:41 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 083C6619A2 for ; Tue, 6 Jul 2021 10:21:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 083C6619A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iCy-0003w0-2f for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:21:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htt-0000sN-PN for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:57 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:53911) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htp-0002I8-5S for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:57 -0400 Received: by mail-wm1-x32d.google.com with SMTP id w13so13163218wmc.3 for ; Tue, 06 Jul 2021 03:01:52 -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=6B+POZuXK4UB4wyT6v8liQNauLEZCXAESHdv+wthCKY=; b=V04YgcC4cBalQaevqeDPpgE/uoGn6j6i3xW1RfOfaXx+TJno1yktXvU/AUvsv0MMCj DdSPYQQUw3fzHazQoki2/v00CC8idHWychDxgx488fC2+c2fJRKi4AnyVExVnDYme1kp S0TIdEkLskKhci8WXwo00ic0ixuEXc9eAUXsriUVucoyJvvQoxeulSJAH++38lRbGoDU ugWjW56xBXc4UjJt/2wSybCJs6cuhz/2KraQ5rON+K6y378T0xy7xPUQuWL6Wd2TsEOd B8PCrs3cZysGCl5uo1OjWubbH4ThHk/ZOjoDrERMw8RiI4ODXGRAqjojYXiQerSTw0ZD zX6w== 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=6B+POZuXK4UB4wyT6v8liQNauLEZCXAESHdv+wthCKY=; b=IHo5kNH/PG37dg1oYGZYCB2KoAZp5jeatS62K8ZpMDZREJn8yr3s3wuWSafooOtGzS izioDWOvWrPpKAPc45tIfoP+JObaLNEZZ5FPMNb+C85YpDEyzMSIQyr8PALkRCa8rV/H MEZY0w8Ckyib3O7IydxBo13OtGg8uQtW9w2NbEy89KrPonBmXz2l83788PwW1Up3oWm8 caw35FxIYN5SsQ4djQSx9GRhBCEH5xA+2EpDrZiREpm68OFWD7+be5lfRBGk1j1PMTDT kK0Yd6vbGOgZAAdqDnLmR2LKJL95xYEUNN37OERcblGF3EoPjWUU/0QYDiDH0WtXyC+7 X8xQ== X-Gm-Message-State: AOAM533R6LRkXK+tASoA3CrrAQRm5mNmsM7qBO7/9MVmaNEQ3qmErf9o rCEOd1iDpPyCM2rJVVYeF+Uq9JpcU9U= X-Google-Smtp-Source: ABdhPJxeOC0NFRW6N6InyCL74U52fDYyufFoQ7pvT6Lmb1zOPorfniJmG+Pxr3FM5XdzsPBRFp9tnA== X-Received: by 2002:a7b:c844:: with SMTP id c4mr3831081wml.107.1625565711892; Tue, 06 Jul 2021 03:01:51 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 14/40] target/i386: Populate x86_ext_save_areas offsets using cpuid where possible Date: Tue, 6 Jul 2021 12:01:15 +0200 Message-Id: <20210706100141.303960-15-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32d.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.25, 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: , Cc: David Edmondson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: David Edmondson Rather than relying on the X86XSaveArea structure definition, determine the offset of XSAVE state areas using CPUID leaf 0xd where possible (KVM and HVF). Signed-off-by: David Edmondson Message-Id: <20210705104632.2902400-8-david.edmondson@oracle.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 13 +------------ target/i386/cpu.h | 2 +- target/i386/hvf/hvf-cpu.c | 29 +++++++++++++++++++++++++++++ target/i386/hvf/hvf.c | 6 ++++++ target/i386/kvm/kvm-cpu.c | 30 ++++++++++++++++++++++++++++++ target/i386/kvm/kvm.c | 7 +++++++ target/i386/tcg/tcg-cpu.c | 20 ++++++++++++++++++++ 7 files changed, 94 insertions(+), 13 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 13caa0de50..5f595a0d7e 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1304,48 +1304,37 @@ static const X86RegisterInfo32 x86_reg_info_32[CPU_NB_REGS32] = { }; #undef REGISTER -const ExtSaveArea x86_ext_save_areas[XSAVE_STATE_AREA_COUNT] = { +ExtSaveArea x86_ext_save_areas[XSAVE_STATE_AREA_COUNT] = { [XSTATE_FP_BIT] = { /* x87 FP state component is always enabled if XSAVE is supported */ .feature = FEAT_1_ECX, .bits = CPUID_EXT_XSAVE, - /* x87 state is in the legacy region of the XSAVE area */ - .offset = 0, .size = sizeof(X86LegacyXSaveArea) + sizeof(X86XSaveHeader), }, [XSTATE_SSE_BIT] = { /* SSE state component is always enabled if XSAVE is supported */ .feature = FEAT_1_ECX, .bits = CPUID_EXT_XSAVE, - /* SSE state is in the legacy region of the XSAVE area */ - .offset = 0, .size = sizeof(X86LegacyXSaveArea) + sizeof(X86XSaveHeader), }, [XSTATE_YMM_BIT] = { .feature = FEAT_1_ECX, .bits = CPUID_EXT_AVX, - .offset = offsetof(X86XSaveArea, avx_state), .size = sizeof(XSaveAVX) }, [XSTATE_BNDREGS_BIT] = { .feature = FEAT_7_0_EBX, .bits = CPUID_7_0_EBX_MPX, - .offset = offsetof(X86XSaveArea, bndreg_state), .size = sizeof(XSaveBNDREG) }, [XSTATE_BNDCSR_BIT] = { .feature = FEAT_7_0_EBX, .bits = CPUID_7_0_EBX_MPX, - .offset = offsetof(X86XSaveArea, bndcsr_state), .size = sizeof(XSaveBNDCSR) }, [XSTATE_OPMASK_BIT] = { .feature = FEAT_7_0_EBX, .bits = CPUID_7_0_EBX_AVX512F, - .offset = offsetof(X86XSaveArea, opmask_state), .size = sizeof(XSaveOpmask) }, [XSTATE_ZMM_Hi256_BIT] = { .feature = FEAT_7_0_EBX, .bits = CPUID_7_0_EBX_AVX512F, - .offset = offsetof(X86XSaveArea, zmm_hi256_state), .size = sizeof(XSaveZMM_Hi256) }, [XSTATE_Hi16_ZMM_BIT] = { .feature = FEAT_7_0_EBX, .bits = CPUID_7_0_EBX_AVX512F, - .offset = offsetof(X86XSaveArea, hi16_zmm_state), .size = sizeof(XSaveHi16_ZMM) }, [XSTATE_PKRU_BIT] = { .feature = FEAT_7_0_ECX, .bits = CPUID_7_0_ECX_PKU, - .offset = offsetof(X86XSaveArea, pkru_state), .size = sizeof(XSavePKRU) }, }; diff --git a/target/i386/cpu.h b/target/i386/cpu.h index c9c0a34330..96b672f8bd 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1377,7 +1377,7 @@ typedef struct ExtSaveArea { #define XSAVE_STATE_AREA_COUNT (XSTATE_PKRU_BIT + 1) -extern const ExtSaveArea x86_ext_save_areas[XSAVE_STATE_AREA_COUNT]; +extern ExtSaveArea x86_ext_save_areas[XSAVE_STATE_AREA_COUNT]; typedef enum TPRAccess { TPR_ACCESS_READ, diff --git a/target/i386/hvf/hvf-cpu.c b/target/i386/hvf/hvf-cpu.c index 8fbc423888..333db59898 100644 --- a/target/i386/hvf/hvf-cpu.c +++ b/target/i386/hvf/hvf-cpu.c @@ -30,6 +30,33 @@ static void hvf_cpu_max_instance_init(X86CPU *cpu) hvf_get_supported_cpuid(0xC0000000, 0, R_EAX); } +static void hvf_cpu_xsave_init(void) +{ + static bool first = true; + int i; + + if (!first) { + return; + } + first = false; + + /* x87 and SSE states are in the legacy region of the XSAVE area. */ + x86_ext_save_areas[XSTATE_FP_BIT].offset = 0; + x86_ext_save_areas[XSTATE_SSE_BIT].offset = 0; + + for (i = XSTATE_SSE_BIT + 1; i < XSAVE_STATE_AREA_COUNT; i++) { + ExtSaveArea *esa = &x86_ext_save_areas[i]; + + if (esa->size) { + int sz = hvf_get_supported_cpuid(0xd, i, R_EAX); + if (sz != 0) { + assert(esa->size == sz); + esa->offset = hvf_get_supported_cpuid(0xd, i, R_EBX); + } + } + } +} + static void hvf_cpu_instance_init(CPUState *cs) { X86CPU *cpu = X86_CPU(cs); @@ -42,6 +69,8 @@ static void hvf_cpu_instance_init(CPUState *cs) if (cpu->max_features) { hvf_cpu_max_instance_init(cpu); } + + hvf_cpu_xsave_init(); } static void hvf_cpu_accel_class_init(ObjectClass *oc, void *data) diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index e62e8df028..79ba4ed93a 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -270,6 +270,12 @@ int hvf_arch_init_vcpu(CPUState *cpu) x86cpu->env.xsave_buf_len = 4096; x86cpu->env.xsave_buf = qemu_memalign(4096, x86cpu->env.xsave_buf_len); + /* + * The allocated storage must be large enough for all of the + * possible XSAVE state components. + */ + assert(hvf_get_supported_cpuid(0xd, 0, R_ECX) <= x86cpu->env.xsave_buf_len); + hv_vcpu_enable_native_msr(cpu->hvf->fd, MSR_STAR, 1); hv_vcpu_enable_native_msr(cpu->hvf->fd, MSR_LSTAR, 1); hv_vcpu_enable_native_msr(cpu->hvf->fd, MSR_CSTAR, 1); diff --git a/target/i386/kvm/kvm-cpu.c b/target/i386/kvm/kvm-cpu.c index 00369c2000..bbe817764d 100644 --- a/target/i386/kvm/kvm-cpu.c +++ b/target/i386/kvm/kvm-cpu.c @@ -122,6 +122,34 @@ static void kvm_cpu_max_instance_init(X86CPU *cpu) kvm_arch_get_supported_cpuid(s, 0xC0000000, 0, R_EAX); } +static void kvm_cpu_xsave_init(void) +{ + static bool first = true; + KVMState *s = kvm_state; + int i; + + if (!first) { + return; + } + first = false; + + /* x87 and SSE states are in the legacy region of the XSAVE area. */ + x86_ext_save_areas[XSTATE_FP_BIT].offset = 0; + x86_ext_save_areas[XSTATE_SSE_BIT].offset = 0; + + for (i = XSTATE_SSE_BIT + 1; i < XSAVE_STATE_AREA_COUNT; i++) { + ExtSaveArea *esa = &x86_ext_save_areas[i]; + + if (esa->size) { + int sz = kvm_arch_get_supported_cpuid(s, 0xd, i, R_EAX); + if (sz != 0) { + assert(esa->size == sz); + esa->offset = kvm_arch_get_supported_cpuid(s, 0xd, i, R_EBX); + } + } + } +} + static void kvm_cpu_instance_init(CPUState *cs) { X86CPU *cpu = X86_CPU(cs); @@ -141,6 +169,8 @@ static void kvm_cpu_instance_init(CPUState *cs) if (cpu->max_features) { kvm_cpu_max_instance_init(cpu); } + + kvm_cpu_xsave_init(); } static void kvm_cpu_accel_class_init(ObjectClass *oc, void *data) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 41b0764ab7..a85035492f 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -1891,6 +1891,13 @@ int kvm_arch_init_vcpu(CPUState *cs) env->xsave_buf_len = sizeof(struct kvm_xsave); env->xsave_buf = qemu_memalign(4096, env->xsave_buf_len); memset(env->xsave_buf, 0, env->xsave_buf_len); + + /* + * The allocated storage must be large enough for all of the + * possible XSAVE state components. + */ + assert(kvm_arch_get_supported_cpuid(kvm_state, 0xd, 0, R_ECX) + <= env->xsave_buf_len); } max_nested_state_len = kvm_max_nested_state_length(); diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 014ebea2f6..e96ec9bbcc 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -80,6 +80,24 @@ static void tcg_cpu_class_init(CPUClass *cc) cc->init_accel_cpu = tcg_cpu_init_ops; } +static void tcg_cpu_xsave_init(void) +{ +#define XO(bit, field) \ + x86_ext_save_areas[bit].offset = offsetof(X86XSaveArea, field); + + XO(XSTATE_FP_BIT, legacy); + XO(XSTATE_SSE_BIT, legacy); + XO(XSTATE_YMM_BIT, avx_state); + XO(XSTATE_BNDREGS_BIT, bndreg_state); + XO(XSTATE_BNDCSR_BIT, bndcsr_state); + XO(XSTATE_OPMASK_BIT, opmask_state); + XO(XSTATE_ZMM_Hi256_BIT, zmm_hi256_state); + XO(XSTATE_Hi16_ZMM_BIT, hi16_zmm_state); + XO(XSTATE_PKRU_BIT, pkru_state); + +#undef XO +} + /* * TCG-specific defaults that override all CPU models when using TCG */ @@ -93,6 +111,8 @@ static void tcg_cpu_instance_init(CPUState *cs) X86CPU *cpu = X86_CPU(cs); /* Special cases not set in the X86CPUDefinition structs: */ x86_cpu_apply_props(cpu, tcg_default_props); + + tcg_cpu_xsave_init(); } static void tcg_cpu_accel_class_init(ObjectClass *oc, void *data) From patchwork Tue Jul 6 10:01:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360275 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C828C07E96 for ; Tue, 6 Jul 2021 10:26:52 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E2CDB61958 for ; Tue, 6 Jul 2021 10:26:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2CDB61958 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iHz-0007Ed-2w for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:26:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htx-00012u-23 for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:01 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:35365) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htp-0002IO-V0 for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:00 -0400 Received: by mail-wm1-x32b.google.com with SMTP id j39-20020a05600c1c27b029020028e48b8fso1301821wms.0 for ; Tue, 06 Jul 2021 03:01:53 -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=Ct6r5RZE0o1S7vdFdC1Guo8aTFQIoeJvAIVNu2PxIuI=; b=ValOFLSGLR7cAZSSe16iu2XAXy4oavw+LZwkCj4WDEac/CXm2hK3ScekuINIoPq9q/ wQVuIcYLD8x5mC4PTRG8N0El/7SUnisYKxapIG1Y+svCGCbcUSjXE54HpZt41pPF1vKA J7nom7TbFjEUtzFwnHmmKCpoWgAF9pQJkMMJIEU3oORnaZka+0JlFBXC1izsl+609lNZ Gj26m4+/MUyW1Xh+nIuvZYWVKGqpXgrztbe0vIYvXZHVcXswbAcnrEb4du5GmMA2Wc/k rjCaucgoqIP9Y7Jt3lxDqPrURAbYy9ttisndkbCeZlCFpJu1FL9kmBv0Fl6FAkL/cu5T 2RLA== 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=Ct6r5RZE0o1S7vdFdC1Guo8aTFQIoeJvAIVNu2PxIuI=; b=uNu3hCSwRSMl2r9OtE1yrq/CdO5Yh2AYjdW+H7W/1kzwvDYQ1bhi9SCTRc9qPrCo2w FkkJLqxrtLA9/tFWOt4z5v5lwk0956R5MXd63mOB2dTqXTIWKigNbFFrG2YwlNsUgc1e 5YVcxBZNCj0+V0algLWM+hhTYHBknhtv/ZRVLFG75RRNDBinaVo6V6eInz7spsExUCSV 24eHvaJDu/rE+oACc+sxromki751MnvDCsug6NMikFzQeEEcHI3iHw7cb5U+vfWqEyvN DOAGlkrhn2vT+MYZWwLZeu0DAye9sG01+ylXquJwZFul3OOAtS2zhm/NsMTAlj7msumg VEPg== X-Gm-Message-State: AOAM530mXfcg2VUCquftKq1pHNPwYR0SyVcjKrT6P++0OYw92LWuZ9A5 h0BDkX4t4Xio0ImNc6Jz3YCTkaGa2U4= X-Google-Smtp-Source: ABdhPJxr6D0GplibUUtX6m0evBhhb90mu2lJoyuxqnpolgsNSheOB0/XF+Qy2VmqWah8t4hA4wOpIQ== X-Received: by 2002:a05:600c:4ed3:: with SMTP id g19mr3215779wmq.145.1625565712529; Tue, 06 Jul 2021 03:01:52 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:52 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 15/40] target/i386: Move X86XSaveArea into TCG Date: Tue, 6 Jul 2021 12:01:16 +0200 Message-Id: <20210706100141.303960-16-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32b.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.25, 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: , Cc: David Edmondson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: David Edmondson Given that TCG is now the only consumer of X86XSaveArea, move the structure definition and associated offset declarations and checks to a TCG specific header. Signed-off-by: David Edmondson Message-Id: <20210705104632.2902400-9-david.edmondson@oracle.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 57 ------------------------------------ target/i386/tcg/fpu_helper.c | 1 + target/i386/tcg/tcg-cpu.h | 57 ++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 57 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 96b672f8bd..0f7ddbfeae 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1305,48 +1305,6 @@ typedef struct XSavePKRU { uint32_t padding; } XSavePKRU; -#define XSAVE_FCW_FSW_OFFSET 0x000 -#define XSAVE_FTW_FOP_OFFSET 0x004 -#define XSAVE_CWD_RIP_OFFSET 0x008 -#define XSAVE_CWD_RDP_OFFSET 0x010 -#define XSAVE_MXCSR_OFFSET 0x018 -#define XSAVE_ST_SPACE_OFFSET 0x020 -#define XSAVE_XMM_SPACE_OFFSET 0x0a0 -#define XSAVE_XSTATE_BV_OFFSET 0x200 -#define XSAVE_AVX_OFFSET 0x240 -#define XSAVE_BNDREG_OFFSET 0x3c0 -#define XSAVE_BNDCSR_OFFSET 0x400 -#define XSAVE_OPMASK_OFFSET 0x440 -#define XSAVE_ZMM_HI256_OFFSET 0x480 -#define XSAVE_HI16_ZMM_OFFSET 0x680 -#define XSAVE_PKRU_OFFSET 0xa80 - -typedef struct X86XSaveArea { - X86LegacyXSaveArea legacy; - X86XSaveHeader header; - - /* Extended save areas: */ - - /* AVX State: */ - XSaveAVX avx_state; - - /* Ensure that XSaveBNDREG is properly aligned. */ - uint8_t padding[XSAVE_BNDREG_OFFSET - - sizeof(X86LegacyXSaveArea) - - sizeof(X86XSaveHeader) - - sizeof(XSaveAVX)]; - - /* MPX State: */ - XSaveBNDREG bndreg_state; - XSaveBNDCSR bndcsr_state; - /* AVX-512 State: */ - XSaveOpmask opmask_state; - XSaveZMM_Hi256 zmm_hi256_state; - XSaveHi16_ZMM hi16_zmm_state; - /* PKRU State: */ - XSavePKRU pkru_state; -} X86XSaveArea; - QEMU_BUILD_BUG_ON(sizeof(XSaveAVX) != 0x100); QEMU_BUILD_BUG_ON(sizeof(XSaveBNDREG) != 0x40); QEMU_BUILD_BUG_ON(sizeof(XSaveBNDCSR) != 0x40); @@ -1355,21 +1313,6 @@ QEMU_BUILD_BUG_ON(sizeof(XSaveZMM_Hi256) != 0x200); QEMU_BUILD_BUG_ON(sizeof(XSaveHi16_ZMM) != 0x400); QEMU_BUILD_BUG_ON(sizeof(XSavePKRU) != 0x8); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.fcw) != XSAVE_FCW_FSW_OFFSET); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.ftw) != XSAVE_FTW_FOP_OFFSET); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.fpip) != XSAVE_CWD_RIP_OFFSET); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.fpdp) != XSAVE_CWD_RDP_OFFSET); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.mxcsr) != XSAVE_MXCSR_OFFSET); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.fpregs) != XSAVE_ST_SPACE_OFFSET); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.xmm_regs) != XSAVE_XMM_SPACE_OFFSET); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, avx_state) != XSAVE_AVX_OFFSET); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, bndreg_state) != XSAVE_BNDREG_OFFSET); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, bndcsr_state) != XSAVE_BNDCSR_OFFSET); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, opmask_state) != XSAVE_OPMASK_OFFSET); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, zmm_hi256_state) != XSAVE_ZMM_HI256_OFFSET); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, hi16_zmm_state) != XSAVE_HI16_ZMM_OFFSET); -QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, pkru_state) != XSAVE_PKRU_OFFSET); - typedef struct ExtSaveArea { uint32_t feature, bits; uint32_t offset, size; diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 4e11965067..74bbe94b80 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include #include "cpu.h" +#include "tcg-cpu.h" #include "exec/helper-proto.h" #include "fpu/softfloat.h" #include "fpu/softfloat-macros.h" diff --git a/target/i386/tcg/tcg-cpu.h b/target/i386/tcg/tcg-cpu.h index 36bd300af0..53a8494455 100644 --- a/target/i386/tcg/tcg-cpu.h +++ b/target/i386/tcg/tcg-cpu.h @@ -19,6 +19,63 @@ #ifndef TCG_CPU_H #define TCG_CPU_H +#define XSAVE_FCW_FSW_OFFSET 0x000 +#define XSAVE_FTW_FOP_OFFSET 0x004 +#define XSAVE_CWD_RIP_OFFSET 0x008 +#define XSAVE_CWD_RDP_OFFSET 0x010 +#define XSAVE_MXCSR_OFFSET 0x018 +#define XSAVE_ST_SPACE_OFFSET 0x020 +#define XSAVE_XMM_SPACE_OFFSET 0x0a0 +#define XSAVE_XSTATE_BV_OFFSET 0x200 +#define XSAVE_AVX_OFFSET 0x240 +#define XSAVE_BNDREG_OFFSET 0x3c0 +#define XSAVE_BNDCSR_OFFSET 0x400 +#define XSAVE_OPMASK_OFFSET 0x440 +#define XSAVE_ZMM_HI256_OFFSET 0x480 +#define XSAVE_HI16_ZMM_OFFSET 0x680 +#define XSAVE_PKRU_OFFSET 0xa80 + +typedef struct X86XSaveArea { + X86LegacyXSaveArea legacy; + X86XSaveHeader header; + + /* Extended save areas: */ + + /* AVX State: */ + XSaveAVX avx_state; + + /* Ensure that XSaveBNDREG is properly aligned. */ + uint8_t padding[XSAVE_BNDREG_OFFSET + - sizeof(X86LegacyXSaveArea) + - sizeof(X86XSaveHeader) + - sizeof(XSaveAVX)]; + + /* MPX State: */ + XSaveBNDREG bndreg_state; + XSaveBNDCSR bndcsr_state; + /* AVX-512 State: */ + XSaveOpmask opmask_state; + XSaveZMM_Hi256 zmm_hi256_state; + XSaveHi16_ZMM hi16_zmm_state; + /* PKRU State: */ + XSavePKRU pkru_state; +} X86XSaveArea; + +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.fcw) != XSAVE_FCW_FSW_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.ftw) != XSAVE_FTW_FOP_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.fpip) != XSAVE_CWD_RIP_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.fpdp) != XSAVE_CWD_RDP_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.mxcsr) != XSAVE_MXCSR_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.fpregs) != XSAVE_ST_SPACE_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, legacy.xmm_regs) != XSAVE_XMM_SPACE_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, avx_state) != XSAVE_AVX_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, bndreg_state) != XSAVE_BNDREG_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, bndcsr_state) != XSAVE_BNDCSR_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, opmask_state) != XSAVE_OPMASK_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, zmm_hi256_state) != XSAVE_ZMM_HI256_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, hi16_zmm_state) != XSAVE_HI16_ZMM_OFFSET); +QEMU_BUILD_BUG_ON(offsetof(X86XSaveArea, pkru_state) != XSAVE_PKRU_OFFSET); + bool tcg_cpu_realizefn(CPUState *cs, Error **errp); #endif /* TCG_CPU_H */ From patchwork Tue Jul 6 10:01:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360235 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17D16C07E96 for ; Tue, 6 Jul 2021 10:14:27 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D079661483 for ; Tue, 6 Jul 2021 10:14:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D079661483 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:35036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0i5x-0003CB-1b for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:14:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htu-0000tZ-1c for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:58 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:42568) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htq-0002Ib-Q5 for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:57 -0400 Received: by mail-wm1-x333.google.com with SMTP id j16-20020a05600c1c10b0290204b096b0caso1830498wms.1 for ; Tue, 06 Jul 2021 03:01:54 -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=eFGWHXQQb5do0DsUHv5riPRy9GmZyZQ5jxNxpkR/NPI=; b=FxMPVTAaBf/BHnrhRwiRC9fjHexBUDOXduoCcztMfa0LrKijH9c0Ip3GHCFLXiloqm G6qfRNikY2+pucSp5ljXYNxTqVpgmKb4n/EuiVIrkEYPmYDsiLiwfqcV0WSSekP1NqVQ 6TpkK9E6gTCg2NYEdb50QKp6QIkYHu3iWKm1Kbl32QwGL6bW4L7RQDbw/zuFHeCkEkgv LbkG13t9sewU2CYx3w6DKFv0weQymX2UDOc931FNnKHqRnA3BsSEs9WGd7FvUqXUFQzO O51mFtlhhlTshZ04ir2mdyM7axQscTXnF4FS1cD1gJLkmj+2wFUOsW9vh4vLBEsGUajN Igbg== 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=eFGWHXQQb5do0DsUHv5riPRy9GmZyZQ5jxNxpkR/NPI=; b=FT/ippwGWm3DNbx8gLj4QpHysMzMM076jP4CrNBuAQhRcrsfBxTi+oQIsF4TMCSdl+ JMvD39aYRq4Uh3zVt0AHjBiV/OnlEeQk7KxOsOZQh9QF67uqmQ1wOsIIdYYS2q4oWRZI C9O0pyVhgZ/lux+k6mke1TtadguBBk1+IygBBEptJHPTFNPXiDP3NBAPwZunsUq9tzlf uC+pbHx31VYAguqHDev75t7dQo4PBqlle9m0xScloRGuEOWKr97vpZK2l8gXXF/O8Gk4 XLg0I8dWPGIlG90w8JGPTLz/67i9If3jnHc6CBaniTN3PbKCgfjXOeUvwq1/UGlqPR9a 2rMQ== X-Gm-Message-State: AOAM532Kd+vA+KWaUnEpH7uDNA0M8aXj/u/eijcPgf88BgPSWcbMhMAd 4gV2nHVBLvpJjqHwWyrYSMyMKj9ewDo= X-Google-Smtp-Source: ABdhPJx2dsNvJ7GAlC6rdhzZQA2oyZVEJbQxRqXaQRYuYU5hfs6FAvR/Id5ZG1sKRClY29WoqDMmrA== X-Received: by 2002:a1c:cc02:: with SMTP id h2mr19164827wmb.39.1625565713193; Tue, 06 Jul 2021 03:01:53 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:52 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 16/40] configure: drop vte-2.90 check Date: Tue, 6 Jul 2021 12:01:17 +0200 Message-Id: <20210706100141.303960-17-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x333.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.25, 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: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" All currently supported distros have vte 0.37 or newer, which is where the ABI changed from 2.90 to 2.91. So drop support for the older ABI. Suggested-by: Daniel P. Berrangé Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- configure | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/configure b/configure index e799d908a3..27841f82ed 100755 --- a/configure +++ b/configure @@ -2803,19 +2803,13 @@ fi # VTE probe if test "$vte" != "no"; then - vteminversion="0.32.0" if $pkg_config --exists "vte-2.91"; then - vtepackage="vte-2.91" - else - vtepackage="vte-2.90" - fi - if $pkg_config --exists "$vtepackage >= $vteminversion"; then - vte_cflags=$($pkg_config --cflags $vtepackage) - vte_libs=$($pkg_config --libs $vtepackage) - vteversion=$($pkg_config --modversion $vtepackage) + vte_cflags=$($pkg_config --cflags vte-2.91) + vte_libs=$($pkg_config --libs vte-2.91) + vteversion=$($pkg_config --modversion vte-2.91) vte="yes" elif test "$vte" = "yes"; then - feature_not_found "vte" "Install libvte-2.90/2.91 devel" + feature_not_found "vte" "Install libvte-2.91 devel" else vte="no" fi From patchwork Tue Jul 6 10:01:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360267 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 546DCC07E9B for ; Tue, 6 Jul 2021 10:23:45 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DEC2F61103 for ; Tue, 6 Jul 2021 10:23:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DEC2F61103 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iEx-0001JN-SW for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:23:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htv-0000xO-6e for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:59 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:52774) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htr-0002Ip-8K for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:58 -0400 Received: by mail-wm1-x32e.google.com with SMTP id g10so7313776wmh.2 for ; Tue, 06 Jul 2021 03:01:54 -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=TlOzwIT4gtytQD0QVEnnLxCV4g3S+nSjH2SRuBjT3ZE=; b=qHof6KqAAAIEUS51mrgRdc7OgEiuGD9/9uLf4wjOz9R/vKTt+YKgrq2wGzKiblwmLD W0maiHDv3aeM5APIuJSv87x5rgT9RbKgyrNop61tUpvtTNWNAYbN5T+NJL/LzRKyPEEz rrtjw4g+venEAWoRKS2QIF3cB83gqwc2nSu2cIGX9sviqwEmouZvxWExWozx0ppgEERd jM6sEWgTB7Ond1kFPR+tPhDebZGmIVAourtR88msGjdLbrTD3uPfJ5y+Za0GsJYLLdP9 fjMGvp91HkD6cPXpteVThckJBGGO+FAC5ANY4CaZRpZay10wBxeEgp7rxl5g0Cd7zp1h cnoQ== 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=TlOzwIT4gtytQD0QVEnnLxCV4g3S+nSjH2SRuBjT3ZE=; b=cJDMphE108puahVqpJqlvjJBjEtJl9jXO58mZQVJfwHxgJof7e5jEDolQW7DG6PmXF 1DpsDxHJ4PilirdxC7RSz7ha+uoGIyhRRsGCvGP5eyvnLqjh2ZRMEi3Vpyk+Fe4ztC89 4mQGVZq9dSCWsumVBlIgWjw97ph5eQ6o5UsGFG8T7uHNd/Jjt85MaP+45zQeY5XxQst0 4Ohk2qbYxE5BogDAblA8SsJL1IboorCAKYMPXtGXwNGSHzRvjRz9yyTIp3oN3SYfczJ5 YyI669WLgrdig3aQbwAyDfohlFL+gBile0uGfZmsVHhxuOiHN57TD34T+oUwYERdnErt zOXQ== X-Gm-Message-State: AOAM533x2ax9M8uOEpDJK6llX/wOyfhsQ8kj1GZfgVRJKeMClf763UGA qwxbV2nKBw1bsxBrauXkwfNEAXvYfA0= X-Google-Smtp-Source: ABdhPJyMg5p17jflfQVxlh9CZHMFK9BKZDpMeaJ8PVEe0jTpfgVZGl02vOocCS//aKUexT0InZjdrQ== X-Received: by 2002:a1c:f705:: with SMTP id v5mr3843539wmh.69.1625565713814; Tue, 06 Jul 2021 03:01:53 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:53 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 17/40] configure, meson: convert vte detection to meson Date: Tue, 6 Jul 2021 12:01:18 +0200 Message-Id: <20210706100141.303960-18-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32e.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.25, 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: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- configure | 29 ++++------------------------- meson.build | 16 ++++++++++------ meson_options.txt | 2 ++ 3 files changed, 16 insertions(+), 31 deletions(-) diff --git a/configure b/configure index 27841f82ed..fe86da4fdd 100755 --- a/configure +++ b/configure @@ -408,7 +408,7 @@ gnutls="auto" nettle="auto" gcrypt="auto" auth_pam="auto" -vte="$default_feature" +vte="auto" virglrenderer="$default_feature" tpm="$default_feature" libssh="$default_feature" @@ -1395,9 +1395,9 @@ for opt do ;; --disable-pvrdma) pvrdma="no" ;; - --disable-vte) vte="no" + --disable-vte) vte="disabled" ;; - --enable-vte) vte="yes" + --enable-vte) vte="enabled" ;; --disable-virglrenderer) virglrenderer="no" ;; @@ -2799,22 +2799,6 @@ EOF fi fi -########################################## -# VTE probe - -if test "$vte" != "no"; then - if $pkg_config --exists "vte-2.91"; then - vte_cflags=$($pkg_config --cflags vte-2.91) - vte_libs=$($pkg_config --libs vte-2.91) - vteversion=$($pkg_config --modversion vte-2.91) - vte="yes" - elif test "$vte" = "yes"; then - feature_not_found "vte" "Install libvte-2.91 devel" - else - vte="no" - fi -fi - ########################################## # RDMA needs OpenFabrics libraries if test "$rdma" != "no" ; then @@ -5482,11 +5466,6 @@ fi if test "$have_copy_file_range" = "yes" ; then echo "HAVE_COPY_FILE_RANGE=y" >> $config_host_mak fi -if test "$vte" = "yes" ; then - echo "CONFIG_VTE=y" >> $config_host_mak - echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak - echo "VTE_LIBS=$vte_libs" >> $config_host_mak -fi if test "$virglrenderer" = "yes" ; then echo "CONFIG_VIRGL=y" >> $config_host_mak echo "VIRGL_CFLAGS=$virgl_cflags" >> $config_host_mak @@ -6149,7 +6128,7 @@ if test "$skip_meson" = no; then -Dkvm=$kvm -Dhax=$hax -Dwhpx=$whpx -Dhvf=$hvf -Dnvmm=$nvmm \ -Dxen=$xen -Dxen_pci_passthrough=$xen_pci_passthrough -Dtcg=$tcg \ -Dcocoa=$cocoa -Dgtk=$gtk -Dmpath=$mpath -Dsdl=$sdl -Dsdl_image=$sdl_image \ - -Dlibusb=$libusb -Dsmartcard=$smartcard -Dusb_redir=$usb_redir \ + -Dlibusb=$libusb -Dsmartcard=$smartcard -Dusb_redir=$usb_redir -Dvte=$vte \ -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \ -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f -Dvirtiofsd=$virtiofsd \ -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt -Dbrlapi=$brlapi \ diff --git a/meson.build b/meson.build index db6789af9c..b15c1ee4fd 100644 --- a/meson.build +++ b/meson.build @@ -860,6 +860,7 @@ endif gtk = not_found gtkx11 = not_found +vte = not_found if not get_option('gtk').auto() or (have_system and not cocoa.found()) gtk = dependency('gtk+-3.0', version: '>=3.22.0', method: 'pkg-config', @@ -871,14 +872,16 @@ if not get_option('gtk').auto() or (have_system and not cocoa.found()) required: false, kwargs: static_kwargs) gtk = declare_dependency(dependencies: [gtk, gtkx11]) + + if not get_option('vte').auto() or have_system + vte = dependency('vte-2.91', + method: 'pkg-config', + required: get_option('vte'), + kwargs: static_kwargs) + endif endif endif -vte = not_found -if 'CONFIG_VTE' in config_host - vte = declare_dependency(compile_args: config_host['VTE_CFLAGS'].split(), - link_args: config_host['VTE_LIBS'].split()) -endif x11 = not_found if gtkx11.found() x11 = dependency('x11', method: 'pkg-config', required: gtkx11.found(), @@ -1208,6 +1211,7 @@ if glusterfs.found() config_host_data.set('CONFIG_GLUSTERFS_IOCB_HAS_STAT', glusterfs_iocb_has_stat) endif config_host_data.set('CONFIG_GTK', gtk.found()) +config_host_data.set('CONFIG_VTE', vte.found()) config_host_data.set('CONFIG_LIBATTR', have_old_libattr) config_host_data.set('CONFIG_LIBCAP_NG', libcap_ng.found()) config_host_data.set('CONFIG_EBPF', libbpf.found()) @@ -2756,7 +2760,7 @@ summary_info += {'SDL image support': sdl_image.found()} summary_info += {'GTK support': gtk.found()} summary_info += {'pixman': pixman.found()} # TODO: add back version -summary_info += {'VTE support': config_host.has_key('CONFIG_VTE')} +summary_info += {'VTE support': vte.found()} # TODO: add back version summary_info += {'slirp support': slirp_opt == 'disabled' ? false : slirp_opt} summary_info += {'libtasn1': tasn1.found()} diff --git a/meson_options.txt b/meson_options.txt index f7ec9bee27..8af42987f4 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -118,6 +118,8 @@ option('vnc_png', type : 'feature', value : 'auto', description: 'PNG compression for VNC server') option('vnc_sasl', type : 'feature', value : 'auto', description: 'SASL authentication for VNC server') +option('vte', type : 'feature', value : 'auto', + description: 'vte support for the gtk UI') option('xkbcommon', type : 'feature', value : 'auto', description: 'xkbcommon support') option('zstd', type : 'feature', value : 'auto', From patchwork Tue Jul 6 10:01:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360279 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5020FC07E96 for ; Tue, 6 Jul 2021 10:28:35 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E3B36619A9 for ; Tue, 6 Jul 2021 10:28:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E3B36619A9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:56762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iJe-00033V-0B for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:28:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htv-0000yK-Do for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:59 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:33365) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htr-0002JS-RG for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:59 -0400 Received: by mail-wr1-x432.google.com with SMTP id d2so1736089wrn.0 for ; Tue, 06 Jul 2021 03:01:55 -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=SK7FknGsSrVgBMFyN/dZ8ttg0HVj9/0z08oXPSrO+gU=; b=JKfEG/QuxUgLwfzy8LhBHv86YC609PmIGb7R+AmhQs9VhKiIxLCCalJeZQy9l8Pomp 5/BIRSplirMGMEZk3f6DtEKBjUs2aJeNQQRqqL/mEGnzrpe0c+Uaj80KkLbfkJOh4iJO 8SqLGpnWodi+FpkE7LG7h/fSJhdhXD40J8EbwW7KHV5X4oMM0rAcedxKeHmcycOQ/DVj F1a5YdnS90xzdhUVsVb4oeiV4AftrgLDRsqDeEPGsNkt5l2CLIr3FBwOt67XwreLKUjn 62XfF28MNugnNetRHfTx6H5GW9rta/trydIlbiHtfsqaEMeJhIaiX3GugOQPqNULTm+a hVlA== 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=SK7FknGsSrVgBMFyN/dZ8ttg0HVj9/0z08oXPSrO+gU=; b=LBJLuaFn7VCGJPqE9yJHrl9thjtEwVcLMXQVGukwXtoRWGtMFMR4sTzGYdnNXlq0J6 i16WYN8biF9hiNZP9KeglM+6UuUDR/yjTRI04Mytt9TW8x5aGRKsJ0uNcRjX5WcS5PGi yEK7bWWiWJes+QpfLiP5yj35FSutkWudwM6yEjgouWNHUV02WiqMBj8fmWeh1vbwS/H7 R/obIrBjQ3AVFhtq1Sp9Sj5DuX8J9g47HSaUoITqQo3Fx+D1iqg+mPc/oOTghxW3m4He wImhiB/ArGx4lxDTV5RET4BXLn8pzABP0jilJCsM4XCIlIekKw5n+PmoCYkRxF/xplIy zcrA== X-Gm-Message-State: AOAM532D1ox1feUJYzpynKb6xQ4u/h73KuHG8bf7FK9MJAfeK5qjOrCe vYiI2qFiGpIvEDlDfzFd1u3vrNNyV9Y= X-Google-Smtp-Source: ABdhPJzER+xS3tvZoTCIdCoHJlsEIFD8lFG5RzBOXqnmavLsIlR9jJ2IO9rQG/0Ja7pwjY3Jjn9AJA== X-Received: by 2002:a5d:5751:: with SMTP id q17mr21057275wrw.245.1625565714446; Tue, 06 Jul 2021 03:01:54 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:54 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 18/40] configure, meson: convert virgl detection to meson Date: Tue, 6 Jul 2021 12:01:19 +0200 Message-Id: <20210706100141.303960-19-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x432.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.25, 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: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- configure | 35 ++++------------------------------- hw/display/meson.build | 6 +++--- meson.build | 10 ++++++---- meson_options.txt | 2 ++ 4 files changed, 15 insertions(+), 38 deletions(-) diff --git a/configure b/configure index fe86da4fdd..895192e0de 100755 --- a/configure +++ b/configure @@ -409,7 +409,7 @@ nettle="auto" gcrypt="auto" auth_pam="auto" vte="auto" -virglrenderer="$default_feature" +virglrenderer="auto" tpm="$default_feature" libssh="$default_feature" live_block_migration=${default_feature:-yes} @@ -1399,9 +1399,9 @@ for opt do ;; --enable-vte) vte="enabled" ;; - --disable-virglrenderer) virglrenderer="no" + --disable-virglrenderer) virglrenderer="disabled" ;; - --enable-virglrenderer) virglrenderer="yes" + --enable-virglrenderer) virglrenderer="enabled" ;; --disable-tpm) tpm="no" ;; @@ -4036,28 +4036,6 @@ EOF fi fi -########################################## -# virgl renderer probe - -if test "$virglrenderer" != "no" ; then - cat > $TMPC << EOF -#include -int main(void) { virgl_renderer_poll(); return 0; } -EOF - virgl_cflags=$($pkg_config --cflags virglrenderer 2>/dev/null) - virgl_libs=$($pkg_config --libs virglrenderer 2>/dev/null) - virgl_version=$($pkg_config --modversion virglrenderer 2>/dev/null) - if $pkg_config virglrenderer >/dev/null 2>&1 && \ - compile_prog "$virgl_cflags" "$virgl_libs" ; then - virglrenderer="yes" - else - if test "$virglrenderer" = "yes" ; then - feature_not_found "virglrenderer" - fi - virglrenderer="no" - fi -fi - ########################################## # capstone @@ -5466,11 +5444,6 @@ fi if test "$have_copy_file_range" = "yes" ; then echo "HAVE_COPY_FILE_RANGE=y" >> $config_host_mak fi -if test "$virglrenderer" = "yes" ; then - echo "CONFIG_VIRGL=y" >> $config_host_mak - echo "VIRGL_CFLAGS=$virgl_cflags" >> $config_host_mak - echo "VIRGL_LIBS=$virgl_libs" >> $config_host_mak -fi if test "$xen" = "enabled" ; then echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak @@ -6137,7 +6110,7 @@ if test "$skip_meson" = no; then -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \ -Dgnutls=$gnutls -Dnettle=$nettle -Dgcrypt=$gcrypt -Dauth_pam=$auth_pam \ -Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs -Dcap_ng=$cap_ng \ - -Dattr=$attr -Ddefault_devices=$default_devices \ + -Dattr=$attr -Ddefault_devices=$default_devices -Dvirglrenderer=$virglrenderer \ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server -Dmultiprocess=$multiprocess \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi -Dbpf=$bpf\ diff --git a/hw/display/meson.build b/hw/display/meson.build index e1f473c1df..1e6b707d3c 100644 --- a/hw/display/meson.build +++ b/hw/display/meson.build @@ -61,7 +61,7 @@ if config_all_devices.has_key('CONFIG_VIRTIO_GPU') hw_display_modules += {'virtio-gpu': virtio_gpu_ss} virtio_gpu_gl_ss = ss.source_set() - virtio_gpu_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRGL', opengl], + virtio_gpu_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', virgl, opengl], if_true: [files('virtio-gpu-gl.c', 'virtio-gpu-virgl.c'), pixman, virgl]) hw_display_modules += {'virtio-gpu-gl': virtio_gpu_gl_ss} endif @@ -75,7 +75,7 @@ if config_all_devices.has_key('CONFIG_VIRTIO_PCI') hw_display_modules += {'virtio-gpu-pci': virtio_gpu_pci_ss} virtio_gpu_pci_gl_ss = ss.source_set() - virtio_gpu_pci_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRTIO_PCI', 'CONFIG_VIRGL', opengl], + virtio_gpu_pci_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRTIO_PCI', virgl, opengl], if_true: [files('virtio-gpu-pci-gl.c'), pixman]) hw_display_modules += {'virtio-gpu-pci-gl': virtio_gpu_pci_gl_ss} endif @@ -89,7 +89,7 @@ if config_all_devices.has_key('CONFIG_VIRTIO_VGA') hw_display_modules += {'virtio-vga': virtio_vga_ss} virtio_vga_gl_ss = ss.source_set() - virtio_vga_gl_ss.add(when: ['CONFIG_VIRTIO_VGA', 'CONFIG_VIRGL', opengl], + virtio_vga_gl_ss.add(when: ['CONFIG_VIRTIO_VGA', virgl, opengl], if_true: [files('virtio-vga-gl.c'), pixman]) hw_display_modules += {'virtio-vga-gl': virtio_vga_gl_ss} endif diff --git a/meson.build b/meson.build index b15c1ee4fd..84ffdb4599 100644 --- a/meson.build +++ b/meson.build @@ -471,9 +471,11 @@ if 'CONFIG_GBM' in config_host link_args: config_host['GBM_LIBS'].split()) endif virgl = not_found -if 'CONFIG_VIRGL' in config_host - virgl = declare_dependency(compile_args: config_host['VIRGL_CFLAGS'].split(), - link_args: config_host['VIRGL_LIBS'].split()) +if not get_option('virglrenderer').auto() or have_system + virgl = dependency('virglrenderer', + method: 'pkg-config', + required: get_option('virglrenderer'), + kwargs: static_kwargs) endif curl = not_found if not get_option('curl').auto() or have_block @@ -2768,7 +2770,7 @@ summary_info += {'PAM': pam.found()} summary_info += {'iconv support': iconv.found()} summary_info += {'curses support': curses.found()} # TODO: add back version -summary_info += {'virgl support': config_host.has_key('CONFIG_VIRGL')} +summary_info += {'virgl support': virgl.found()} summary_info += {'curl support': curl.found()} summary_info += {'Multipath support': mpathpersist.found()} summary_info += {'VNC support': vnc.found()} diff --git a/meson_options.txt b/meson_options.txt index 8af42987f4..a70aedb0eb 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -110,6 +110,8 @@ option('u2f', type : 'feature', value : 'auto', description: 'U2F emulation support') option('usb_redir', type : 'feature', value : 'auto', description: 'libusbredir support') +option('virglrenderer', type : 'feature', value : 'auto', + description: 'virgl rendering support') option('vnc', type : 'feature', value : 'enabled', description: 'VNC server') option('vnc_jpeg', type : 'feature', value : 'auto', From patchwork Tue Jul 6 10:01:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360241 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0617DC07E96 for ; Tue, 6 Jul 2021 10:16:44 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 75322619A1 for ; Tue, 6 Jul 2021 10:16:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75322619A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0i8A-0000dc-GH for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:16:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htv-0000yR-Ey for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:59 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:37487) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0hts-0002KU-F8 for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:59 -0400 Received: by mail-wm1-x32a.google.com with SMTP id r9-20020a7bc0890000b02901f347b31d55so1280768wmh.2 for ; Tue, 06 Jul 2021 03:01:56 -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=/MVRv4+jx3llq16RDcVRAyicy4Ay5QfckD+dpn3sjS4=; b=Zl7pNb8Fjo13bdt+8VyfXU+w54TGNe1wex2TfADC82PhaxuqVIEgZyko28gAWvY2z9 din7f0v6i59sQpF/CX23R+0rOEsM2hw8hCPEfuB87op+ikqMX0NuS2DYYZo5UJHpECHm TPwmDpKDs2/KtNPJ01+vUjTmIIe06YKbwqFJbhypp/Bfzu/98EZ6k/eVmiLGGhaUlXga 2quBnmOrlFAeMYlzhtTkao+DubmqbFItMjReFZWOOwg9a9Hh8Y3F7ZFHfdOqxiDPJBe/ fpXAWEWSPZTrdwHeOBtdeNI8B0zhW3weAZBN2+X7GKgAQy+NNqmCrUeuWyFKfkZnYI5R lPUQ== 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=/MVRv4+jx3llq16RDcVRAyicy4Ay5QfckD+dpn3sjS4=; b=gh5yX+nhkSuEY1JJjrcl67QzvBc8Uhc2ecZWmWLZ8UkqCIBlaVHVutnEUK1wcug1Vp d7C0EOuqJaCHzaZeEw9rnjDhywNcda3w1MthTRTYkXq2yF2iox7OPUZwt8SzR7Gqbg4k Fey/NqJf2aH3KplihSo8QJ9/DSScVQU95tRDnvJN8lFOOUWOaKXgo8+8F6pRTKykE746 2/7rNuduHXrsiFvI7MnRiZr8w5fQQrwaF7aXc6NnFnsraDSM5JZkuMVQODshsliENNWT DHeBHBRCXDszoKOMS822SBIn8wbSQBRT0dG0XmhyAn1w4LD/+XJ1jMHzECiE9V4Kh3z+ yCGg== X-Gm-Message-State: AOAM531mI8vDPZXLOkfkvO2bLEPaf5aYkrEqxBAVPlpSEWm2itEF7onc azA45O/YNUrRVXvcH9gUSsGhDTwkiYk= X-Google-Smtp-Source: ABdhPJx2+QOFwpdIm0t0OgR3JQwe7c52LY5YaC4hhZOOmi7VHSokArobXBYe2tI1hu6JAW3JD9FTKA== X-Received: by 2002:a05:600c:3b0b:: with SMTP id m11mr19781086wms.162.1625565715152; Tue, 06 Jul 2021 03:01:55 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:54 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 19/40] configure, meson: convert libdaxctl detection to meson Date: Tue, 6 Jul 2021 12:01:20 +0200 Message-Id: <20210706100141.303960-20-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32a.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.25, 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: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- configure | 28 ++++------------------------ meson.build | 8 +++++--- meson_options.txt | 2 ++ 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/configure b/configure index 895192e0de..5b18f4fac3 100755 --- a/configure +++ b/configure @@ -433,7 +433,7 @@ plugins="no" fuzzing="no" rng_none="no" secret_keyring="$default_feature" -libdaxctl="$default_feature" +libdaxctl="auto" meson="" ninja="" skip_meson=no @@ -1534,9 +1534,9 @@ for opt do ;; --disable-keyring) secret_keyring="no" ;; - --enable-libdaxctl) libdaxctl=yes + --enable-libdaxctl) libdaxctl=disabled ;; - --disable-libdaxctl) libdaxctl=no + --disable-libdaxctl) libdaxctl=enabled ;; --enable-fuse) fuse="enabled" ;; @@ -4949,22 +4949,6 @@ if test "$libpmem" != "no"; then fi fi -########################################## -# check for libdaxctl - -if test "$libdaxctl" != "no"; then - if $pkg_config --atleast-version=57 "libdaxctl"; then - libdaxctl="yes" - libdaxctl_libs=$($pkg_config --libs libdaxctl) - libdaxctl_cflags=$($pkg_config --cflags libdaxctl) - else - if test "$libdaxctl" = "yes" ; then - feature_not_found "libdaxctl" "Install libdaxctl" - fi - libdaxctl="no" - fi -fi - ########################################## # check for slirp @@ -5738,11 +5722,6 @@ if test "$libpmem" = "yes" ; then echo "LIBPMEM_CFLAGS=$libpmem_cflags" >> $config_host_mak fi -if test "$libdaxctl" = "yes" ; then - echo "CONFIG_LIBDAXCTL=y" >> $config_host_mak - echo "LIBDAXCTL_LIBS=$libdaxctl_libs" >> $config_host_mak -fi - if test "$bochs" = "yes" ; then echo "CONFIG_BOCHS=y" >> $config_host_mak fi @@ -6108,6 +6087,7 @@ if test "$skip_meson" = no; then -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \ -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \ + -Dlibdaxctl=$libdaxctl \ -Dgnutls=$gnutls -Dnettle=$nettle -Dgcrypt=$gcrypt -Dauth_pam=$auth_pam \ -Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs -Dcap_ng=$cap_ng \ -Dattr=$attr -Ddefault_devices=$default_devices -Dvirglrenderer=$virglrenderer \ diff --git a/meson.build b/meson.build index 84ffdb4599..e530829105 100644 --- a/meson.build +++ b/meson.build @@ -1011,8 +1011,10 @@ if 'CONFIG_LIBPMEM' in config_host link_args: config_host['LIBPMEM_LIBS'].split()) endif libdaxctl = not_found -if 'CONFIG_LIBDAXCTL' in config_host - libdaxctl = declare_dependency(link_args: config_host['LIBDAXCTL_LIBS'].split()) +if not get_option('libdaxctl').auto() or have_system + libdaxctl = dependency('libdaxctl', required: get_option('libdaxctl'), + version: '>=57', method: 'pkg-config', + kwargs: static_kwargs) endif tasn1 = not_found if gnutls.found() @@ -2821,7 +2823,7 @@ summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')} summary_info += {'libxml2': config_host.has_key('CONFIG_LIBXML2')} summary_info += {'capstone': capstone_opt == 'disabled' ? false : capstone_opt} summary_info += {'libpmem support': config_host.has_key('CONFIG_LIBPMEM')} -summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')} +summary_info += {'libdaxctl support': libdaxctl.found()} summary_info += {'libudev': libudev.found()} summary_info += {'FUSE lseek': fuse_lseek.found()} summary(summary_info, bool_yn: true, section: 'Dependencies') diff --git a/meson_options.txt b/meson_options.txt index a70aedb0eb..46180000fd 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -84,6 +84,8 @@ option('nettle', type : 'feature', value : 'auto', description: 'nettle cryptography support') option('gcrypt', type : 'feature', value : 'auto', description: 'libgcrypt cryptography support') +option('libdaxctl', type : 'feature', value : 'auto', + description: 'libdaxctl support') option('libudev', type : 'feature', value : 'auto', description: 'Use libudev to enumerate host devices') option('libusb', type : 'feature', value : 'auto', From patchwork Tue Jul 6 10:01:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360287 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE74DC07E96 for ; Tue, 6 Jul 2021 10:32:31 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5A790619AC for ; Tue, 6 Jul 2021 10:32:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A790619AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:36956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iNS-0000HU-8h for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:32:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htv-0000yW-G4 for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:59 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:45752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htt-0002L9-BA for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:01:59 -0400 Received: by mail-wr1-x433.google.com with SMTP id i8so12482651wrp.12 for ; Tue, 06 Jul 2021 03:01:56 -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=NOvdFt+RLlKN0qQm+dvftDb9ngUzv7CJ6xbSDTj8gq0=; b=dpKtzZLOKV3zFMWBNrtZp1H2aAuVI5lOk/xhMc7pi3JED4Uc6M1GtOfGSKANtVUuF1 F5fT03nbyJtTAlkhwggn997jnYg28TjqLK/AapEXLULShv9ty51Guu0PnLFGYRvhAMnh UzGHCveDaRK8iAFBWvzeT0DM/+xy/CrCxIlwfsIOzI46SShbS5OG1CjqYIiTQr5M76TA 0IDtlDA91ub8luUhF4GOE2mrMwtoPiiXl9Jlkj4BBD6dhBe+th1/snMX7HbQpfKkBlUk JqlRn8eXjvSa4rrgYpY3MoTwmavWxOHTItyAP8trxVs2pUPNZsNO4IJxhCwtQ47gcqlD Re/A== 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=NOvdFt+RLlKN0qQm+dvftDb9ngUzv7CJ6xbSDTj8gq0=; b=pXOPuzGNz9IeXAQt38yw+/0hmMB6mFOAcbZfBIvxr4sQ3kzLlymLz9kO0h4jpGKtxu 2buCvuKucNKDOYKjO7yfhBSOas/2ceOHMugbH4DW31FFZoyfytrEkHgMmXhC78rEULFn WSyDg7sO475gG5t4E6p7tB4uVPkbBYIkN+kuBpkmf4rJBEeBdwWc568PrOhwnPotG1Yd x10aYxSfPQ3a8pIGgSmQ7ypkaUiXpp3qrXBgjyVmtbjfGjOYRO84Nss1o8OuW7/3E6dJ zVemUIZaMIvPHyR9vdnxHuSvQoSXRWxMMgLzo0eA8woq6cmqO+M2bno11MlT61gJXN1N xQhw== X-Gm-Message-State: AOAM5332moULvYNoMxEni+fLZWSUeOviPkGWdi+1bG1vzKsAEQhdTLDX IbeFJxdiujoAaa5M6aS2O+34lu9enEk= X-Google-Smtp-Source: ABdhPJy7MWbGkN3DVDMDffTZ7tSDsOxTdsdk1nzOZEx0KYwAl3dvVzd2sVhV/Ly0qNBB27CKB3e73Q== X-Received: by 2002:a5d:6d81:: with SMTP id l1mr20341360wrs.282.1625565715976; Tue, 06 Jul 2021 03:01:55 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:55 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 20/40] configure, meson: convert libpmem detection to meson Date: Tue, 6 Jul 2021 12:01:21 +0200 Message-Id: <20210706100141.303960-21-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x433.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.25, 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: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- configure | 24 ++++-------------------- meson.build | 8 ++++---- meson_options.txt | 2 ++ 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/configure b/configure index 5b18f4fac3..51b8c3290a 100755 --- a/configure +++ b/configure @@ -427,7 +427,7 @@ qed=${default_feature:-yes} parallels=${default_feature:-yes} libxml2="$default_feature" debug_mutex="no" -libpmem="$default_feature" +libpmem="auto" default_devices="true" plugins="no" fuzzing="no" @@ -1504,9 +1504,9 @@ for opt do ;; --disable-debug-mutex) debug_mutex=no ;; - --enable-libpmem) libpmem=yes + --enable-libpmem) libpmem=disabled ;; - --disable-libpmem) libpmem=no + --disable-libpmem) libpmem=enabled ;; --enable-xkbcommon) xkbcommon="enabled" ;; @@ -4933,22 +4933,6 @@ EOF fi fi -########################################## -# check for libpmem - -if test "$libpmem" != "no"; then - if $pkg_config --exists "libpmem"; then - libpmem="yes" - libpmem_libs=$($pkg_config --libs libpmem) - libpmem_cflags=$($pkg_config --cflags libpmem) - else - if test "$libpmem" = "yes" ; then - feature_not_found "libpmem" "Install nvml or pmdk" - fi - libpmem="no" - fi -fi - ########################################## # check for slirp @@ -6087,7 +6071,7 @@ if test "$skip_meson" = no; then -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \ -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \ - -Dlibdaxctl=$libdaxctl \ + -Dlibdaxctl=$libdaxctl -Dlibpmem=$libpmem \ -Dgnutls=$gnutls -Dnettle=$nettle -Dgcrypt=$gcrypt -Dauth_pam=$auth_pam \ -Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs -Dcap_ng=$cap_ng \ -Dattr=$attr -Ddefault_devices=$default_devices -Dvirglrenderer=$virglrenderer \ diff --git a/meson.build b/meson.build index e530829105..e301eda3a5 100644 --- a/meson.build +++ b/meson.build @@ -1006,9 +1006,9 @@ if not get_option('libusb').auto() or have_system endif libpmem = not_found -if 'CONFIG_LIBPMEM' in config_host - libpmem = declare_dependency(compile_args: config_host['LIBPMEM_CFLAGS'].split(), - link_args: config_host['LIBPMEM_LIBS'].split()) +if not get_option('libpmem').auto() or have_system + libpmem = dependency('libpmem', required: get_option('libpmem'), + method: 'pkg-config', kwargs: static_kwargs) endif libdaxctl = not_found if not get_option('libdaxctl').auto() or have_system @@ -2822,7 +2822,7 @@ summary_info += {'zstd support': zstd.found()} summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')} summary_info += {'libxml2': config_host.has_key('CONFIG_LIBXML2')} summary_info += {'capstone': capstone_opt == 'disabled' ? false : capstone_opt} -summary_info += {'libpmem support': config_host.has_key('CONFIG_LIBPMEM')} +summary_info += {'libpmem support': libpmem.found()} summary_info += {'libdaxctl support': libdaxctl.found()} summary_info += {'libudev': libudev.found()} summary_info += {'FUSE lseek': fuse_lseek.found()} diff --git a/meson_options.txt b/meson_options.txt index 46180000fd..b23174d0a1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -86,6 +86,8 @@ option('gcrypt', type : 'feature', value : 'auto', description: 'libgcrypt cryptography support') option('libdaxctl', type : 'feature', value : 'auto', description: 'libdaxctl support') +option('libpmem', type : 'feature', value : 'auto', + description: 'libpmem support') option('libudev', type : 'feature', value : 'auto', description: 'Use libudev to enumerate host devices') option('libusb', type : 'feature', value : 'auto', From patchwork Tue Jul 6 10:01:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360261 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B711BC07E96 for ; Tue, 6 Jul 2021 10:22:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 64AAC619A2 for ; Tue, 6 Jul 2021 10:22:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 64AAC619A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:36030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iDd-0005yT-EG for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:22:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htw-00012t-WA for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:01 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:36732) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htu-0002LK-0R for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:00 -0400 Received: by mail-wm1-x332.google.com with SMTP id t14-20020a05600c198eb029020c8aac53d4so3283450wmq.1 for ; Tue, 06 Jul 2021 03:01:57 -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=kaaZWJiitdvOZB1EKQidwztAXzBPA1xDA7Q+V1EEpW4=; b=Bn0dwgp5UC7lhEJzw9+gsKlzcad+LNDqX40L52Tg1k+FI1/mb4Vk+FmUW6ylVy/F6T Rh13oKwEXAXY2yCZG0getXorhey/c+gfKjqqwwFyHSPP/ron0ZJp+gqnM2YFim/q80t+ jOlj6Nlk43AaR7AaZeW/ZXAAQ5i/KTXFnWgF6llhue0S/xNaVOV2bplnBJA+9DoQL6/h i+iu87L25bInULEicWe3p1e+ptCo4vjrr0GjksDylwLd2CXEz2uhVxRUAd8x0SfOmbpe UXFukpqz5LhOfUWBak5cBsOUiVyTE9kn0SKJylIOI4Wfa2AMJTFMgbThCOD4y9edx/Ox n+qA== 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=kaaZWJiitdvOZB1EKQidwztAXzBPA1xDA7Q+V1EEpW4=; b=S7E92Fj8W/WIOmoia+StcGAxp8eFc4CusObZIAgfv/vrBZ1uWx4p2UBRxF1iNoy6pY p+BTXkVyl/gzP8brDUVna7reuDFoNBvHqEiQPNf3cefKDszoZwOl0j6w+Q7aiIVKQuWs jKbe5wA7c8S30SrqLcusSeG0CBuCA027YhtB/eDk5r+Dv8/URivEPlpG4/paa8MGgtZX EohzxpoWvPrYOywqRRxvzmnKElSqRtYUr41o2QhUKFSuAuT2c1Tc6G7raTHIbzoqszFI S+LnV0qe/D3Wy3UtNyYHt6y0UV2hWMRADmewBMKF2yBWqQpO5enXNuw7eELzEB/du8Kb VnXQ== X-Gm-Message-State: AOAM531Toxxk0g2WPv1Qx+33ACPo/DF/qI0C4njKxk4unOkNMoGeug0w aKLg3LHIcV7FLznbJpIBORDnpKsqE/E= X-Google-Smtp-Source: ABdhPJy6STlsfT7EVNXzxpDM1Nc9pxf7dPaFJhPyLa3UHylb+tbpJ/KYhc58H3TquMM/w+kJ77uXHw== X-Received: by 2002:a05:600c:a04:: with SMTP id z4mr19422325wmp.103.1625565716583; Tue, 06 Jul 2021 03:01:56 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:56 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 21/40] configure, meson: convert liburing detection to meson Date: Tue, 6 Jul 2021 12:01:22 +0200 Message-Id: <20210706100141.303960-22-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x332.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.25, 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: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- configure | 28 ++++------------------------ meson.build | 9 +++++---- meson_options.txt | 2 ++ 3 files changed, 11 insertions(+), 28 deletions(-) diff --git a/configure b/configure index 51b8c3290a..4e016f671c 100755 --- a/configure +++ b/configure @@ -315,7 +315,7 @@ xen="$default_feature" xen_ctrl_version="$default_feature" xen_pci_passthrough="auto" linux_aio="$default_feature" -linux_io_uring="$default_feature" +linux_io_uring="auto" cap_ng="auto" attr="auto" xfs="$default_feature" @@ -1205,9 +1205,9 @@ for opt do ;; --enable-linux-aio) linux_aio="yes" ;; - --disable-linux-io-uring) linux_io_uring="no" + --disable-linux-io-uring) linux_io_uring="disabled" ;; - --enable-linux-io-uring) linux_io_uring="yes" + --enable-linux-io-uring) linux_io_uring="enabled" ;; --disable-attr) attr="disabled" ;; @@ -3334,21 +3334,6 @@ EOF linux_aio=no fi fi -########################################## -# linux-io-uring probe - -if test "$linux_io_uring" != "no" ; then - if $pkg_config liburing; then - linux_io_uring_cflags=$($pkg_config --cflags liburing) - linux_io_uring_libs=$($pkg_config --libs liburing) - linux_io_uring=yes - else - if test "$linux_io_uring" = "yes" ; then - feature_not_found "linux io_uring" "Install liburing devel" - fi - linux_io_uring=no - fi -fi ########################################## # TPM emulation is only on POSIX @@ -5421,11 +5406,6 @@ fi if test "$linux_aio" = "yes" ; then echo "CONFIG_LINUX_AIO=y" >> $config_host_mak fi -if test "$linux_io_uring" = "yes" ; then - echo "CONFIG_LINUX_IO_URING=y" >> $config_host_mak - echo "LINUX_IO_URING_CFLAGS=$linux_io_uring_cflags" >> $config_host_mak - echo "LINUX_IO_URING_LIBS=$linux_io_uring_libs" >> $config_host_mak -fi if test "$vhost_scsi" = "yes" ; then echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak fi @@ -6071,7 +6051,7 @@ if test "$skip_meson" = no; then -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \ -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \ - -Dlibdaxctl=$libdaxctl -Dlibpmem=$libpmem \ + -Dlibdaxctl=$libdaxctl -Dlibpmem=$libpmem -Dlinux_io_uring=$linux_io_uring \ -Dgnutls=$gnutls -Dnettle=$nettle -Dgcrypt=$gcrypt -Dauth_pam=$auth_pam \ -Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs -Dcap_ng=$cap_ng \ -Dattr=$attr -Ddefault_devices=$default_devices -Dvirglrenderer=$virglrenderer \ diff --git a/meson.build b/meson.build index e301eda3a5..5304744f2e 100644 --- a/meson.build +++ b/meson.build @@ -327,10 +327,11 @@ if have_system or have_tools endif libaio = cc.find_library('aio', required: false) zlib = dependency('zlib', required: true, kwargs: static_kwargs) + linux_io_uring = not_found -if 'CONFIG_LINUX_IO_URING' in config_host - linux_io_uring = declare_dependency(compile_args: config_host['LINUX_IO_URING_CFLAGS'].split(), - link_args: config_host['LINUX_IO_URING_LIBS'].split()) +if not get_option('linux_io_uring').auto() or have_block + linux_io_uring = dependency('liburing', required: get_option('linux_io_uring'), + method: 'pkg-config', kwargs: static_kwargs) endif libxml2 = not_found if 'CONFIG_LIBXML2' in config_host @@ -2785,7 +2786,7 @@ summary_info += {'brlapi support': brlapi.found()} summary_info += {'vde support': config_host.has_key('CONFIG_VDE')} summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')} summary_info += {'Linux AIO support': config_host.has_key('CONFIG_LINUX_AIO')} -summary_info += {'Linux io_uring support': config_host.has_key('CONFIG_LINUX_IO_URING')} +summary_info += {'Linux io_uring support': linux_io_uring.found()} summary_info += {'ATTR/XATTR support': libattr.found()} summary_info += {'RDMA support': config_host.has_key('CONFIG_RDMA')} summary_info += {'PVRDMA support': config_host.has_key('CONFIG_PVRDMA')} diff --git a/meson_options.txt b/meson_options.txt index b23174d0a1..6610c4dc64 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -92,6 +92,8 @@ option('libudev', type : 'feature', value : 'auto', description: 'Use libudev to enumerate host devices') option('libusb', type : 'feature', value : 'auto', description: 'libusb support for USB passthrough') +option('linux_io_uring', type : 'feature', value : 'auto', + description: 'Linux io_uring support') option('lzfse', type : 'feature', value : 'auto', description: 'lzfse support for DMG images') option('lzo', type : 'feature', value : 'auto', From patchwork Tue Jul 6 10:01:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360253 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C65AC07E96 for ; Tue, 6 Jul 2021 10:20:05 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C9F3E619A5 for ; Tue, 6 Jul 2021 10:20:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9F3E619A5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:55448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iBP-0008UJ-Sb for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:20:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htx-00012y-6m for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:01 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:46842) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htu-0002LX-KD for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:00 -0400 Received: by mail-wm1-x32b.google.com with SMTP id k16-20020a05600c1c90b02901f4ed0fcfe7so1823181wms.5 for ; Tue, 06 Jul 2021 03:01:58 -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=hEd6aN+rbZ1x2CIJyx9n+fGMegRkSbQEApN0YpiBx2I=; b=iq8D/3QfklCVNlshj39KqH5yS1LUFUNIK8k8YCYKsZ41OsucoCA+odFs+uAun3K8me ptdS2Ifk+wowVfWZ+6c7gri66YPE3UkGBJ4+GYB6JfKpMaXs9wAt7TEWJn0W7NPVzr66 OY0wuinm5LMrgL7ZzhqhKxdTdeGyy7jyhpjJUiskwqRDcC25EpVwlp0eJ+hMJAQUktom puOIjNJeNVXJRK+fqOgA0qI+Irh/SRu4PftyalreuD5JjwzLUuGLUbB/CFtfdGouFaeC TTYFRdLXSqC3IgEeqM+v5nDSsFRJ5TrrR+eRHqe6BGWcs3RzKOfMXTaqehukgt+lBmVI BqBw== 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=hEd6aN+rbZ1x2CIJyx9n+fGMegRkSbQEApN0YpiBx2I=; b=PBmqwfNgap7iNDjw9lk1QR8O7isWmdIhLUpQfNfJfsEhMxOQzyKOyZ5ZUJXLx+xUif +rh7+Fy5Oq1fK/rtXkF4Nsmh94FhZSC66TIo1HMjwIMkRuvofO2yhJCHhKfJxzRP+lrf 4gWnhT2QC/gm8PY1qwAdsCcoNRH9fXAu8wG0hD5SUzP0vn4QUTjYdjTyOaelTmV9UTYZ BRO+7dlRMS4pU5ObiC/kihSmfMvpOv421Jwez8QoiZRyC7sITonHmFAfoF1Ptk66uItC tQ2o8Rs4+e6UwKyh0umFfJjzu2wh+3sZO+94Mh1zIAFpyv519LKriKnJMN9fm+HG8kLU chJA== X-Gm-Message-State: AOAM531dv8vK/q/wgtwQXORK2ZVYHQMXnlFbt0fQ+LOVk5Y7cHCmbmpV sf+b+CHGHlQDdRQiOw8yXHzg8k6DqdI= X-Google-Smtp-Source: ABdhPJwilc6073AJnhsrv5wJ5Krmmf8UhBZuX3WMIzgm3Up+uUeh/sw0iW2NliKdrCrkKoIkDT+6vg== X-Received: by 2002:a1c:9d46:: with SMTP id g67mr1378283wme.188.1625565717149; Tue, 06 Jul 2021 03:01:57 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:56 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 22/40] configure, meson: convert libxml2 detection to meson Date: Tue, 6 Jul 2021 12:01:23 +0200 Message-Id: <20210706100141.303960-23-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32b.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.25, 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: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- configure | 29 ++++------------------------- meson.build | 8 ++++---- meson_options.txt | 2 ++ 3 files changed, 10 insertions(+), 29 deletions(-) diff --git a/configure b/configure index 4e016f671c..341b74dd5e 100755 --- a/configure +++ b/configure @@ -425,7 +425,7 @@ vdi=${default_feature:-yes} vvfat=${default_feature:-yes} qed=${default_feature:-yes} parallels=${default_feature:-yes} -libxml2="$default_feature" +libxml2="auto" debug_mutex="no" libpmem="auto" default_devices="true" @@ -1419,9 +1419,9 @@ for opt do ;; --enable-numa) numa="yes" ;; - --disable-libxml2) libxml2="no" + --disable-libxml2) libxml2="disabled" ;; - --enable-libxml2) libxml2="yes" + --enable-libxml2) libxml2="enabled" ;; --disable-tcmalloc) tcmalloc="no" ;; @@ -3409,21 +3409,6 @@ EOF fi fi -########################################## -# libxml2 probe -if test "$libxml2" != "no" ; then - if $pkg_config --exists libxml-2.0; then - libxml2="yes" - libxml2_cflags=$($pkg_config --cflags libxml-2.0) - libxml2_libs=$($pkg_config --libs libxml-2.0) - else - if test "$libxml2" = "yes"; then - feature_not_found "libxml2" "Install libxml2 devel" - fi - libxml2="no" - fi -fi - # Check for inotify functions when we are building linux-user # emulator. This is done because older glibc versions don't # have syscall stubs for these implemented. In that case we @@ -5636,12 +5621,6 @@ if test "$have_rtnetlink" = "yes" ; then echo "CONFIG_RTNETLINK=y" >> $config_host_mak fi -if test "$libxml2" = "yes" ; then - echo "CONFIG_LIBXML2=y" >> $config_host_mak - echo "LIBXML2_CFLAGS=$libxml2_cflags" >> $config_host_mak - echo "LIBXML2_LIBS=$libxml2_libs" >> $config_host_mak -fi - if test "$replication" = "yes" ; then echo "CONFIG_REPLICATION=y" >> $config_host_mak fi @@ -6050,7 +6029,7 @@ if test "$skip_meson" = no; then -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt -Dbrlapi=$brlapi \ -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \ -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ - -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \ + -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse -Dlibxml2=$libxml2 \ -Dlibdaxctl=$libdaxctl -Dlibpmem=$libpmem -Dlinux_io_uring=$linux_io_uring \ -Dgnutls=$gnutls -Dnettle=$nettle -Dgcrypt=$gcrypt -Dauth_pam=$auth_pam \ -Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs -Dcap_ng=$cap_ng \ diff --git a/meson.build b/meson.build index 5304744f2e..1216ac8f72 100644 --- a/meson.build +++ b/meson.build @@ -334,9 +334,9 @@ if not get_option('linux_io_uring').auto() or have_block method: 'pkg-config', kwargs: static_kwargs) endif libxml2 = not_found -if 'CONFIG_LIBXML2' in config_host - libxml2 = declare_dependency(compile_args: config_host['LIBXML2_CFLAGS'].split(), - link_args: config_host['LIBXML2_LIBS'].split()) +if not get_option('libxml2').auto() or have_block + libxml2 = dependency('libxml-2.0', required: get_option('libxml2'), + method: 'pkg-config', kwargs: static_kwargs) endif libnfs = not_found if not get_option('libnfs').auto() or have_block @@ -2821,7 +2821,7 @@ summary_info += {'bzip2 support': libbzip2.found()} summary_info += {'lzfse support': liblzfse.found()} summary_info += {'zstd support': zstd.found()} summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')} -summary_info += {'libxml2': config_host.has_key('CONFIG_LIBXML2')} +summary_info += {'libxml2': libxml2.found()} summary_info += {'capstone': capstone_opt == 'disabled' ? false : capstone_opt} summary_info += {'libpmem support': libpmem.found()} summary_info += {'libdaxctl support': libdaxctl.found()} diff --git a/meson_options.txt b/meson_options.txt index 6610c4dc64..a9a9b8f4c6 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -92,6 +92,8 @@ option('libudev', type : 'feature', value : 'auto', description: 'Use libudev to enumerate host devices') option('libusb', type : 'feature', value : 'auto', description: 'libusb support for USB passthrough') +option('libxml2', type : 'feature', value : 'auto', + description: 'libxml2 support for Parallels image format') option('linux_io_uring', type : 'feature', value : 'auto', description: 'Linux io_uring support') option('lzfse', type : 'feature', value : 'auto', From patchwork Tue Jul 6 10:01:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360295 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C3D1C07E96 for ; Tue, 6 Jul 2021 10:34:33 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2F5EE619AA for ; Tue, 6 Jul 2021 10:34:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F5EE619AA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iPQ-0004rm-4N for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:34:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htx-00012v-3E for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:01 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:36736) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htv-0002Lu-99 for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:00 -0400 Received: by mail-wm1-x336.google.com with SMTP id t14-20020a05600c198eb029020c8aac53d4so3283588wmq.1 for ; Tue, 06 Jul 2021 03:01:58 -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=cxP6H7astAMh/Svx/Qb16hkYAt94IE8X0Jh9lpll8tU=; b=nGRwGVLgSWC8grFUrpyp+ViNkA6mSq8Jzt1xIeuy/J2SpjnQbd+Rv3Zr2XUWhmWLcd +Pl++Wo8kmThWPGJ8BCSMNgsagO6AB58a4Qas9xJ80m9uP7fWJwfYwjKZL/MW0UzHT7K S+ppRAF90IeQ6Uprpj3X/iq4EPtAYnCJQ2UZ56BSRiLJGlOxBGZlCrcjc8ZtkWO31Eyq oMqJmLrwBR8w4sJplLByj4yaO61ywX3AdqOWjBfDSkor0Nh9TdCovhyq5ezgjRnfaG+t 0400CUtuDbg6IPqEzmDyAPU9bxmcD3PbRK04kDmWuyWSXRdvoxlpGWQiayuVUroh+weE xMJQ== 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=cxP6H7astAMh/Svx/Qb16hkYAt94IE8X0Jh9lpll8tU=; b=PgOq7I3wJ9oh9YYHsiGMmjehcrtsqLPxToZ6nk1YbRjep3PoxgdbHO3Sif8WISkOSR Y8kWlJ9n5SCnuF00ky4XtWxib+MjDQPI9e//UNzFVs/qqEiQScWiFyXfZ10I8ewKR3Xm hmtkG/AcXP/xP2TFU52QBW6B7cuyiJ58/th4wvdtnZofnnGJAYgmLM8y0GPhVGk2jASe 94SrJ5xgVD4ECjLBF0laAQc9buFe89lXgsVyMPFq+E/Wb6T1RlvzKpnbpzN+/ozHAr1n /OkowDtb4ULW9y889A9MtOW+L0UQU/34zLOYf170sa065fkcH0aKu9XowPiKI8pKpT6e dEtQ== X-Gm-Message-State: AOAM530g68u9YfuAzRRgTfjVXO9SVEUPocPknj+RZZA6oNkULw4Rm2Xr 2gi4hENz5+PO4aKloLHnDTNdNSCLQ5c= X-Google-Smtp-Source: ABdhPJxOeZudOZZRJU1VSdTCG+1GFOh8ejdqyEJR2BA7GtqCyuDbfh43AxZEsiU4IevsdSeYHWQM4g== X-Received: by 2002:a05:600c:3783:: with SMTP id o3mr3874790wmr.123.1625565717770; Tue, 06 Jul 2021 03:01:57 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:57 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 23/40] meson: sort existing compiler tests Date: Tue, 6 Jul 2021 12:01:24 +0200 Message-Id: <20210706100141.303960-24-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x336.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.25, 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: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The next patches will add more compiler tests. Sort and group the existing tests, keeping similar cc.has_* tests together and sorting them alphabetically by macro name. This should make it easier to look for examples when adding new tests to meson.build. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- meson.build | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 1216ac8f72..53dfc2b4c6 100644 --- a/meson.build +++ b/meson.build @@ -1253,16 +1253,19 @@ config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0] config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1]) config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2]) +config_host_data.set('HAVE_HOST_BLOCK_DEVICE', have_host_block_device) + +# has_header config_host_data.set('HAVE_BTRFS_H', cc.has_header('linux/btrfs.h')) config_host_data.set('HAVE_DRM_H', cc.has_header('libdrm/drm.h')) config_host_data.set('HAVE_PTY_H', cc.has_header('pty.h')) +config_host_data.set('HAVE_SYS_DISK_H', cc.has_header('sys/disk.h')) config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h')) config_host_data.set('HAVE_SYS_KCOV_H', cc.has_header('sys/kcov.h')) -config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', prefix: '#include ')) -config_host_data.set('HAVE_HOST_BLOCK_DEVICE', have_host_block_device) -config_host_data.set('HAVE_SYS_DISK_H', cc.has_header('sys/disk.h')) +# has_function config_host_data.set('CONFIG_PREADV', cc.has_function('preadv', prefix: '#include ')) +config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', prefix: '#include ')) ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] From patchwork Tue Jul 6 10:01:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A743DC07E96 for ; Tue, 6 Jul 2021 10:27:31 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 35E4F61958 for ; Tue, 6 Jul 2021 10:27:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35E4F61958 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iIc-0000mU-3G for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:27:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hu1-0001Dy-4k for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:05 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:43871) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htv-0002Mc-N4 for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:04 -0400 Received: by mail-wm1-x32d.google.com with SMTP id q18-20020a1ce9120000b02901f259f3a250so1828585wmc.2 for ; Tue, 06 Jul 2021 03:01:59 -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=fDz5tkFjEMWh1jGsn5Uv286sF3P/RJ6lk3yQfzYfsNw=; b=RdtGfiDBq+nlTne5lHiymGXZP1pksuK+okc3yQ9lkZ6srgjaEmbxA0nMWADUcsQjRQ 7DRZ7q/PcMg5B7/eoFqnlAAKYm3Uc4If8AjpZwy7UW9pTcl6enwmS0XaprkHTn6wgykH iG5tw5lyHv6hoaW4xuNc4Cne3DjfLPzio73J5sg/NokNF2dBpTloKY4dqkPfUZnc9lVd CN5qpL9C/Ub4dIx7GGMXN5AnhL+1P3pxIw/DfiNLaSQIByPI25PWHzXiWLpGIGlkKybw cVktDAA4fD4CBUgkbk94Zd7cdcCZmrCfkgpDjDDxwOD0BA8iz3UdpuDKL+Ak2gaN96Nm yHgA== 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=fDz5tkFjEMWh1jGsn5Uv286sF3P/RJ6lk3yQfzYfsNw=; b=gzRlkQ8vV6G4+mypJn/PEkedaeoKMvAFu32WTY23ikaUUv3QVsy6yLtu+QgKACAEpC AYgXbTfq6ungELLQQfCjaKaoD4JtW4v1wboIWiflA+vMOUSfsRhNOAoUyd3ooipB39VD TRPTi94uTxuR+BzgiQ4ONlJnGmNLaFbDrXUSWHNBj/4ImLzlyhqVQc+u1MTXptBCXGRe rWivkj/YFzTuKApmFQC5WuTEjzHPArpa1hl+kgAmMwxAbKuxMjWeezeEn53EMRkmXJ0F CeeroFe0gHRw/2DNTnzOl5wdQJ8AIk4ELahCvlXiwAcOMsJcmXIclLg3fjR/uH5MV7gP JINw== X-Gm-Message-State: AOAM533FJBTv8h0LHtWpNp3nArY8RB9D6MuyQVZdKjtr2qtJ/dBCYUtH y1TWzuWh2LFXP+govGxxj5kYpeYoOyM= X-Google-Smtp-Source: ABdhPJwg9k67IBOuQWZe3aWMqKBQXLYSUjO9v/wQWRg4swhUV8knoZPu9AGSIPVg5lZs8781wdy+jA== X-Received: by 2002:a1c:cc02:: with SMTP id h2mr19165342wmb.39.1625565718421; Tue, 06 Jul 2021 03:01:58 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:58 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 24/40] meson: store dependency('threads') in a variable Date: Tue, 6 Jul 2021 12:01:25 +0200 Message-Id: <20210706100141.303960-25-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32d.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.25, 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: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" It can be useful for has_function checks. Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- meson.build | 3 ++- util/meson.build | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 53dfc2b4c6..e288e4c21c 100644 --- a/meson.build +++ b/meson.build @@ -164,6 +164,7 @@ endif multiprocess_allowed = targetos == 'linux' and not get_option('multiprocess').disabled() libm = cc.find_library('m', required: false) +threads = dependency('threads') util = cc.find_library('util', required: false) winmm = [] socket = [] @@ -1999,7 +2000,7 @@ util_ss.add_all(trace_ss) util_ss = util_ss.apply(config_all, strict: false) libqemuutil = static_library('qemuutil', sources: util_ss.sources() + stub_ss.sources() + genh, - dependencies: [util_ss.dependencies(), libm, glib, socket, malloc, pixman]) + dependencies: [util_ss.dependencies(), libm, threads, glib, socket, malloc, pixman]) qemuutil = declare_dependency(link_with: libqemuutil, sources: genh + version_res) diff --git a/util/meson.build b/util/meson.build index 97fad44105..6af05a5716 100644 --- a/util/meson.build +++ b/util/meson.build @@ -1,4 +1,3 @@ -util_ss.add(dependency('threads')) util_ss.add(files('osdep.c', 'cutils.c', 'unicode.c', 'qemu-timer-common.c')) util_ss.add(when: 'CONFIG_ATOMIC64', if_false: files('atomic64.c')) util_ss.add(when: 'CONFIG_POSIX', if_true: files('aio-posix.c')) From patchwork Tue Jul 6 10:01:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360269 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45F10C07E96 for ; Tue, 6 Jul 2021 10:24:27 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id EFC7C619A5 for ; Tue, 6 Jul 2021 10:24:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EFC7C619A5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:44708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iFe-0003GJ-3L for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:24:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hty-000165-RE for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:02 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:43921) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htw-0002Nv-HR for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:02 -0400 Received: by mail-wr1-x436.google.com with SMTP id a13so25330166wrf.10 for ; Tue, 06 Jul 2021 03:02:00 -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=sHXNM04uxEiAbDswn208ExLFOlINybso2tUyXQRPesg=; b=alee1nSCNGW/u0vrPRRfiaOWa0qocXdtarL/+MvGhUHRL8kvhsK0Ap29V/iA0YxWdL q6UWEu3UezK1YPqohtULuK5dqstvrtkQh8BDjcBe0sXs1sIHqhrlqByFof+ZHUtH3kbA ToFdVnU+xBT8MXhucfPfITmt5RiYCVscZZtPsAnvjveRwgZ4Lo8pO9V0dab01fjIRyxq UmcYtSkFP+2ODYplujasTXoapA9201xx7BmBEvQzQU9k3oCVo0IvqsjJFNaJ0duQBj9Q IPcSK1ZJhttVGawBeZjSLJAsVmtU/yrrMDlje9/6X1+eP2vtOy0Zdhz2ycchc1OGglhJ WZrQ== 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=sHXNM04uxEiAbDswn208ExLFOlINybso2tUyXQRPesg=; b=kIOIlQGh5LwzkTcTWUvSMFPN1P601ZfF1eiyMeXFaOv4RZM+/1C4agIKc20Z9BEj3v AhnvxFoSMNgryms3K576um1ndB2lCQkQfW54jkT0fLgsffEKAViH//HWKY0TaQbMAUT4 jHMFZM1/Q6NIt7c4oIlqBPSUM9AG6siX8FINGP2rwJWFpObQsgB5kSlO41OZ8BIUAEmD Td4a63SRiBmdx0db+rB0f2yKbL7H+fJ8K3PDvA5RyLdRxmHpVnsI1rh9PaKF9HT1xier 9kYS8DPsMgHtjldSZnEGQwKVvq/mfT/cmULrDbOf5pwvnXTcFNUH+nL3POR0FChcXIU/ ufng== X-Gm-Message-State: AOAM533xG1wtCB50Rusq7bDS2Q2FJ4hrIa2nJA2Gi79Y3eHYHX3co10G oSI23bv53FHU2oD4CcLcBGNjB+GDhsM= X-Google-Smtp-Source: ABdhPJw4Bb0zkwbbLqEA7aeJrms6U+RgpZNEpZm7CuQePQrmW9rOaAhKuLQIdrXDcs2K/deW5jkzYQ== X-Received: by 2002:a05:6000:18ca:: with SMTP id w10mr20339037wrq.55.1625565719194; Tue, 06 Jul 2021 03:01:59 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:58 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 25/40] configure, meson: move CONFIG_IVSHMEM to meson Date: Tue, 6 Jul 2021 12:01:26 +0200 Message-Id: <20210706100141.303960-26-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x436.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.25, 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: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This is a duplicate of CONFIG_EVENTFD, handle it directly in meson.build. Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- configure | 8 -------- docs/devel/kconfig.rst | 2 +- meson.build | 5 +++-- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/configure b/configure index 341b74dd5e..a524104120 100755 --- a/configure +++ b/configure @@ -5037,11 +5037,6 @@ if test "$mingw32" = "yes" ; then done fi -# We can only support ivshmem if we have eventfd -if [ "$eventfd" = "yes" ]; then - ivshmem=yes -fi - # Probe for guest agent support/options if [ "$guest_agent" != "no" ]; then @@ -5639,9 +5634,6 @@ fi if test "$have_getrandom" = "yes" ; then echo "CONFIG_GETRANDOM=y" >> $config_host_mak fi -if test "$ivshmem" = "yes" ; then - echo "CONFIG_IVSHMEM=y" >> $config_host_mak -fi if test "$debug_mutex" = "yes" ; then echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak fi diff --git a/docs/devel/kconfig.rst b/docs/devel/kconfig.rst index cb2d7ffac0..a1cdbec751 100644 --- a/docs/devel/kconfig.rst +++ b/docs/devel/kconfig.rst @@ -303,5 +303,5 @@ variable:: 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'] : []) + \ + (have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \ ... diff --git a/meson.build b/meson.build index e288e4c21c..b5dcc3d70e 100644 --- a/meson.build +++ b/meson.build @@ -1335,10 +1335,11 @@ if link_language == 'cpp' } endif +have_ivshmem = config_host.has_key('CONFIG_EVENTFD') 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'] : []) + \ + (have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \ ('CONFIG_OPENGL' in config_host ? ['CONFIG_OPENGL=y'] : []) + \ (x11.found() ? ['CONFIG_X11=y'] : []) + \ ('CONFIG_VHOST_USER' in config_host ? ['CONFIG_VHOST_USER=y'] : []) + \ @@ -2489,7 +2490,7 @@ if have_tools install: true) endif - if 'CONFIG_IVSHMEM' in config_host + if have_ivshmem subdir('contrib/ivshmem-client') subdir('contrib/ivshmem-server') endif From patchwork Tue Jul 6 10:01:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360281 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BD1CC07E96 for ; Tue, 6 Jul 2021 10:29:19 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 44986619A9 for ; Tue, 6 Jul 2021 10:29:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 44986619A9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iKM-0004VY-6v for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:29:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0htz-000174-8l for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:03 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:43911) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htx-0002OO-8Q for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:02 -0400 Received: by mail-wr1-x42b.google.com with SMTP id a13so25330207wrf.10 for ; Tue, 06 Jul 2021 03:02:00 -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=7IOWB9L8C5ZVMJR0h6DK/2DFyq1pG83qdF6FgW1CUf0=; b=F1tO58RdujAJ/wZ0ui9BzZfhXGbx7eqak1I8n2Nj2ynYB8U9q/lFMfeQkO7+hZ7Npf Vmm/stR+nQMMkDz+5O3JM5Qtt4d5OzZjYOMUPaCTBLHqMMZmvYMKKemzqtPES0StjR66 97yM0KlGoeWMIqauFAb3NBeKtJuu0zWDh8ZmmwxOWJslKEqRLlwx4gh+Lru58xgLs24k PuxU3quKUXzDVysNTuYVVBN23RYgdwRPufUeSmqYeMWf9EEj9IqPR0EJ138VkmqT+AjE Nap0SLHW4rEptmKO4lNnZkz7BSx0W+N3Ag5e1To4l5HsH8xOX3SIN9+Guz8IW87YbmO9 N3rw== 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=7IOWB9L8C5ZVMJR0h6DK/2DFyq1pG83qdF6FgW1CUf0=; b=EeMVHZHDaurWYdtIl9nzGNJZa4bNhUM8LhPBGxSb3mYOyo3UEKl6ua5NlgQhUpoTeX wwcB9kQRXGYAPjDrko5IZSW720m1uvwnAnQEODn/15jD/qhHt9RTvmZFwZcp2QEfdorM K/9o0BmZ96ueYrYB/q3lNcDPYVTqW1Hfn3lApTj+lhjqn/cBt8Aeh9M5qJNCJ6J6yzIy fq6u4d45FWjUuqlh8cn8V5wk5JIVGpFWYKM2DyBXR04B0w70iIwSKOo/4ztowV/Gli9r IhR5NSpOcOJKkfNBJ2JObg86ASqGxWUWBdHG8Kc+2XihAwTMlX40sT+HuYgRoaVgrHet L2Ow== X-Gm-Message-State: AOAM531j7Xs1O48Frx9hWExRkWDM9ptx1eC8gjn8fmotwDRwsAihYzM9 SPV3bW9WBPUgZ1iHFsi254lDaLXpf3Y= X-Google-Smtp-Source: ABdhPJxT/uP5/FzXjQuiFwzQe7mNZ9Zzo37Vx/IjDVBKpcrKMnD5eaoPGdh4yr16q6x6XNnnvMF2cg== X-Received: by 2002:a5d:5388:: with SMTP id d8mr20232278wrv.423.1625565719809; Tue, 06 Jul 2021 03:01:59 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:01:59 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 26/40] configure: convert HAVE_BROKEN_SIZE_MAX to meson Date: Tue, 6 Jul 2021 12:01:27 +0200 Message-Id: <20210706100141.303960-27-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x42b.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.25, 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: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- configure | 17 ----------------- meson.build | 9 +++++++++ 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/configure b/configure index a524104120..98d6068941 100755 --- a/configure +++ b/configure @@ -2375,20 +2375,6 @@ if test "$softmmu" = "no"; then audio_drv_list="" fi -########################################## -# Some versions of Mac OS X incorrectly define SIZE_MAX -cat > $TMPC << EOF -#include -#include -int main(int argc, char *argv[]) { - return printf("%zu", SIZE_MAX); -} -EOF -have_broken_size_max=no -if ! compile_object -Werror ; then - have_broken_size_max=yes -fi - ########################################## # L2TPV3 probe @@ -5360,9 +5346,6 @@ if test "$gdbus_codegen" != "" ; then echo "GDBUS_CODEGEN=$gdbus_codegen" >> $config_host_mak fi echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak -if test "$have_broken_size_max" = "yes" ; then - echo "HAVE_BROKEN_SIZE_MAX=y" >> $config_host_mak -fi if test "$have_openpty" = "yes" ; then echo "HAVE_OPENPTY=y" >> $config_host_mak fi diff --git a/meson.build b/meson.build index b5dcc3d70e..79b5834266 100644 --- a/meson.build +++ b/meson.build @@ -1268,6 +1268,15 @@ config_host_data.set('HAVE_SYS_KCOV_H', cc.has_header('sys/kcov.h')) config_host_data.set('CONFIG_PREADV', cc.has_function('preadv', prefix: '#include ')) config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', prefix: '#include ')) +# Some versions of Mac OS X incorrectly define SIZE_MAX +config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles(''' + #include + #include + int main(int argc, char *argv[]) { + return printf("%zu", SIZE_MAX); + }''', args: ['-Werror'])) + + ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] strings = ['HOST_DSOSUF', 'CONFIG_IASL'] From patchwork Tue Jul 6 10:01:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360301 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12570C07E9B for ; Tue, 6 Jul 2021 10:35:54 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 99680619AB for ; Tue, 6 Jul 2021 10:35:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99680619AB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:48980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iQi-0008Be-Lq for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:35:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hu1-0001Ee-9a for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:05 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:46015) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htx-0002Ok-Us for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:04 -0400 Received: by mail-wm1-x336.google.com with SMTP id u8-20020a7bcb080000b02901e44e9caa2aso1823661wmj.4 for ; Tue, 06 Jul 2021 03:02:01 -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=LGpiaTZ6+7FCkauZmZp+mBlyBJ3kbRXrTfa+7FMz+Q4=; b=XWl+Rk2vL2UiUGQQfcLh2UIfAMJXbpKdnw6MshREYI2kn/FJijkSztcuWvywZuk3v5 t8z7PaV+BnBOdgUs4fbt/nO3AUU+tRb8+cvblfErhQQgUew/sRR7XCb2uWlrqNaNj3kS L1PkZH1lulpkiDM/lXTBHxIhwrBgLL6cNNYlx7TZwNru+ib/eAi0UR8MhmwcQQMYy74x XIxDrL28cYfRyNCvhB9zZ6+oJetP+LL5lJaI7YqtuoNKWAuyioSBYU6DSLuW1XXuPnYw BHCRMQCPzEJ9YulDQ9kG9f5LxO2qMsPtvvT/N062tjRzSv22mYEsLdk1u97PerKOn0dz pU1Q== 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=LGpiaTZ6+7FCkauZmZp+mBlyBJ3kbRXrTfa+7FMz+Q4=; b=kwEkE1A91+XdA9PBANrAJyTgO6UW/6qUDnJzKhCflzyKdJGJIXTTsijQWH1PgZuXdh WtLeXbOzLDDYyFw3XqdP5dwPn1vPWB6dVgUQf07d13mijGPrn4KrKWVktADm8cMOaQEZ 4U0CRU8z0koT4N/C3q8no5+5tAHdnlIPBQq9aN5ULg8SxUmnmkLp33GoK4mrID+Fg+y2 p6JpWyepSFwfTaJXOnRRimfaKQwGQjjjj3hwpH5KeaBboVHx28OTNvvG48upEWojgip+ 9Ft/CBTv50nmJaBKUIC3dzyDra6Hsq3p9q/1oR4iw5CWLLIDJSIF+jrNe8lU2rDFX6tj FJcw== X-Gm-Message-State: AOAM533Rmsaxq4CW7yNKaHSqQvFhcKPSat4x5AkkI8qBM9bMO2iqEOzT I1UKuzgHA75EiCJl4/zQoyMTWtoCCkI= X-Google-Smtp-Source: ABdhPJwCb+FrZF6fLxxgKrnQLz3pnpbvHVYMNO1qXcC2iMw9snEQg+WJcaKWbJGOACqK8VQ1DPITWw== X-Received: by 2002:a05:600c:3b0b:: with SMTP id m11mr3862532wms.25.1625565720448; Tue, 06 Jul 2021 03:02:00 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.01.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:02:00 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 27/40] configure: convert compiler tests to meson, part 1 Date: Tue, 6 Jul 2021 12:01:28 +0200 Message-Id: <20210706100141.303960-28-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x336.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.25, 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: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- configure | 364 ----------------------------------------------- meson.build | 41 +++++- util/meson.build | 4 +- 3 files changed, 43 insertions(+), 366 deletions(-) diff --git a/configure b/configure index 98d6068941..e2bf77f55d 100755 --- a/configure +++ b/configure @@ -3588,297 +3588,6 @@ EOF fi fi -# check for fallocate -fallocate=no -cat > $TMPC << EOF -#include - -int main(void) -{ - fallocate(0, 0, 0, 0); - return 0; -} -EOF -if compile_prog "" "" ; then - fallocate=yes -fi - -# check for fallocate hole punching -fallocate_punch_hole=no -cat > $TMPC << EOF -#include -#include - -int main(void) -{ - fallocate(0, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 0); - return 0; -} -EOF -if compile_prog "" "" ; then - fallocate_punch_hole=yes -fi - -# check that fallocate supports range zeroing inside the file -fallocate_zero_range=no -cat > $TMPC << EOF -#include -#include - -int main(void) -{ - fallocate(0, FALLOC_FL_ZERO_RANGE, 0, 0); - return 0; -} -EOF -if compile_prog "" "" ; then - fallocate_zero_range=yes -fi - -# check for posix_fallocate -posix_fallocate=no -cat > $TMPC << EOF -#include - -int main(void) -{ - posix_fallocate(0, 0, 0); - return 0; -} -EOF -if compile_prog "" "" ; then - posix_fallocate=yes -fi - -# check for sync_file_range -sync_file_range=no -cat > $TMPC << EOF -#include - -int main(void) -{ - sync_file_range(0, 0, 0, 0); - return 0; -} -EOF -if compile_prog "" "" ; then - sync_file_range=yes -fi - -# check for linux/fiemap.h and FS_IOC_FIEMAP -fiemap=no -cat > $TMPC << EOF -#include -#include -#include - -int main(void) -{ - ioctl(0, FS_IOC_FIEMAP, 0); - return 0; -} -EOF -if compile_prog "" "" ; then - fiemap=yes -fi - -# check for dup3 -dup3=no -cat > $TMPC << EOF -#include - -int main(void) -{ - dup3(0, 0, 0); - return 0; -} -EOF -if compile_prog "" "" ; then - dup3=yes -fi - -# check for ppoll support -ppoll=no -cat > $TMPC << EOF -#include - -int main(void) -{ - struct pollfd pfd = { .fd = 0, .events = 0, .revents = 0 }; - ppoll(&pfd, 1, 0, 0); - return 0; -} -EOF -if compile_prog "" "" ; then - ppoll=yes -fi - -# check for prctl(PR_SET_TIMERSLACK , ... ) support -prctl_pr_set_timerslack=no -cat > $TMPC << EOF -#include - -int main(void) -{ - prctl(PR_SET_TIMERSLACK, 1, 0, 0, 0); - return 0; -} -EOF -if compile_prog "" "" ; then - prctl_pr_set_timerslack=yes -fi - -# check for epoll support -epoll=no -cat > $TMPC << EOF -#include - -int main(void) -{ - epoll_create(0); - return 0; -} -EOF -if compile_prog "" "" ; then - epoll=yes -fi - -# epoll_create1 is a later addition -# so we must check separately for its presence -epoll_create1=no -cat > $TMPC << EOF -#include - -int main(void) -{ - /* Note that we use epoll_create1 as a value, not as - * a function being called. This is necessary so that on - * old SPARC glibc versions where the function was present in - * the library but not declared in the header file we will - * fail the configure check. (Otherwise we will get a compiler - * warning but not an error, and will proceed to fail the - * qemu compile where we compile with -Werror.) - */ - return (int)(uintptr_t)&epoll_create1; -} -EOF -if compile_prog "" "" ; then - epoll_create1=yes -fi - -# check for sendfile support -sendfile=no -cat > $TMPC << EOF -#include - -int main(void) -{ - return sendfile(0, 0, 0, 0); -} -EOF -if compile_prog "" "" ; then - sendfile=yes -fi - -# check for timerfd support (glibc 2.8 and newer) -timerfd=no -cat > $TMPC << EOF -#include - -int main(void) -{ - return(timerfd_create(CLOCK_REALTIME, 0)); -} -EOF -if compile_prog "" "" ; then - timerfd=yes -fi - -# check for setns and unshare support -setns=no -cat > $TMPC << EOF -#include - -int main(void) -{ - int ret; - ret = setns(0, 0); - ret = unshare(0); - return ret; -} -EOF -if compile_prog "" "" ; then - setns=yes -fi - -# clock_adjtime probe -clock_adjtime=no -cat > $TMPC < -#include - -int main(void) -{ - return clock_adjtime(0, 0); -} -EOF -clock_adjtime=no -if compile_prog "" "" ; then - clock_adjtime=yes -fi - -# syncfs probe -syncfs=no -cat > $TMPC < - -int main(void) -{ - return syncfs(0); -} -EOF -syncfs=no -if compile_prog "" "" ; then - syncfs=yes -fi - -# Search for bswap_32 function -byteswap_h=no -cat > $TMPC << EOF -#include -int main(void) { return bswap_32(0); } -EOF -if compile_prog "" "" ; then - byteswap_h=yes -fi - -# Search for bswap32 function -bswap_h=no -cat > $TMPC << EOF -#include -#include -#include -int main(void) { return bswap32(0); } -EOF -if compile_prog "" "" ; then - bswap_h=yes -fi - -# Check whether we have openpty() in either libc or libutil -cat > $TMPC << EOF -extern int openpty(int *am, int *as, char *name, void *termp, void *winp); -int main(void) { return openpty(0, 0, 0, 0, 0); } -EOF - -have_openpty="no" -if compile_prog "" "" ; then - have_openpty="yes" -else - if compile_prog "" "-lutil" ; then - have_openpty="yes" - fi -fi - ########################################## # spice probe if test "$spice_protocol" != "no" ; then @@ -4114,19 +3823,6 @@ if compile_prog "" "" ; then st_atim=yes fi -########################################## -# check if we have sigev_notify_thread_id - -sigev_notify_thread_id=no -cat > $TMPC << EOF -#include -#include -int main(void) { return offsetof(struct sigevent, sigev_notify_thread_id); } -EOF -if compile_prog "" "" ; then - sigev_notify_thread_id=yes -fi - ########################################## # check if trace backend exists @@ -5265,54 +4961,6 @@ fi if test "$have_usbfs" = "yes" ; then echo "CONFIG_USBFS=y" >> $config_host_mak fi -if test "$fallocate" = "yes" ; then - echo "CONFIG_FALLOCATE=y" >> $config_host_mak -fi -if test "$fallocate_punch_hole" = "yes" ; then - echo "CONFIG_FALLOCATE_PUNCH_HOLE=y" >> $config_host_mak -fi -if test "$fallocate_zero_range" = "yes" ; then - echo "CONFIG_FALLOCATE_ZERO_RANGE=y" >> $config_host_mak -fi -if test "$posix_fallocate" = "yes" ; then - echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak -fi -if test "$sync_file_range" = "yes" ; then - echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak -fi -if test "$fiemap" = "yes" ; then - echo "CONFIG_FIEMAP=y" >> $config_host_mak -fi -if test "$dup3" = "yes" ; then - echo "CONFIG_DUP3=y" >> $config_host_mak -fi -if test "$ppoll" = "yes" ; then - echo "CONFIG_PPOLL=y" >> $config_host_mak -fi -if test "$prctl_pr_set_timerslack" = "yes" ; then - echo "CONFIG_PRCTL_PR_SET_TIMERSLACK=y" >> $config_host_mak -fi -if test "$epoll" = "yes" ; then - echo "CONFIG_EPOLL=y" >> $config_host_mak -fi -if test "$epoll_create1" = "yes" ; then - echo "CONFIG_EPOLL_CREATE1=y" >> $config_host_mak -fi -if test "$sendfile" = "yes" ; then - echo "CONFIG_SENDFILE=y" >> $config_host_mak -fi -if test "$timerfd" = "yes" ; then - echo "CONFIG_TIMERFD=y" >> $config_host_mak -fi -if test "$setns" = "yes" ; then - echo "CONFIG_SETNS=y" >> $config_host_mak -fi -if test "$clock_adjtime" = "yes" ; then - echo "CONFIG_CLOCK_ADJTIME=y" >> $config_host_mak -fi -if test "$syncfs" = "yes" ; then - echo "CONFIG_SYNCFS=y" >> $config_host_mak -fi if test "$inotify" = "yes" ; then echo "CONFIG_INOTIFY=y" >> $config_host_mak fi @@ -5328,15 +4976,6 @@ fi if test "$st_atim" = "yes" ; then echo "HAVE_STRUCT_STAT_ST_ATIM=y" >> $config_host_mak fi -if test "$sigev_notify_thread_id" = "yes" ; then - echo "HAVE_SIGEV_NOTIFY_THREAD_ID=y" >> $config_host_mak -fi -if test "$byteswap_h" = "yes" ; then - echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak -fi -if test "$bswap_h" = "yes" ; then - echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak -fi if test "$gio" = "yes" ; then echo "CONFIG_GIO=y" >> $config_host_mak echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak @@ -5346,9 +4985,6 @@ if test "$gdbus_codegen" != "" ; then echo "GDBUS_CODEGEN=$gdbus_codegen" >> $config_host_mak fi echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak -if test "$have_openpty" = "yes" ; then - echo "HAVE_OPENPTY=y" >> $config_host_mak -fi # Work around a system header bug with some kernel/XFS header # versions where they both try to define 'struct fsxattr': diff --git a/meson.build b/meson.build index 79b5834266..29a050066e 100644 --- a/meson.build +++ b/meson.build @@ -1051,10 +1051,12 @@ endif # Check whether the glibc provides statx() -statx_test = ''' +gnu_source_prefix = ''' #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif +''' +statx_test = gnu_source_prefix + ''' #include int main(void) { struct statx statxbuf; @@ -1257,6 +1259,7 @@ config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2] config_host_data.set('HAVE_HOST_BLOCK_DEVICE', have_host_block_device) # has_header +config_host_data.set('CONFIG_EPOLL', cc.has_header('sys/epoll.h')) config_host_data.set('HAVE_BTRFS_H', cc.has_header('linux/btrfs.h')) config_host_data.set('HAVE_DRM_H', cc.has_header('libdrm/drm.h')) config_host_data.set('HAVE_PTY_H', cc.has_header('pty.h')) @@ -1265,9 +1268,45 @@ config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h')) config_host_data.set('HAVE_SYS_KCOV_H', cc.has_header('sys/kcov.h')) # has_function +config_host_data.set('CONFIG_CLOCK_ADJTIME', cc.has_function('clock_adjtime')) +config_host_data.set('CONFIG_DUP3', cc.has_function('dup3')) +config_host_data.set('CONFIG_FALLOCATE', cc.has_function('fallocate')) +config_host_data.set('CONFIG_POSIX_FALLOCATE', cc.has_function('posix_fallocate')) +config_host_data.set('CONFIG_PPOLL', cc.has_function('ppoll')) config_host_data.set('CONFIG_PREADV', cc.has_function('preadv', prefix: '#include ')) +config_host_data.set('CONFIG_SENDFILE', cc.has_function('sendfile')) +config_host_data.set('CONFIG_SETNS', cc.has_function('setns') and cc.has_function('unshare')) +config_host_data.set('CONFIG_SYNCFS', cc.has_function('syncfs')) +config_host_data.set('CONFIG_SYNC_FILE_RANGE', cc.has_function('sync_file_range')) +config_host_data.set('CONFIG_TIMERFD', cc.has_function('timerfd_create')) +config_host_data.set('HAVE_OPENPTY', cc.has_function('openpty', dependencies: util)) config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', prefix: '#include ')) +# has_header_symbol +config_host_data.set('CONFIG_BYTESWAP_H', + cc.has_header_symbol('byteswap.h', 'bswap_32')) +config_host_data.set('CONFIG_EPOLL_CREATE1', + cc.has_header_symbol('sys/epoll.h', 'epoll_create1')) +config_host_data.set('CONFIG_FALLOCATE_PUNCH_HOLE', + cc.has_header_symbol('linux/falloc.h', 'FALLOC_FL_PUNCH_HOLE') and + cc.has_header_symbol('linux/falloc.h', 'FALLOC_FL_KEEP_SIZE')) +config_host_data.set('CONFIG_FALLOCATE_ZERO_RANGE', + cc.has_header_symbol('linux/falloc.h', 'FALLOC_FL_ZERO_RANGE')) +config_host_data.set('CONFIG_FIEMAP', + cc.has_header('linux/fiemap.h') and + cc.has_header_symbol('linux/fs.h', 'FS_IOC_FIEMAP')) +config_host_data.set('CONFIG_MACHINE_BSWAP_H', + cc.has_header_symbol('machine/bswap.h', 'bswap32', + prefix: '''#include + #include ''')) +config_host_data.set('CONFIG_PRCTL_PR_SET_TIMERSLACK', + cc.has_header_symbol('sys/prctl.h', 'PR_SET_TIMERSLACK')) + +# has_member +config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID', + cc.has_member('struct sigevent', 'sigev_notify_thread_id', + prefix: '#include ')) + # Some versions of Mac OS X incorrectly define SIZE_MAX config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles(''' #include diff --git a/util/meson.build b/util/meson.build index 6af05a5716..0ffd7f4bde 100644 --- a/util/meson.build +++ b/util/meson.build @@ -2,7 +2,9 @@ util_ss.add(files('osdep.c', 'cutils.c', 'unicode.c', 'qemu-timer-common.c')) util_ss.add(when: 'CONFIG_ATOMIC64', if_false: files('atomic64.c')) util_ss.add(when: 'CONFIG_POSIX', if_true: files('aio-posix.c')) util_ss.add(when: 'CONFIG_POSIX', if_true: files('fdmon-poll.c')) -util_ss.add(when: 'CONFIG_EPOLL_CREATE1', if_true: files('fdmon-epoll.c')) +if config_host_data.get('CONFIG_EPOLL_CREATE1') + util_ss.add(files('fdmon-epoll.c')) +endif util_ss.add(when: ['CONFIG_LINUX_IO_URING', linux_io_uring], if_true: files('fdmon-io_uring.c')) util_ss.add(when: 'CONFIG_POSIX', if_true: files('compatfd.c')) util_ss.add(when: 'CONFIG_POSIX', if_true: files('event_notifier-posix.c')) From patchwork Tue Jul 6 10:01:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360285 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9E91C07E96 for ; Tue, 6 Jul 2021 10:30:51 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4C1916195E for ; Tue, 6 Jul 2021 10:30:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C1916195E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iLq-0006ck-9A for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:30:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hu1-0001FX-IL for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:05 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:39451) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htz-0002PX-Gx for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:05 -0400 Received: by mail-wm1-x32f.google.com with SMTP id l18-20020a1ced120000b029014c1adff1edso1269147wmh.4 for ; Tue, 06 Jul 2021 03:02:03 -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=vY3VbBmrVZM9YYm9NAx6C9SJhnw2mI1KKJt0obRhixo=; b=GsW97VMQKlRYK38FvoNgYsZxFCPHsmOS2DoJc1gdAu70Zf3pi0LTn88HZvALKetJ7C C6gZigQVnqVI76GR5MrjV1DaIrtFsp+Up+sxE9n21IdGy95uhdKlWJHJIhKNFdHMLskd mb7Cshwi2NTIq4UDMBHWCMicDEFJsd+xg2A2BW+ulaWAdFnwsdOk4cAaxvwqAe8pRzoW hfNBsTk7zD4P7Sl1t/hwyJiHfGKmGCiHFMCn96QNrSd2LLCOcdR1741d+2eNvk5Lrr6H iarJrxmDmYiMGL3MxXr8QdaDElsj4l3u4rixWaIGxGAdLZvqyLWxJ9aEP601B5TnuTb+ 7WFw== 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=vY3VbBmrVZM9YYm9NAx6C9SJhnw2mI1KKJt0obRhixo=; b=GMqdPlii5f2NYy/T4M7MfimpVgI8gHEN1yMQfoh3iTVHQG6HBON0yS92gJAjVY07NY MArWUasLH2mTjFIgNz1hiE7ba1+3kJ/zdJToyT1zn8wYLPGHdvN+D+F2SdgxlykpoPKR cLO1pLMXigKunqzTJjYaN5aP9yAgrwG+8WZ+YEUlO7G+6w/sRPk6Lg1W3O5LEIAJLh4C DUsaTAISwDhZchI6dQ8IsRHHLh1DdagKz+6QoSEANUSKFDmcv2NuFUEaxwDkRG+vzzEW R6NR1YU0R6gGweV1t91hG9ml/Olxj91BYBgvpGuBUCnQ2cU1IXgjmcOZOIdpPBDQFmum 5x3Q== X-Gm-Message-State: AOAM5338/nWxSuWUdbjOnbMZjiw4GV5+5kavuohIdSSjV4mQwdOtfl0s 5CidN8TmujsdMHWZfwIuEhcLrbTNxpw= X-Google-Smtp-Source: ABdhPJwtrv0wf//QFkqXF5ECj1mbIB/21OrACtXvxg+WzU4Nq8X2h66fNiRe0L1uGV/uPoxz1/KqFA== X-Received: by 2002:a05:600c:19d2:: with SMTP id u18mr3363360wmq.21.1625565721132; Tue, 06 Jul 2021 03:02:01 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.02.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:02:00 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 28/40] configure: convert compiler tests to meson, part 2 Date: Tue, 6 Jul 2021 12:01:29 +0200 Message-Id: <20210706100141.303960-29-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32f.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.25, 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: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- configure | 49 ------------------------------------------------- meson.build | 5 +++++ 2 files changed, 5 insertions(+), 49 deletions(-) diff --git a/configure b/configure index e2bf77f55d..78f4a351d9 100755 --- a/configure +++ b/configure @@ -3783,46 +3783,6 @@ if compile_prog "" "" ; then posix_syslog=yes fi -########################################## -# check if we have sem_timedwait - -sem_timedwait=no -cat > $TMPC << EOF -#include -int main(void) { sem_t s; struct timespec t = {0}; return sem_timedwait(&s, &t); } -EOF -if compile_prog "" "" ; then - sem_timedwait=yes -fi - -########################################## -# check if we have strchrnul - -strchrnul=no -cat > $TMPC << EOF -#include -int main(void); -// Use a haystack that the compiler shouldn't be able to constant fold -char *haystack = (char*)&main; -int main(void) { return strchrnul(haystack, 'x') != &haystack[6]; } -EOF -if compile_prog "" "" ; then - strchrnul=yes -fi - -######################################### -# check if we have st_atim - -st_atim=no -cat > $TMPC << EOF -#include -#include -int main(void) { return offsetof(struct stat, st_atim); } -EOF -if compile_prog "" "" ; then - st_atim=yes -fi - ########################################## # check if trace backend exists @@ -4967,15 +4927,6 @@ fi if test "$inotify1" = "yes" ; then echo "CONFIG_INOTIFY1=y" >> $config_host_mak fi -if test "$sem_timedwait" = "yes" ; then - echo "CONFIG_SEM_TIMEDWAIT=y" >> $config_host_mak -fi -if test "$strchrnul" = "yes" ; then - echo "HAVE_STRCHRNUL=y" >> $config_host_mak -fi -if test "$st_atim" = "yes" ; then - echo "HAVE_STRUCT_STAT_ST_ATIM=y" >> $config_host_mak -fi if test "$gio" = "yes" ; then echo "CONFIG_GIO=y" >> $config_host_mak echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak diff --git a/meson.build b/meson.build index 29a050066e..4314b9b4c5 100644 --- a/meson.build +++ b/meson.build @@ -1274,12 +1274,14 @@ config_host_data.set('CONFIG_FALLOCATE', cc.has_function('fallocate')) config_host_data.set('CONFIG_POSIX_FALLOCATE', cc.has_function('posix_fallocate')) config_host_data.set('CONFIG_PPOLL', cc.has_function('ppoll')) config_host_data.set('CONFIG_PREADV', cc.has_function('preadv', prefix: '#include ')) +config_host_data.set('CONFIG_SEM_TIMEDWAIT', cc.has_function('sem_timedwait', dependencies: threads)) config_host_data.set('CONFIG_SENDFILE', cc.has_function('sendfile')) config_host_data.set('CONFIG_SETNS', cc.has_function('setns') and cc.has_function('unshare')) config_host_data.set('CONFIG_SYNCFS', cc.has_function('syncfs')) config_host_data.set('CONFIG_SYNC_FILE_RANGE', cc.has_function('sync_file_range')) config_host_data.set('CONFIG_TIMERFD', cc.has_function('timerfd_create')) config_host_data.set('HAVE_OPENPTY', cc.has_function('openpty', dependencies: util)) +config_host_data.set('HAVE_STRCHRNUL', cc.has_function('strchrnul')) config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', prefix: '#include ')) # has_header_symbol @@ -1306,6 +1308,9 @@ config_host_data.set('CONFIG_PRCTL_PR_SET_TIMERSLACK', config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID', cc.has_member('struct sigevent', 'sigev_notify_thread_id', prefix: '#include ')) +config_host_data.set('HAVE_STRUCT_STAT_ST_ATIM', + cc.has_member('struct stat', 'st_atim', + prefix: '#include ')) # Some versions of Mac OS X incorrectly define SIZE_MAX config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles(''' From patchwork Tue Jul 6 10:01:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360303 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0017EC07E96 for ; Tue, 6 Jul 2021 10:36:48 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 80A1C619AA for ; Tue, 6 Jul 2021 10:36:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 80A1C619AA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:52270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iRb-00020F-Kp for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:36:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42450) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hu1-0001GX-QA for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:05 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:42809) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htz-0002P6-Hl for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:05 -0400 Received: by mail-wr1-x435.google.com with SMTP id t6so15432010wrm.9 for ; Tue, 06 Jul 2021 03:02:02 -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=4BdD6jxidGfMEq7c7dSE3OTNZydmwQIYhRWbOc8EIzE=; b=CRKxEkg1/l24mqSjwfoyTQGE1d6p4qf8IkG3gEHJDVEsPMW6VXrz2HWs/qHng7JQyG +pIObi5zjBV/dsh8iGPyhPntUKaLWQFaMJF5TY8WGw+aGQt8kdtlfrS7NfFYZ2JGDhB1 sTn0R/SIXuixzBLgTXD1Jm151ubJaOQHpCA9NGdqfIEctiyWHe67tPyA/9g+K7lfRQJB XgWnSh0XpxxzR77ak1XfM4FUGhCdPhpXgJ4Q4qXPN7Zmn/H0RNsgizM7tyuKMpbeQU0m UjPEEvqIRgcsA1hFi5npPfCZBdsmtjPQ49L7hD+4p1xgwqjEyjjqgDqCSFesYl3XY9o6 dU1A== 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=4BdD6jxidGfMEq7c7dSE3OTNZydmwQIYhRWbOc8EIzE=; b=F/0SwSQ62uEpa3D9HlDDvVcqHMuBXTu4vzslD0qFIZrjRDyOqeKfqc0qt9VD7fQzMY 1ZPP0nrqJ1uMyga1mz5laLNolZiPlPb48tT4T/KsNceH+P3NJlzLZHbFGB3QwFUZe/Mx 2FEmZthYyef28lYMeeq8GI6jFf3ZeO+qQE0pzB2nIVcp7NEvuE/SMJjBA6zWdLDbgMxK CRvg9WuLlf0TqPVzJIXyJwjIXx5FO/eHM3tbDm1H6a2LO+0o5AMnlEYbbfhJGXJ30k0H vSOlg+p/BhXqleQJReb7SZ1je3KwCl+NHXzDawBCXdjscekiatYC7ZzXSV5j1sJmWgYz ITDw== X-Gm-Message-State: AOAM530WKBT55KFxdDT6p4w4xikwEhUHqxYyShhp84dZy22ZUpH9Hpsu 1ATsO2jQ1AbvkxVU5oiurH7xlqqdCYg= X-Google-Smtp-Source: ABdhPJw+JLiXrI+9IEFznLCDypByNtANiRLsi6FHviIlLBXgGks/WeFP4bwdqBY2t+CNUvXGfX4cyw== X-Received: by 2002:a5d:4b8b:: with SMTP id b11mr10407570wrt.113.1625565721761; Tue, 06 Jul 2021 03:02:01 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.02.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:02:01 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 29/40] configure: convert compiler tests to meson, part 3 Date: Tue, 6 Jul 2021 12:01:30 +0200 Message-Id: <20210706100141.303960-30-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x435.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.25, 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: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- configure | 87 ----------------------------------------------------- meson.build | 10 ++++++ 2 files changed, 10 insertions(+), 87 deletions(-) diff --git a/configure b/configure index 78f4a351d9..cf7f71fe40 100755 --- a/configure +++ b/configure @@ -4293,20 +4293,6 @@ if test "$fortify_source" != "no"; then fi fi -############################################### -# Check if copy_file_range is provided by glibc -have_copy_file_range=no -cat > $TMPC << EOF -#include -int main(void) { - copy_file_range(0, NULL, 0, NULL, 0, 0); - return 0; -} -EOF -if compile_prog "" "" ; then - have_copy_file_range=yes -fi - ########################################## # check if struct fsxattr is available via linux/fs.h @@ -4353,19 +4339,6 @@ else membarrier=no fi -########################################## -# check if rtnetlink.h exists and is useful -have_rtnetlink=no -cat > $TMPC << EOF -#include -int main(void) { - return IFLA_PROTO_DOWN; -} -EOF -if compile_prog "" "" ; then - have_rtnetlink=yes -fi - ########################################## # check for usable AF_VSOCK environment have_af_vsock=no @@ -4419,49 +4392,6 @@ then fi -################################################# -# check for sysmacros.h - -have_sysmacros=no -cat > $TMPC << EOF -#include -int main(void) { - return makedev(0, 0); -} -EOF -if compile_prog "" "" ; then - have_sysmacros=yes -fi - -########################################## -# check for utmpx.h, it is missing e.g. on OpenBSD - -have_utmpx=no -cat > $TMPC << EOF -#include -struct utmpx user_info; -int main(void) { - return 0; -} -EOF -if compile_prog "" "" ; then - have_utmpx=yes -fi - -########################################## -# check for getrandom() - -have_getrandom=no -cat > $TMPC << EOF -#include -int main(void) { - return getrandom(0, 0, GRND_NONBLOCK); -} -EOF -if compile_prog "" "" ; then - have_getrandom=yes -fi - ########################################## # checks for sanitizers @@ -4944,9 +4874,6 @@ echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak if test "$have_fsxattr" = "yes" ; then echo "HAVE_FSXATTR=y" >> $config_host_mak fi -if test "$have_copy_file_range" = "yes" ; then - echo "HAVE_COPY_FILE_RANGE=y" >> $config_host_mak -fi if test "$xen" = "enabled" ; then echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak @@ -5182,10 +5109,6 @@ if test "$pvrdma" = "yes" ; then echo "CONFIG_PVRDMA=y" >> $config_host_mak fi -if test "$have_rtnetlink" = "yes" ; then - echo "CONFIG_RTNETLINK=y" >> $config_host_mak -fi - if test "$replication" = "yes" ; then echo "CONFIG_REPLICATION=y" >> $config_host_mak fi @@ -5194,16 +5117,6 @@ if test "$have_af_vsock" = "yes" ; then echo "CONFIG_AF_VSOCK=y" >> $config_host_mak fi -if test "$have_sysmacros" = "yes" ; then - echo "CONFIG_SYSMACROS=y" >> $config_host_mak -fi - -if test "$have_utmpx" = "yes" ; then - echo "HAVE_UTMPX=y" >> $config_host_mak -fi -if test "$have_getrandom" = "yes" ; then - echo "CONFIG_GETRANDOM=y" >> $config_host_mak -fi if test "$debug_mutex" = "yes" ; then echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak fi diff --git a/meson.build b/meson.build index 4314b9b4c5..5fec46bb65 100644 --- a/meson.build +++ b/meson.build @@ -1280,6 +1280,7 @@ config_host_data.set('CONFIG_SETNS', cc.has_function('setns') and cc.has_functio config_host_data.set('CONFIG_SYNCFS', cc.has_function('syncfs')) config_host_data.set('CONFIG_SYNC_FILE_RANGE', cc.has_function('sync_file_range')) config_host_data.set('CONFIG_TIMERFD', cc.has_function('timerfd_create')) +config_host_data.set('HAVE_COPY_FILE_RANGE', cc.has_function('copy_file_range')) config_host_data.set('HAVE_OPENPTY', cc.has_function('openpty', dependencies: util)) config_host_data.set('HAVE_STRCHRNUL', cc.has_function('strchrnul')) config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', prefix: '#include ')) @@ -1297,12 +1298,21 @@ config_host_data.set('CONFIG_FALLOCATE_ZERO_RANGE', config_host_data.set('CONFIG_FIEMAP', cc.has_header('linux/fiemap.h') and cc.has_header_symbol('linux/fs.h', 'FS_IOC_FIEMAP')) +config_host_data.set('CONFIG_GETRANDOM', + cc.has_function('getrandom') and + cc.has_header_symbol('sys/random.h', 'GRND_NONBLOCK')) config_host_data.set('CONFIG_MACHINE_BSWAP_H', cc.has_header_symbol('machine/bswap.h', 'bswap32', prefix: '''#include #include ''')) config_host_data.set('CONFIG_PRCTL_PR_SET_TIMERSLACK', cc.has_header_symbol('sys/prctl.h', 'PR_SET_TIMERSLACK')) +config_host_data.set('CONFIG_RTNETLINK', + cc.has_header_symbol('linux/rtnetlink.h', 'IFLA_PROTO_DOWN')) +config_host_data.set('CONFIG_SYSMACROS', + cc.has_header_symbol('sys/sysmacros.h', 'makedev')) +config_host_data.set('HAVE_UTMPX', + cc.has_header_symbol('utmpx.h', 'struct utmpx')) # has_member config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID', From patchwork Tue Jul 6 10:01:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE0AAC07E96 for ; Tue, 6 Jul 2021 10:29:24 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5833D608FE for ; Tue, 6 Jul 2021 10:29:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5833D608FE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iKR-0004h1-Eu for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:29:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hu3-0001Kx-0z for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:07 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:51892) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0htz-0002Pt-Ry for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:06 -0400 Received: by mail-wm1-x332.google.com with SMTP id n33so5669838wms.1 for ; Tue, 06 Jul 2021 03:02:03 -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=dWfQhBashspj92n3O9gjSje6wEHhYNIVjiIMVmNraZU=; b=F5Y+G9lPO3zabhOXsjY2BTJLZoWQpS5FfRjuU2zPsIOFRX0M4/FTTlrwc0J/2Nf67/ OjWhy9bi19rzYmk2xpS40e2J3cEaNzrPVZQVjxdvpI/vGk5KC6AOE+9PbHyifcScQqbS ZSZr0f/7bNr/4cPw4ot0RdXSJCWXULNZ0NonPobd+QkYhaSWePtEuNJrPgymjxUwkd6/ SHffYqkDOqM2rAaXipdcpaY8aS6p/YkHQJnFriFMRlqSfdAQ6p3bOCp2DirO25I6az8j HRqYTE92e/VRv5MBLs4INTIQG+6JpeS2ZfUU91Gl/Ggr57Z+NddPEGJzDcjBMGxB8QXn JSSg== 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=dWfQhBashspj92n3O9gjSje6wEHhYNIVjiIMVmNraZU=; b=rO2jmyMT+blYhdeB7zJqht9VXLvDHdly0ENUcLeFrUKiMDh32fluJ04Qv5EI7zp/a9 cStyxSq6+QOrm8weVcEaP/kZe7QYmPOO1adQQcC/jTHj5/0F3HIkhn0FadmPKX8Q5dQD RIqhx94koHXeZigCJy5nb+kQllhy9L1KT5wPwnSiscmcNZDfvcNX7sJyKLgrIa4j1Kla m/holUg0UvGrog0+f0woD2+Q9tLYkWP0LDYsGUdZwDGF1wMzs2dcgVLTKqSoiFNZDWjs ug9TcCSFY1/JCYlxGDBg63XFFTXMoLdTKhWBQfzLPDGU6wHZjtR0RpcE3ALaQ3R80fLn EmTw== X-Gm-Message-State: AOAM533m548MDhFLXRdsp80xL9h85TSRyioZOsHUXAp6J/4H3uY+xEMF MOj3FL3jwkKhHT0l+qDaMFIDI/eT1Mc= X-Google-Smtp-Source: ABdhPJzKx+6BHRGgNHY4IS1ZCzzAZ+v0gzjV5YsKMybxrwt4LcuwaODgdpFXIZfrY9RVuSXh8JwXwA== X-Received: by 2002:a7b:ca4e:: with SMTP id m14mr3813246wml.93.1625565722356; Tue, 06 Jul 2021 03:02:02 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.02.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:02:02 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 30/40] configure: convert compiler tests to meson, part 4 Date: Tue, 6 Jul 2021 12:01:31 +0200 Message-Id: <20210706100141.303960-31-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x332.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.25, 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: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" And remove them from the summary, since now their outcome is verbosely included in the meson output. Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- configure | 137 ---------------------------------------------------- meson.build | 39 +++++++++++++-- 2 files changed, 34 insertions(+), 142 deletions(-) diff --git a/configure b/configure index cf7f71fe40..83168ceb52 100755 --- a/configure +++ b/configure @@ -3511,59 +3511,6 @@ elif test "$jemalloc" = "yes" ; then malloc=jemalloc fi -########################################## -# signalfd probe -signalfd="no" -cat > $TMPC << EOF -#include -#include -#include -int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); } -EOF - -if compile_prog "" "" ; then - signalfd=yes -fi - -# check if optreset global is declared by -optreset="no" -cat > $TMPC << EOF -#include -int main(void) { return optreset; } -EOF - -if compile_prog "" "" ; then - optreset=yes -fi - -# check if eventfd is supported -eventfd=no -cat > $TMPC << EOF -#include - -int main(void) -{ - return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); -} -EOF -if compile_prog "" "" ; then - eventfd=yes -fi - -# check if memfd is supported -memfd=no -cat > $TMPC << EOF -#include - -int main(void) -{ - return memfd_create("foo", MFD_ALLOW_SEALING); -} -EOF -if compile_prog "" "" ; then - memfd=yes -fi - # check for usbfs have_usbfs=no if test "$linux_user" = "yes"; then @@ -3711,66 +3658,6 @@ case "$capstone" in ;; esac -########################################## -# check if we have fdatasync - -fdatasync=no -cat > $TMPC << EOF -#include -int main(void) { -#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 -return fdatasync(0); -#else -#error Not supported -#endif -} -EOF -if compile_prog "" "" ; then - fdatasync=yes -fi - -########################################## -# check if we have madvise - -madvise=no -cat > $TMPC << EOF -#include -#include -#include -int main(void) { return madvise(NULL, 0, MADV_DONTNEED); } -EOF -if compile_prog "" "" ; then - madvise=yes -fi - -########################################## -# check if we have posix_madvise - -posix_madvise=no -cat > $TMPC << EOF -#include -#include -int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); } -EOF -if compile_prog "" "" ; then - posix_madvise=yes -fi - -########################################## -# check if we have posix_memalign() - -posix_memalign=no -cat > $TMPC << EOF -#include -int main(void) { - void *p; - return posix_memalign(&p, 8, 8); -} -EOF -if compile_prog "" "" ; then - posix_memalign=yes -fi - ########################################## # check if we have posix_syslog @@ -4842,12 +4729,6 @@ fi if test "$splice" = "yes" ; then echo "CONFIG_SPLICE=y" >> $config_host_mak fi -if test "$eventfd" = "yes" ; then - echo "CONFIG_EVENTFD=y" >> $config_host_mak -fi -if test "$memfd" = "yes" ; then - echo "CONFIG_MEMFD=y" >> $config_host_mak -fi if test "$have_usbfs" = "yes" ; then echo "CONFIG_USBFS=y" >> $config_host_mak fi @@ -4922,27 +4803,9 @@ fi if test "$membarrier" = "yes" ; then echo "CONFIG_MEMBARRIER=y" >> $config_host_mak fi -if test "$signalfd" = "yes" ; then - echo "CONFIG_SIGNALFD=y" >> $config_host_mak -fi -if test "$optreset" = "yes" ; then - echo "HAVE_OPTRESET=y" >> $config_host_mak -fi if test "$tcg" = "enabled" -a "$tcg_interpreter" = "true" ; then echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak fi -if test "$fdatasync" = "yes" ; then - echo "CONFIG_FDATASYNC=y" >> $config_host_mak -fi -if test "$madvise" = "yes" ; then - echo "CONFIG_MADVISE=y" >> $config_host_mak -fi -if test "$posix_madvise" = "yes" ; then - echo "CONFIG_POSIX_MADVISE=y" >> $config_host_mak -fi -if test "$posix_memalign" = "yes" ; then - echo "CONFIG_POSIX_MEMALIGN=y" >> $config_host_mak -fi if test "$spice_protocol" = "yes" ; then echo "CONFIG_SPICE_PROTOCOL=y" >> $config_host_mak diff --git a/meson.build b/meson.build index 5fec46bb65..cb50a2e473 100644 --- a/meson.build +++ b/meson.build @@ -1272,6 +1272,7 @@ config_host_data.set('CONFIG_CLOCK_ADJTIME', cc.has_function('clock_adjtime')) config_host_data.set('CONFIG_DUP3', cc.has_function('dup3')) config_host_data.set('CONFIG_FALLOCATE', cc.has_function('fallocate')) config_host_data.set('CONFIG_POSIX_FALLOCATE', cc.has_function('posix_fallocate')) +config_host_data.set('CONFIG_POSIX_MEMALIGN', cc.has_function('posix_memalign')) config_host_data.set('CONFIG_PPOLL', cc.has_function('ppoll')) config_host_data.set('CONFIG_PREADV', cc.has_function('preadv', prefix: '#include ')) config_host_data.set('CONFIG_SEM_TIMEDWAIT', cc.has_function('sem_timedwait', dependencies: threads)) @@ -1311,6 +1312,8 @@ config_host_data.set('CONFIG_RTNETLINK', cc.has_header_symbol('linux/rtnetlink.h', 'IFLA_PROTO_DOWN')) config_host_data.set('CONFIG_SYSMACROS', cc.has_header_symbol('sys/sysmacros.h', 'makedev')) +config_host_data.set('HAVE_OPTRESET', + cc.has_header_symbol('getopt.h', 'optreset')) config_host_data.set('HAVE_UTMPX', cc.has_header_symbol('utmpx.h', 'struct utmpx')) @@ -1322,6 +1325,36 @@ config_host_data.set('HAVE_STRUCT_STAT_ST_ATIM', cc.has_member('struct stat', 'st_atim', prefix: '#include ')) +config_host_data.set('CONFIG_EVENTFD', cc.compiles(''' + #include + int main(void) { return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); }''')) +config_host_data.set('CONFIG_FDATASYNC', cc.compiles(gnu_source_prefix + ''' + #include + int main(void) { + #if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 + return fdatasync(0); + #else + #error Not supported + #endif + }''')) +config_host_data.set('CONFIG_MADVISE', cc.compiles(gnu_source_prefix + ''' + #include + #include + #include + int main(void) { return madvise(NULL, 0, MADV_DONTNEED); }''')) +config_host_data.set('CONFIG_MEMFD', cc.compiles(gnu_source_prefix + ''' + #include + int main(void) { return memfd_create("foo", MFD_ALLOW_SEALING); }''')) +config_host_data.set('CONFIG_POSIX_MADVISE', cc.compiles(gnu_source_prefix + ''' + #include + #include + int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); }''')) +config_host_data.set('CONFIG_SIGNALFD', cc.compiles(gnu_source_prefix + ''' + #include + #include + #include + int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }''')) + # Some versions of Mac OS X incorrectly define SIZE_MAX config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles(''' #include @@ -1398,7 +1431,7 @@ if link_language == 'cpp' } endif -have_ivshmem = config_host.has_key('CONFIG_EVENTFD') +have_ivshmem = config_host_data.get('CONFIG_EVENTFD') host_kconfig = \ ('CONFIG_TPM' in config_host ? ['CONFIG_TPM=y'] : []) + \ ('CONFIG_SPICE' in config_host ? ['CONFIG_SPICE=y'] : []) + \ @@ -2711,10 +2744,6 @@ summary_info += {'PIE': get_option('b_pie')} summary_info += {'static build': config_host.has_key('CONFIG_STATIC')} summary_info += {'malloc trim support': has_malloc_trim} summary_info += {'membarrier': config_host.has_key('CONFIG_MEMBARRIER')} -summary_info += {'fdatasync': config_host.has_key('CONFIG_FDATASYNC')} -summary_info += {'madvise': config_host.has_key('CONFIG_MADVISE')} -summary_info += {'posix_madvise': config_host.has_key('CONFIG_POSIX_MADVISE')} -summary_info += {'posix_memalign': config_host.has_key('CONFIG_POSIX_MEMALIGN')} summary_info += {'debug stack usage': config_host.has_key('CONFIG_DEBUG_STACK_USAGE')} summary_info += {'mutex debugging': config_host.has_key('CONFIG_DEBUG_MUTEX')} summary_info += {'memory allocator': get_option('malloc')} From patchwork Tue Jul 6 10:01:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360291 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB30FC07E9C for ; Tue, 6 Jul 2021 10:33:11 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4F4F8619AC for ; Tue, 6 Jul 2021 10:33:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F4F8619AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iO6-0001ag-ET for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:33:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42490) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hu4-0001Od-B7 for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:08 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:42803) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0hu2-0002S7-6P for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:07 -0400 Received: by mail-wr1-x42e.google.com with SMTP id t6so15432202wrm.9 for ; Tue, 06 Jul 2021 03:02:05 -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=0skwyYzRx8lw1Lptcw6cX8ImdqPgrLgTWanS4XnbGr4=; b=HAL3t1uDlb+lF7GKRHQuzGc0UAe2VQVES0d71qLyp9MNcOxkwtRkA3tVAy3FXBmRo8 91fvxlA4L3KAXSqJpOXTSfs0yIAl/Sp8b0HSS69ac2Xq/gT7TBCiBGsvrmxv4KP/eNuk tQu3nCOURPQpnMmlv9VMbyZMFMVH1QJ8PcRJiy7TUrPZTRXCNIeeXGqjAqdqaHBA8yy2 nVcRgEs/zy/MCX9kz+0N6yhlIuAnSDIcLVyxnAr7hV8BGRwqRF6emVM2FoDXhip1vy7B /ONc8VsLwnbUxSc/6WaxFqdBFyVEEwPF7HMK1iM3c0ny7EZpuUMrbi9wQ1pKLjjm2SiG /RJw== 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=0skwyYzRx8lw1Lptcw6cX8ImdqPgrLgTWanS4XnbGr4=; b=X4uPvowyZPG1LvKArl2qD8jJ0dF58KkGokUnipZgXKFGcPVCtChl10YqK+IxWRo7VT eo2zkxz+PYzmIS/agUDKALnWRUz1Q5OURe5MMj1oQPqIFDH2Adfesopt6Q4E1U/GojEr uWTXcI7IJurp/mnzcJhuxKeRT8nrfgKe8o7WnVend8Epw3V6fRTswTKN3ftZUBb2WUrG DMARnfhwXx5NjVRz4FT5ALmGvbvJKIdbauTaHDMOHhQUpwvCeCKZ8w+BFUGLSFFCSXkD veQWYB0/C19mQSdMwlsFKFRqHHwIBHMzhRf5kMHYBoWdRY37hxEfziX7bDWbpoS+TF7d So5w== X-Gm-Message-State: AOAM530op+//e37oWu0tiysXnyTdcauBj/FN6L2bnYkawfh7ihug0pr8 rK/1hiAr1wqxq6Ihm84MM56UBqbZuRQ= X-Google-Smtp-Source: ABdhPJz1MNzIhxz5shObM4gQIrm95v4R5hbYoKEci4/4no5q9BUDI5Dne1TDjzSZeyWAyTRtc1VSyQ== X-Received: by 2002:a05:6000:81:: with SMTP id m1mr20650450wrx.322.1625565724489; Tue, 06 Jul 2021 03:02:04 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.02.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:02:04 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 31/40] configure: convert compiler tests to meson, part 5 Date: Tue, 6 Jul 2021 12:01:32 +0200 Message-Id: <20210706100141.303960-32-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x42e.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.25, 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: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- configure | 101 ---------------------------------------------------- meson.build | 26 ++++++++++++++ 2 files changed, 26 insertions(+), 101 deletions(-) diff --git a/configure b/configure index 83168ceb52..1cac47399d 100755 --- a/configure +++ b/configure @@ -3395,92 +3395,6 @@ EOF fi fi -# Check for inotify functions when we are building linux-user -# emulator. This is done because older glibc versions don't -# have syscall stubs for these implemented. In that case we -# don't provide them even if kernel supports them. -# -inotify=no -cat > $TMPC << EOF -#include - -int -main(void) -{ - /* try to start inotify */ - return inotify_init(); -} -EOF -if compile_prog "" "" ; then - inotify=yes -fi - -inotify1=no -cat > $TMPC << EOF -#include - -int -main(void) -{ - /* try to start inotify */ - return inotify_init1(0); -} -EOF -if compile_prog "" "" ; then - inotify1=yes -fi - -# check if pipe2 is there -pipe2=no -cat > $TMPC << EOF -#include -#include - -int main(void) -{ - int pipefd[2]; - return pipe2(pipefd, O_CLOEXEC); -} -EOF -if compile_prog "" "" ; then - pipe2=yes -fi - -# check if accept4 is there -accept4=no -cat > $TMPC << EOF -#include -#include - -int main(void) -{ - accept4(0, NULL, NULL, SOCK_CLOEXEC); - return 0; -} -EOF -if compile_prog "" "" ; then - accept4=yes -fi - -# check if tee/splice is there. vmsplice was added same time. -splice=no -cat > $TMPC << EOF -#include -#include -#include - -int main(void) -{ - int len, fd = 0; - len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); - splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE); - return 0; -} -EOF -if compile_prog "" "" ; then - splice=yes -fi - ########################################## # libnuma probe @@ -4720,24 +4634,9 @@ fi if test "$module_upgrades" = "yes"; then echo "CONFIG_MODULE_UPGRADES=y" >> $config_host_mak fi -if test "$pipe2" = "yes" ; then - echo "CONFIG_PIPE2=y" >> $config_host_mak -fi -if test "$accept4" = "yes" ; then - echo "CONFIG_ACCEPT4=y" >> $config_host_mak -fi -if test "$splice" = "yes" ; then - echo "CONFIG_SPLICE=y" >> $config_host_mak -fi if test "$have_usbfs" = "yes" ; then echo "CONFIG_USBFS=y" >> $config_host_mak fi -if test "$inotify" = "yes" ; then - echo "CONFIG_INOTIFY=y" >> $config_host_mak -fi -if test "$inotify1" = "yes" ; then - echo "CONFIG_INOTIFY1=y" >> $config_host_mak -fi if test "$gio" = "yes" ; then echo "CONFIG_GIO=y" >> $config_host_mak echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak diff --git a/meson.build b/meson.build index cb50a2e473..12162264db 100644 --- a/meson.build +++ b/meson.build @@ -1268,6 +1268,7 @@ config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h')) config_host_data.set('HAVE_SYS_KCOV_H', cc.has_header('sys/kcov.h')) # has_function +config_host_data.set('CONFIG_ACCEPT4', cc.has_function('accept4')) config_host_data.set('CONFIG_CLOCK_ADJTIME', cc.has_function('clock_adjtime')) config_host_data.set('CONFIG_DUP3', cc.has_function('dup3')) config_host_data.set('CONFIG_FALLOCATE', cc.has_function('fallocate')) @@ -1302,6 +1303,10 @@ config_host_data.set('CONFIG_FIEMAP', config_host_data.set('CONFIG_GETRANDOM', cc.has_function('getrandom') and cc.has_header_symbol('sys/random.h', 'GRND_NONBLOCK')) +config_host_data.set('CONFIG_INOTIFY', + cc.has_header_symbol('sys/inotify.h', 'inotify_init')) +config_host_data.set('CONFIG_INOTIFY1', + cc.has_header_symbol('sys/inotify.h', 'inotify_init1')) config_host_data.set('CONFIG_MACHINE_BSWAP_H', cc.has_header_symbol('machine/bswap.h', 'bswap32', prefix: '''#include @@ -1345,6 +1350,15 @@ config_host_data.set('CONFIG_MADVISE', cc.compiles(gnu_source_prefix + ''' config_host_data.set('CONFIG_MEMFD', cc.compiles(gnu_source_prefix + ''' #include int main(void) { return memfd_create("foo", MFD_ALLOW_SEALING); }''')) +config_host_data.set('CONFIG_PIPE2', cc.compiles(gnu_source_prefix + ''' + #include + #include + + int main(void) + { + int pipefd[2]; + return pipe2(pipefd, O_CLOEXEC); + }''')) config_host_data.set('CONFIG_POSIX_MADVISE', cc.compiles(gnu_source_prefix + ''' #include #include @@ -1354,6 +1368,18 @@ config_host_data.set('CONFIG_SIGNALFD', cc.compiles(gnu_source_prefix + ''' #include #include int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }''')) +config_host_data.set('CONFIG_SPLICE', cc.compiles(gnu_source_prefix + ''' + #include + #include + #include + + int main(void) + { + int len, fd = 0; + len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); + splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE); + return 0; + }''')) # Some versions of Mac OS X incorrectly define SIZE_MAX config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles(''' From patchwork Tue Jul 6 10:01:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360313 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5785DC07E96 for ; Tue, 6 Jul 2021 10:42:19 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id CE4ED619AC for ; Tue, 6 Jul 2021 10:42:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE4ED619AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iWv-0003kC-Is for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:42:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hu8-0001aJ-4n for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:12 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:46801) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0hu2-0002T3-G0 for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:11 -0400 Received: by mail-wr1-x432.google.com with SMTP id n9so8028241wrs.13 for ; Tue, 06 Jul 2021 03:02:06 -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=wsCVXQaLB1KXZv6TQRlcL157BoPpd+++508LQhtC4LY=; b=EHJORUMotC5D2pkf0OZsuz5N0XzyzKK+56WiznP6girG7qzbH1UpzfGguxP/lhYC2T W8wtmnJqnJFDWsIOdEkAi8KEChCA/ixHdrXQ0n5Nj/6zG0LnMUiSqmf4g+LLFIOuwd4k dCXFEETbK5kCx4mUi8kAJT9Gn3sMo6xXTpOm7CrgRsiW2LDTN5Q8JwUHBkjL101NfNRI R18kqJgdblSaG05vq5xc1rFhp4j9iGxh1TdIgBg4PHe/qr0MocHUoq+RDNxBgxTnoxf5 N5iuC6mvuTOntlQxz27P4owNgfLNdAKgSlIQMVtY2sF8YdwhewAQlqeNmDXl87jcpyUV GTOw== 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=wsCVXQaLB1KXZv6TQRlcL157BoPpd+++508LQhtC4LY=; b=OIf/bdRUSGmxBURf6Iod60C66DhqJ+/3z8upvVWj66xuQ6XGPhOdT0uqhLn4siACoA HDNT1GcGeJuhglv5afcHnevmhxXlEAhVQpVj9S/psf+CxbG81cp9ib4LI4zYoUjkOQ4u oWBBhMhjyJhiMbt0gv/rl+Szms8k15bJ0vmeSGNUBxCs8pmKm1RmnBleGT9C9Astdfe2 VASlldoBSmsX1L+52cKMZiP5wdBRi611U3b9IRxjx3PF/95XlYX/mMq/nufasjpMOu9z grvhvS8Bw9ZbLCRdsu45z59O13GnCELjM7tCOHvG8AMxe1Fg+zEsgPQ+Pbg/KlCJada5 COkA== X-Gm-Message-State: AOAM532fk3zVCbGNOJ72PSBvyqzI6VHYpZPGCI3fCV71IZ6Jrcn242Uv mKiyqlm5UA6TwU8T7/K4G0vCaSubTKY= X-Google-Smtp-Source: ABdhPJymioGfEP2wHXiDBVE1NI+CK6LSqQ85OjrXINWfvqTqUaiSEAzwfTImIIneQ+UZ55NLbNWHhg== X-Received: by 2002:adf:a404:: with SMTP id d4mr20921240wra.156.1625565725170; Tue, 06 Jul 2021 03:02:05 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.02.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:02:04 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 32/40] configure: convert compiler tests to meson, part 6 Date: Tue, 6 Jul 2021 12:01:33 +0200 Message-Id: <20210706100141.303960-33-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x432.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.25, 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: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- configure | 75 ----------------------------------------------------- meson.build | 11 ++++++++ 2 files changed, 11 insertions(+), 75 deletions(-) diff --git a/configure b/configure index 1cac47399d..0e487ae091 100755 --- a/configure +++ b/configure @@ -3763,65 +3763,6 @@ else # "$safe_stack" = "" fi fi -########################################## -# check if we have open_by_handle_at - -open_by_handle_at=no -cat > $TMPC << EOF -#include -#if !defined(AT_EMPTY_PATH) -# error missing definition -#else -int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); } -#endif -EOF -if compile_prog "" "" ; then - open_by_handle_at=yes -fi - -######################################## -# check if we have linux/magic.h - -linux_magic_h=no -cat > $TMPC << EOF -#include -int main(void) { - return 0; -} -EOF -if compile_prog "" "" ; then - linux_magic_h=yes -fi - -######################################## -# check if we have valgrind/valgrind.h - -valgrind_h=no -cat > $TMPC << EOF -#include -int main(void) { - return 0; -} -EOF -if compile_prog "" "" ; then - valgrind_h=yes -fi - -######################################## -# check if environ is declared - -has_environ=no -cat > $TMPC << EOF -#include -int main(void) { - environ = 0; - return 0; -} -EOF -if compile_prog "" "" ; then - has_environ=yes -fi - ######################################## # check if cpuid.h is usable. @@ -4761,18 +4702,6 @@ if test "$crypto_afalg" = "yes" ; then echo "CONFIG_AF_ALG=y" >> $config_host_mak fi -if test "$open_by_handle_at" = "yes" ; then - echo "CONFIG_OPEN_BY_HANDLE=y" >> $config_host_mak -fi - -if test "$linux_magic_h" = "yes" ; then - echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak -fi - -if test "$valgrind_h" = "yes" ; then - echo "CONFIG_VALGRIND_H=y" >> $config_host_mak -fi - if test "$have_asan_iface_fiber" = "yes" ; then echo "CONFIG_ASAN_IFACE_FIBER=y" >> $config_host_mak fi @@ -4781,10 +4710,6 @@ if test "$have_tsan" = "yes" && test "$have_tsan_iface_fiber" = "yes" ; then echo "CONFIG_TSAN=y" >> $config_host_mak fi -if test "$has_environ" = "yes" ; then - echo "CONFIG_HAS_ENVIRON=y" >> $config_host_mak -fi - if test "$cpuid_h" = "yes" ; then echo "CONFIG_CPUID_H=y" >> $config_host_mak fi diff --git a/meson.build b/meson.build index 12162264db..1651496800 100644 --- a/meson.build +++ b/meson.build @@ -1260,6 +1260,8 @@ config_host_data.set('HAVE_HOST_BLOCK_DEVICE', have_host_block_device) # has_header config_host_data.set('CONFIG_EPOLL', cc.has_header('sys/epoll.h')) +config_host_data.set('CONFIG_LINUX_MAGIC_H', cc.has_header('linux/magic.h')) +config_host_data.set('CONFIG_VALGRIND_H', cc.has_header('valgrind/valgrind.h')) config_host_data.set('HAVE_BTRFS_H', cc.has_header('linux/btrfs.h')) config_host_data.set('HAVE_DRM_H', cc.has_header('libdrm/drm.h')) config_host_data.set('HAVE_PTY_H', cc.has_header('pty.h')) @@ -1292,6 +1294,8 @@ config_host_data.set('CONFIG_BYTESWAP_H', cc.has_header_symbol('byteswap.h', 'bswap_32')) config_host_data.set('CONFIG_EPOLL_CREATE1', cc.has_header_symbol('sys/epoll.h', 'epoll_create1')) +config_host_data.set('CONFIG_HAS_ENVIRON', + cc.has_header_symbol('unistd.h', 'environ', prefix: gnu_source_prefix)) config_host_data.set('CONFIG_FALLOCATE_PUNCH_HOLE', cc.has_header_symbol('linux/falloc.h', 'FALLOC_FL_PUNCH_HOLE') and cc.has_header_symbol('linux/falloc.h', 'FALLOC_FL_KEEP_SIZE')) @@ -1350,6 +1354,13 @@ config_host_data.set('CONFIG_MADVISE', cc.compiles(gnu_source_prefix + ''' config_host_data.set('CONFIG_MEMFD', cc.compiles(gnu_source_prefix + ''' #include int main(void) { return memfd_create("foo", MFD_ALLOW_SEALING); }''')) +config_host_data.set('CONFIG_OPEN_BY_HANDLE', cc.compiles(gnu_source_prefix + ''' + #include + #if !defined(AT_EMPTY_PATH) + # error missing definition + #else + int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); } + #endif''')) config_host_data.set('CONFIG_PIPE2', cc.compiles(gnu_source_prefix + ''' #include #include From patchwork Tue Jul 6 10:01:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360309 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0759C07E96 for ; Tue, 6 Jul 2021 10:40:04 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3F706619A9 for ; Tue, 6 Jul 2021 10:40:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F706619A9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:60582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iUk-0007Tb-8c for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:40:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hu6-0001Tp-2c for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:10 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:34336) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0hu4-0002Uo-5T for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:09 -0400 Received: by mail-wm1-x330.google.com with SMTP id u5-20020a7bc0450000b02901480e40338bso1246870wmc.1 for ; Tue, 06 Jul 2021 03:02:07 -0700 (PDT) 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=eaWfNNyaVagDad1eRt/V1RCmBUTKiX/vUI2Ausu/1+0=; b=QI2++XN4IUd1VlQJ2jN1mUV8m468n/RDdUXdVFAC0Xmv0q2xcUM0UqNbKl94ElqiEv VOHthdtY4SX8iD6ztICJCw82tsJjEp6G9vQzt6JzN3tJlNWJnKOwqfADP7F79SOU8Yeq /oWI7RyF42Xhcvd6vjryJoKPvOX9kJo6kt8M6VM2WL6A7VdFgiKtAiTFG6KwF2fNg/9D 0hjB+0h5T9K59n6tiwDUHMzD5uoq/n68gB55iVad/yi3197nXND/vMKwyuvndXiBgdov XVFnxd0FIABHHH09oc5/+cCj++qqiUiVTjsbZDBkhr0s0z0KSMFcFn/9IUEzrxzISyH5 XzOQ== 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=eaWfNNyaVagDad1eRt/V1RCmBUTKiX/vUI2Ausu/1+0=; b=mLK8EoDjcKIQyW/9ypksIgRO/KtuVgeO6htHLthcWiywcMci0MZ5cb3ueEcbYZAC+o QznTlRSONmhcjCBTo0tHcYva5rnyh73ww8K3+Z9mZxtIA9p94SbtNZ5KP+u6dX4cr3z+ sz1WoBLs5vH7SIm/MDIA/RPxqORclj5E23BrC6ddmjlpINOQ+EYsY+lCc9M1E4XVi+U6 AdS636oFo9oXM6w3Ux0XTWY60oe4DpbZE4JGf+Wf7HLN7Ui55zki/II68uiaE+7G9UzN RCaY4sUZP9R03tH+Fra9aZ0grUTXW64DHTVtQ27FGQGsbxoQSJbusd8ub5jtn4VAhkf8 6qlw== X-Gm-Message-State: AOAM530dIvkgJZp7SwnXAwqgJqLFq+kuRNeQFy0qCdj7qoCkTBaxm1F1 qpyURi+lqFkA0L4+9X4XIykh9KQY2ug= X-Google-Smtp-Source: ABdhPJzPZ4N+qNKKd8CiQ2Xyv2IGH/gjKNF+pgKfWKpPR6d9OMZyyZLMNgZLxZZxW0oaecPbWv6ORg== X-Received: by 2002:a05:600c:4ecd:: with SMTP id g13mr16298912wmq.50.1625565725752; Tue, 06 Jul 2021 03:02:05 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.02.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:02:05 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 33/40] qom: export more functions for use with non-UserCreatable objects Date: Tue, 6 Jul 2021 12:01:34 +0200 Message-Id: <20210706100141.303960-34-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x330.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.25, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Machines and accelerators are not user-creatable but they are going to share similar command-line parsing machinery. Export functions that will be used with -machine and -accel in softmmu/vl.c. Signed-off-by: Paolo Bonzini --- include/qom/object.h | 23 ++++++++++++++++ qom/object_interfaces.c | 58 +++++++++++++++++++++++++++++------------ 2 files changed, 65 insertions(+), 16 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 6721cd312e..faae0d841f 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -861,6 +861,29 @@ static void do_qemu_init_ ## type_array(void) \ } \ type_init(do_qemu_init_ ## type_array) +/** + * type_print_class_properties: + * @type: a QOM class name + * + * Print the object's class properties to stdout or the monitor. + * Return whether an object was found. + */ +bool type_print_class_properties(const char *type); + +/** + * object_set_properties_from_keyval: + * @obj: a QOM object + * @qdict: a dictionary with the properties to be set + * @from_json: true if leaf values of @qdict are typed, false if they + * are strings + * @errp: pointer to error object + * + * For each key in the dictionary, parse the value string if needed, + * then set the corresponding property in @obj. + */ +void object_set_properties_from_keyval(Object *obj, const QDict *qdict, + bool from_json, Error **errp); + /** * object_class_dynamic_cast_assert: * @klass: The #ObjectClass to attempt to cast. diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index 4479ee693a..ad9b56b59a 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -42,6 +42,44 @@ bool user_creatable_can_be_deleted(UserCreatable *uc) } } +static void object_set_properties_from_qdict(Object *obj, const QDict *qdict, + Visitor *v, Error **errp) +{ + const QDictEntry *e; + Error *local_err = NULL; + + if (!visit_start_struct(v, NULL, NULL, 0, &local_err)) { + goto out; + } + for (e = qdict_first(qdict); e; e = qdict_next(qdict, e)) { + if (!object_property_set(obj, e->key, v, &local_err)) { + break; + } + } + if (!local_err) { + visit_check_struct(v, &local_err); + } + visit_end_struct(v, NULL); + +out: + if (local_err) { + error_propagate(errp, local_err); + } +} + +void object_set_properties_from_keyval(Object *obj, const QDict *qdict, + bool from_json, Error **errp) +{ + Visitor *v; + if (from_json) { + v = qobject_input_visitor_new(QOBJECT(qdict)); + } else { + v = qobject_input_visitor_new_keyval(QOBJECT(qdict)); + } + object_set_properties_from_qdict(obj, qdict, v, errp); + visit_free(v); +} + Object *user_creatable_add_type(const char *type, const char *id, const QDict *qdict, Visitor *v, Error **errp) @@ -49,7 +87,6 @@ Object *user_creatable_add_type(const char *type, const char *id, ERRP_GUARD(); Object *obj; ObjectClass *klass; - const QDictEntry *e; Error *local_err = NULL; if (id != NULL && !id_wellformed(id)) { @@ -78,18 +115,7 @@ Object *user_creatable_add_type(const char *type, const char *id, assert(qdict); obj = object_new(type); - if (!visit_start_struct(v, NULL, NULL, 0, &local_err)) { - goto out; - } - for (e = qdict_first(qdict); e; e = qdict_next(qdict, e)) { - if (!object_property_set(obj, e->key, v, &local_err)) { - break; - } - } - if (!local_err) { - visit_check_struct(v, &local_err); - } - visit_end_struct(v, NULL); + object_set_properties_from_qdict(obj, qdict, v, &local_err); if (local_err) { goto out; } @@ -178,7 +204,7 @@ static void user_creatable_print_types(void) g_slist_free(list); } -static bool user_creatable_print_type_properites(const char *type) +bool type_print_class_properties(const char *type) { ObjectClass *klass; ObjectPropertyIterator iter; @@ -224,7 +250,7 @@ bool user_creatable_print_help(const char *type, QemuOpts *opts) } if (qemu_opt_has_help_opt(opts)) { - return user_creatable_print_type_properites(type); + return type_print_class_properties(type); } return false; @@ -234,7 +260,7 @@ static void user_creatable_print_help_from_qdict(QDict *args) { const char *type = qdict_get_try_str(args, "qom-type"); - if (!type || !user_creatable_print_type_properites(type)) { + if (!type || !type_print_class_properties(type)) { user_creatable_print_types(); } } From patchwork Tue Jul 6 10:01:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360311 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DB03C07E96 for ; Tue, 6 Jul 2021 10:40:07 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0DF8C619A9 for ; Tue, 6 Jul 2021 10:40:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0DF8C619A9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:60634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iUo-0007Vs-1A for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:40:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hu6-0001TV-0h for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:10 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:41895) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0hu3-0002UP-SS for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:09 -0400 Received: by mail-wm1-x336.google.com with SMTP id a5-20020a7bc1c50000b02901e3bbe0939bso1852558wmj.0 for ; Tue, 06 Jul 2021 03:02:07 -0700 (PDT) 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=M3EvHDpYBWYLEeRj8A2fJ1IC2EdtujyKIqQke+rzFYo=; b=nQHg1yHaWYgieWCa+vJFqSbwaj0ks1xHXXWgcubBn/LTu9xZNFdkqBzuEDd68VIJ58 UC/mh9cul+qcxsRPNcG937Cdcz/6AHwd7SUtwMg7wFR/DOhZ497ZxcTsLDa2KR1sVC/7 8EcKs/y/B2GDSGQURmbQNq1zMpxxiMt437vsfCCdPgC5izxuCg4kIarHJFaEpaoe84aa sZ/38LYJGOk0kinbvgtKjOzG3LXNLED/yYzdInWTLzs+hf878W/w97R+CExE28ladQcS eu0wvR4Wb2QaoST+c20NeJBbcWd1o/66j2nSKB4guZrPWtdvrK4hILqbZryV72+GlNjw wkFg== 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=M3EvHDpYBWYLEeRj8A2fJ1IC2EdtujyKIqQke+rzFYo=; b=hY+bw4TRUXuBHAg3bIErQZ/AqsJUM2tjW3P3l9i0HwSr40TOPaIlyHpnsBxHaXd0GA zI/dvxEVqYv4OY0Y4dyj9Ams+bO7m/A/0MRo2/BQbVk4/NIF6tzwwomCClQCqpgp4D7v BuDahu77n6YwZUEfj0dv9JFWN3fC0BgMwbHp/AKRKOya65CdTIee9xguDnhRZIAyXhlh wvVcxSy41lhMzoeIndvTo4pI8yuFg83LThMlP8zsS3shpy/HV+AHrLeA67+frH2SQQPz YgDh9k6UJqTUWuLdlmKjt2RXwfy4yvyjz8j5sRiXC/QNH24av70W/1zZyWu5vtf7epjH LZcw== X-Gm-Message-State: AOAM533NgbkuZX0ifpbGl49pI63e4f3m98PgwVSqNNrQgjfovEzMRlCk ejVdRBooKIrY3CzIrlvoAjqb4m72N5Q= X-Google-Smtp-Source: ABdhPJxwccu1TwgQ+7VAWfCzmRK1e2LfYIgH3h9I3dDH5bWHnnA/sHma3mvk6k9qqkDrEkq2KXPoig== X-Received: by 2002:a05:600c:3648:: with SMTP id y8mr19750352wmq.174.1625565726455; Tue, 06 Jul 2021 03:02:06 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.02.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:02:06 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 34/40] keyval: introduce keyval_merge Date: Tue, 6 Jul 2021 12:01:35 +0200 Message-Id: <20210706100141.303960-35-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x336.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.25, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This patch introduces a function that merges two keyval-produced (or keyval-like) QDicts. It can be used to emulate the behavior of .merge_lists = true QemuOpts groups, merging -readconfig sections and command-line options in a single QDict, and also to implement -set. Signed-off-by: Paolo Bonzini --- include/qemu/option.h | 1 + tests/unit/test-keyval.c | 58 +++++++++++++++++++++++++++++ util/keyval.c | 80 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 139 insertions(+) diff --git a/include/qemu/option.h b/include/qemu/option.h index f73e0dc7d9..d89c66145a 100644 --- a/include/qemu/option.h +++ b/include/qemu/option.h @@ -149,5 +149,6 @@ QemuOptsList *qemu_opts_append(QemuOptsList *dst, QemuOptsList *list); QDict *keyval_parse(const char *params, const char *implied_key, bool *help, Error **errp); +void keyval_merge(QDict *old, const QDict *new, Error **errp); #endif diff --git a/tests/unit/test-keyval.c b/tests/unit/test-keyval.c index e20c07cf3e..af0581ae6c 100644 --- a/tests/unit/test-keyval.c +++ b/tests/unit/test-keyval.c @@ -747,6 +747,61 @@ static void test_keyval_visit_any(void) visit_free(v); } +static void test_keyval_merge_dict(void) +{ + QDict *first = keyval_parse("opt1=abc,opt2.sub1=def,opt2.sub2=ghi,opt3=xyz", + NULL, NULL, &error_abort); + QDict *second = keyval_parse("opt1=ABC,opt2.sub2=GHI,opt2.sub3=JKL", + NULL, NULL, &error_abort); + QDict *combined = keyval_parse("opt1=ABC,opt2.sub1=def,opt2.sub2=GHI,opt2.sub3=JKL,opt3=xyz", + NULL, NULL, &error_abort); + Error *err = NULL; + + keyval_merge(first, second, &err); + g_assert(!err); + g_assert(qobject_is_equal(QOBJECT(combined), QOBJECT(first))); + qobject_unref(first); + qobject_unref(second); + qobject_unref(combined); +} + +static void test_keyval_merge_list(void) +{ + QDict *first = keyval_parse("opt1.0=abc,opt2.0=xyz", + NULL, NULL, &error_abort); + QDict *second = keyval_parse("opt1.0=def", + NULL, NULL, &error_abort); + QDict *combined = keyval_parse("opt1.0=abc,opt1.1=def,opt2.0=xyz", + NULL, NULL, &error_abort); + Error *err = NULL; + + keyval_merge(first, second, &err); + g_assert(!err); + g_assert(qobject_is_equal(QOBJECT(combined), QOBJECT(first))); + qobject_unref(first); + qobject_unref(second); + qobject_unref(combined); +} + +static void test_keyval_merge_conflict(void) +{ + QDict *first = keyval_parse("opt2=ABC", + NULL, NULL, &error_abort); + QDict *second = keyval_parse("opt2.sub1=def,opt2.sub2=ghi", + NULL, NULL, &error_abort); + QDict *third = qdict_clone_shallow(first); + Error *err = NULL; + + keyval_merge(first, second, &err); + error_free_or_abort(&err); + keyval_merge(second, third, &err); + error_free_or_abort(&err); + + qobject_unref(first); + qobject_unref(second); + qobject_unref(third); +} + int main(int argc, char *argv[]) { g_test_init(&argc, &argv, NULL); @@ -760,6 +815,9 @@ int main(int argc, char *argv[]) g_test_add_func("/keyval/visit/optional", test_keyval_visit_optional); g_test_add_func("/keyval/visit/alternate", test_keyval_visit_alternate); g_test_add_func("/keyval/visit/any", test_keyval_visit_any); + g_test_add_func("/keyval/merge/dict", test_keyval_merge_dict); + g_test_add_func("/keyval/merge/list", test_keyval_merge_list); + g_test_add_func("/keyval/merge/conflict", test_keyval_merge_conflict); g_test_run(); return 0; } diff --git a/util/keyval.c b/util/keyval.c index be34928813..9bc380686a 100644 --- a/util/keyval.c +++ b/util/keyval.c @@ -310,6 +310,86 @@ static char *reassemble_key(GSList *key) return g_string_free(s, FALSE); } +/* + * Recursive worker for keyval_merge. + * + * @str is the path that led to the * current dictionary (to be used for + * error messages). It is modified internally but restored before the + * function returns. + */ +static void keyval_do_merge(QDict *dest, const QDict *merged, GString *str, Error **errp) +{ + size_t save_len = str->len; + const QDictEntry *ent; + QObject *old_value; + + for (ent = qdict_first(merged); ent; ent = qdict_next(merged, ent)) { + old_value = qdict_get(dest, ent->key); + if (old_value) { + if (qobject_type(old_value) != qobject_type(ent->value)) { + error_setg(errp, "Parameter '%s%s' used inconsistently", + str->str, ent->key); + return; + } else if (qobject_type(ent->value) == QTYPE_QDICT) { + /* Merge sub-dictionaries. */ + g_string_append(str, ent->key); + g_string_append_c(str, '.'); + keyval_do_merge(qobject_to(QDict, old_value), + qobject_to(QDict, ent->value), + str, errp); + g_string_truncate(str, save_len); + continue; + } else if (qobject_type(ent->value) == QTYPE_QLIST) { + /* Append to old list. */ + QList *old = qobject_to(QList, old_value); + QList *new = qobject_to(QList, ent->value); + const QListEntry *item; + QLIST_FOREACH_ENTRY(new, item) { + qobject_ref(item->value); + qlist_append_obj(old, item->value); + } + continue; + } else { + assert(qobject_type(ent->value) == QTYPE_QSTRING); + } + } + + qobject_ref(ent->value); + qdict_put_obj(dest, ent->key, ent->value); + } +} + +/* Merge the @merged dictionary into @dest. + * + * The dictionaries are expected to be returned by the keyval parser, and + * therefore the only expected scalar type is the string. In case the same + * path is present in both @dest and @merged, the semantics are as follows: + * + * - lists are concatenated + * + * - dictionaries are merged recursively + * + * - for scalar values, @merged wins + * + * In case an error is reported, @dest may already have been modified. + * + * This function can be used to implement semantics analogous to QemuOpts's + * .merge_lists = true case, or to implement -set for options backed by QDicts. + * + * Note: while QemuOpts is commonly used so that repeated keys overwrite + * ("last one wins"), it can also be used so that repeated keys build up + * a list. keyval_merge() can only be used when the options' semantics are + * the former, not the latter. + */ +void keyval_merge(QDict *dest, const QDict *merged, Error **errp) +{ + GString *str; + + str = g_string_new(""); + keyval_do_merge(dest, merged, str, errp); + g_string_free(str, TRUE); +} + /* * Listify @cur recursively. * Replace QDicts whose keys are all valid list indexes by QLists. From patchwork Tue Jul 6 10:01:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360297 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 718FCC07E96 for ; Tue, 6 Jul 2021 10:35:00 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0D5EE6044F for ; Tue, 6 Jul 2021 10:34:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D5EE6044F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iPr-0006Eg-41 for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:34:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hu8-0001a5-3q for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:12 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:34338) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0hu4-0002VA-NV for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:11 -0400 Received: by mail-wm1-x332.google.com with SMTP id u5-20020a7bc0450000b02901480e40338bso1246921wmc.1 for ; Tue, 06 Jul 2021 03:02:08 -0700 (PDT) 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=pPKh7lIKm+SGPL0+HFk+8YhEYmWyPFDkPiymEwO3vwM=; b=ejT1++htkKn3Mgs8xIPXfp9dhSvljmnBHjN8oKyUSq8JxWU9gi85xxnep8bqT59bgr gVjL24rOnLyDeBb0qaU1J9nT4IR9EbH4K3Z6BfrLOm3pUMk1VbzH8U5PI3kgbx3puWP2 8JhTIRHxeYvhcJ9GU494rp6thlBV/DZimVr+Yv3VAo/h8cvkM8c8NCMZn3hjSS8hmsdy lEhUeM3crOQEAJn90rf/C+i+8hQQ/5XZQY/rsj2fHNyBN5UjEwTNGDSsaIiWFY0eFQPX mBId8SwN2gsEe0CWlzk0MtIKvFa85G9w5dhIQhp6R0YjyH7AQS5fCBi5SDm+s1Hi63RK Vt/Q== 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=pPKh7lIKm+SGPL0+HFk+8YhEYmWyPFDkPiymEwO3vwM=; b=T4LJ7dZ7P5iq1ZLayHnX/qSlA8aBcKWpJVjRNNcYb/34J3gyC4zreSWXpZFyKOvSkx C/tN1iZc5+n6UCNWAf4Dn5NlsHreEz9cf9NrGhBfqP0pd700o04wWvZpBLB9SQpFjdFU +xjUgoitZAe/4BTKisqj5LjnHki3CA1PKeEf6jFZwo7yAS1fTODsVpcoGqFPJ9FRYAsk Q+1KNSMLDmxKq76koxDpLv9bHvNqS/hp8mCS9IzUQSc6faNDyUpYnRbL/1eK4qMR8cIy dwi0PQrmX+/vKZYtrguBm9jUo2lLqCINpoic75Xc4txORBS2OT1rjidiqgA+eYTa9DXw 8Lag== X-Gm-Message-State: AOAM530Cky/fmqwNJX41/vnX4lLT4IvdrFq2MOHRTWm6RJLn6ef4+InD fNWjCjSsrIXEp1SOpgdA5oKnFBu880A= X-Google-Smtp-Source: ABdhPJyBcqHG1K1iTGPIvhXisOGvjj8drcRd0miSndotYIovV/8wYuDkJs7FIIZ62+aN+LEjlSgBlg== X-Received: by 2002:a05:600c:3783:: with SMTP id o3mr3875798wmr.123.1625565727100; Tue, 06 Jul 2021 03:02:07 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.02.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:02:06 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 35/40] keyval: introduce keyval_parse_into Date: Tue, 6 Jul 2021 12:01:36 +0200 Message-Id: <20210706100141.303960-36-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x332.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.25, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Allow parsing multiple keyval sequences into the same dictionary. This will be used to simplify the parsing of the -M command line option, which is currently a .merge_lists = true QemuOpts group. Signed-off-by: Paolo Bonzini --- include/qemu/option.h | 2 ++ util/keyval.c | 43 +++++++++++++++++++++++++++++++++++-------- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/include/qemu/option.h b/include/qemu/option.h index d89c66145a..fffb03d848 100644 --- a/include/qemu/option.h +++ b/include/qemu/option.h @@ -147,6 +147,8 @@ void qemu_opts_print_help(QemuOptsList *list, bool print_caption); void qemu_opts_free(QemuOptsList *list); QemuOptsList *qemu_opts_append(QemuOptsList *dst, QemuOptsList *list); +QDict *keyval_parse_into(QDict *qdict, const char *params, const char *implied_key, + bool *p_help, Error **errp); QDict *keyval_parse(const char *params, const char *implied_key, bool *help, Error **errp); void keyval_merge(QDict *old, const QDict *new, Error **errp); diff --git a/util/keyval.c b/util/keyval.c index 9bc380686a..904337c8a1 100644 --- a/util/keyval.c +++ b/util/keyval.c @@ -511,13 +511,14 @@ static QObject *keyval_listify(QDict *cur, GSList *key_of_cur, Error **errp) * If @p_help is not NULL, store whether help is requested there. * If @p_help is NULL and help is requested, fail. * - * On success, return a dictionary of the parsed keys and values. - * On failure, store an error through @errp and return NULL. + * On success, return @dict, now filled with the parsed keys and values. + * + * On failure, store an error through @errp and return NULL. Any keys + * and values parsed so far will be in @dict nevertheless. */ -QDict *keyval_parse(const char *params, const char *implied_key, - bool *p_help, Error **errp) +QDict *keyval_parse_into(QDict *qdict, const char *params, const char *implied_key, + bool *p_help, Error **errp) { - QDict *qdict = qdict_new(); QObject *listified; const char *s; bool help = false; @@ -526,7 +527,6 @@ QDict *keyval_parse(const char *params, const char *implied_key, while (*s) { s = keyval_parse_one(qdict, s, implied_key, &help, errp); if (!s) { - qobject_unref(qdict); return NULL; } implied_key = NULL; @@ -536,15 +536,42 @@ QDict *keyval_parse(const char *params, const char *implied_key, *p_help = help; } else if (help) { error_setg(errp, "Help is not available for this option"); - qobject_unref(qdict); return NULL; } listified = keyval_listify(qdict, NULL, errp); if (!listified) { - qobject_unref(qdict); return NULL; } assert(listified == QOBJECT(qdict)); return qdict; } + +/* + * Parse @params in QEMU's traditional KEY=VALUE,... syntax. + * + * If @implied_key, the first KEY= can be omitted. @implied_key is + * implied then, and VALUE can't be empty or contain ',' or '='. + * + * A parameter "help" or "?" without a value isn't added to the + * resulting dictionary, but instead is interpreted as help request. + * All other options are parsed and returned normally so that context + * specific help can be printed. + * + * If @p_help is not NULL, store whether help is requested there. + * If @p_help is NULL and help is requested, fail. + * + * On success, return a dictionary of the parsed keys and values. + * On failure, store an error through @errp and return NULL. + */ +QDict *keyval_parse(const char *params, const char *implied_key, + bool *p_help, Error **errp) +{ + QDict *qdict = qdict_new(); + QDict *ret = keyval_parse_into(qdict, params, implied_key, p_help, errp); + + if (!ret) { + qobject_unref(qdict); + } + return ret; +} From patchwork Tue Jul 6 10:01:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360323 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F25FFC11F6E for ; Tue, 6 Jul 2021 10:44:07 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5913F61A24 for ; Tue, 6 Jul 2021 10:44:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5913F61A24 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:44450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iYf-0007Az-GP for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:44:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hu8-0001ch-RJ for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:12 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:38426) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0hu5-0002Vj-9F for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:12 -0400 Received: by mail-wm1-x32d.google.com with SMTP id b14-20020a1c1b0e0000b02901fc3a62af78so1264812wmb.3 for ; Tue, 06 Jul 2021 03:02:08 -0700 (PDT) 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=zh4GxReNrELnvZPOAIHk+AhUsAzEsGGe+r4dqXAJUf0=; b=BOUt7qNTXpt4px5B9ag5woZ4ZU4uiiH6YBFGopfnNzA31+wL1LtD+Z4l/Xqk7h0zkJ az5DZtVSZ4cqW5unkVsXHPbsR+6hpqRakzi4UQi3YJSb7xxgRiwyGj5QFWqaj/Bg9vA3 OM9ow3GF5l4oZjW4einHVcvKvkNrmxpUfHEmZDFps0L1wCWpcWj1kBUqciY6LjkO3b25 ONr3S25NPCEyx6m3K8ksFeVnqRe3Yk8A8I/CVYm9F8F1z7Dw0JAAtrv25SWYSB7ASlu5 HIQotORN3qcrJ5nz8rJR3OEZ0eNN+XZweC1A6T9JuYbeuiXYdtoP3xyT5Y2xiHp7JuHG Kamg== 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=zh4GxReNrELnvZPOAIHk+AhUsAzEsGGe+r4dqXAJUf0=; b=iXrcUcksaZMrsMAsUoKhhK2mJapQ3N9H9sOL6KuJE+xVn6lFVGTqRQpVPngl6ni4F6 6ofCoE/hmvjlrnmKDcHyYqR2OlE7W3zlujtlXxrKpn6ozgRzTCGf7wm61y6xvsVOTN5V 3HtSJwXgSMw2X69kKB+aoKpxgjmulMqFCnJ8XFMehpLkXMcOxoCqZdzYaXL/onReVAK/ /tgxb+cVAJzT7ZqFJ91IqmF6Mpk2zpm37XUfFIOI7JAUuO8KGnzqi7v86FxbExxouxFk xZW3bUobnDUpTL5fuk2Sr+lirgWuuCTLvjCaSac6IsaPK4lbE4YBWtoGcI8X6mIuiSZA pZmg== X-Gm-Message-State: AOAM531nD1yAC9SY21i/9iBncjqHeCtND4IZSqxKjudY9tExLfRr+RUV 2xs/eoRNnpkkG7v2BX1pH25OKltXg2w= X-Google-Smtp-Source: ABdhPJxYKrtOtfk/F+qc8AxW3+NUcOHg6v9ZQWYVItYqqnqouE3nrGz8gIKicaaOkaFTWzpVJp0Zgw== X-Received: by 2002:a7b:c844:: with SMTP id c4mr3832768wml.107.1625565727846; Tue, 06 Jul 2021 03:02:07 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.02.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:02:07 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 36/40] vl: switch -M parsing to keyval Date: Tue, 6 Jul 2021 12:01:37 +0200 Message-Id: <20210706100141.303960-37-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32d.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.25, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Switch from QemuOpts to keyval. This enables the introduction of non-scalar machine properties, and JSON syntax in the future. For JSON syntax to be supported right now, we would have to consider what would happen if string-based dictionaries (produced by -M key=val) were to be merged with strongly-typed dictionaries (produced by -M {'key': 123}). The simplest way out is to never enter the situation, and only allow one -M option when JSON syntax is in use. However, we want options such as -smp to become syntactic sugar for -M, and this is a problem; as soon as -smp becomes a shortcut for -M, QEMU would forbid using -M '{....}' together with -smp. Therefore, allowing JSON syntax right now for -M would be a forward-compatibility nightmare and it would be impossible anyway to introduce -M incrementally in tools. Instead, support for JSON syntax is delayed until after the main options are converted to QOM compound properties. These include -boot, -acpitable, -smbios, -m, -semihosting-config, -rtc and -fw_cfg. Once JSON syntax is introduced, these options will _also_ be forbidden together with -M '{...}'. Signed-off-by: Paolo Bonzini --- softmmu/vl.c | 315 ++++++++++++++++++++++++--------------------------- 1 file changed, 146 insertions(+), 169 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 7dd2d72d0b..f848abd31a 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -145,6 +145,8 @@ static const char *cpu_option; static const char *mem_path; static const char *incoming; static const char *loadvm; +static const char *accelerators; +static QDict *machine_opts_dict; static QTAILQ_HEAD(, ObjectOption) object_opts = QTAILQ_HEAD_INITIALIZER(object_opts); static ram_addr_t maxram_size; static uint64_t ram_slots; @@ -235,21 +237,6 @@ static QemuOptsList qemu_option_rom_opts = { }, }; -static QemuOptsList qemu_machine_opts = { - .name = "machine", - .implied_opt_name = "type", - .merge_lists = true, - .head = QTAILQ_HEAD_INITIALIZER(qemu_machine_opts.head), - .desc = { - /* - * no elements => accept any - * sanity checking will happen later - * when setting machine properties - */ - { } - }, -}; - static QemuOptsList qemu_accel_opts = { .name = "accel", .implied_opt_name = "accel", @@ -498,16 +485,6 @@ static QemuOptsList qemu_action_opts = { }, }; -/** - * Get machine options - * - * Returns: machine options (never null). - */ -static QemuOpts *qemu_get_machine_opts(void) -{ - return qemu_find_opts_singleton("machine"); -} - const char *qemu_get_vm_name(void) { return qemu_name; @@ -815,33 +792,6 @@ static MachineClass *find_default_machine(GSList *machines) return default_machineclass; } -static int machine_help_func(QemuOpts *opts, MachineState *machine) -{ - ObjectProperty *prop; - ObjectPropertyIterator iter; - - if (!qemu_opt_has_help_opt(opts)) { - return 0; - } - - object_property_iter_init(&iter, OBJECT(machine)); - while ((prop = object_property_iter_next(&iter))) { - if (!prop->set) { - continue; - } - - printf("%s.%s=%s", MACHINE_GET_CLASS(machine)->name, - prop->name, prop->type); - if (prop->description) { - printf(" (%s)\n", prop->description); - } else { - printf("\n"); - } - } - - return 1; -} - static void version(void) { printf("QEMU emulator version " QEMU_FULL_VERSION "\n" @@ -1554,33 +1504,31 @@ static gint machine_class_cmp(gconstpointer a, gconstpointer b) object_class_get_name(OBJECT_CLASS(mc1))); } -static MachineClass *machine_parse(const char *name, GSList *machines) +static void machine_help_func(const QDict *qdict) { - MachineClass *mc; - GSList *el; + GSList *machines, *el; + const char *type = qdict_get_try_str(qdict, "type"); - if (is_help_option(name)) { - printf("Supported machines are:\n"); - machines = g_slist_sort(machines, machine_class_cmp); - for (el = machines; el; el = el->next) { - MachineClass *mc = el->data; - if (mc->alias) { - printf("%-20s %s (alias of %s)\n", mc->alias, mc->desc, mc->name); - } - printf("%-20s %s%s%s\n", mc->name, mc->desc, - mc->is_default ? " (default)" : "", - mc->deprecation_reason ? " (deprecated)" : ""); + machines = object_class_get_list(TYPE_MACHINE, false); + if (type) { + ObjectClass *machine_class = OBJECT_CLASS(find_machine(type, machines)); + if (machine_class) { + type_print_class_properties(object_class_get_name(machine_class)); + return; } - exit(0); } - mc = find_machine(name, machines); - if (!mc) { - error_report("unsupported machine type"); - error_printf("Use -machine help to list supported machines\n"); - exit(1); + printf("Supported machines are:\n"); + machines = g_slist_sort(machines, machine_class_cmp); + for (el = machines; el; el = el->next) { + MachineClass *mc = el->data; + if (mc->alias) { + printf("%-20s %s (alias of %s)\n", mc->alias, mc->desc, mc->name); + } + printf("%-20s %s%s%s\n", mc->name, mc->desc, + mc->is_default ? " (default)" : "", + mc->deprecation_reason ? " (deprecated)" : ""); } - return mc; } static const char *pid_file; @@ -1633,32 +1581,31 @@ static const QEMUOption *lookup_opt(int argc, char **argv, return popt; } -static MachineClass *select_machine(void) +static MachineClass *select_machine(QDict *qdict, Error **errp) { + const char *optarg = qdict_get_try_str(qdict, "type"); GSList *machines = object_class_get_list(TYPE_MACHINE, false); - MachineClass *machine_class = find_default_machine(machines); - const char *optarg; - QemuOpts *opts; - Location loc; + MachineClass *machine_class; + Error *local_err = NULL; - loc_push_none(&loc); - - opts = qemu_get_machine_opts(); - qemu_opts_loc_restore(opts); - - optarg = qemu_opt_get(opts, "type"); if (optarg) { - machine_class = machine_parse(optarg, machines); + machine_class = find_machine(optarg, machines); + qdict_del(qdict, "type"); + if (!machine_class) { + error_setg(&local_err, "unsupported machine type"); + } + } else { + machine_class = find_default_machine(machines); + if (!machine_class) { + error_setg(&local_err, "No machine specified, and there is no default"); + } } - if (!machine_class) { - error_report("No machine specified, and there is no default"); - error_printf("Use -machine help to list supported machines\n"); - exit(1); - } - - loc_pop(&loc); g_slist_free(machines); + if (local_err) { + error_append_hint(&local_err, "Use -machine help to list supported machines\n"); + error_propagate(errp, local_err); + } return machine_class; } @@ -1677,42 +1624,70 @@ static int object_parse_property_opt(Object *obj, return 0; } -static int machine_set_property(void *opaque, - const char *name, const char *value, - Error **errp) +/* *Non*recursively replace underscores with dashes in QDict keys. */ +static void keyval_dashify(QDict *qdict, Error **errp) { - g_autofree char *qom_name = g_strdup(name); + const QDictEntry *ent, *next; char *p; - for (p = qom_name; *p; p++) { - if (*p == '_') { - *p = '-'; + for (ent = qdict_first(qdict); ent; ent = next) { + g_autofree char *new_key = NULL; + + next = qdict_next(qdict, ent); + if (!strchr(ent->key, '_')) { + continue; } + new_key = g_strdup(ent->key); + for (p = new_key; *p; p++) { + if (*p == '_') { + *p = '-'; + } + } + if (qdict_haskey(qdict, new_key)) { + error_setg(errp, "Conflict between '%s' and '%s'", ent->key, new_key); + return; + } + qobject_ref(ent->value); + qdict_put_obj(qdict, new_key, ent->value); + qdict_del(qdict, ent->key); } +} + +static void qemu_apply_legacy_machine_options(QDict *qdict) +{ + const char *value; + + keyval_dashify(qdict, &error_fatal); /* Legacy options do not correspond to MachineState properties. */ - if (g_str_equal(qom_name, "accel")) { - return 0; - } - if (g_str_equal(qom_name, "igd-passthru")) { - object_register_sugar_prop(ACCEL_CLASS_NAME("xen"), qom_name, value, - false); - return 0; - } - if (g_str_equal(qom_name, "kvm-shadow-mem")) { - object_register_sugar_prop(ACCEL_CLASS_NAME("kvm"), qom_name, value, - false); - return 0; - } - if (g_str_equal(qom_name, "kernel-irqchip")) { - object_register_sugar_prop(ACCEL_CLASS_NAME("kvm"), qom_name, value, - false); - object_register_sugar_prop(ACCEL_CLASS_NAME("whpx"), qom_name, value, - false); - return 0; + value = qdict_get_try_str(qdict, "accel"); + if (value) { + accelerators = g_strdup(value); + qdict_del(qdict, "accel"); } - return object_parse_property_opt(opaque, name, value, "type", errp); + value = qdict_get_try_str(qdict, "igd-passthru"); + if (value) { + object_register_sugar_prop(ACCEL_CLASS_NAME("xen"), "igd-passthru", value, + false); + qdict_del(qdict, "igd-passthru"); + } + + value = qdict_get_try_str(qdict, "kvm-shadow-mem"); + if (value) { + object_register_sugar_prop(ACCEL_CLASS_NAME("kvm"), "kvm-shadow-mem", value, + false); + qdict_del(qdict, "kvm-shadow-mem"); + } + + value = qdict_get_try_str(qdict, "kernel-irqchip"); + if (value) { + object_register_sugar_prop(ACCEL_CLASS_NAME("kvm"), "kernel-irqchip", value, + false); + object_register_sugar_prop(ACCEL_CLASS_NAME("whpx"), "kernel-irqchip", value, + false); + qdict_del(qdict, "kernel-irqchip"); + } } static void object_option_foreach_add(bool (*type_opt_predicate)(const char *)) @@ -1827,16 +1802,14 @@ static bool object_create_early(const char *type) return true; } -static void qemu_apply_machine_options(void) +static void qemu_apply_machine_options(QDict *qdict) { MachineClass *machine_class = MACHINE_GET_CLASS(current_machine); - QemuOpts *machine_opts = qemu_get_machine_opts(); const char *boot_order = NULL; const char *boot_once = NULL; QemuOpts *opts; - qemu_opt_foreach(machine_opts, machine_set_property, current_machine, - &error_fatal); + object_set_properties_from_keyval(OBJECT(current_machine), qdict, false, &error_fatal); current_machine->ram_size = ram_size; current_machine->maxram_size = maxram_size; current_machine->ram_slots = ram_slots; @@ -1865,10 +1838,8 @@ static void qemu_apply_machine_options(void) current_machine->boot_once = boot_once; if (semihosting_enabled() && !semihosting_get_argc()) { - const char *kernel_filename = qemu_opt_get(machine_opts, "kernel"); - const char *kernel_cmdline = qemu_opt_get(machine_opts, "append") ?: ""; /* fall back to the -kernel/-append */ - semihosting_arg_fallback(kernel_filename, kernel_cmdline); + semihosting_arg_fallback(current_machine->kernel_filename, current_machine->kernel_cmdline); } } @@ -1924,8 +1895,7 @@ static void qemu_create_early_backends(void) /* * Note: we need to create audio and block backends before - * machine_set_property(), so machine properties can refer to - * them. + * setting machine properties, so they can be referred to. */ configure_blockdev(&bdo_queue, machine_class, snapshot); audio_init_audiodevs(); @@ -2091,16 +2061,14 @@ static void set_memory_options(MachineClass *mc) loc_pop(&loc); } -static void qemu_create_machine(MachineClass *machine_class) +static void qemu_create_machine(QDict *qdict) { + MachineClass *machine_class = select_machine(qdict, &error_fatal); object_set_machine_compat_props(machine_class->compat_props); set_memory_options(machine_class); current_machine = MACHINE(object_new_with_class(OBJECT_CLASS(machine_class))); - if (machine_help_func(qemu_get_machine_opts(), current_machine)) { - exit(0); - } object_property_add_child(object_get_root(), "machine", OBJECT(current_machine)); object_property_add_child(container_get(OBJECT(current_machine), @@ -2131,8 +2099,12 @@ static void qemu_create_machine(MachineClass *machine_class) * specified either by the configuration file or by the command line. */ if (machine_class->default_machine_opts) { - qemu_opts_set_defaults(qemu_find_opts("machine"), - machine_class->default_machine_opts, 0); + QDict *default_opts = + keyval_parse(machine_class->default_machine_opts, NULL, NULL, + &error_abort); + object_set_properties_from_keyval(OBJECT(current_machine), default_opts, + false, &error_abort); + qobject_unref(default_opts); } } @@ -2154,7 +2126,8 @@ static int global_init_func(void *opaque, QemuOpts *opts, Error **errp) */ static bool is_qemuopts_group(const char *group) { - if (g_str_equal(group, "object")) { + if (g_str_equal(group, "object") || + g_str_equal(group, "machine")) { return false; } return true; @@ -2167,6 +2140,13 @@ static void qemu_record_config_group(const char *group, QDict *dict, Visitor *v = qobject_input_visitor_new_keyval(QOBJECT(dict)); object_option_add_visitor(v); visit_free(v); + } else if (g_str_equal(group, "machine")) { + /* + * Cannot merge string-valued and type-safe dictionaries, so JSON + * is not accepted yet for -M. + */ + assert(!from_json); + keyval_merge(machine_opts_dict, dict, errp); } else { abort(); } @@ -2297,13 +2277,11 @@ static int do_configure_accelerator(void *opaque, QemuOpts *opts, Error **errp) static void configure_accelerators(const char *progname) { - const char *accelerators; bool init_failed = false; qemu_opts_foreach(qemu_find_opts("icount"), do_configure_icount, NULL, &error_fatal); - accelerators = qemu_opt_get(qemu_get_machine_opts(), "accel"); if (QTAILQ_EMPTY(&qemu_accel_opts.head)) { char **accel_list, **tmp; @@ -2391,12 +2369,11 @@ static void create_default_memdev(MachineState *ms, const char *path) &error_fatal); } -static void qemu_validate_options(void) +static void qemu_validate_options(const QDict *machine_opts) { - QemuOpts *machine_opts = qemu_get_machine_opts(); - const char *kernel_filename = qemu_opt_get(machine_opts, "kernel"); - const char *initrd_filename = qemu_opt_get(machine_opts, "initrd"); - const char *kernel_cmdline = qemu_opt_get(machine_opts, "append"); + const char *kernel_filename = qdict_get_try_str(machine_opts, "kernel"); + const char *initrd_filename = qdict_get_try_str(machine_opts, "initrd"); + const char *kernel_cmdline = qdict_get_try_str(machine_opts, "append"); if (kernel_filename == NULL) { if (kernel_cmdline != NULL) { @@ -2736,7 +2713,6 @@ void qemu_init(int argc, char **argv, char **envp) qemu_add_opts(&qemu_trace_opts); qemu_plugin_add_opts(); qemu_add_opts(&qemu_option_rom_opts); - qemu_add_opts(&qemu_machine_opts); qemu_add_opts(&qemu_accel_opts); qemu_add_opts(&qemu_mem_opts); qemu_add_opts(&qemu_smp_opts); @@ -2777,6 +2753,7 @@ void qemu_init(int argc, char **argv, char **envp) } } + machine_opts_dict = qdict_new(); if (userconfig) { qemu_read_default_config_file(&error_fatal); } @@ -2866,8 +2843,7 @@ void qemu_init(int argc, char **argv, char **envp) parse_display(optarg); break; case QEMU_OPTION_nographic: - olist = qemu_find_opts("machine"); - qemu_opts_parse_noisily(olist, "graphics=off", false); + qdict_put_str(machine_opts_dict, "graphics", "off"); nographic = true; dpy.type = DISPLAY_TYPE_NONE; break; @@ -2891,16 +2867,16 @@ void qemu_init(int argc, char **argv, char **envp) } break; case QEMU_OPTION_kernel: - qemu_opts_set(qemu_find_opts("machine"), "kernel", optarg, &error_abort); + qdict_put_str(machine_opts_dict, "kernel", optarg); break; case QEMU_OPTION_initrd: - qemu_opts_set(qemu_find_opts("machine"), "initrd", optarg, &error_abort); + qdict_put_str(machine_opts_dict, "initrd", optarg); break; case QEMU_OPTION_append: - qemu_opts_set(qemu_find_opts("machine"), "append", optarg, &error_abort); + qdict_put_str(machine_opts_dict, "append", optarg); break; case QEMU_OPTION_dtb: - qemu_opts_set(qemu_find_opts("machine"), "dtb", optarg, &error_abort); + qdict_put_str(machine_opts_dict, "dtb", optarg); break; case QEMU_OPTION_cdrom: drive_add(IF_DEFAULT, 2, optarg, CDROM_OPTS); @@ -3010,7 +2986,7 @@ void qemu_init(int argc, char **argv, char **envp) } break; case QEMU_OPTION_bios: - qemu_opts_set(qemu_find_opts("machine"), "firmware", optarg, &error_abort); + qdict_put_str(machine_opts_dict, "firmware", optarg); break; case QEMU_OPTION_singlestep: singlestep = 1; @@ -3281,17 +3257,20 @@ void qemu_init(int argc, char **argv, char **envp) preconfig_requested = true; break; case QEMU_OPTION_enable_kvm: - olist = qemu_find_opts("machine"); - qemu_opts_parse_noisily(olist, "accel=kvm", false); + qdict_put_str(machine_opts_dict, "accel", "kvm"); break; case QEMU_OPTION_M: case QEMU_OPTION_machine: - olist = qemu_find_opts("machine"); - opts = qemu_opts_parse_noisily(olist, optarg, true); - if (!opts) { - exit(1); + { + bool help; + + keyval_parse_into(machine_opts_dict, optarg, "type", &help, &error_fatal); + if (help) { + machine_help_func(machine_opts_dict); + exit(EXIT_SUCCESS); + } + break; } - break; case QEMU_OPTION_accel: accel_opts = qemu_opts_parse_noisily(qemu_find_opts("accel"), optarg, true); @@ -3318,12 +3297,10 @@ void qemu_init(int argc, char **argv, char **envp) } break; case QEMU_OPTION_usb: - olist = qemu_find_opts("machine"); - qemu_opts_parse_noisily(olist, "usb=on", false); + qdict_put_str(machine_opts_dict, "usb", "on"); break; case QEMU_OPTION_usbdevice: - olist = qemu_find_opts("machine"); - qemu_opts_parse_noisily(olist, "usb=on", false); + qdict_put_str(machine_opts_dict, "usb", "on"); add_device_config(DEV_USB, optarg); break; case QEMU_OPTION_device: @@ -3342,12 +3319,10 @@ void qemu_init(int argc, char **argv, char **envp) vnc_parse(optarg); break; case QEMU_OPTION_no_acpi: - olist = qemu_find_opts("machine"); - qemu_opts_parse_noisily(olist, "acpi=off", false); + qdict_put_str(machine_opts_dict, "acpi", "off"); break; case QEMU_OPTION_no_hpet: - olist = qemu_find_opts("machine"); - qemu_opts_parse_noisily(olist, "hpet=off", false); + qdict_put_str(machine_opts_dict, "hpet", "off"); break; case QEMU_OPTION_no_reboot: olist = qemu_find_opts("action"); @@ -3600,7 +3575,7 @@ void qemu_init(int argc, char **argv, char **envp) */ loc_set_none(); - qemu_validate_options(); + qemu_validate_options(machine_opts_dict); qemu_process_sugar_options(); /* @@ -3633,7 +3608,7 @@ void qemu_init(int argc, char **argv, char **envp) configure_rtc(qemu_find_opts_singleton("rtc")); - qemu_create_machine(select_machine()); + qemu_create_machine(machine_opts_dict); suspend_mux_open(); @@ -3641,12 +3616,14 @@ void qemu_init(int argc, char **argv, char **envp) qemu_create_default_devices(); qemu_create_early_backends(); - qemu_apply_machine_options(); + qemu_apply_legacy_machine_options(machine_opts_dict); + qemu_apply_machine_options(machine_opts_dict); + qobject_unref(machine_opts_dict); phase_advance(PHASE_MACHINE_CREATED); /* * Note: uses machine properties such as kernel-irqchip, must run - * after machine_set_property(). + * after qemu_apply_machine_options. */ configure_accelerators(argv[0]); phase_advance(PHASE_ACCEL_CREATED); From patchwork Tue Jul 6 10:01:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360307 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AF95C07E96 for ; Tue, 6 Jul 2021 10:37:53 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 474EA619AB for ; Tue, 6 Jul 2021 10:37:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 474EA619AB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:54514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iSe-0003UC-En for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:37:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hu8-0001ap-9q for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:12 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:36729) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0hu5-0002W9-SI for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:11 -0400 Received: by mail-wm1-x32a.google.com with SMTP id t14-20020a05600c198eb029020c8aac53d4so3284861wmq.1 for ; Tue, 06 Jul 2021 03:02:09 -0700 (PDT) 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=w9hauRMulhEqoYfvW+lN0XMvwP2olsiQiM62j8QW464=; b=CRGZx5RbanpntDViFwcy+cFQXjzDJV9RlMC67bcoLAz7JJYqkdCML6TpYdRZVUm/gh s0c0QAgvV0SDNRYHCztBCMvI1X3RikNcgqDvpDVKCJgP+j2/8/7fI0jWySEPuJj2NsYN Q/xorBnM4T6XRWsbcHbwG4llbyHGtlKvye5oeG2sW9fFtSmV2aNnKdPU5elPNoa36l0/ vu45KeWcKaMWAiF7PlKYVn5/ewePaoxP6REDz2PuzzVRPS904dve6/hYqPidHE5FRi0t 20XhFsegGitnFhZ0++w+KUD/m4/70Leii5AYqNWNRR7/L28zMBn7DweNoxRxSgNTOyuN ADAw== 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=w9hauRMulhEqoYfvW+lN0XMvwP2olsiQiM62j8QW464=; b=YOR3TFY+YLQjJv/SgsGGb03xRWdVEiaMPtMLrkRfixVtxgA8nuBmBQ0Po4pqxYRdYZ rRkb3IaQJnSlRyN9pOj2af0mWsL0FVkupYHJyO+i55hJFlrWQevBHo62np8+3sR9DP/D hVmyDk3yqu1Mv6mtmOj1dlQGzkvUfNzedwagfdSRe+JkILEWwhC/sDb/OR2W4l9tRwOL n0DoEUaQwvAUQw9C5OL6miDjFwx5vq+X6MH+geheB5M2NZxgG/RGn65bMKQy4gD05PlT PJCQJVXDD8H7Wuzndl77aMwznugxy2qtwzQy4RHKHWTPe2GyDCc1brD3kp2zIVhtYiYQ G8bA== X-Gm-Message-State: AOAM531vdPMAMEna+1bgOq4EZE7zdI/UNJsOl6GQGDMd3rIR+c4Xg5+e p29ULADlsMzuEZPjlGbflfOSla4OeE0= X-Google-Smtp-Source: ABdhPJyKxCrDnbGUwR8+yzJlIFoABZwoQIAjiNuH8FC0tv37L2ket5AuLkGxe68j25vc3px1FoNTNg== X-Received: by 2002:a05:600c:4b92:: with SMTP id e18mr19666669wmp.161.1625565728435; Tue, 06 Jul 2021 03:02:08 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.02.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:02:08 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 37/40] machine: add smp compound property Date: Tue, 6 Jul 2021 12:01:38 +0200 Message-Id: <20210706100141.303960-38-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32a.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.25, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Make -smp syntactic sugar for a compound property "-machine smp.{cores,threads,cpu,...}". machine_smp_parse is replaced by the setter for the property. numa-test will now cover the new syntax, while other tests still use -smp. Signed-off-by: Paolo Bonzini --- hw/core/machine.c | 108 +++++++++++++++++++++------------------- include/hw/boards.h | 1 - softmmu/vl.c | 33 +++++++++--- tests/qtest/numa-test.c | 22 ++++---- 4 files changed, 95 insertions(+), 69 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index ca69f0343a..57c18f909a 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -19,6 +19,7 @@ #include "hw/loader.h" #include "qapi/error.h" #include "qapi/qapi-visit-common.h" +#include "qapi/qapi-visit-machine.h" #include "qapi/visitor.h" #include "hw/sysbus.h" #include "sysemu/cpus.h" @@ -799,6 +800,57 @@ static void smp_parse(MachineState *ms, SMPConfiguration *config, Error **errp) ms->smp.sockets = sockets; } +static void machine_get_smp(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + MachineState *ms = MACHINE(obj); + SMPConfiguration *config = &(SMPConfiguration){ + .has_cores = true, .cores = ms->smp.cores, + .has_sockets = true, .sockets = ms->smp.sockets, + .has_dies = true, .dies = ms->smp.dies, + .has_threads = true, .threads = ms->smp.threads, + .has_cpus = true, .cpus = ms->smp.cpus, + .has_maxcpus = true, .maxcpus = ms->smp.max_cpus, + }; + if (!visit_type_SMPConfiguration(v, name, &config, &error_abort)) { + return; + } +} + +static void machine_set_smp(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + MachineClass *mc = MACHINE_GET_CLASS(obj); + MachineState *ms = MACHINE(obj); + SMPConfiguration *config; + ERRP_GUARD(); + + if (!visit_type_SMPConfiguration(v, name, &config, errp)) { + return; + } + + mc->smp_parse(ms, config, errp); + if (errp) { + goto out_free; + } + + /* sanity-check smp_cpus and max_cpus against mc */ + if (ms->smp.cpus < mc->min_cpus) { + error_setg(errp, "Invalid SMP CPUs %d. The min CPUs " + "supported by machine '%s' is %d", + ms->smp.cpus, + mc->name, mc->min_cpus); + } else if (ms->smp.max_cpus > mc->max_cpus) { + error_setg(errp, "Invalid SMP CPUs %d. The max CPUs " + "supported by machine '%s' is %d", + current_machine->smp.max_cpus, + mc->name, mc->max_cpus); + } + +out_free: + qapi_free_SMPConfiguration(config); +} + static void machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); @@ -838,6 +890,12 @@ static void machine_class_init(ObjectClass *oc, void *data) object_class_property_set_description(oc, "dumpdtb", "Dump current dtb to a file and quit"); + object_class_property_add(oc, "smp", "SMPConfiguration", + machine_get_smp, machine_set_smp, + NULL, NULL); + object_class_property_set_description(oc, "smp", + "CPU topology"); + object_class_property_add(oc, "phandle-start", "int", machine_get_phandle_start, machine_set_phandle_start, NULL, NULL); @@ -1126,56 +1184,6 @@ MemoryRegion *machine_consume_memdev(MachineState *machine, return ret; } -bool machine_smp_parse(MachineState *ms, QemuOpts *opts, Error **errp) -{ - MachineClass *mc = MACHINE_GET_CLASS(ms); - ERRP_GUARD(); - - if (opts) { - SMPConfiguration config = { - .has_cpus = !!qemu_opt_get(opts, "cpus"), - .cpus = qemu_opt_get_number(opts, "cpus", 0), - .has_sockets = !!qemu_opt_get(opts, "sockets"), - .sockets = qemu_opt_get_number(opts, "sockets", 0), - .has_dies = !!qemu_opt_get(opts, "dies"), - .dies = qemu_opt_get_number(opts, "dies", 0), - .has_cores = !!qemu_opt_get(opts, "cores"), - .cores = qemu_opt_get_number(opts, "cores", 0), - .has_threads = !!qemu_opt_get(opts, "threads"), - .threads = qemu_opt_get_number(opts, "threads", 0), - .has_maxcpus = !!qemu_opt_get(opts, "maxcpus"), - .maxcpus = qemu_opt_get_number(opts, "maxcpus", 0), - }; - - mc->smp_parse(ms, &config, errp); - if (*errp) { - return false; - } - } - - /* sanity-check smp_cpus and max_cpus against mc */ - if (ms->smp.cpus < mc->min_cpus) { - error_setg(errp, "Invalid SMP CPUs %d. The min CPUs " - "supported by machine '%s' is %d", - ms->smp.cpus, - mc->name, mc->min_cpus); - return false; - } else if (ms->smp.max_cpus > mc->max_cpus) { - error_setg(errp, "Invalid SMP CPUs %d. The max CPUs " - "supported by machine '%s' is %d", - current_machine->smp.max_cpus, - mc->name, mc->max_cpus); - return false; - } - - if (ms->smp.cpus > 1) { - Error *blocker = NULL; - error_setg(&blocker, QERR_REPLAY_NOT_SUPPORTED, "smp"); - replay_add_blocker(blocker); - } - return true; -} - void machine_run_board_init(MachineState *machine) { MachineClass *machine_class = MACHINE_GET_CLASS(machine); diff --git a/include/hw/boards.h b/include/hw/boards.h index 1eae4427e8..accd6eff35 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -26,7 +26,6 @@ OBJECT_DECLARE_TYPE(MachineState, MachineClass, MACHINE) extern MachineState *current_machine; void machine_run_board_init(MachineState *machine); -bool machine_smp_parse(MachineState *ms, QemuOpts *opts, Error **errp); bool machine_usb(MachineState *machine); int machine_phandle_start(MachineState *machine); bool machine_dump_guest_core(MachineState *machine); diff --git a/softmmu/vl.c b/softmmu/vl.c index f848abd31a..a50c8575a1 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1531,6 +1531,25 @@ static void machine_help_func(const QDict *qdict) } } +static void +machine_parse_property_opt(QemuOptsList *opts_list, const char *propname, + const char *arg, Error **errp) +{ + QDict *opts, *prop; + bool help = false; + ERRP_GUARD(); + + prop = keyval_parse(arg, opts_list->implied_opt_name, &help, errp); + if (help) { + qemu_opts_print_help(opts_list, true); + return; + } + opts = qdict_new(); + qdict_put(opts, propname, prop); + keyval_merge(machine_opts_dict, opts, errp); + qobject_unref(opts); +} + static const char *pid_file; static Notifier qemu_unlink_pidfile_notifier; @@ -1841,6 +1860,12 @@ static void qemu_apply_machine_options(QDict *qdict) /* fall back to the -kernel/-append */ semihosting_arg_fallback(current_machine->kernel_filename, current_machine->kernel_cmdline); } + + if (current_machine->smp.cpus > 1) { + Error *blocker = NULL; + error_setg(&blocker, QERR_REPLAY_NOT_SUPPORTED, "smp"); + replay_add_blocker(blocker); + } } static void qemu_create_early_backends(void) @@ -2091,9 +2116,6 @@ static void qemu_create_machine(QDict *qdict) qemu_set_hw_version(machine_class->hw_version); } - machine_smp_parse(current_machine, - qemu_opts_find(qemu_find_opts("smp-opts"), NULL), &error_fatal); - /* * Get the default machine options from the machine if it is not already * specified either by the configuration file or by the command line. @@ -3310,10 +3332,7 @@ void qemu_init(int argc, char **argv, char **envp) } break; case QEMU_OPTION_smp: - if (!qemu_opts_parse_noisily(qemu_find_opts("smp-opts"), - optarg, true)) { - exit(1); - } + machine_parse_property_opt(qemu_find_opts("smp-opts"), "smp", optarg, &error_fatal); break; case QEMU_OPTION_vnc: vnc_parse(optarg); diff --git a/tests/qtest/numa-test.c b/tests/qtest/numa-test.c index dc0ec571ca..c677cd63c4 100644 --- a/tests/qtest/numa-test.c +++ b/tests/qtest/numa-test.c @@ -25,7 +25,7 @@ static void test_mon_explicit(const void *data) g_autofree char *s = NULL; g_autofree char *cli = NULL; - cli = make_cli(data, "-smp 8 -numa node,nodeid=0,memdev=ram,cpus=0-3 " + cli = make_cli(data, "-machine smp.cpus=8 -numa node,nodeid=0,memdev=ram,cpus=0-3 " "-numa node,nodeid=1,cpus=4-7"); qts = qtest_init(cli); @@ -42,7 +42,7 @@ static void test_def_cpu_split(const void *data) g_autofree char *s = NULL; g_autofree char *cli = NULL; - cli = make_cli(data, "-smp 8 -numa node,memdev=ram -numa node"); + cli = make_cli(data, "-machine smp.cpus=8 -numa node,memdev=ram -numa node"); qts = qtest_init(cli); s = qtest_hmp(qts, "info numa"); @@ -58,7 +58,7 @@ static void test_mon_partial(const void *data) g_autofree char *s = NULL; g_autofree char *cli = NULL; - cli = make_cli(data, "-smp 8 " + cli = make_cli(data, "-machine smp.cpus=8 " "-numa node,nodeid=0,memdev=ram,cpus=0-1 " "-numa node,nodeid=1,cpus=4-5 "); qts = qtest_init(cli); @@ -86,7 +86,7 @@ static void test_query_cpus(const void *data) QTestState *qts; g_autofree char *cli = NULL; - cli = make_cli(data, "-smp 8 -numa node,memdev=ram,cpus=0-3 " + cli = make_cli(data, "-machine smp.cpus=8 -numa node,memdev=ram,cpus=0-3 " "-numa node,cpus=4-7"); qts = qtest_init(cli); cpus = get_cpus(qts, &resp); @@ -124,7 +124,7 @@ static void pc_numa_cpu(const void *data) QTestState *qts; g_autofree char *cli = NULL; - cli = make_cli(data, "-cpu pentium -smp 8,sockets=2,cores=2,threads=2 " + cli = make_cli(data, "-cpu pentium -machine smp.cpus=8,smp.sockets=2,smp.cores=2,smp.threads=2 " "-numa node,nodeid=0,memdev=ram -numa node,nodeid=1 " "-numa cpu,node-id=1,socket-id=0 " "-numa cpu,node-id=0,socket-id=1,core-id=0 " @@ -177,7 +177,7 @@ static void spapr_numa_cpu(const void *data) QTestState *qts; g_autofree char *cli = NULL; - cli = make_cli(data, "-smp 4,cores=4 " + cli = make_cli(data, "-machine smp.cpus=4,smp.cores=4 " "-numa node,nodeid=0,memdev=ram -numa node,nodeid=1 " "-numa cpu,node-id=0,core-id=0 " "-numa cpu,node-id=0,core-id=1 " @@ -222,7 +222,7 @@ static void aarch64_numa_cpu(const void *data) QTestState *qts; g_autofree char *cli = NULL; - cli = make_cli(data, "-smp 2 " + cli = make_cli(data, "-machine smp.cpus=2 " "-numa node,nodeid=0,memdev=ram -numa node,nodeid=1 " "-numa cpu,node-id=1,thread-id=0 " "-numa cpu,node-id=0,thread-id=1"); @@ -265,7 +265,7 @@ static void pc_dynamic_cpu_cfg(const void *data) QTestState *qs; g_autofree char *cli = NULL; - cli = make_cli(data, "-nodefaults --preconfig -smp 2"); + cli = make_cli(data, "-nodefaults --preconfig -machine smp.cpus=2"); qs = qtest_init(cli); /* create 2 numa nodes */ @@ -324,7 +324,7 @@ static void pc_hmat_build_cfg(const void *data) g_autofree char *cli = NULL; cli = make_cli(data, "-nodefaults --preconfig -machine hmat=on " - "-smp 2,sockets=2 " + "-machine smp.cpus=2,smp.sockets=2 " "-m 128M,slots=2,maxmem=1G " "-object memory-backend-ram,size=64M,id=m0 " "-object memory-backend-ram,size=64M,id=m1 " @@ -453,7 +453,7 @@ static void pc_hmat_off_cfg(const void *data) g_autofree char *cli = NULL; cli = make_cli(data, "-nodefaults --preconfig " - "-smp 2,sockets=2 " + "-machine smp.cpus=2,smp.sockets=2 " "-m 128M,slots=2,maxmem=1G " "-object memory-backend-ram,size=64M,id=m0,prealloc=y " "-object memory-backend-ram,size=64M,id=m1 " @@ -492,7 +492,7 @@ static void pc_hmat_erange_cfg(const void *data) g_autofree char *cli = NULL; cli = make_cli(data, "-nodefaults --preconfig -machine hmat=on " - "-smp 2,sockets=2 " + "-machine smp.cpus=2,smp.sockets=2 " "-m 128M,slots=2,maxmem=1G " "-object memory-backend-ram,size=64M,id=m0 " "-object memory-backend-ram,size=64M,id=m1 " From patchwork Tue Jul 6 10:01:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360299 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F01FC07E96 for ; Tue, 6 Jul 2021 10:35:53 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 90B69619AB for ; Tue, 6 Jul 2021 10:35:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 90B69619AB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:48924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iQh-00088Y-NC for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:35:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0huA-0001ht-BF for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:14 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:54949) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0hu7-0002X6-R3 for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:13 -0400 Received: by mail-wm1-x331.google.com with SMTP id l1so13138306wme.4 for ; Tue, 06 Jul 2021 03:02:11 -0700 (PDT) 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=IDPNHb+HPzR8VO7xPUhdfTuo9DK5TmK3Ukrht2Or98o=; b=mZw45Skp6QQwkYAH5uCQhE+UT+wVna9uVKxZj1yDGOgxOQgnnoVcS6QhfMdxVFq/3r XRDmImEySQTn6MqeU3+mzhhhY0i3EWdXNq74v3TiV4FhFCTTG2PicjZHa4CgSUBEdoZ1 nBY6l6f6px3K5NW9QBtZdyosev4wGRlwm6JfVbTgtYEPVCU6+Q0NPntS2kzManDcAz9w aYldlDT39F8maKKCXOhtS9lENEt1O4RgNreqymbm1jc7fhlEpBjK4dsv/df78V7L9UUS tMF97B0BucTZ6Bz8GGlhTrRUNQ2Z8pMjvDlQSKa+dbiXvKIBTigMoNvFyLzw/1Ojs0NR h7bA== 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=IDPNHb+HPzR8VO7xPUhdfTuo9DK5TmK3Ukrht2Or98o=; b=jzt56VnHcHJkvaObh9CHvOxoFoEqEDxBoKU/aTudXpTJD6ocsEja08I13k/3vSBm+A nwFrnUU1+GRRAwe8GAGgh2ZlLs37zpETxL5boOzgkRaOTpgo3S/FJo1ZSIPwISRrXoqR z8jwWGKXbyNPREp7NDrQHIwARKfg+ylQZbwYzLyM8Xv2ne3fp1OjO/zLt1UBaRHGtVHk kb4KVIjcyuRIYgZyI1vEkSQAGJ7zzUL29toKGqhZL27FaISDZf6M4/4ELKdoGNdHpgfS udVAvCP+YQEoAzSB70ecFjcQIG8sFJDdNxYdC3fH5k63AzC6sESVubt4x7TsjEEYeF4t 9+IA== X-Gm-Message-State: AOAM530LXnnNklOXYZy46SsVvxJmefUizc82pQAc9YfbL4p7MeCGPR93 voJP7dxUgxHBqbPB/opEfDQEIaJXD1k= X-Google-Smtp-Source: ABdhPJxNTPg3vdgyx+3+fvE0NY+731a/1R2wZemBHHLpRkq44w98iJFvuaT1k3F+EWg3+h0koG6fQg== X-Received: by 2002:a7b:c1c1:: with SMTP id a1mr19870966wmj.187.1625565729061; Tue, 06 Jul 2021 03:02:09 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.02.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:02:08 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 38/40] qemu-option: remove now-dead code Date: Tue, 6 Jul 2021 12:01:39 +0200 Message-Id: <20210706100141.303960-39-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x331.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.25, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" -M was the sole user of qemu_opts_set and qemu_opts_set_defaults, remove them and the arguments that they used. Signed-off-by: Paolo Bonzini --- include/qemu/option.h | 3 --- tests/unit/test-qemu-opts.c | 35 ------------------------- util/qemu-option.c | 51 ++++++++----------------------------- 3 files changed, 10 insertions(+), 79 deletions(-) diff --git a/include/qemu/option.h b/include/qemu/option.h index fffb03d848..306bf07575 100644 --- a/include/qemu/option.h +++ b/include/qemu/option.h @@ -119,7 +119,6 @@ QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id, int fail_if_exists, Error **errp); void qemu_opts_reset(QemuOptsList *list); void qemu_opts_loc_restore(QemuOpts *opts); -bool qemu_opts_set(QemuOptsList *list, const char *name, const char *value, Error **errp); const char *qemu_opts_id(QemuOpts *opts); void qemu_opts_set_id(QemuOpts *opts, char *id); void qemu_opts_del(QemuOpts *opts); @@ -130,8 +129,6 @@ QemuOpts *qemu_opts_parse_noisily(QemuOptsList *list, const char *params, bool permit_abbrev); QemuOpts *qemu_opts_parse(QemuOptsList *list, const char *params, bool permit_abbrev, Error **errp); -void qemu_opts_set_defaults(QemuOptsList *list, const char *params, - int permit_abbrev); QemuOpts *qemu_opts_from_qdict(QemuOptsList *list, const QDict *qdict, Error **errp); QDict *qemu_opts_to_qdict_filtered(QemuOpts *opts, QDict *qdict, diff --git a/tests/unit/test-qemu-opts.c b/tests/unit/test-qemu-opts.c index 6568e31a72..828d40e928 100644 --- a/tests/unit/test-qemu-opts.c +++ b/tests/unit/test-qemu-opts.c @@ -410,40 +410,6 @@ static void test_qemu_opts_reset(void) g_assert(opts == NULL); } -static void test_qemu_opts_set(void) -{ - QemuOptsList *list; - QemuOpts *opts; - const char *opt; - - list = qemu_find_opts("opts_list_04"); - g_assert(list != NULL); - g_assert(QTAILQ_EMPTY(&list->head)); - g_assert_cmpstr(list->name, ==, "opts_list_04"); - - /* should not find anything at this point */ - opts = qemu_opts_find(list, NULL); - g_assert(opts == NULL); - - /* implicitly create opts and set str3 value */ - qemu_opts_set(list, "str3", "value", &error_abort); - g_assert(!QTAILQ_EMPTY(&list->head)); - - /* get the just created opts */ - opts = qemu_opts_find(list, NULL); - g_assert(opts != NULL); - - /* check the str3 value */ - opt = qemu_opt_get(opts, "str3"); - g_assert_cmpstr(opt, ==, "value"); - - qemu_opts_del(opts); - - /* should not find anything at this point */ - opts = qemu_opts_find(list, NULL); - g_assert(opts == NULL); -} - static int opts_count_iter(void *opaque, const char *name, const char *value, Error **errp) { @@ -1041,7 +1007,6 @@ int main(int argc, char *argv[]) g_test_add_func("/qemu-opts/opt_get_size", test_qemu_opt_get_size); g_test_add_func("/qemu-opts/opt_unset", test_qemu_opt_unset); g_test_add_func("/qemu-opts/opts_reset", test_qemu_opts_reset); - g_test_add_func("/qemu-opts/opts_set", test_qemu_opts_set); g_test_add_func("/qemu-opts/opts_parse/general", test_opts_parse); g_test_add_func("/qemu-opts/opts_parse/bool", test_opts_parse_bool); g_test_add_func("/qemu-opts/opts_parse/number", test_opts_parse_number); diff --git a/util/qemu-option.c b/util/qemu-option.c index 4944015a25..ee78e42216 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -479,19 +479,14 @@ int qemu_opt_unset(QemuOpts *opts, const char *name) } } -static QemuOpt *opt_create(QemuOpts *opts, const char *name, char *value, - bool prepend) +static QemuOpt *opt_create(QemuOpts *opts, const char *name, char *value) { QemuOpt *opt = g_malloc0(sizeof(*opt)); opt->name = g_strdup(name); opt->str = value; opt->opts = opts; - if (prepend) { - QTAILQ_INSERT_HEAD(&opts->head, opt, next); - } else { - QTAILQ_INSERT_TAIL(&opts->head, opt, next); - } + QTAILQ_INSERT_TAIL(&opts->head, opt, next); return opt; } @@ -518,7 +513,7 @@ static bool opt_validate(QemuOpt *opt, Error **errp) bool qemu_opt_set(QemuOpts *opts, const char *name, const char *value, Error **errp) { - QemuOpt *opt = opt_create(opts, name, g_strdup(value), false); + QemuOpt *opt = opt_create(opts, name, g_strdup(value)); if (!opt_validate(opt, errp)) { qemu_opt_del(opt); @@ -662,15 +657,6 @@ void qemu_opts_loc_restore(QemuOpts *opts) loc_restore(&opts->loc); } -bool qemu_opts_set(QemuOptsList *list, const char *name, const char *value, Error **errp) -{ - QemuOpts *opts; - - assert(list->merge_lists); - opts = qemu_opts_create(list, NULL, 0, &error_abort); - return qemu_opt_set(opts, name, value, errp); -} - const char *qemu_opts_id(QemuOpts *opts) { return opts->id; @@ -811,7 +797,7 @@ static const char *get_opt_name_value(const char *params, } static bool opts_do_parse(QemuOpts *opts, const char *params, - const char *firstname, bool prepend, + const char *firstname, bool warn_on_flag, bool *help_wanted, Error **errp) { char *option, *value; @@ -833,7 +819,7 @@ static bool opts_do_parse(QemuOpts *opts, const char *params, continue; } - opt = opt_create(opts, option, value, prepend); + opt = opt_create(opts, option, value); g_free(option); if (!opt_validate(opt, errp)) { qemu_opt_del(opt); @@ -889,11 +875,11 @@ bool has_help_option(const char *params) bool qemu_opts_do_parse(QemuOpts *opts, const char *params, const char *firstname, Error **errp) { - return opts_do_parse(opts, params, firstname, false, false, NULL, errp); + return opts_do_parse(opts, params, firstname, false, NULL, errp); } static QemuOpts *opts_parse(QemuOptsList *list, const char *params, - bool permit_abbrev, bool defaults, + bool permit_abbrev, bool warn_on_flag, bool *help_wanted, Error **errp) { const char *firstname; @@ -903,21 +889,13 @@ static QemuOpts *opts_parse(QemuOptsList *list, const char *params, assert(!permit_abbrev || list->implied_opt_name); firstname = permit_abbrev ? list->implied_opt_name : NULL; - /* - * This code doesn't work for defaults && !list->merge_lists: when - * params has no id=, and list has an element with !opts->id, it - * appends a new element instead of returning the existing opts. - * However, we got no use for this case. Guard against possible - * (if unlikely) future misuse: - */ - assert(!defaults || list->merge_lists); opts = qemu_opts_create(list, id, !list->merge_lists, errp); g_free(id); if (opts == NULL) { return NULL; } - if (!opts_do_parse(opts, params, firstname, defaults, + if (!opts_do_parse(opts, params, firstname, warn_on_flag, help_wanted, errp)) { qemu_opts_del(opts); return NULL; @@ -936,7 +914,7 @@ static QemuOpts *opts_parse(QemuOptsList *list, const char *params, QemuOpts *qemu_opts_parse(QemuOptsList *list, const char *params, bool permit_abbrev, Error **errp) { - return opts_parse(list, params, permit_abbrev, false, false, NULL, errp); + return opts_parse(list, params, permit_abbrev, false, NULL, errp); } /** @@ -954,7 +932,7 @@ QemuOpts *qemu_opts_parse_noisily(QemuOptsList *list, const char *params, QemuOpts *opts; bool help_wanted = false; - opts = opts_parse(list, params, permit_abbrev, false, true, + opts = opts_parse(list, params, permit_abbrev, true, opts_accepts_any(list) ? NULL : &help_wanted, &err); if (!opts) { @@ -968,15 +946,6 @@ QemuOpts *qemu_opts_parse_noisily(QemuOptsList *list, const char *params, return opts; } -void qemu_opts_set_defaults(QemuOptsList *list, const char *params, - int permit_abbrev) -{ - QemuOpts *opts; - - opts = opts_parse(list, params, permit_abbrev, true, false, NULL, NULL); - assert(opts); -} - static bool qemu_opts_from_qdict_entry(QemuOpts *opts, const QDictEntry *entry, Error **errp) From patchwork Tue Jul 6 10:01:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360293 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC4BCC07E9C for ; Tue, 6 Jul 2021 10:33:46 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A5057619AC for ; Tue, 6 Jul 2021 10:33:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A5057619AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iOf-00038P-PE for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:33:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hu9-0001fV-LU for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:13 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:54950) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0hu7-0002Wk-0Q for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:13 -0400 Received: by mail-wm1-x332.google.com with SMTP id l1so13138318wme.4 for ; Tue, 06 Jul 2021 03:02:10 -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=S4a4DETRAyhHFXba3Piw4UbV8J7nicTVM9Gs0MaTHSM=; b=SCVWJ0je2KnVWwOq2zGyAD8uX7DIGqd7Bquwz3eoE5TCgODXaW1QzTf44qNRc6PTRM AfDGaPk6ev1HvVd6ytMi+aJf79hJ4d3cJw7ZHLaRc9uzcJYd3xuSrBdQLEiHGKEkQXAN aM2o5agVdXIGmS90+N0CwAnFOoCBfniwPpyPI6/mBCzCHR90ybYyNnB5qa1VwrSt9EVw 5LGtcUa7dQlypTaPCWWY4QR40bSwpoOGqW4SgEj03/iWH0EDIqa9ZnBXONGt8+8sXmkW ex/x2I3GGvj3ijMKSE5CEJRFUCg2OBhuZu8OPuPkqfFwvckYBCUti5zmC7XQ4GR6vTWF oznw== 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=S4a4DETRAyhHFXba3Piw4UbV8J7nicTVM9Gs0MaTHSM=; b=IrO0m180yi74dKRKe+js8qZB3CxtlI4aIQjS/TNlzao53m6B78I6kH920lf2+1D49q IAY2fEZ99xExZsMioO+E+3Bd5Blngj694XYE9Z93a6K+76HglxE+PPgJmVM5PdfRT56x J7x812xU2JIg9mmfQ4H9Oe2H7C4MnVmYM9pgi4KmpjzqhpRPgv315FIDAxgiSgxo39sy /RmtF1YDk/L9j2dVnHgsIHdAUuNeYO1tCB4DyT/f/BoqHxEyakfGN1kE5dAaEgWGgWGZ UZovyn7j+nIVhV5h8Idmp/QNtjY8IGawSFK22UnBCsE3ZKno7S0Hxj0Q4DnwlRPZ831W eRWg== X-Gm-Message-State: AOAM5311eza3x/Ydoto/hsOsAHa6xMv3PgJWLuWtn/+NolG//2DeDNfr a88kn/lJJtUOBxhgaR7ChzIwZIPMJBc= X-Google-Smtp-Source: ABdhPJybRse/haUz3VL2CjODs4qa9cbyCFtjF0VmYCZy0fU0mJ1RCrNSJFvl7kjubbl4qUe5TyQscA== X-Received: by 2002:a1c:f705:: with SMTP id v5mr3845238wmh.69.1625565729766; Tue, 06 Jul 2021 03:02:09 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.02.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:02:09 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 39/40] Set icon for QEMU binary on Mac OS Date: Tue, 6 Jul 2021 12:01:40 +0200 Message-Id: <20210706100141.303960-40-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x332.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.25, 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: , Cc: John Arbuckle Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: John Arbuckle Before switching the build system over to Meson, an icon was added to the QEMU binary on Mac OS. This patch adds back that feature; it piggybacks on the existing scripts/entitlement.sh, which already does in-place changes to the executable on Darwin. Signed-off-by: John Arbuckle Message-Id: <20210705195328.36442-1-programmingkidx@gmail.com> Signed-off-by: Paolo Bonzini --- meson.build | 15 ++++++++++----- scripts/entitlement.sh | 10 +++++++++- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 1651496800..8b61fdb4be 100644 --- a/meson.build +++ b/meson.build @@ -2507,8 +2507,7 @@ foreach target : target_dirs endif foreach exe: execs exe_name = exe['name'] - exe_sign = 'CONFIG_HVF' in config_target - if exe_sign + if targetos == 'darwin' exe_name += '-unsigned' endif @@ -2522,7 +2521,13 @@ foreach target : target_dirs link_args: link_args, gui_app: exe['gui']) - if exe_sign + if 'CONFIG_HVF' in config_target + entitlements = meson.current_source_dir() / 'accel/hvf/entitlements.plist' + else + entitlements = '/dev/null' + endif + if targetos == 'darwin' + icon = meson.current_source_dir() / 'pc-bios/qemu.rsrc' emulators += {exe['name'] : custom_target(exe['name'], depends: emulator, output: exe['name'], @@ -2530,14 +2535,14 @@ foreach target : target_dirs meson.current_source_dir() / 'scripts/entitlement.sh', meson.current_build_dir() / exe_name, meson.current_build_dir() / exe['name'], - meson.current_source_dir() / 'accel/hvf/entitlements.plist' + entitlements, icon ]) } meson.add_install_script('scripts/entitlement.sh', '--install', get_option('bindir') / exe_name, get_option('bindir') / exe['name'], - meson.current_source_dir() / 'accel/hvf/entitlements.plist') + entitlements, icon) else emulators += {exe['name']: emulator} endif diff --git a/scripts/entitlement.sh b/scripts/entitlement.sh index f7aaaf2766..d2a7079ce3 100755 --- a/scripts/entitlement.sh +++ b/scripts/entitlement.sh @@ -11,6 +11,7 @@ fi SRC="$1" DST="$2" ENTITLEMENT="$3" +ICON="$4" if $in_place; then trap 'rm "$DST.tmp"' exit @@ -20,6 +21,13 @@ else cd "$MESON_INSTALL_DESTDIR_PREFIX" fi -codesign --entitlements "$ENTITLEMENT" --force -s - "$SRC" +if test "$ENTITLEMENT" != '/dev/null'; then + codesign --entitlements "$ENTITLEMENT" --force -s - "$SRC" +fi + +# Add the QEMU icon to the binary on Mac OS +Rez -append "$ICON" -o "$SRC" +SetFile -a C "$SRC" + mv -f "$SRC" "$DST" trap '' exit From patchwork Tue Jul 6 10:01:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 12360325 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27F98C07E96 for ; Tue, 6 Jul 2021 10:45:59 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C670C619B1 for ; Tue, 6 Jul 2021 10:45:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C670C619B1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:48920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0iaT-0001vu-M7 for qemu-devel@archiver.kernel.org; Tue, 06 Jul 2021 06:45:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0hu9-0001gf-Rw for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:13 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:51892) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0hu8-0002XA-2k for qemu-devel@nongnu.org; Tue, 06 Jul 2021 06:02:13 -0400 Received: by mail-wm1-x331.google.com with SMTP id n33so5670098wms.1 for ; Tue, 06 Jul 2021 03:02:11 -0700 (PDT) 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=2y9vFZOp8T0joOImIgGzNfZmpLp7ynkcqgEs8ar2hNQ=; b=TZby2+Dc+/6EClHJWh0R9vb7UsFJccFg6FHk3pByFffrHDgTLAmnsQpvclFXXWhjVS sNaPbAbAw+xNlaALx5ll00sytdLnzmauZIrYjZfgqklXUj8Mg/eHVRPIXQNUffcbHQ59 4oWkvItBtQ+9cg+iO0zpQhiMgykRiw/cmLN3TH1Si8SQYxt5vlbe4bLdtW+emq7zvswL QrBnp+fJyCTSuDbmGoTA5Qc9TEH98z26DSGkFnSTCD5kPPplIUc7WfO2iexIJtOr6svI G3hD8edSUQ1MzBekzEzDe5Gq1Hafpkjf49HBSqL2iBW3dYDYZ/zlwrvNpj4wwfCISWYa 8tSA== 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=2y9vFZOp8T0joOImIgGzNfZmpLp7ynkcqgEs8ar2hNQ=; b=d63NyZj52yCfPx9YgKp3rhdweGmJ25OfclHMMaq++Zcuf2jmwq1WKo+4QWJxvtv9+2 hnzxdt66INWHr9iJCVH4WvzKKSCGWDTdxh/oSl2Zb6sFWKO4YxMgwtZTI3fTbmrA3CIr L9l+Kz2byaX6Mf89CQRac2++cPP1ltZJz/xCO8vdB6e+LPl93rg9CuSow5Fynt5KIdli a5dN0Sgl6HT07/rheO0Vs0dlMAGyA2jF73sv3z97Q6osJDjhlVa/A/Eg5aWVhYMGyhs7 IDn3+zTHeH4iICT4V5ZBdvQNLaEssVKcajUWmPpn8ZW0ma+9qa0dbjimNWj6tEGT6BTE 3bKQ== X-Gm-Message-State: AOAM532T5ENefNWQJvDyLZsAr99yYuoJd8WWSGjZms9Wp5+dTxtEYLdL 7QmLW5Exm1rkj2ZAFO/ldm3F5YT0Yaw= X-Google-Smtp-Source: ABdhPJx/rDJBYZecOtWFd4OTTjjLQIsHX+uP7Jd92UdIWmYbTrqtT0EYVshFU0nUrEZqUpwhrcNlfA== X-Received: by 2002:a7b:ca4e:: with SMTP id m14mr3814153wml.93.1625565730363; Tue, 06 Jul 2021 03:02:10 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id v15sm2331268wmj.39.2021.07.06.03.02.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 03:02:10 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 40/40] config-host.mak: remove unused compiler-related lines Date: Tue, 6 Jul 2021 12:01:41 +0200 Message-Id: <20210706100141.303960-41-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210706100141.303960-1-pbonzini@redhat.com> References: <20210706100141.303960-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x331.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.25, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Most of the build is not done via Makefiles, therefore the toolchain variables are mostly unused. They are still used by tests/tcg and pc-bios/roms, but most of them are not needed there. Signed-off-by: Paolo Bonzini --- configure | 10 ---------- meson.build | 1 - 2 files changed, 11 deletions(-) diff --git a/configure b/configure index 0e487ae091..650d9c0735 100755 --- a/configure +++ b/configure @@ -521,9 +521,6 @@ query_pkg_config() { pkg_config=query_pkg_config sdl2_config="${SDL2_CONFIG-${cross_prefix}sdl2-config}" -# If the user hasn't specified ARFLAGS, default to 'rv', just as make does. -ARFLAGS="${ARFLAGS-rv}" - # default flags for all hosts # We use -fwrapv to tell the compiler that we require a C dialect where # left shift of signed integers is well defined and has the expected @@ -4917,19 +4914,12 @@ echo "HOST_CC=$host_cc" >> $config_host_mak if $iasl -h > /dev/null 2>&1; then echo "CONFIG_IASL=$iasl" >> $config_host_mak fi -echo "CXX=$cxx" >> $config_host_mak -echo "OBJCC=$objcc" >> $config_host_mak echo "AR=$ar" >> $config_host_mak -echo "ARFLAGS=$ARFLAGS" >> $config_host_mak echo "AS=$as" >> $config_host_mak echo "CCAS=$ccas" >> $config_host_mak echo "CPP=$cpp" >> $config_host_mak echo "OBJCOPY=$objcopy" >> $config_host_mak echo "LD=$ld" >> $config_host_mak -echo "RANLIB=$ranlib" >> $config_host_mak -echo "NM=$nm" >> $config_host_mak -echo "PKG_CONFIG=$pkg_config_exe" >> $config_host_mak -echo "WINDRES=$windres" >> $config_host_mak echo "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak diff --git a/meson.build b/meson.build index 8b61fdb4be..7e12de01be 100644 --- a/meson.build +++ b/meson.build @@ -2765,7 +2765,6 @@ if targetos == 'windows' summary_info += {'Windows SDK': config_host['WIN_SDK']} endif endif -summary_info += {'ARFLAGS': config_host['ARFLAGS']} summary_info += {'CFLAGS': ' '.join(get_option('c_args') + ['-O' + get_option('optimization')] + (get_option('debug') ? ['-g'] : []))}