From patchwork Tue Mar 15 12:53:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781396 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8BF51C433F5 for ; Tue, 15 Mar 2022 12:57:48 +0000 (UTC) Received: from localhost ([::1]:58532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU6kF-0006Mt-NW for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 08:57:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6gj-0003pt-VP for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:54:10 -0400 Received: from [2607:f8b0:4864:20::429] (port=46635 helo=mail-pf1-x429.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6gh-0007e4-QN for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:54:09 -0400 Received: by mail-pf1-x429.google.com with SMTP id s11so19477424pfu.13 for ; Tue, 15 Mar 2022 05:54:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H3t4JkKVu4nm0xKX1SYsaS01qBX8DSvVvUSoQ9fq1mk=; b=K1cGaLA9q0/2ZwF74aQJkteTvs8UTZSxMorNNVEzT/M+8uoHDLPtY6XFcWaC9inJi1 HaZTKXV27FYsPlMjFoa79pPrHsI7kOYIgn42PL9ZFvVcAbFJ/rsUscCH9raimYOTOCk5 F/yI+JhvwvojrODI74HazFv8Ha+c+SoAPUP6xaXEUkp7wQ2HAExre/Jtj+ls5EYj4rgc dqwSCfOWfQazO/e96LlZrxKSl5g/0Gw/2hKq1LB80Jr+OeCH0+fHvkvQYDJBnzhaHlxi P+CbJD5WyeDarUUDuZdjtk7NVtKrOc4OEJLt5T1+6X6L0Ym8g4IaINbdXEml7p68ilgb Rttg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=H3t4JkKVu4nm0xKX1SYsaS01qBX8DSvVvUSoQ9fq1mk=; b=lysle1YnNBMDmatmqqPlrvki5EZuZM6FiPW18TtlqvpVH6zjc4WE2ADzoxigDLv2PQ yacOVtdtYKRE1IzOU5dj4BfE2jkHMTo8dZ4jPb+B3n+jxgQhpNOpCGUdagE2RLzNTtOn Hc7wSVoz98xs2+iaedw17SsARJSIkrVlOEWZUfv3rPDAbrObWS3ZIivYBb31RU4vVv9B UG4nzYFhakb23VYtk/2Zck94JQ0entzNktVjKTfDZl/FzzSAYnmxpLr/SPGJTbp7WSA+ VcksdP+sbnvqkKUv8W8uHApU49mPwkJQp/9uSgRlKPcwSESp/Gf053CX96+eJ7eybbSd kcQQ== X-Gm-Message-State: AOAM533PesZDWhbrXTvmBd5OgWSxS6NkGAI/ojP5Tjwx9TFIaaGIoUfN EDD0ELoxU+uoEllcta8AlxF9CRLAYkM= X-Google-Smtp-Source: ABdhPJzlJ0NhDwHc9Acce4poCLmRYeHICI27GbCK1xQsKpZyIE5r/GUBcYLO3jjKEsT56qGfR8GjdQ== X-Received: by 2002:a05:6a00:1483:b0:4f7:af9a:c807 with SMTP id v3-20020a056a00148300b004f7af9ac807mr14885607pfu.17.1647348845692; Tue, 15 Mar 2022 05:54:05 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id a38-20020a056a001d2600b004f72acd4dadsm24445749pfx.81.2022.03.15.05.54.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:54:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 01/21] configure: Allow passing extra Objective C compiler flags Date: Tue, 15 Mar 2022 13:53:30 +0100 Message-Id: <20220315125350.82452-2-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::429 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pf1-x429.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé We can pass C/CPP/LD flags via CFLAGS/CXXFLAGS/LDFLAGS environment variables, or via configure --extra-cflags / --extra-cxxflags / --extra-ldflags options. Provide similar behavior for Objective C: use existing flags from $OBJCFLAGS, or passed via --extra-objcflags. Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki Signed-off-by: Philippe Mathieu-Daudé --- configure | 8 ++++++++ meson.build | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/configure b/configure index 886000346a..2bf40d9eeb 100755 --- a/configure +++ b/configure @@ -285,6 +285,7 @@ done EXTRA_CFLAGS="" EXTRA_CXXFLAGS="" +EXTRA_OBJCFLAGS="" EXTRA_LDFLAGS="" xen_ctrl_version="$default_feature" @@ -366,9 +367,12 @@ for opt do --extra-cflags=*) EXTRA_CFLAGS="$EXTRA_CFLAGS $optarg" EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $optarg" + EXTRA_OBJCFLAGS="$EXTRA_OBJCFLAGS $optarg" ;; --extra-cxxflags=*) EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $optarg" ;; + --extra-objcflags=*) EXTRA_OBJCFLAGS="$EXTRA_OBJCFLAGS $optarg" + ;; --extra-ldflags=*) EXTRA_LDFLAGS="$EXTRA_LDFLAGS $optarg" ;; --enable-debug-info) debug_info="yes" @@ -748,6 +752,8 @@ for opt do ;; --extra-cxxflags=*) ;; + --extra-objcflags=*) + ;; --extra-ldflags=*) ;; --enable-debug-info) @@ -1172,6 +1178,7 @@ Advanced options (experts only): --objcc=OBJCC use Objective-C compiler OBJCC [$objcc] --extra-cflags=CFLAGS append extra C compiler flags CFLAGS --extra-cxxflags=CXXFLAGS append extra C++ compiler flags CXXFLAGS + --extra-objcflags=OBJCFLAGS append extra Objective C compiler flags OBJCFLAGS --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS --cross-cc-ARCH=CC use compiler when building ARCH guest test cases --cross-cc-cflags-ARCH= use compiler flags when building ARCH guest tests @@ -3137,6 +3144,7 @@ if test "$skip_meson" = no; then echo "[built-in options]" >> $cross echo "c_args = [$(meson_quote $CFLAGS $EXTRA_CFLAGS)]" >> $cross echo "cpp_args = [$(meson_quote $CXXFLAGS $EXTRA_CXXFLAGS)]" >> $cross + test -n "$objcc" && echo "objc_args = [$(meson_quote $OBJCFLAGS $EXTRA_OBJCFLAGS)]" >> $cross echo "c_link_args = [$(meson_quote $CFLAGS $LDFLAGS $EXTRA_CFLAGS $EXTRA_LDFLAGS)]" >> $cross echo "cpp_link_args = [$(meson_quote $CXXFLAGS $LDFLAGS $EXTRA_CXXFLAGS $EXTRA_LDFLAGS)]" >> $cross echo "[binaries]" >> $cross diff --git a/meson.build b/meson.build index 2d6601467f..351f9f4360 100644 --- a/meson.build +++ b/meson.build @@ -3467,6 +3467,11 @@ if link_language == 'cpp' + ['-O' + get_option('optimization')] + (get_option('debug') ? ['-g'] : []))} endif +if targetos == 'darwin' + summary_info += {'OBJCFLAGS': ' '.join(get_option('objc_args') + + ['-O' + get_option('optimization')] + + (get_option('debug') ? ['-g'] : []))} +endif link_args = get_option(link_language + '_link_args') if link_args.length() > 0 summary_info += {'LDFLAGS': ' '.join(link_args)} From patchwork Tue Mar 15 12:53:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781401 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9C2F9C433EF for ; Tue, 15 Mar 2022 13:03:28 +0000 (UTC) Received: from localhost ([::1]:38962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU6pj-0004Y1-Ap for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:03:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6gu-00040L-RI for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:54:23 -0400 Received: from [2607:f8b0:4864:20::632] (port=37830 helo=mail-pl1-x632.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6gq-0007f0-1G for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:54:20 -0400 Received: by mail-pl1-x632.google.com with SMTP id n2so16157021plf.4 for ; Tue, 15 Mar 2022 05:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yM0ExPfucPGnLuN+qCSdAMHJpYVpYrGUNOCDjIec9GA=; b=ns36NBSr73mbBczDik/pnN5pzAd6VZXPcxNTUzlMy/CN/Iwe9hZSZdMMeKDlu3owJ6 KgnN0WVqKWbwY6bzAPultyMLIqCCDPp9oq7Zz3k/fMY7PChF/jedha+NAD3luGULJHjj kGWSr4Efa64iHyt/H5GtVsOITwmz/9uv9r3FY0jYlrRNzxhnb0WuUzfagNpy3b0zCgtA FDzj7d3jLlTY36+pSsJdCTjfcmqiZXVftO9bOoKNUlJ/VE4YvROeeD+QTTAuqJyjXCD4 A9QSu8q7V120CdAHe9MTnnk102MCPysd/lcS/+adSDD9cOMmCU1V8q/JSPewZovmZocZ /hkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yM0ExPfucPGnLuN+qCSdAMHJpYVpYrGUNOCDjIec9GA=; b=CB+lXNZ9jk8nBBmYk4O/iTUoALPLoicwSMHDdGhe8fOekTA7FlnJYouqaIqOmMRxT5 7S8bLEYF9CPDhfIB2CZQGs7nLnIMhfAEmqV2V8WOxxPhzpmsCuQrz1m10dwnqJc4d5Oo Q21Y1HhZkR5n5b6M1AzZd5RrpcpZYuqEHHXJ6TINWqQdukhZnyh2l4LBFJ8U9uj4G7rN 9uqm9TuJUWSHZ5jYlgHjqCschpxcDS8KlPB2OKQqpokMEsopmADvqWvm0KG2WAcmwEvs Flea8AWCnbgTkPm4qgkF2LvIZrQ0lZ7DnXYjwlhqt34RQNTFSAh81GNyLqPqueljBF78 t4gg== X-Gm-Message-State: AOAM533WkdyD3WaiMPapSPHKHEAgVu/GP8jJAQSrafc5o+mYeC7x+cSn gUBHohK/Nps4N2ou+1Yp4yzO9YIZStg= X-Google-Smtp-Source: ABdhPJxYQ8/2z5Ukr9MSx+b4zLFYWav5xMm2S1Tmihab+anbQ7IYdmk4zAj5h3HDkXsuEk/P6bemEQ== X-Received: by 2002:a17:902:ed82:b0:153:85d5:7dff with SMTP id e2-20020a170902ed8200b0015385d57dffmr6720630plj.79.1647348854623; Tue, 15 Mar 2022 05:54:14 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id v6-20020a056a00148600b004f9f9b9092fsm3261440pfu.113.2022.03.15.05.54.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:54:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 02/21] tests/fp/berkeley-testfloat-3: Ignore ignored #pragma directives Date: Tue, 15 Mar 2022 13:53:31 +0100 Message-Id: <20220315125350.82452-3-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::632 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pl1-x632.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki , Roman Bolshakov , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Since we already use -Wno-unknown-pragmas, we can also use -Wno-ignored-pragmas. This silences hundred of warnings using clang 13 on macOS Monterey: [409/771] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_test_az_f128_rx.c.o ../tests/fp/berkeley-testfloat-3/source/test_az_f128_rx.c:49:14: warning: '#pragma FENV_ACCESS' is not supported on this target - ignored [-Wignored-pragmas] #pragma STDC FENV_ACCESS ON ^ 1 warning generated. Having: $ cc -v Apple clang version 13.0.0 (clang-1300.0.29.30) Reported-by: Roman Bolshakov Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki Acked-by: Alex Bennée Signed-off-by: Philippe Mathieu-Daudé --- tests/fp/meson.build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/fp/meson.build b/tests/fp/meson.build index 59776a00a7..8bd0979f67 100644 --- a/tests/fp/meson.build +++ b/tests/fp/meson.build @@ -37,6 +37,11 @@ tfcflags = [ '-Wno-error', ] +if cc.get_id() == 'clang' + # Clang does not support '#pragma STDC FENV_ACCESS' + tfcflags += [ '-Wno-ignored-pragmas' ] +endif + tfgencases = [ tfdir / 'genCases_ui32.c', tfdir / 'genCases_ui64.c', From patchwork Tue Mar 15 12:53:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781408 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 621DDC433EF for ; Tue, 15 Mar 2022 13:08:11 +0000 (UTC) Received: from localhost ([::1]:47604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU6uI-00028X-AP for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:08:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6h0-000420-HA for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:54:30 -0400 Received: from [2607:f8b0:4864:20::634] (port=44821 helo=mail-pl1-x634.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6gy-0007ft-QY for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:54:26 -0400 Received: by mail-pl1-x634.google.com with SMTP id q11so16126982pln.11 for ; Tue, 15 Mar 2022 05:54:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3zqaK9s5/raZ8zuTcIzPJOQG8kwceFqw1+s0bbIn7Ok=; b=TiXb2Wud5kFc2dhcv+gNEwEvbQu6rd2Q2c55AGY5qK2kKnSdLuzEWpXRyXY4ua1Qxk eIKSTdyKMrBvKj6Kof5OZNDlCBgIVHrJXVYuZLnFIbljkXFvbWxUcymuioQnhMJDDmU6 uGoomG8aW9XNyigDie1FMs4Bgupql5mXP92xpjgSC4yGrwvyOErFdMTrtli5cuxxibIp 7Pq3ots/pKR2SQW965lANuMI1iQCqm0JvefZFq11gPctWtx3EBHS+e1j2s2X0eJJkv8k HrJqQLzErbSNbByb3jfs6I92x7zQAAZUjIGw5wC+UJoRXfnnQws/M7UgPCJTu9WspG5d Uevg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3zqaK9s5/raZ8zuTcIzPJOQG8kwceFqw1+s0bbIn7Ok=; b=7AT5yhJKKdXgaAvFc3CtnBtrF5Q81Y0l0azSd7pT4eSO5sq1laoP+fj7uIba8nDLmJ 9SjmpM1P9EHI7nykdbYNS31xxdvEULt2MwClV3n7DyizTVfmchuoRDsnxjju1BKfqkAE Xrw5X8dc/zKt2qq/k1NxVpbMvMVgN3uPTcIS6glnazaam7zz+s0o9KKGw4nV+0DI2F71 YBu71GAlh+lC1pGh5IOLGEWCYXsi9KYtruWOziOc77ffXZtfMxEkm0R6XUHYMXdBfsfz n4HbhGDEJWZYxm0WwpV734PdyGejl8wDYNyt/WMiiR3xzihHE2V566jHsW4ivsDQIeZX GR+w== X-Gm-Message-State: AOAM530BEFprTYrl33zFqPGuTg0vxu0nbXxovX6dMAffMD/4n/QgDQLy lQx5zwMVIZF69eKF9nveJsb3lIA2ASk= X-Google-Smtp-Source: ABdhPJxrnSMQsj3rGIqHMuhBMWH+VL3gL8kGozhw4PUjOogQDj+1O27L6rmSKGlfjMqvVAFYH9Ushg== X-Received: by 2002:a17:902:ea12:b0:151:dbbd:aeb8 with SMTP id s18-20020a170902ea1200b00151dbbdaeb8mr27573384plg.157.1647348863354; Tue, 15 Mar 2022 05:54:23 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id j9-20020a056a00130900b004f73df40914sm25320276pfu.82.2022.03.15.05.54.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:54:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 03/21] hvf: Use standard CR0 and CR4 register definitions Date: Tue, 15 Mar 2022 13:53:32 +0100 Message-Id: <20220315125350.82452-4-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::634 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pl1-x634.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Cameron Esfahani No need to have our own definitions of these registers. Signed-off-by: Cameron Esfahani Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé --- target/i386/hvf/vmx.h | 17 +++++++++-------- target/i386/hvf/x86.c | 6 +++--- target/i386/hvf/x86.h | 34 ---------------------------------- target/i386/hvf/x86_mmu.c | 2 +- target/i386/hvf/x86_task.c | 3 ++- 5 files changed, 15 insertions(+), 47 deletions(-) diff --git a/target/i386/hvf/vmx.h b/target/i386/hvf/vmx.h index 6df87116f6..29b7deed3c 100644 --- a/target/i386/hvf/vmx.h +++ b/target/i386/hvf/vmx.h @@ -124,10 +124,11 @@ static inline void macvm_set_cr0(hv_vcpuid_t vcpu, uint64_t cr0) uint64_t efer = rvmcs(vcpu, VMCS_GUEST_IA32_EFER); uint64_t old_cr0 = rvmcs(vcpu, VMCS_GUEST_CR0); uint64_t changed_cr0 = old_cr0 ^ cr0; - uint64_t mask = CR0_PG | CR0_CD | CR0_NW | CR0_NE | CR0_ET; + uint64_t mask = CR0_PG_MASK | CR0_CD_MASK | CR0_NW_MASK | + CR0_NE_MASK | CR0_ET_MASK; uint64_t entry_ctls; - if ((cr0 & CR0_PG) && (rvmcs(vcpu, VMCS_GUEST_CR4) & CR4_PAE) && + if ((cr0 & CR0_PG_MASK) && (rvmcs(vcpu, VMCS_GUEST_CR4) & CR4_PAE_MASK) && !(efer & MSR_EFER_LME)) { address_space_read(&address_space_memory, rvmcs(vcpu, VMCS_GUEST_CR3) & ~0x1f, @@ -142,8 +143,8 @@ static inline void macvm_set_cr0(hv_vcpuid_t vcpu, uint64_t cr0) wvmcs(vcpu, VMCS_CR0_SHADOW, cr0); if (efer & MSR_EFER_LME) { - if (changed_cr0 & CR0_PG) { - if (cr0 & CR0_PG) { + if (changed_cr0 & CR0_PG_MASK) { + if (cr0 & CR0_PG_MASK) { enter_long_mode(vcpu, cr0, efer); } else { exit_long_mode(vcpu, cr0, efer); @@ -155,8 +156,8 @@ static inline void macvm_set_cr0(hv_vcpuid_t vcpu, uint64_t cr0) } /* Filter new CR0 after we are finished examining it above. */ - cr0 = (cr0 & ~(mask & ~CR0_PG)); - wvmcs(vcpu, VMCS_GUEST_CR0, cr0 | CR0_NE | CR0_ET); + cr0 = (cr0 & ~(mask & ~CR0_PG_MASK)); + wvmcs(vcpu, VMCS_GUEST_CR0, cr0 | CR0_NE_MASK | CR0_ET_MASK); hv_vcpu_invalidate_tlb(vcpu); hv_vcpu_flush(vcpu); @@ -164,11 +165,11 @@ static inline void macvm_set_cr0(hv_vcpuid_t vcpu, uint64_t cr0) static inline void macvm_set_cr4(hv_vcpuid_t vcpu, uint64_t cr4) { - uint64_t guest_cr4 = cr4 | CR4_VMXE; + uint64_t guest_cr4 = cr4 | CR4_VMXE_MASK; wvmcs(vcpu, VMCS_GUEST_CR4, guest_cr4); wvmcs(vcpu, VMCS_CR4_SHADOW, cr4); - wvmcs(vcpu, VMCS_CR4_MASK, CR4_VMXE); + wvmcs(vcpu, VMCS_CR4_MASK, CR4_VMXE_MASK); hv_vcpu_invalidate_tlb(vcpu); hv_vcpu_flush(vcpu); diff --git a/target/i386/hvf/x86.c b/target/i386/hvf/x86.c index 2898bb70a8..91a3fe002c 100644 --- a/target/i386/hvf/x86.c +++ b/target/i386/hvf/x86.c @@ -119,7 +119,7 @@ bool x86_read_call_gate(struct CPUState *cpu, struct x86_call_gate *idt_desc, bool x86_is_protected(struct CPUState *cpu) { uint64_t cr0 = rvmcs(cpu->hvf->fd, VMCS_GUEST_CR0); - return cr0 & CR0_PE; + return cr0 & CR0_PE_MASK; } bool x86_is_real(struct CPUState *cpu) @@ -150,13 +150,13 @@ bool x86_is_long64_mode(struct CPUState *cpu) bool x86_is_paging_mode(struct CPUState *cpu) { uint64_t cr0 = rvmcs(cpu->hvf->fd, VMCS_GUEST_CR0); - return cr0 & CR0_PG; + return cr0 & CR0_PG_MASK; } bool x86_is_pae_enabled(struct CPUState *cpu) { uint64_t cr4 = rvmcs(cpu->hvf->fd, VMCS_GUEST_CR4); - return cr4 & CR4_PAE; + return cr4 & CR4_PAE_MASK; } target_ulong linear_addr(struct CPUState *cpu, target_ulong addr, X86Seg seg) diff --git a/target/i386/hvf/x86.h b/target/i386/hvf/x86.h index 782664c2ea..947b98da41 100644 --- a/target/i386/hvf/x86.h +++ b/target/i386/hvf/x86.h @@ -42,40 +42,6 @@ typedef struct x86_register { }; } __attribute__ ((__packed__)) x86_register; -typedef enum x86_reg_cr0 { - CR0_PE = (1L << 0), - CR0_MP = (1L << 1), - CR0_EM = (1L << 2), - CR0_TS = (1L << 3), - CR0_ET = (1L << 4), - CR0_NE = (1L << 5), - CR0_WP = (1L << 16), - CR0_AM = (1L << 18), - CR0_NW = (1L << 29), - CR0_CD = (1L << 30), - CR0_PG = (1L << 31), -} x86_reg_cr0; - -typedef enum x86_reg_cr4 { - CR4_VME = (1L << 0), - CR4_PVI = (1L << 1), - CR4_TSD = (1L << 2), - CR4_DE = (1L << 3), - CR4_PSE = (1L << 4), - CR4_PAE = (1L << 5), - CR4_MSE = (1L << 6), - CR4_PGE = (1L << 7), - CR4_PCE = (1L << 8), - CR4_OSFXSR = (1L << 9), - CR4_OSXMMEXCPT = (1L << 10), - CR4_VMXE = (1L << 13), - CR4_SMXE = (1L << 14), - CR4_FSGSBASE = (1L << 16), - CR4_PCIDE = (1L << 17), - CR4_OSXSAVE = (1L << 18), - CR4_SMEP = (1L << 20), -} x86_reg_cr4; - /* 16 bit Task State Segment */ typedef struct x86_tss_segment16 { uint16_t link; diff --git a/target/i386/hvf/x86_mmu.c b/target/i386/hvf/x86_mmu.c index e9ed0f5aa1..df0b91cd42 100644 --- a/target/i386/hvf/x86_mmu.c +++ b/target/i386/hvf/x86_mmu.c @@ -129,7 +129,7 @@ static bool test_pt_entry(struct CPUState *cpu, struct gpt_translation *pt, uint32_t cr0 = rvmcs(cpu->hvf->fd, VMCS_GUEST_CR0); /* check protection */ - if (cr0 & CR0_WP) { + if (cr0 & CR0_WP_MASK) { if (pt->write_access && !pte_write_access(pte)) { return false; } diff --git a/target/i386/hvf/x86_task.c b/target/i386/hvf/x86_task.c index 422156128b..e1301599e9 100644 --- a/target/i386/hvf/x86_task.c +++ b/target/i386/hvf/x86_task.c @@ -174,7 +174,8 @@ void vmx_handle_task_switch(CPUState *cpu, x68_segment_selector tss_sel, int rea //ret = task_switch_16(cpu, tss_sel, old_tss_sel, old_tss_base, &next_tss_desc); VM_PANIC("task_switch_16"); - macvm_set_cr0(cpu->hvf->fd, rvmcs(cpu->hvf->fd, VMCS_GUEST_CR0) | CR0_TS); + macvm_set_cr0(cpu->hvf->fd, rvmcs(cpu->hvf->fd, VMCS_GUEST_CR0) | + CR0_TS_MASK); x86_segment_descriptor_to_vmx(cpu, tss_sel, &next_tss_desc, &vmx_seg); vmx_write_segment_descriptor(cpu, &vmx_seg, R_TR); From patchwork Tue Mar 15 12:53:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781406 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 11E8AC433F5 for ; Tue, 15 Mar 2022 13:04:49 +0000 (UTC) Received: from localhost ([::1]:41316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU6r2-0006Bk-3c for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:04:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6h8-0004Eu-UB for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:54:34 -0400 Received: from [2607:f8b0:4864:20::630] (port=44818 helo=mail-pl1-x630.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6h7-0007ii-Av for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:54:34 -0400 Received: by mail-pl1-x630.google.com with SMTP id q11so16127319pln.11 for ; Tue, 15 Mar 2022 05:54:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ArFcmNt0gGLU+mr5/TYFcI9zp4Pabr8VQk5NFCrO7o4=; b=X/OJRggSFgvLrn605ZAG8YkgQVRSqmaVL5ubenTjIvqmqilKMytR1bFqOsKYNCYhpt Q5dCcYTNdgTVWCUWrD82kwrba5967gKyb4S/adh/ksR55o+hLnkDhdca0lFEH7GIYUp7 bFM3CGQ9YyXuqH1AfHz0mjEmoUVr2Na6mnHReBkhK6pa2twzBUapGw5p0nZDSFx5qDDc y+50tcZuumFG7skwUOdLZs76tVgQYYMgUjb9rGa4LgrpLiOauGCUcbYtnMZjDWJIAwpV XWh+am3osS2bhLhkLei0AbeSNn189sSlIYglKsuRtu+8AhwVdoYunzd4H2wVT9coqvxB NxKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ArFcmNt0gGLU+mr5/TYFcI9zp4Pabr8VQk5NFCrO7o4=; b=Vdl9fxmHKfxneClFU5tob3IJnyRDy6+lXteNWPCHS5MAxHbnBlQT2RR+LN7Ed2LyhK VssWiavvH1qohP6MynqxI+kEGTig3CsINXTfcIvaBfXqsOYDMM0D6o3z+r7b0cPxcFkQ 1/Id7f7utjmqMT7/Cz9+DjCtxBaUPxIhCBO+C+T7ekINE3X/ZiHB7tZOvKCuJ89SiOiN aMnNtVDtPeByw2DuzgrTh/e2IGcd7UYcX5D6UsazV3knY6HF7qC1P0/IsRTVcwhiD/kH D7RzITwjjtf6TIWvV/taK3cvrNuwRfuaks3BrVo2B6mOU0UQZ0QbamGwMHkztRcodsaZ upig== X-Gm-Message-State: AOAM531rU2ZE8fvslNa0S9j0CaPvp3FqBALxokFNq8aw6Wx05gmxYNud wbSojCvPcj4LM89i9rl/ERuH3MWga+U= X-Google-Smtp-Source: ABdhPJw8WNXVljoRfvDS3cGvUPSzGK0zNt1Jj68dlWTk0cHlAPcUeq2hEoK/sokqiQjT8XSCbP/+oA== X-Received: by 2002:a17:90a:d0c4:b0:1bc:b02e:ed75 with SMTP id y4-20020a17090ad0c400b001bcb02eed75mr4474573pjw.104.1647348871863; Tue, 15 Mar 2022 05:54:31 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id l13-20020a056a00140d00b004e13da93eaasm24476939pfu.62.2022.03.15.05.54.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:54:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 04/21] hvf: Make hvf_get_segments() / hvf_put_segments() local Date: Tue, 15 Mar 2022 13:53:33 +0100 Message-Id: <20220315125350.82452-5-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::630 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pl1-x630.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Both hvf_get_segments/hvf_put_segments() functions are only used within x86hvf.c: do not declare them as public API. Reviewed-by: Roman Bolshakov Tested-by: Roman Bolshakov Signed-off-by: Philippe Mathieu-Daudé --- target/i386/hvf/x86hvf.c | 4 ++-- target/i386/hvf/x86hvf.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/target/i386/hvf/x86hvf.c b/target/i386/hvf/x86hvf.c index 05ec1bddc4..907f09f1b4 100644 --- a/target/i386/hvf/x86hvf.c +++ b/target/i386/hvf/x86hvf.c @@ -83,7 +83,7 @@ void hvf_put_xsave(CPUState *cpu_state) } } -void hvf_put_segments(CPUState *cpu_state) +static void hvf_put_segments(CPUState *cpu_state) { CPUX86State *env = &X86_CPU(cpu_state)->env; struct vmx_segment seg; @@ -166,7 +166,7 @@ void hvf_get_xsave(CPUState *cpu_state) x86_cpu_xrstor_all_areas(X86_CPU(cpu_state), xsave, xsave_len); } -void hvf_get_segments(CPUState *cpu_state) +static void hvf_get_segments(CPUState *cpu_state) { CPUX86State *env = &X86_CPU(cpu_state)->env; diff --git a/target/i386/hvf/x86hvf.h b/target/i386/hvf/x86hvf.h index 99ed8d608d..db6003d6bd 100644 --- a/target/i386/hvf/x86hvf.h +++ b/target/i386/hvf/x86hvf.h @@ -26,11 +26,9 @@ void hvf_set_segment(struct CPUState *cpu, struct vmx_segment *vmx_seg, SegmentCache *qseg, bool is_tr); void hvf_get_segment(SegmentCache *qseg, struct vmx_segment *vmx_seg); void hvf_put_xsave(CPUState *cpu_state); -void hvf_put_segments(CPUState *cpu_state); void hvf_put_msrs(CPUState *cpu_state); void hvf_get_xsave(CPUState *cpu_state); void hvf_get_msrs(CPUState *cpu_state); void vmx_clear_int_window_exiting(CPUState *cpu); -void hvf_get_segments(CPUState *cpu_state); void vmx_update_tpr(CPUState *cpu); #endif From patchwork Tue Mar 15 12:53:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781410 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BFA02C433F5 for ; Tue, 15 Mar 2022 13:08:39 +0000 (UTC) Received: from localhost ([::1]:50100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU6uk-0003nu-UC for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:08:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60822) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6hJ-0004VY-9C for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:54:45 -0400 Received: from [2607:f8b0:4864:20::62e] (port=35676 helo=mail-pl1-x62e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6hH-0007k1-Kb for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:54:44 -0400 Received: by mail-pl1-x62e.google.com with SMTP id n15so16169026plh.2 for ; Tue, 15 Mar 2022 05:54:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RcstpUhbUgnI9fuTcLWWtxfVGC/x5MLDlmMnW6NP8eM=; b=lMg61RT0+u+kv279f53F8sXH8CF9qu+M4Ccga24blC0WwCAwLyJz94E/KrayJG/HAV L4WnZ1aRC8U2bhRmGp62fhknL1z2EhZRdAumEIRKBTgYsTMtPrAP3FSpTVW93oC3AiVX ZS8H8gCT9bqu0pghVZC0isj5roNXj2paGqPT2ZjZJuu8c1C/irP8X4dQxladSp79ax+v D5oN9kOCjDOJmMwbjXbI0cyoMXOOowcfecx4ztieGVIvAMmVIK4YGYjcUTkQRqfQPFJq ZB1lsnweFgRzKAK+p/+Zrkl1f9mbMTcaE1bR3/M1dCEBVoNqWbnCGleM4+NPb8EuuaPJ I/sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RcstpUhbUgnI9fuTcLWWtxfVGC/x5MLDlmMnW6NP8eM=; b=igBbzk25rHlQ6RhCIrhmAfhWyHlUmR00UxKHEJ8Ky/GnLCchilP6lI5aYAhid6ovWD lrvUNaxlkn2PXe/62xFEVEGOINTVPka6HAAlMGYZ+13X8ZQ4d9a7JEp3E97DmAvHSnuT hbPXY4MUTkH22fKxIX7dxyu90RnsRQrJiCPl6/Asv8WtkVBNw7wD0x2U7y/mRqFoIhKG JoswAy5GFNxLz+X+aDvnn6M0nLxlAKo4EHAZvzc0jkHawEuK+yBasUijFRjpL9fA8Vrl /UYzI07/neYlbO5or8vSONS/5L6c/njaG3EJycfmGR7rznScjdfVOrCVNgststkYVPxv jbsA== X-Gm-Message-State: AOAM532/KjLcX2QkgMFie8j2NQBz9ikBgfuJxLK6TKEp1zVi61k1Ehy4 mATy5snXu5j8m2zANEKXgPqoXglvmAc= X-Google-Smtp-Source: ABdhPJyC/8TC8tmOPfzMln0S5kvzdku7rAR9pUu/rXwoHUYF7Z6joc7icdEoaUvZ8A4QCYVA23cICw== X-Received: by 2002:a17:90a:5794:b0:1b9:8932:d475 with SMTP id g20-20020a17090a579400b001b98932d475mr4445932pji.24.1647348880257; Tue, 15 Mar 2022 05:54:40 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id w2-20020a17090a380200b001bf46846c09sm3175989pjb.36.2022.03.15.05.54.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:54:39 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 05/21] hvf: Remove deprecated hv_vcpu_flush() calls Date: Tue, 15 Mar 2022 13:53:34 +0100 Message-Id: <20220315125350.82452-6-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pl1-x62e.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé When building on macOS 11 [*], we get: In file included from ../target/i386/hvf/hvf.c:59: ../target/i386/hvf/vmx.h:174:5: error: 'hv_vcpu_flush' is deprecated: first deprecated in macOS 11.0 - This API has no effect and always returns HV_UNSUPPORTED [-Werror,-Wdeprecated-declarations] hv_vcpu_flush(vcpu); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Hypervisor.framework/Headers/hv.h:364:20: note: 'hv_vcpu_flush' has been explicitly marked deprecated here extern hv_return_t hv_vcpu_flush(hv_vcpuid_t vcpu) ^ Since this call "has no effect", simply remove it ¯\_(ツ)_/¯ Not very useful deprecation doc: https://developer.apple.com/documentation/hypervisor/1441386-hv_vcpu_flush [*] Also 10.15 (Catalina): https://lore.kernel.org/qemu-devel/Yd3DmSqZ1SiJwd7P@roolebo.dev/ Reviewed-by: Roman Bolshakov Tested-by: Roman Bolshakov Signed-off-by: Philippe Mathieu-Daudé --- target/i386/hvf/vmx.h | 2 -- target/i386/hvf/x86_task.c | 1 - target/i386/hvf/x86hvf.c | 2 -- 3 files changed, 5 deletions(-) diff --git a/target/i386/hvf/vmx.h b/target/i386/hvf/vmx.h index 29b7deed3c..573ddc33c0 100644 --- a/target/i386/hvf/vmx.h +++ b/target/i386/hvf/vmx.h @@ -160,7 +160,6 @@ static inline void macvm_set_cr0(hv_vcpuid_t vcpu, uint64_t cr0) wvmcs(vcpu, VMCS_GUEST_CR0, cr0 | CR0_NE_MASK | CR0_ET_MASK); hv_vcpu_invalidate_tlb(vcpu); - hv_vcpu_flush(vcpu); } static inline void macvm_set_cr4(hv_vcpuid_t vcpu, uint64_t cr4) @@ -172,7 +171,6 @@ static inline void macvm_set_cr4(hv_vcpuid_t vcpu, uint64_t cr4) wvmcs(vcpu, VMCS_CR4_MASK, CR4_VMXE_MASK); hv_vcpu_invalidate_tlb(vcpu); - hv_vcpu_flush(vcpu); } static inline void macvm_set_rip(CPUState *cpu, uint64_t rip) diff --git a/target/i386/hvf/x86_task.c b/target/i386/hvf/x86_task.c index e1301599e9..d24daf6a41 100644 --- a/target/i386/hvf/x86_task.c +++ b/target/i386/hvf/x86_task.c @@ -182,5 +182,4 @@ void vmx_handle_task_switch(CPUState *cpu, x68_segment_selector tss_sel, int rea store_regs(cpu); hv_vcpu_invalidate_tlb(cpu->hvf->fd); - hv_vcpu_flush(cpu->hvf->fd); } diff --git a/target/i386/hvf/x86hvf.c b/target/i386/hvf/x86hvf.c index 907f09f1b4..bec9fc5814 100644 --- a/target/i386/hvf/x86hvf.c +++ b/target/i386/hvf/x86hvf.c @@ -125,8 +125,6 @@ static void hvf_put_segments(CPUState *cpu_state) hvf_set_segment(cpu_state, &seg, &env->ldt, false); vmx_write_segment_descriptor(cpu_state, &seg, R_LDTR); - - hv_vcpu_flush(cpu_state->hvf->fd); } void hvf_put_msrs(CPUState *cpu_state) From patchwork Tue Mar 15 12:53:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781397 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8D328C433F5 for ; Tue, 15 Mar 2022 12:58:24 +0000 (UTC) Received: from localhost ([::1]:60318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU6kp-0007eL-Em for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 08:58:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6hP-0004l9-UE for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:54:51 -0400 Received: from [2607:f8b0:4864:20::1031] (port=56318 helo=mail-pj1-x1031.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6hO-0007lL-8r for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:54:51 -0400 Received: by mail-pj1-x1031.google.com with SMTP id e3so17601482pjm.5 for ; Tue, 15 Mar 2022 05:54:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ot2D326O8foCPTFoiSw5ZmusSMStw8kBL5YJqBE67gs=; b=L/VP+LBuDd5iaY9YsUnQMhiCXMuLHym9yo7pc5slZY22YRb71dxWjFZur/3rqK6hjA 41KA0uABCYrbfO9wLaAM6oDfWCXgHo/Q6bZS7hNmG4hN8fEZwnaQLwXqp9GFUuQ1ival KctGZUSUn6auDAa922oeggX3Gf3JVzJ2ZzQiVqRq7x/tvPWF2q9RArWnagSvMM78SYh1 PzJCTBy7ZWswJpNP2ProqIiL/EmNnQKpEJdaDH3cPwMNDTWiPqK4TxQRlJfcmFAMZeLO C2HWN6rbuxqyUEliXRWwst6SS58whHpdIlnhwe2ntyk0jO3exY5I+2KcgmiB5gYF3bA2 qpPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ot2D326O8foCPTFoiSw5ZmusSMStw8kBL5YJqBE67gs=; b=239zHhw0Ae0iNgG1/rWnhVglrPBAX7+GtCNjor4BrjYqajZc7tjnk4cKRTpJTYfS8H Htn0OPa4vKjqVuq/QNYq9M09D4gduoyL6F6yxQG7TUHKFBR+uilW4Xc/4zIB0IMJ6IK1 J+rAGWikEjMlwRqcqNjci1B/fTViYq0ACboZRdh53x4FTBUf++dU2iT1ycmh8mVL7IrW GotiqZwnj7Vhny2W0oJQe/xlY+gRfuPzGhZK+JwykVNo8OP4h6tgDTLtmJ5WpBz8wiKt yNq0kV+UqwSSBSHbvAIhHiRsi4xfa2v9QAS9W8R/brj5DzLE/rkWUzCwd70uIrHvcDv/ JHhA== X-Gm-Message-State: AOAM5329QHIAYUJQf1Flq/qyXaXi4R600GGfz5DEaRcMG0nY0En3QF8d ChrWjuf5luoo6aWBpv8tu2I/DFESDUs= X-Google-Smtp-Source: ABdhPJwyDL436cgneKoW9OA7bw0tEWBcgwCyBEMHflFZA0k8E0tlapz30AG2+aVOsrdmaO8+cPPJyQ== X-Received: by 2002:a17:90a:f8c:b0:1bc:cf23:2319 with SMTP id 12-20020a17090a0f8c00b001bccf232319mr4487280pjz.67.1647348888736; Tue, 15 Mar 2022 05:54:48 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id o7-20020a056a00214700b004c169d45699sm24048615pfk.184.2022.03.15.05.54.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:54:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 06/21] block/file-posix: Remove a deprecation warning on macOS 12 Date: Tue, 15 Mar 2022 13:53:35 +0100 Message-Id: <20220315125350.82452-7-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1031 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pj1-x1031.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé When building on macOS 12 we get: block/file-posix.c:3335:18: warning: 'IOMasterPort' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations] kernResult = IOMasterPort( MACH_PORT_NULL, &masterPort ); ^~~~~~~~~~~~ IOMainPort Replace by IOMainPort, redefining it to IOMasterPort if not available. Suggested-by: Akihiko Odaki Reviewed-by: Christian Schoenebeck Reviewed by: Cameron Esfahani Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki Signed-off-by: Philippe Mathieu-Daudé --- block/file-posix.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index c000a61db2..39a3d6dbe6 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -3320,17 +3320,23 @@ BlockDriver bdrv_file = { #if defined(__APPLE__) && defined(__MACH__) static kern_return_t GetBSDPath(io_iterator_t mediaIterator, char *bsdPath, CFIndex maxPathSize, int flags); + +#if !defined(MAC_OS_VERSION_12_0) \ + || (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_VERSION_12_0) +#define IOMainPort IOMasterPort +#endif + static char *FindEjectableOpticalMedia(io_iterator_t *mediaIterator) { kern_return_t kernResult = KERN_FAILURE; - mach_port_t masterPort; + mach_port_t mainPort; CFMutableDictionaryRef classesToMatch; const char *matching_array[] = {kIODVDMediaClass, kIOCDMediaClass}; char *mediaType = NULL; - kernResult = IOMasterPort( MACH_PORT_NULL, &masterPort ); + kernResult = IOMainPort(MACH_PORT_NULL, &mainPort); if ( KERN_SUCCESS != kernResult ) { - printf( "IOMasterPort returned %d\n", kernResult ); + printf("IOMainPort returned %d\n", kernResult); } int index; @@ -3343,7 +3349,7 @@ static char *FindEjectableOpticalMedia(io_iterator_t *mediaIterator) } CFDictionarySetValue(classesToMatch, CFSTR(kIOMediaEjectableKey), kCFBooleanTrue); - kernResult = IOServiceGetMatchingServices(masterPort, classesToMatch, + kernResult = IOServiceGetMatchingServices(mainPort, classesToMatch, mediaIterator); if (kernResult != KERN_SUCCESS) { error_report("Note: IOServiceGetMatchingServices returned %d", From patchwork Tue Mar 15 12:53:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781407 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2D464C433F5 for ; Tue, 15 Mar 2022 13:06:15 +0000 (UTC) Received: from localhost ([::1]:44088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU6sQ-00089e-9V for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:06:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6hY-0004xx-Nc for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:55:00 -0400 Received: from [2607:f8b0:4864:20::1035] (port=42545 helo=mail-pj1-x1035.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6hX-0007le-1J for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:55:00 -0400 Received: by mail-pj1-x1035.google.com with SMTP id rm8-20020a17090b3ec800b001c55791fdb1so2334496pjb.1 for ; Tue, 15 Mar 2022 05:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ueCRNYHpSl6dEFkGrmfKFWZkvVO5EBSCasWZO0J78vo=; b=kHle3FXStWATN8oCaH+586k6fnLkW0pLwq+zdx6qmVV6ejv4DEmb74FVG0ScV9FjtI g9caa0yxBmjFzwAM3Y0sUqXQ9QqsxMFeJ7hLGncyg59vNBcXuICdxrwUAL4SGYM7Zd90 iEOxp19QV7w9WkDM19AN37MzBkLYgOnIUmUbfHJTtdhPe1o5DqHwyfUNFtPY8npo5/F+ o+SIyzw3V6v9smJocJ29Ul6az1ol1PR3ioI5aX1hypopAML7iokRI43eTFJbiRFooX4+ 5xgI7hgnl/c9PRw26tD+vZc+k2R16Sp6ibwETQ/owJi8+IHXFwwrDAD2m4NSSeXHQ0a5 Dg6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ueCRNYHpSl6dEFkGrmfKFWZkvVO5EBSCasWZO0J78vo=; b=fIwkiwqhpiVsK9TTE2Ae7SqAn9XS6zYBYc56fW5cx8QjW9mtwSE5L3KBtumNXQJZWW vCEmsOl+vNPKSibkGPExgjj4clMytXT0k/wo9+9WCEWlZXQQuggbPaH/8Sazw7tux6HT zyw/UOLKVG93pr177Ske3AT4Uky+OsP4jjWWN09jiOnwd3nrzNQ8SoUbyIjvq4rn90Li 0Sw5Ff3RBRUuWmjfloUCmfjzlZY7FvYZh2oTT8FTlTNggkuyYZig9MG8+ipGj1qKINLm p++8aSkwcyaEdIyefYfmmNrfNCwmmpe47UQ7eYgiQ8cMKg0PXVpZtsbA/RCMd4TV89HZ A2zw== X-Gm-Message-State: AOAM533zYxCdLcFpALLkt5AFsbW6vxWvdLxKzFIA65DE0MKX9R83e/aA 5eLvOHiZjOI1L+S866cXm9Vn/kDsKZU= X-Google-Smtp-Source: ABdhPJwcTpLbiVqLpXvoRbSVZBhz/mgtg1vGSZjmw7JqmkmvOp3Igr+enbWn7zyH8q6TaE/iPFSFlg== X-Received: by 2002:a17:902:cf08:b0:151:9d28:f46f with SMTP id i8-20020a170902cf0800b001519d28f46fmr27840334plg.53.1647348897378; Tue, 15 Mar 2022 05:54:57 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id h8-20020a17090a648800b001bf2b437609sm3152727pjj.24.2022.03.15.05.54.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:54:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 07/21] audio/coreaudio: Remove a deprecation warning on macOS 12 Date: Tue, 15 Mar 2022 13:53:36 +0100 Message-Id: <20220315125350.82452-8-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1035 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pj1-x1035.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki , Roman Bolshakov Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé When building on macOS 12 we get: audio/coreaudio.c:50:5: error: 'kAudioObjectPropertyElementMaster' is deprecated: first deprecated in macOS 12.0 [-Werror,-Wdeprecated-declarations] kAudioObjectPropertyElementMaster ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kAudioObjectPropertyElementMain /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:208:5: note: 'kAudioObjectPropertyElementMaster' has been explicitly marked deprecated here kAudioObjectPropertyElementMaster API_DEPRECATED_WITH_REPLACEMENT("kAudioObjectPropertyElementMain", macos(10.0, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0)) = kAudioObjectPropertyElementMain ^ Replace by kAudioObjectPropertyElementMain, redefining it to kAudioObjectPropertyElementMaster if not available. Suggested-by: Akihiko Odaki Suggested-by: Christian Schoenebeck Suggested-by: Roman Bolshakov Reviewed-by: Christian Schoenebeck Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki Signed-off-by: Philippe Mathieu-Daudé --- audio/coreaudio.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/audio/coreaudio.c b/audio/coreaudio.c index 0f19d0ce01..23d7593eb9 100644 --- a/audio/coreaudio.c +++ b/audio/coreaudio.c @@ -44,10 +44,15 @@ typedef struct coreaudioVoiceOut { bool enabled; } coreaudioVoiceOut; +#if !defined(MAC_OS_VERSION_12_0) \ + || (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_VERSION_12_0) +#define kAudioObjectPropertyElementMain kAudioObjectPropertyElementMaster +#endif + static const AudioObjectPropertyAddress voice_addr = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, - kAudioObjectPropertyElementMaster + kAudioObjectPropertyElementMain }; static OSStatus coreaudio_get_voice(AudioDeviceID *id) @@ -69,7 +74,7 @@ static OSStatus coreaudio_get_framesizerange(AudioDeviceID id, AudioObjectPropertyAddress addr = { kAudioDevicePropertyBufferFrameSizeRange, kAudioDevicePropertyScopeOutput, - kAudioObjectPropertyElementMaster + kAudioObjectPropertyElementMain }; return AudioObjectGetPropertyData(id, @@ -86,7 +91,7 @@ static OSStatus coreaudio_get_framesize(AudioDeviceID id, UInt32 *framesize) AudioObjectPropertyAddress addr = { kAudioDevicePropertyBufferFrameSize, kAudioDevicePropertyScopeOutput, - kAudioObjectPropertyElementMaster + kAudioObjectPropertyElementMain }; return AudioObjectGetPropertyData(id, @@ -103,7 +108,7 @@ static OSStatus coreaudio_set_framesize(AudioDeviceID id, UInt32 *framesize) AudioObjectPropertyAddress addr = { kAudioDevicePropertyBufferFrameSize, kAudioDevicePropertyScopeOutput, - kAudioObjectPropertyElementMaster + kAudioObjectPropertyElementMain }; return AudioObjectSetPropertyData(id, @@ -121,7 +126,7 @@ static OSStatus coreaudio_set_streamformat(AudioDeviceID id, AudioObjectPropertyAddress addr = { kAudioDevicePropertyStreamFormat, kAudioDevicePropertyScopeOutput, - kAudioObjectPropertyElementMaster + kAudioObjectPropertyElementMain }; return AudioObjectSetPropertyData(id, @@ -138,7 +143,7 @@ static OSStatus coreaudio_get_isrunning(AudioDeviceID id, UInt32 *result) AudioObjectPropertyAddress addr = { kAudioDevicePropertyDeviceIsRunning, kAudioDevicePropertyScopeOutput, - kAudioObjectPropertyElementMaster + kAudioObjectPropertyElementMain }; return AudioObjectGetPropertyData(id, From patchwork Tue Mar 15 12:53:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781413 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1B3ABC433F5 for ; Tue, 15 Mar 2022 13:10:37 +0000 (UTC) Received: from localhost ([::1]:56188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU6wd-0007tq-RK for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:10:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6hn-0005AQ-47 for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:55:16 -0400 Received: from [2607:f8b0:4864:20::433] (port=43744 helo=mail-pf1-x433.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6hi-0007y6-Qp for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:55:12 -0400 Received: by mail-pf1-x433.google.com with SMTP id t2so16830246pfj.10 for ; Tue, 15 Mar 2022 05:55:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LG/c+ztFQy+lUqxAjjhbBGZeuruF9FjjhdwvvjkCJJo=; b=Yd1nBQW2mtlGX87fE8YhTjfDA+/bygnMccGLbHCBc5Ic6wzkdc8dtIS7CMnEH4YMNY QJN7Y+M/kVm5sqxYWyfp16L0BVkklkq4gmO11ZUddPyHMUtZ/j4fuvf+wIt4FnXvPbJm MePeVhDnraBFqSki5UlO4rk1vYaKlyVtTwX6WMrXjWIfMGfwi02xvDga9ro/QQdm1wme B1C1Q9iGHuWs9I5O+G9UuLWgDZNkgdAF3jfgLpbrViKMaz1qhc0i3UKAcQ0a21T/wlu8 BkWImlA8vQUwbNfaITF9f1Ndl4fp7R8zC59L55XceEn7bdvzk3Z2mD16SlKB+jaDX1n2 8v4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LG/c+ztFQy+lUqxAjjhbBGZeuruF9FjjhdwvvjkCJJo=; b=3sL1Tr6/bI3aoc0pbBgzS4kPHZ01gjBBW5KxrVU+VyF6ML2stLucxAjHqii9HEcGn2 v/B+mwoc0jLHyHfnMXdCCYoe8hLoKq8PsoKRjl3Omm22bPs8PwUYjZS6GsatYq8A049V hCNcLvkqNliNqATILyFLeht3rsUZEgO/k+50SBTxern0L2rWR52jawa3CPwUgEIHUMRw V7UZXthRImRcfIw1huJhruuwdY9GflnIs2I44uTToV5LQAT6/xWJtS7HWdRRaBosAvw5 yzE6pU2172zCTlVe+HDVWi9ChxMLh24FE7AZLxCHLMmNpyNt/2R4sVcsLD6LSY+W5oOA KuMQ== X-Gm-Message-State: AOAM532Db7Jvnh5rFxJlVdTfHEV8ZiS6xwbZTLGF8Ijuyc6YBvaMt8hS 9qG5IdG3IChYTOimWq8Pk64VXLOcljU= X-Google-Smtp-Source: ABdhPJwR2ib+LSWtnmCU6ZJovLr63O7ttgxztHCXBaaMijW7HjmJO6VeYZheR32W+tAtkxDiQHvcXQ== X-Received: by 2002:a05:6a00:17a6:b0:4f7:d375:ac4c with SMTP id s38-20020a056a0017a600b004f7d375ac4cmr9284541pfg.19.1647348906268; Tue, 15 Mar 2022 05:55:06 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id j6-20020a63b606000000b003808b0ea96fsm19512366pgf.66.2022.03.15.05.55.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:55:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 08/21] audio/dbus: Fix building with modules on macOS Date: Tue, 15 Mar 2022 13:53:37 +0100 Message-Id: <20220315125350.82452-9-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::433 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pf1-x433.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Li Zhang , Christian Schoenebeck , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé When configuring QEMU with --enable-modules we get on macOS: --- stderr --- Dependency ui-dbus cannot be satisfied ui-dbus depends on pixman and opengl, so add these dependencies to audio-dbus. Fixes: 739362d420 ("audio: add "dbus" audio backend") Reviewed-by: Li Zhang Signed-off-by: Philippe Mathieu-Daudé --- audio/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/meson.build b/audio/meson.build index 0ac3791d0b..d9b295514f 100644 --- a/audio/meson.build +++ b/audio/meson.build @@ -28,7 +28,7 @@ endforeach if dbus_display module_ss = ss.source_set() - module_ss.add(when: gio, if_true: files('dbusaudio.c')) + module_ss.add(when: [gio, pixman, opengl, 'CONFIG_GIO'], if_true: files('dbusaudio.c')) audio_modules += {'dbus': module_ss} endif From patchwork Tue Mar 15 12:53:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781414 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 42BDEC433EF for ; Tue, 15 Mar 2022 13:11:49 +0000 (UTC) Received: from localhost ([::1]:58646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU6xo-00016v-3Y for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:11:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6hu-0005CC-NN for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:55:23 -0400 Received: from [2607:f8b0:4864:20::62b] (port=37830 helo=mail-pl1-x62b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6ho-00080S-P8 for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:55:18 -0400 Received: by mail-pl1-x62b.google.com with SMTP id n2so16159434plf.4 for ; Tue, 15 Mar 2022 05:55:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=46NBNvVoysH9eJqR3eLDXH7RhT1oumyXXssv7c0pDs4=; b=f4io/NGfwhnOScwGHCD+cp9MCtYbVyW/+cdsPMUURlxE0QlKDAkV8aXbxApXnmwpq9 HmCfsda5AMaGdBTF1SUpdoOufYFS41oscoau6e/bMPWdtMCY+DrUKokubVXIzEwIvNIK 71+mxYNz1yFI9tAvD3JY99LMvmSnP/C83z9MaA0a2/ICkqObBn6w3zeRpNK8kMxokKsq wJz5ohc+0tPS5HTJLrW0rYEWVkWRigBxJFIN7pmZ0NXDYsxd5z0BDDTj7EO5/Pfom7Sw RhsMgkDg73/snNpaZKy7UZRZmbyMWyUdHcI1GQ9gioHXei2ejxwpcz+J4iCKzi69kq33 BDQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=46NBNvVoysH9eJqR3eLDXH7RhT1oumyXXssv7c0pDs4=; b=3ms02HaXJG2DAp/sqiv7S87DKlqaHtIFlqnB/3uj56etwvRXtwHNfcIbjVmXaSjDiA HCa900K59nSt0S2/XD9dBTzc+x1LJ6c4i9XfvemRUyHa3vnr3XwEHAs/qXsmP7C2/b8v ejKL5G4YYH03VkY1+E/5KeIrLvqdSq5eSJGk0unfxBK/qzuQfj2eOovcTkQJ0aEjAEG6 19htJLdQ+xiTtAtpAJlQttF3kxuxr7UhSYnz9YUlazQ4HoIXxbqWcU2FnF1JEzyR8nkW d0tR72bdss6bmdRu/H1YUhdIwx5g63WE1g60d1b4WkRa7LppAJlFdZb0fCYoNQUdl4+N Pf9w== X-Gm-Message-State: AOAM530oK9lxOx6aZ/VzM2XaSfWIrpycVe3xku46tIP1mT5HmlWFfC5U jrqDqSaZ+7yTtz4YZkAbwYJxY508vgo= X-Google-Smtp-Source: ABdhPJzBGKRkVO3KvNuBv2svgV/0Ojcyi9y18VrVjfN/usJJ9x8NBG0yQPfnNGvw3aDjNgJFLcW6xw== X-Received: by 2002:a17:90a:5643:b0:1bf:ac1f:a1de with SMTP id d3-20020a17090a564300b001bfac1fa1demr4405183pji.224.1647348914792; Tue, 15 Mar 2022 05:55:14 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id w6-20020a17090a460600b001bf355e964fsm3099227pjg.0.2022.03.15.05.55.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:55:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 09/21] audio: Log context for audio bug Date: Tue, 15 Mar 2022 13:53:38 +0100 Message-Id: <20220315125350.82452-10-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62b (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pl1-x62b.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Akihiko Odaki Without this change audio_bug aborts when the bug condition is met, which discards following useful logs. Call abort after such logs. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220306063202.27331-1-akihiko.odaki@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- audio/audio.c | 25 ++++++++++++------------- audio/audio_template.h | 27 ++++++++++++--------------- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index a88572e713..6bc313d9f5 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -117,7 +117,6 @@ int audio_bug (const char *funcname, int cond) AUD_log (NULL, "I am sorry\n"); } AUD_log (NULL, "Context:\n"); - abort(); } return cond; @@ -138,7 +137,7 @@ static inline int audio_bits_to_index (int bits) default: audio_bug ("bits_to_index", 1); AUD_log (NULL, "invalid bits %d\n", bits); - return 0; + abort(); } } @@ -156,7 +155,7 @@ void *audio_calloc (const char *funcname, int nmemb, size_t size) AUD_log (NULL, "%s passed invalid arguments to audio_calloc\n", funcname); AUD_log (NULL, "nmemb=%d size=%zu (len=%zu)\n", nmemb, size, len); - return NULL; + abort(); } return g_malloc0 (len); @@ -543,7 +542,7 @@ static size_t audio_pcm_hw_get_live_in(HWVoiceIn *hw) size_t live = hw->total_samples_captured - audio_pcm_hw_find_min_in (hw); if (audio_bug(__func__, live > hw->conv_buf->size)) { dolog("live=%zu hw->conv_buf->size=%zu\n", live, hw->conv_buf->size); - return 0; + abort(); } return live; } @@ -581,7 +580,7 @@ static size_t audio_pcm_sw_read(SWVoiceIn *sw, void *buf, size_t size) } if (audio_bug(__func__, live > hw->conv_buf->size)) { dolog("live_in=%zu hw->conv_buf->size=%zu\n", live, hw->conv_buf->size); - return 0; + abort(); } rpos = audio_ring_posb(hw->conv_buf->pos, live, hw->conv_buf->size); @@ -656,7 +655,7 @@ static size_t audio_pcm_hw_get_live_out (HWVoiceOut *hw, int *nb_live) if (audio_bug(__func__, live > hw->mix_buf->size)) { dolog("live=%zu hw->mix_buf->size=%zu\n", live, hw->mix_buf->size); - return 0; + abort(); } return live; } @@ -706,7 +705,7 @@ static size_t audio_pcm_sw_write(SWVoiceOut *sw, void *buf, size_t size) live = sw->total_hw_samples_mixed; if (audio_bug(__func__, live > hwsamples)) { dolog("live=%zu hw->mix_buf->size=%zu\n", live, hwsamples); - return 0; + abort(); } if (live == hwsamples) { @@ -998,7 +997,7 @@ static size_t audio_get_avail (SWVoiceIn *sw) if (audio_bug(__func__, live > sw->hw->conv_buf->size)) { dolog("live=%zu sw->hw->conv_buf->size=%zu\n", live, sw->hw->conv_buf->size); - return 0; + abort(); } ldebug ( @@ -1028,7 +1027,7 @@ static size_t audio_get_free(SWVoiceOut *sw) if (audio_bug(__func__, live > sw->hw->mix_buf->size)) { dolog("live=%zu sw->hw->mix_buf->size=%zu\n", live, sw->hw->mix_buf->size); - return 0; + abort(); } dead = sw->hw->mix_buf->size - live; @@ -1170,7 +1169,7 @@ static void audio_run_out (AudioState *s) if (audio_bug(__func__, live > hw->mix_buf->size)) { dolog("live=%zu hw->mix_buf->size=%zu\n", live, hw->mix_buf->size); - continue; + abort(); } if (hw->pending_disable && !nb_live) { @@ -1203,7 +1202,7 @@ static void audio_run_out (AudioState *s) if (audio_bug(__func__, hw->mix_buf->pos >= hw->mix_buf->size)) { dolog("hw->mix_buf->pos=%zu hw->mix_buf->size=%zu played=%zu\n", hw->mix_buf->pos, hw->mix_buf->size, played); - hw->mix_buf->pos = 0; + abort(); } #ifdef DEBUG_OUT @@ -1223,7 +1222,7 @@ static void audio_run_out (AudioState *s) if (audio_bug(__func__, played > sw->total_hw_samples_mixed)) { dolog("played=%zu sw->total_hw_samples_mixed=%zu\n", played, sw->total_hw_samples_mixed); - played = sw->total_hw_samples_mixed; + abort(); } sw->total_hw_samples_mixed -= played; @@ -1346,7 +1345,7 @@ static void audio_run_capture (AudioState *s) if (audio_bug(__func__, captured > sw->total_hw_samples_mixed)) { dolog("captured=%zu sw->total_hw_samples_mixed=%zu\n", captured, sw->total_hw_samples_mixed); - captured = sw->total_hw_samples_mixed; + abort(); } sw->total_hw_samples_mixed -= captured; diff --git a/audio/audio_template.h b/audio/audio_template.h index d2d348638b..7192b19e73 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -59,12 +59,13 @@ static void glue(audio_init_nb_voices_, TYPE)(AudioState *s, if (audio_bug(__func__, !voice_size && max_voices)) { dolog ("drv=`%s' voice_size=0 max_voices=%d\n", drv->name, max_voices); - glue (s->nb_hw_voices_, TYPE) = 0; + abort(); } if (audio_bug(__func__, voice_size && !max_voices)) { dolog ("drv=`%s' voice_size=%d max_voices=0\n", drv->name, voice_size); + abort(); } } @@ -81,6 +82,7 @@ static void glue(audio_pcm_hw_alloc_resources_, TYPE)(HW *hw) size_t samples = hw->samples; if (audio_bug(__func__, samples == 0)) { dolog("Attempted to allocate empty buffer\n"); + abort(); } HWBUF = g_malloc0(sizeof(STSampleBuffer) + sizeof(st_sample) * samples); @@ -252,12 +254,12 @@ static HW *glue(audio_pcm_hw_add_new_, TYPE)(AudioState *s, if (audio_bug(__func__, !drv)) { dolog ("No host audio driver\n"); - return NULL; + abort(); } if (audio_bug(__func__, !drv->pcm_ops)) { dolog ("Host audio driver without pcm_ops\n"); - return NULL; + abort(); } hw = audio_calloc(__func__, 1, glue(drv->voice_size_, TYPE)); @@ -275,12 +277,13 @@ static HW *glue(audio_pcm_hw_add_new_, TYPE)(AudioState *s, QLIST_INIT (&hw->cap_head); #endif if (glue (hw->pcm_ops->init_, TYPE) (hw, as, s->drv_opaque)) { - goto err0; + g_free(hw); + return NULL; } if (audio_bug(__func__, hw->samples <= 0)) { dolog("hw->samples=%zd\n", hw->samples); - goto err1; + abort(); } if (hw->info.is_float) { @@ -309,12 +312,6 @@ static HW *glue(audio_pcm_hw_add_new_, TYPE)(AudioState *s, audio_attach_capture (hw); #endif return hw; - - err1: - glue (hw->pcm_ops->fini_, TYPE) (hw); - err0: - g_free (hw); - return NULL; } AudiodevPerDirectionOptions *glue(audio_get_pdo_, TYPE)(Audiodev *dev) @@ -435,7 +432,7 @@ void glue (AUD_close_, TYPE) (QEMUSoundCard *card, SW *sw) if (sw) { if (audio_bug(__func__, !card)) { dolog ("card=%p\n", card); - return; + abort(); } glue (audio_close_, TYPE) (sw); @@ -457,7 +454,7 @@ SW *glue (AUD_open_, TYPE) ( if (audio_bug(__func__, !card || !name || !callback_fn || !as)) { dolog ("card=%p name=%p callback_fn=%p as=%p\n", card, name, callback_fn, as); - goto fail; + abort(); } s = card->state; @@ -468,12 +465,12 @@ SW *glue (AUD_open_, TYPE) ( if (audio_bug(__func__, audio_validate_settings(as))) { audio_print_settings (as); - goto fail; + abort(); } if (audio_bug(__func__, !s->drv)) { dolog ("Can not open `%s' (no host audio driver)\n", name); - goto fail; + abort(); } if (sw && audio_pcm_info_eq (&sw->info, as)) { From patchwork Tue Mar 15 12:53:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781416 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C5567C433F5 for ; Tue, 15 Mar 2022 13:13:54 +0000 (UTC) Received: from localhost ([::1]:35874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU6zp-0004tI-Sb for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:13:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6i6-0005L9-Qi for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:55:34 -0400 Received: from [2607:f8b0:4864:20::42d] (port=44610 helo=mail-pf1-x42d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6hx-00084m-A2 for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:55:26 -0400 Received: by mail-pf1-x42d.google.com with SMTP id u17so17346157pfk.11 for ; Tue, 15 Mar 2022 05:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4Tp3WhNKm8JxXl/T2EoFZ8o3VjhBm7jaY9n4gps6ekw=; b=bQR6UdtxGZ2y7/OxggowNfVB4Zll4W5Ngz3CsdhrLluJiS8yKIunwF7aKbPDvf+xBj UVsjfZOH0+DAD3LHsBHTfxkoVVchhK50ixkLZA9tSLtuBugzmIrrnSjfYlluQGr1N/1Y 5oj0OqeWbUyU8A8uu+6vfiwMEYoHVHujdCT8WiJAYYmeCFxbjrlvuGadBeiAbKTKU6Sm zvmrmzJLJesSyP90lJb+3ALS8N8nUjBRNGyLDBlCGiLYcd3JdUX0kcIBBArw2Oom/l3d HKjx8eEj3cqkVqREVjAg4p/xwj9w2uvSJ/4Em6PtwaM3fG2yUvBeCbS3YNIvKl0pin+o FT2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4Tp3WhNKm8JxXl/T2EoFZ8o3VjhBm7jaY9n4gps6ekw=; b=p3lXorBEQNk6pp6G0M2b1tgNfQp6+v7Zql75Roy/+03KNzT1ZT/0S/qjkLJPWChObJ 7lEI71q5COuCjkeBnnJ1q10HyAo9lfTKv3Y0O1VOlOGAKbsssR0FviuIvHsjpI1HM+ks CDDag5/Q7FnLcuSgWt9OcmRMb2XZ9O/3/0xf7+rR7TmybrlQbggaRLvDUsdOqaJQIn8/ A3mI2j950fnZS5zTWQMxOSdjA849SuFGrhk7Iqdgzj1dzpQWKKvW24cOrYCHrHQIAc0E wUI1XtUMK+h9TotIm1phBXZG/K+UpkWsJ7ec4JdG64bcMJoPoPGKeKWSswKHwVO6PfKl 5LsQ== X-Gm-Message-State: AOAM531JGfG8lJtM7kf7qe0EztuABfR8K8OBZnWSymzxUEgK5SSH5u/F eNiKc3uAiPuK207AIL7VGUlEYyriGGw= X-Google-Smtp-Source: ABdhPJy/dj4hIlgzEvC/MGrwmDYrSI587xI8JN37IbGaVY0JUEE4RSwHv/cNDdTGpqHmAYCh292epw== X-Received: by 2002:a63:2003:0:b0:381:2dd3:ab4b with SMTP id g3-20020a632003000000b003812dd3ab4bmr11641620pgg.517.1647348923390; Tue, 15 Mar 2022 05:55:23 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id g7-20020a656cc7000000b00375948e63d6sm18838537pgw.91.2022.03.15.05.55.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:55:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 10/21] coreaudio: Always return 0 in handle_voice_change Date: Tue, 15 Mar 2022 13:53:39 +0100 Message-Id: <20220315125350.82452-11-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::42d (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pf1-x42d.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Akihiko Odaki handle_voice_change() is a CoreAudio callback function as of CoreAudio type AudioObjectPropertyListenerProc, and for the latter MacOSX.sdk/System/ Library/Frameworks/CoreAudio.framework/Headers/AudioHardware.h says "The return value is currently unused and should always be 0.". Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220306123410.61063-1-akihiko.odaki@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- audio/coreaudio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/audio/coreaudio.c b/audio/coreaudio.c index 23d7593eb9..3186b68474 100644 --- a/audio/coreaudio.c +++ b/audio/coreaudio.c @@ -545,7 +545,6 @@ static OSStatus handle_voice_change( const AudioObjectPropertyAddress *in_addresses, void *in_client_data) { - OSStatus status; coreaudioVoiceOut *core = in_client_data; qemu_mutex_lock_iothread(); @@ -554,13 +553,12 @@ static OSStatus handle_voice_change( fini_out_device(core); } - status = init_out_device(core); - if (!status) { + if (!init_out_device(core)) { update_device_playback_state(core); } qemu_mutex_unlock_iothread(); - return status; + return 0; } static int coreaudio_init_out(HWVoiceOut *hw, struct audsettings *as, From patchwork Tue Mar 15 12:53:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781405 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 36BF5C433FE for ; Tue, 15 Mar 2022 13:04:14 +0000 (UTC) Received: from localhost ([::1]:40254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU6qT-0005TG-3m for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:04:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6i8-0005QB-Dr for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:55:36 -0400 Received: from [2607:f8b0:4864:20::431] (port=39781 helo=mail-pf1-x431.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6i6-0008AI-GP for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:55:36 -0400 Received: by mail-pf1-x431.google.com with SMTP id h2so15530232pfh.6 for ; Tue, 15 Mar 2022 05:55:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ldn2Z6B3k3Plt1cJVie4T8Wt19hcp59Igf8ZqI/jiUE=; b=Rte72YRN+lAsESV89Z25RtrpkBvAcfUaul4iVNjO/qbKpdNLnEQNsPthtdH3gol4kq 0MfMUMogqoSYZXEBuxanFUUQUalVDo20scmQl74N96C51J360TGGASOmaAkFQ9x+cgY9 VQbjq+I4CgKAt3FYYSmOTf+O+8bzGQkWZ1b4PTQoDfXoiQY5M3ljjXlPBE3s9QEhY3+6 Cxr+yr7MQ+c/FqlVNtS4fgi0enPAfaV8WCL9MwFeWZrDnEZnX4jVQY5TTNK0QFI/8nCD gmnlkhiJ6gvibzxz7c185YShnYgE7Voo63mIWVMW49bDvw8L34bLCgLNmbKSlYfDwxj8 D2eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ldn2Z6B3k3Plt1cJVie4T8Wt19hcp59Igf8ZqI/jiUE=; b=e/oKGxiGDSx3qnYu1FR7l3E7M/nqrkzsILP5VMASRehxTqSikt/UtYLMgekaBkfOV3 2IqW2+pIQckigqyLo9F6yxFw1AAO/mKdQ4h8dq//fO4tmfgF+LNIrCuliLrO4qWBBUyh PDodO1jlwvjN+UxZJ0dhm4lgbfnAwmuim8GG2x9LMX+4y/D35hwGWTp0yY40Q6ujuvr/ 8dCWjxrryzxJZFwqUdjs/oprPOurN3A4EN+PZg7T28w8R8qqxsnSvXRsSWQf3sXJdT0y qrUct1zkde7DvgK53n5lWSvw1jkRrn6/0+J/B+OiU+xEDqKsvzg0EslyWTVy0gbZgJGb PMRQ== X-Gm-Message-State: AOAM533L25gXK+ojcwpwAkNLhbiz1jkuyEw6humBC97AgQwkJoHUiCaF DDa30j3wx+JAOL5ivz3Uxxz0p8CtZas= X-Google-Smtp-Source: ABdhPJz4414xLW+uPuQKNtVwZBmEoEmsC+Vy1/RkkVdw0NFdFG1wA754cKIXRH67qa2HlF1luTBAhA== X-Received: by 2002:a62:f203:0:b0:4f6:f330:7e56 with SMTP id m3-20020a62f203000000b004f6f3307e56mr28729241pfh.49.1647348931980; Tue, 15 Mar 2022 05:55:31 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id f13-20020a056a0022cd00b004f7eaac852dsm6096212pfj.151.2022.03.15.05.55.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:55:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 11/21] audio: Rename coreaudio extension to use Objective-C compiler Date: Tue, 15 Mar 2022 13:53:40 +0100 Message-Id: <20220315125350.82452-12-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::431 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pf1-x431.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé The coreaudio library includes Objective-C declarations (using the caret '^' symbol to declare block references [*]). When building with a C compiler we get: [175/839] Compiling C object libcommon.fa.p/audio_coreaudio.c.o In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h:18, from ../../audio/coreaudio.c:26: /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardware.h:162:2: error: expected identifier or '(' before '^' token 162 | (^AudioObjectPropertyListenerBlock)( UInt32 inNumberAddresses, | ^ FAILED: libcommon.fa.p/audio_coreaudio.c.o Rename the file to use the Objective-C default extension (.m) so meson calls the correct compiler. [*] https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithBlocks/WorkingwithBlocks.html Reviewed-by: Christian Schoenebeck Signed-off-by: Philippe Mathieu-Daudé --- audio/{coreaudio.c => coreaudio.m} | 0 audio/meson.build | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename audio/{coreaudio.c => coreaudio.m} (100%) diff --git a/audio/coreaudio.c b/audio/coreaudio.m similarity index 100% rename from audio/coreaudio.c rename to audio/coreaudio.m diff --git a/audio/meson.build b/audio/meson.build index d9b295514f..94dab16891 100644 --- a/audio/meson.build +++ b/audio/meson.build @@ -7,7 +7,7 @@ softmmu_ss.add(files( 'wavcapture.c', )) -softmmu_ss.add(when: coreaudio, if_true: files('coreaudio.c')) +softmmu_ss.add(when: coreaudio, if_true: files('coreaudio.m')) softmmu_ss.add(when: dsound, if_true: files('dsoundaudio.c', 'audio_win_int.c')) audio_modules = {} From patchwork Tue Mar 15 12:53:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781412 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A2645C4332F for ; Tue, 15 Mar 2022 13:09:09 +0000 (UTC) Received: from localhost ([::1]:52750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU6vE-0005bj-Hi for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:09:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6iF-0005ZR-VG for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:55:45 -0400 Received: from [2607:f8b0:4864:20::429] (port=36850 helo=mail-pf1-x429.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6iE-0008Bm-Gk for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:55:43 -0400 Received: by mail-pf1-x429.google.com with SMTP id z16so19539966pfh.3 for ; Tue, 15 Mar 2022 05:55:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T/cRYsvljJjM7J77pLO7Mi0qGdNpxLyCaN5IKbfOo00=; b=dAbqaDhhfcsAkPwfe/G5FX4sIbY3PkzZmZjGi5k/QILSZNxnmnNcgreRypR8x09vKF QJXXy0wNjLMRPUKFEcH76Isy0oQYJDKv3tvqXDt+IMahyTfv81AtMi3UgVAEn2JRsXn+ hpKzjBRUPIVv6Mk9EcBT5VpAHrWzVUmqJKe9gFwKDo1e62c0ImArzXsnIs2L2LY19V1t 4nbQfzW+ArwobFDY/9Q8CsWupZghdT3Co+7T6D0KV5N3/wJdmfL1vv8HKB6EhUAQ3e61 AkTo0gNliQ/+M339Ox4X6Hh+zztWz9j/jMU+9J1P1++9oCt8m2CDiglQL/F+aOI+5X/v 1kTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T/cRYsvljJjM7J77pLO7Mi0qGdNpxLyCaN5IKbfOo00=; b=X113bSotkqv2VOkJdL5pPy4N684C8m13Wa39Y9R9DOuvQLwmwaJLkvPliO+ZhacNmU j8o1sfy11yAoZGuswaHltehmG6KFWbBo8XMZJXilNzfZkTZ74iN6K4y8mphfvCnS5jbD s8qvOJKxeWrP3HNVnfs53uvGsP7c40ZNGS1crTRRLfbKhpKVCsiOLOag5kpklaHRTl3B 9D98/7EMeNDkdwUBJLZ0pbc+gDFClFxvUrAOjONPPwfsT6fDpaCQ0ONsXkNWuNamnPgS kLFt9w++AR1VGTqAJmDQLRjor3U4bHH7/RB9ZTBrXHH0uVTULd3X76GYOSrZcjVNJ13p vFEw== X-Gm-Message-State: AOAM5327CkcKJBa/o5VpDbzHDAXXg/S1b8soSK8A/CDlkEjEjixIabi7 b2N6/YsVH0WUiq21V2jS7OuR8U7yK0U= X-Google-Smtp-Source: ABdhPJx0m1gMeQ9Lv+CJ+s8cbqOIV+r+IZRPpfEiwhr386lDAQmMuwnFie9iUgWdzbBk15jCHVFFAw== X-Received: by 2002:a63:ec16:0:b0:381:6a51:6231 with SMTP id j22-20020a63ec16000000b003816a516231mr1842456pgh.189.1647348940471; Tue, 15 Mar 2022 05:55:40 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id s1-20020a056a00178100b004f731a1a952sm25717785pfg.168.2022.03.15.05.55.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:55:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 12/21] osdep: Avoid using Clang-specific __builtin_available() Date: Tue, 15 Mar 2022 13:53:41 +0100 Message-Id: <20220315125350.82452-13-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::429 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pf1-x429.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Remove the Clang specific __builtin_available() to allow building with GCC, otherwise we get: include/qemu/osdep.h: In function 'qemu_thread_jit_write': include/qemu/osdep.h:787:9: warning: implicit declaration of function '__builtin_available'; did you mean '__builtin_scalbl'? [-Wimplicit-function-declaration] 787 | if (__builtin_available(macOS 11.0, *)) { | ^~~~~~~~~~~~~~~~~~~ | __builtin_scalbl include/qemu/osdep.h:787:9: warning: nested extern declaration of '__builtin_available' [-Wnested-externs] include/qemu/osdep.h:787:29: error: 'macOS' undeclared (first use in this function) 787 | if (__builtin_available(macOS 11.0, *)) { | ^~~~~ include/qemu/osdep.h:787:29: note: each undeclared identifier is reported only once for each function it appears in include/qemu/osdep.h:787:34: error: expected ')' before numeric constant 787 | if (__builtin_available(macOS 11.0, *)) { | ~ ^~~~~ | ) Beside, on macOS Catalina we get 2254 times: include/qemu/osdep.h:780:5: warning: 'pthread_jit_write_protect_np' is only available on macOS 11.0 or newer [-Wunguarded-availability-new] pthread_jit_write_protect_np(true); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix by using a stricker toolchain version low range, replacing MAC_OS_X_VERSION_MAX_ALLOWED by MAC_OS_X_VERSION_MIN_REQUIRED. Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/osdep.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index c9ec7830c9..322103aadb 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -624,19 +624,15 @@ size_t qemu_get_host_physmem(void); * for the current thread. */ #if defined(MAC_OS_VERSION_11_0) && \ - MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0 + MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_11_0 static inline void qemu_thread_jit_execute(void) { - if (__builtin_available(macOS 11.0, *)) { - pthread_jit_write_protect_np(true); - } + pthread_jit_write_protect_np(true); } static inline void qemu_thread_jit_write(void) { - if (__builtin_available(macOS 11.0, *)) { - pthread_jit_write_protect_np(false); - } + pthread_jit_write_protect_np(false); } #else static inline void qemu_thread_jit_write(void) {} From patchwork Tue Mar 15 12:53:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781415 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6F638C433EF for ; Tue, 15 Mar 2022 13:12:32 +0000 (UTC) Received: from localhost ([::1]:33032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU6yV-0002wV-IP for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:12:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6iR-0005dA-Hg for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:55:57 -0400 Received: from [2607:f8b0:4864:20::636] (port=40511 helo=mail-pl1-x636.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6iM-0008Cd-Eg for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:55:51 -0400 Received: by mail-pl1-x636.google.com with SMTP id h5so14792143plf.7 for ; Tue, 15 Mar 2022 05:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KNSrqoEq2GhUevDTVk/vUxoGKtaQfRE5FRcTgjCh7JE=; b=D16b8kP7WZ0UZar4yxnBdthqem5/SJs9xdC6OPinOWKfjNU7yhnKCySKQcAKVZs1DF 9ZjSwKD0lr3N6qTAp2modP4OXYUuAkDH+dq+1sJlHmsIC2xNMcS+Vtvne5zkW7GKhKNb uSKbZRJY+RKEuRMn8Q7zWdkTN3I2DO4NxGxdA5OE6XMrcccgKaLPSKq0XXfrMms226eM a+2J25v4gFmFtZUrK6l9Gn5cLFEiJhTmXo68HdO30IYnK2SalW1n8Ke8mZ7IPAIl9rgu LHhC9gNFhy2Y6djnECwlOnTnCmZ4PsS7vRnAHk7gwM7QOWP8UI71hraIIr4/Y+hKuwxl /Ivg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KNSrqoEq2GhUevDTVk/vUxoGKtaQfRE5FRcTgjCh7JE=; b=ldCeBDbJvdp8TsMuBwafkgecC4pRn8gyzNv5z62YWZP0GsdIXAS2bpAdP2dMpz7Y9Y xcB+PG6F9fPhxW8T/Mmc7CEl0yGbcm2k27PfH8oNuHbx1+tG2dqnD51bBgSwrCD/LpYb mYmJuw0kVjaalefV2etJfm7eTnQOshiB9Ft15h0KVhEdtP+RcNvSPEVEs7912uxvYHgO Mk1m4U4v+KQ2UlzocbVROEOckjki+D3dMHUSr+J1905/vEhEvRWzfnh/mrL71PqPtva7 L379S9aBiODXrGPM7lUBhhu7xSs3LaOfpe45iRLQ6F4i5fQsiDQo5a5ePJCtrmhV6yNy Gd7w== X-Gm-Message-State: AOAM53250GeiaiyLcQrMooaZKGFizBMrJ27kYzA+X8QcANGYYQy7MsCi WHdMVaZVK5kJ/FwIsMvg2ZUrQNQcqnY= X-Google-Smtp-Source: ABdhPJzDuxlfZfC/cIa0mt/e6k0NVvj86L+eOm4gjjABp9ahjUdRqRo4lSJ5m312vBsgHrjBIX5eIA== X-Received: by 2002:a17:902:d4c6:b0:151:d21c:7eb7 with SMTP id o6-20020a170902d4c600b00151d21c7eb7mr28120340plg.148.1647348949008; Tue, 15 Mar 2022 05:55:49 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id d16-20020a17090ad99000b001bcbc4247a0sm3034474pjv.57.2022.03.15.05.55.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:55:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 13/21] meson: Resolve the entitlement.sh script once for good Date: Tue, 15 Mar 2022 13:53:42 +0100 Message-Id: <20220315125350.82452-14-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::636 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pl1-x636.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Commit 235b523dba ("meson: Use find_program() to resolve the entitlement.sh script") didn't correctly fixed the issue, as the script is still resolved for each target. Move the check earlier, before processing each target. Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki Signed-off-by: Philippe Mathieu-Daudé --- meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 351f9f4360..6e8fa4ab31 100644 --- a/meson.build +++ b/meson.build @@ -3073,6 +3073,10 @@ common_all = static_library('common', feature_to_c = find_program('scripts/feature_to_c.sh') +if targetos == 'darwin' + entitlement = find_program('scripts/entitlement.sh') +endif + emulators = {} foreach target : target_dirs config_target = config_target_mak[target] @@ -3230,7 +3234,6 @@ foreach target : target_dirs install_input += meson.current_source_dir() / entitlements endif - entitlement = find_program('scripts/entitlement.sh') emulators += {exe['name'] : custom_target(exe['name'], input: build_input, output: exe['name'], From patchwork Tue Mar 15 12:53:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781424 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1D1F1C433F5 for ; Tue, 15 Mar 2022 13:14:50 +0000 (UTC) Received: from localhost ([::1]:37786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU70j-00069t-3M for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:14:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6ik-0005km-C6 for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:56:14 -0400 Received: from [2607:f8b0:4864:20::102b] (port=40460 helo=mail-pj1-x102b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6ii-0008Da-S6 for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:56:14 -0400 Received: by mail-pj1-x102b.google.com with SMTP id mv14-20020a17090b198e00b001c64b23f5b0so712836pjb.5 for ; Tue, 15 Mar 2022 05:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QMyzk5TbfTma9V9T5wnA+JkeOowwITQ4Gqp93IqPrDk=; b=Uxo8gSyvxbJO2lZOlRbMpKtZTCG60N1+r7nNZcsy0c2MFjTN0FdcOjPlUjYjUgxMVz YKRbNOkNk52ATyNamIKTLij2JDXcNI5Z+Xpfx5P8WuwkiYUJ9oC6V8+gf46R49mom9xR UJXRW+CEqWoZY1bOlYSxPfzSOJEoJqOUcnUhpaimNmVPDHthRvTKY2Pz4J38Y4xjiz5D AbcyfPaQJTLEIQBcrCnAzfHM/8hch5yrf7tZ2cvL71SKR4iN9kjrXavVQopEThRUPmHP 9lzeLQJvCUqVbUSQFggUUTFD2ysnEB0/Pdqhciy8A3yCzB9q1PtDh4NYYxh56P0GAXyU eQhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QMyzk5TbfTma9V9T5wnA+JkeOowwITQ4Gqp93IqPrDk=; b=IMAG6VP2OfRYN/VqSCsdVxm/SzIrE6uyUZSbuDc26vakQFklMYqo6DYeARn404MTid 3L82So4cetUJk4GFqpcnclM6NuyG0hBTKn1QDXMUn+N9rhvF+FPe7023FYKcE85NNTuR 25/Q1GqS+3vGIAhU7uvSHVanYnWVRee+8Qco36e3LQYa5uCGAURs8xvVdyPE0sv2frad ZjKlvJthWC5twN1sFu+ViqB75FOKUlbC9bYyB7TdwGfpqxd1RQabbZnFIeTFTAFsP+Z/ vXLFC6uMAhiERQI+udV6TIcHTNDzMvce01SqwGOLh0R8Ni3WjtiBl+0eH7winta4N80W DfPw== X-Gm-Message-State: AOAM532fBSyA86idcVSIY2j5yZnaye8syjh5YHEiOiwvfHWcPOKo0ARp pFuFkwRr/pFFyYAZFMDqkE6Hh5a3lek= X-Google-Smtp-Source: ABdhPJzOFcu/dTHpCEjZqTWmwxGnPbLeADXeGARFTJADzu7lvOkGsyGZH57vTHWJgsMPYJVXqJXaEg== X-Received: by 2002:a17:90b:250f:b0:1b8:f257:c39 with SMTP id ns15-20020a17090b250f00b001b8f2570c39mr4375597pjb.135.1647348957177; Tue, 15 Mar 2022 05:55:57 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id t6-20020a63b246000000b0038085c0a9d7sm19601367pgo.49.2022.03.15.05.55.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:55:56 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 14/21] meson: Log QEMU_CXXFLAGS content in summary Date: Tue, 15 Mar 2022 13:53:43 +0100 Message-Id: <20220315125350.82452-15-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102b (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pj1-x102b.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki Signed-off-by: Philippe Mathieu-Daudé --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index 6e8fa4ab31..5fed23847b 100644 --- a/meson.build +++ b/meson.build @@ -3480,6 +3480,7 @@ if link_args.length() > 0 summary_info += {'LDFLAGS': ' '.join(link_args)} endif summary_info += {'QEMU_CFLAGS': config_host['QEMU_CFLAGS']} +summary_info += {'QEMU_CXXFLAGS': config_host['QEMU_CXXFLAGS']} summary_info += {'QEMU_LDFLAGS': config_host['QEMU_LDFLAGS']} summary_info += {'profiler': get_option('profiler')} summary_info += {'link-time optimization (LTO)': get_option('b_lto')} From patchwork Tue Mar 15 12:53:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781427 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id CB69FC433F5 for ; Tue, 15 Mar 2022 13:17:28 +0000 (UTC) Received: from localhost ([::1]:44280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU73H-0002Fw-Vw for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:17:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6ik-0005kx-JC for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:56:14 -0400 Received: from [2607:f8b0:4864:20::102a] (port=37843 helo=mail-pj1-x102a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6ii-0008Fm-Sc for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:56:14 -0400 Received: by mail-pj1-x102a.google.com with SMTP id lj8-20020a17090b344800b001bfaa46bca3so2232949pjb.2 for ; Tue, 15 Mar 2022 05:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tMw9uEt6EjoDEMpxmCEU8mo4kl9R3ksIy7H1DqcYAjY=; b=O3dXa2n6/5qitSZ5DWrHJfe2MLHfagC4ttSvejrWI7qMuoXdNSAxU+P78/nla87/L8 nQgU2M+qxDV2w1Ti3rmmFl7SQoPF9A7cKYHNgU7JIO2XDJD21gfH/LfaHPXnky4FMpc4 pGNQd+OwXTy40WhG0NjJUc6/cGbK5nIgAjsRUK8I8GNRAkVsPzeHEjrvKITHpUU1AxvX tkjmK2IoGqAxbIIx7uaYxOPss5H2S+FK869l4gMs0iwZHdRtync925B+3b1S33+1wxok NZ1jA9loRKZiZuWZiz3eSef9dm8Nar4RSKggRy4dfixHameeBq8v/8bx3EBRaf9TGj5I +5mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tMw9uEt6EjoDEMpxmCEU8mo4kl9R3ksIy7H1DqcYAjY=; b=KkcOTo/ahwpzho6S3xoUVfAb5RpyHV71UR2RAKIvevDmWEFbazE95GHnynG5JtZImD JMx8AkWznysZMtHFZw7wP0BqsUvZ8+C6Gw1EBWWX1kxSHsU2GSOFZa3In2wKBoKQ/HH+ 0eBfS+mctMkFE7CF5YVQ8dKSJTW/uD8qYhD/earVBW/kVam+Cdjv3Kotd9tpOef1wHfo cSscUJ21eEd9ATsN1iJYPD6UwBDnYbRqTpOKZcckjlyw+EBYZf1v26Bf1sCPts5yduq4 a/XP4EcZjNF3U+KPHfb/5FZGFN9ASMcNoVmXjnyfyqWl7IBFXiEW64uTflgNoDAUq0Bq oPyg== X-Gm-Message-State: AOAM531rFjCmjB3OcOmBBg3ET5OqgU64sTo0VU/UNh2VBhWgmpUylLWg 6DG0pjf785VPla8wO/j24QQqQL8zlFQ= X-Google-Smtp-Source: ABdhPJxqKRbyEq1snPVGQGrNPMhyk5jM3tGv9nD+Cmhe36dBH3b7cTWgB3wSYyQGEXWdruqZ0GJe9Q== X-Received: by 2002:a17:902:e949:b0:14d:8ab1:919 with SMTP id b9-20020a170902e94900b0014d8ab10919mr28296478pll.122.1647348965963; Tue, 15 Mar 2022 05:56:05 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id lp4-20020a17090b4a8400b001bedba2df04sm3396289pjb.30.2022.03.15.05.56.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:56:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 15/21] configure: Pass filtered QEMU_OBJCFLAGS to meson Date: Tue, 15 Mar 2022 13:53:44 +0100 Message-Id: <20220315125350.82452-16-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102a (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pj1-x102a.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki , Paolo Bonzini Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Filter unsupported Objective-C options, to avoid 'unknown-warning-option' warnings when using Clang: [34/373] Compiling Objective-C object libcommon.fa.p/audio_coreaudio.m.o warning: unknown warning option '-Wold-style-declaration'; did you mean '-Wout-of-line-declaration'? [-Wunknown-warning-option] warning: unknown warning option '-Wimplicit-fallthrough=2'; did you mean '-Wimplicit-fallthrough'? [-Wunknown-warning-option] 2 warnings generated. Acked-by: Paolo Bonzini Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki Signed-off-by: Philippe Mathieu-Daudé --- configure | 23 +++++++++++++++++++++++ meson.build | 6 +++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 2bf40d9eeb..cd4946b43e 100755 --- a/configure +++ b/configure @@ -77,6 +77,7 @@ TMPB="qemu-conf" TMPC="${TMPDIR1}/${TMPB}.c" TMPO="${TMPDIR1}/${TMPB}.o" TMPCXX="${TMPDIR1}/${TMPB}.cxx" +TMPM="${TMPDIR1}/${TMPB}.m" TMPE="${TMPDIR1}/${TMPB}.exe" rm -f config.log @@ -148,6 +149,10 @@ do_cxx() { do_compiler "$cxx" $CPU_CFLAGS "$@" } +do_objc() { + do_compiler "$objcc" $CPU_CFLAGS "$@" +} + # Append $2 to the variable named $1, with space separation add_to() { eval $1=\${$1:+\"\$$1 \"}\$2 @@ -1445,10 +1450,27 @@ cc_has_warning_flag() { compile_prog "-Werror $optflag" "" } +objcc_has_warning_flag() { + cat > $TMPM <> $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 +echo "QEMU_OBJCFLAGS=$QEMU_OBJCFLAGS" >> $config_host_mak echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak echo "GLIB_LIBS=$glib_libs" >> $config_host_mak echo "GLIB_VERSION=$(pkg-config --modversion glib-2.0)" >> $config_host_mak diff --git a/meson.build b/meson.build index 5fed23847b..cb24d30697 100644 --- a/meson.build +++ b/meson.build @@ -173,11 +173,13 @@ endif qemu_cflags = config_host['QEMU_CFLAGS'].split() qemu_cxxflags = config_host['QEMU_CXXFLAGS'].split() +qemu_objcflags = config_host['QEMU_OBJCFLAGS'].split() qemu_ldflags = config_host['QEMU_LDFLAGS'].split() if get_option('gprof') qemu_cflags += ['-p'] qemu_cxxflags += ['-p'] + qemu_objcflags += ['-p'] qemu_ldflags += ['-p'] endif @@ -216,8 +218,9 @@ if get_option('fuzzing') endif endif -add_global_arguments(qemu_cflags, native: false, language: ['c', 'objc']) +add_global_arguments(qemu_cflags, native: false, language: ['c']) add_global_arguments(qemu_cxxflags, native: false, language: ['cpp']) +add_global_arguments(qemu_objcflags, native: false, language: ['objc']) add_global_link_arguments(qemu_ldflags, native: false, language: ['c', 'cpp', 'objc']) if targetos == 'linux' @@ -3481,6 +3484,7 @@ if link_args.length() > 0 endif summary_info += {'QEMU_CFLAGS': config_host['QEMU_CFLAGS']} summary_info += {'QEMU_CXXFLAGS': config_host['QEMU_CXXFLAGS']} +summary_info += {'QEMU_OBJCFLAGS': config_host['QEMU_OBJCFLAGS']} summary_info += {'QEMU_LDFLAGS': config_host['QEMU_LDFLAGS']} summary_info += {'profiler': get_option('profiler')} summary_info += {'link-time optimization (LTO)': get_option('b_lto')} From patchwork Tue Mar 15 12:53:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781429 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 20866C433EF for ; Tue, 15 Mar 2022 13:20:33 +0000 (UTC) Received: from localhost ([::1]:50422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU76F-0006dn-Tp for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:20:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6in-0005tb-K0 for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:56:17 -0400 Received: from [2607:f8b0:4864:20::434] (port=40917 helo=mail-pf1-x434.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6im-0008Gz-3D for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:56:17 -0400 Received: by mail-pf1-x434.google.com with SMTP id d19so12239726pfv.7 for ; Tue, 15 Mar 2022 05:56:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=szNpCULTdSVW6/SnQzOqZ1askH+O+tpqopbhblHKbSM=; b=CUxmM3FMqmt5HN3dQTIto35KC3jr+nILU/t9RJxMtBM1/nqxOcHpXsQT6U+Ms+xeOs gY/V1M3Nk8sdhZbckAvXFiP/gm8HR8Iuvep/aMJuJUYCEbKHYEOVMVA/hQR9LE2JlaqJ +QrF6LXsNlpww3cS57ChP2icY64SwABJyUqhK0pi9cBsiYoK67GmERrDZNqRW9na8ZM6 2TcR3D4aXUtnVo3NwbKqvAOJjxi3Xh+erErBBR9U1HZaiZBfgBn/DUTOZHLgPSLwk4eQ X7CWffsMGm/T5whYUjmjuDHhuUzT0UviHuc0ayhofGlWJZhntjV4vY/iPRWfobAL7eid 28YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=szNpCULTdSVW6/SnQzOqZ1askH+O+tpqopbhblHKbSM=; b=aKKk2basoBASLYfpzEodbKJfLiTAA2rbqfeaR/ngrBrLb+v3vNNbbm5cIm7uELhGXA C6MOaWqehrrUW7Jg9vUUjIfxgsWd10X1A0yqr5hmonVRoe8OPc6mRCTSsjY/QtX0hDiG tjGg+ZnFPnC+dX0dOT9ReEbbzRpFnkO9RJmv8DWoqypWl/YgrC5WGUrwbTFig9CjFndI q8IgIXyvZbP5HjbiiqiBvtuDJl8VfKVoxcWGV7x384CXBVy8Cy/BkaHarN8kNBmNZ0W/ yRd3ZlwHv3rMEoAtUEV1DFBbAuft4tX3uMWyO4O6KQ/13Rj9GURtUJ85iPxHNMZgh+yy ghGg== X-Gm-Message-State: AOAM532ApyxW2H6xadOO6Y06Hukw++XQWqwFkDMHl0lyyo+Rbygdh4F0 Lz8dxSqpvAVr9EtgQdA3QYe6Jj8fd7U= X-Google-Smtp-Source: ABdhPJyfiIiA7Vnb4RgLoScuq9De/tTOOJY6LBljFbTj5zzZn+6kogf+98x3SVR6VAljty/JYxy3BQ== X-Received: by 2002:a63:5747:0:b0:381:54b9:b083 with SMTP id h7-20020a635747000000b0038154b9b083mr4347776pgm.178.1647348974632; Tue, 15 Mar 2022 05:56:14 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id s21-20020a63dc15000000b00378c9e5b37fsm19158234pgg.63.2022.03.15.05.56.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:56:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 16/21] ui/cocoa: Constify qkeycode translation arrays Date: Tue, 15 Mar 2022 13:53:45 +0100 Message-Id: <20220315125350.82452-17-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::434 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pf1-x434.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Christian Schoenebeck , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Reported-by: Peter Maydell Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki Signed-off-by: Philippe Mathieu-Daudé --- ui/cocoa.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index c88149852b..a66ba3d7b6 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -671,7 +671,7 @@ QemuCocoaView *cocoaView; /* translates Macintosh keycodes to QEMU's keysym */ - int without_control_translation[] = { + static const int without_control_translation[] = { [0 ... 0xff] = 0, // invalid key [kVK_UpArrow] = QEMU_KEY_UP, @@ -686,7 +686,7 @@ QemuCocoaView *cocoaView; [kVK_Delete] = QEMU_KEY_BACKSPACE, }; - int with_control_translation[] = { + static const int with_control_translation[] = { [0 ... 0xff] = 0, // invalid key [kVK_UpArrow] = QEMU_KEY_CTRL_UP, From patchwork Tue Mar 15 12:53:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781430 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EE2ADC433F5 for ; Tue, 15 Mar 2022 13:23:38 +0000 (UTC) Received: from localhost ([::1]:57216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU79F-00030l-LI for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:23:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6iw-00064r-JD for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:56:28 -0400 Received: from [2607:f8b0:4864:20::102e] (port=36406 helo=mail-pj1-x102e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6iv-0008Jy-2p for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:56:26 -0400 Received: by mail-pj1-x102e.google.com with SMTP id kx6-20020a17090b228600b001bf859159bfso2239641pjb.1 for ; Tue, 15 Mar 2022 05:56:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=d1A01qt64fth03kaxOvkd6uuWOpE/ywgplyaseYZCZk=; b=Qq9+1eiHw8njqJjOPIDuxI8M/uc8gVFsvwZE34fb6ixQgz0lFsuOYI/PSBmTQU2QNf FI0Mg4s+YPOFqcHNL8eCa8rUt0Y04vOES2I73XZm2tKDz3KfSdE5TgKzYV6H5GaFI/E7 ZvS7uaPSnC7PyGUBGUw00JeeIpA5aVMZsnS8dbNiTIe2OXPWldA5p37OO0pcweXRwR7/ Y8o0oQPK7wDCUZG6vBNLlsuikOXZFz2/gueu2VdLFsX2G46vsx1FU10ZbfV4IgcKN1H+ vu+5A9GX8MQFpp+7rRqd0mLMIpC0UH3k8S/Se6nK0ipjylZOvzwNOVotpzrRK9g82UTd xenQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=d1A01qt64fth03kaxOvkd6uuWOpE/ywgplyaseYZCZk=; b=c5l1WV2gBFhEfJEWJQEWu5jjHRAQuMHzoHWOIwoV6/uQxtSKtoIGZG3gFJzFfpeeZb 2IXkBOhEGctpgty0oVUyv6EGGumW1QA2f1mt3XZGOD2l8LNO67sF1trYnJyBLYV/yZBF kGGlHzd7gk+5h9ACMtda+4ffJiuY2+nD6xUyf1r7lqQcAJ9paDXQstGST+ZeJjyLgIRW 95VfWtLAv8VbYTfZJU2/79oLa11JPQuNRvXJHPZYrOOBm4pNZIQIOrZX/nHVQxy5ZxKP wOxRc/PxiD7G7tYvkPqNZlPiTrTnKZ7J/NacOEc53hngDUua/wax3RBbsFbcy8xoG/t7 1LNg== X-Gm-Message-State: AOAM533vbqahM4lT9hPcL+250+f8W98hhR8Y94ErNmoA3wI7mATI29LR EXc9T2xTZhjEvvHwhJOu3/yLKSrjYUg= X-Google-Smtp-Source: ABdhPJxKA+w3ppZkxrOiKiUsq+kne0AQIE94pOt+b6BSNQqKXC6qEa4xZMnhVYtN6NnjQMXFDJNcAA== X-Received: by 2002:a17:90b:4f8c:b0:1bf:3ef:d668 with SMTP id qe12-20020a17090b4f8c00b001bf03efd668mr4356528pjb.219.1647348983430; Tue, 15 Mar 2022 05:56:23 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id v7-20020a637a07000000b0037c9268a310sm20730135pgc.3.2022.03.15.05.56.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:56:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 17/21] ui/cocoa: add option to disable left-command forwarding to guest Date: Tue, 15 Mar 2022 13:53:46 +0100 Message-Id: <20220315125350.82452-18-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pj1-x102e.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki , Carwyn Ellis Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Carwyn Ellis When switching between guest and host on a Mac using command-tab the command key is sent to the guest which can trigger functionality in the guest OS. Specifying left-command-key=off disables forwarding this key to the guest. Defaults to enabled. Also updated the cocoa display documentation to reference the new left-command-key option along with the existing show-cursor option. Signed-off-by: Carwyn Ellis Reviewed-by: Akihiko Odaki [PMD: Set QAPI structure @since tag to 7.0] Signed-off-by: Philippe Mathieu-Daudé --- qapi/ui.json | 18 ++++++++++++++++++ qemu-options.hx | 12 ++++++++++++ ui/cocoa.m | 8 +++++++- 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/qapi/ui.json b/qapi/ui.json index 4a13f883a3..4dea35a819 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1260,6 +1260,23 @@ { 'struct' : 'DisplayCurses', 'data' : { '*charset' : 'str' } } +## +# @DisplayCocoa: +# +# Cocoa display options. +# +# @left-command-key: Enable/disable forwarding of left command key to +# guest. Allows command-tab window switching on the +# host without sending this key to the guest when +# "off". Defaults to "on" +# +# Since: 7.0 +## +{ 'struct': 'DisplayCocoa', + 'data': { + '*left-command-key': 'bool' + } } + ## # @DisplayType: # @@ -1338,6 +1355,7 @@ 'discriminator' : 'type', 'data' : { 'gtk': { 'type': 'DisplayGTK', 'if': 'CONFIG_GTK' }, + 'cocoa': { 'type': 'DisplayCocoa', 'if': 'CONFIG_COCOA' }, 'curses': { 'type': 'DisplayCurses', 'if': 'CONFIG_CURSES' }, 'egl-headless': { 'type': 'DisplayEGLHeadless', 'if': { 'all': ['CONFIG_OPENGL', 'CONFIG_GBM'] } }, diff --git a/qemu-options.hx b/qemu-options.hx index 5ce0ada75e..f464b2fe27 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1922,6 +1922,9 @@ DEF("display", HAS_ARG, QEMU_OPTION_display, #if defined(CONFIG_DBUS_DISPLAY) "-display dbus[,addr=]\n" " [,gl=on|core|es|off][,rendernode=]\n" +#endif +#if defined(CONFIG_COCOA) + "-display cocoa[,show-cursor=on|off][,left-command-key=on|off]\n" #endif "-display none\n" " select display backend type\n" @@ -2009,6 +2012,15 @@ SRST ``charset=CP850`` for IBM CP850 encoding. The default is ``CP437``. + ``cocoa`` + Display video output in a Cocoa window. Mac only. This interface + provides drop-down menus and other UI elements to configure and + control the VM during runtime. Valid parameters are: + + ``show-cursor=on|off`` : Force showing the mouse cursor + + ``left-command-key=on|off`` : Disable forwarding left command key to host + ``egl-headless[,rendernode=]`` Offload all OpenGL operations to a local DRI device. For any graphical display, this display needs to be paired with either diff --git a/ui/cocoa.m b/ui/cocoa.m index a66ba3d7b6..1aa51c42dc 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -95,6 +95,7 @@ static DisplayChangeListener dcl = { }; static int last_buttons; static int cursor_hide = 1; +static int left_command_key_enabled = 1; static int gArgc; static char **gArgv; @@ -853,7 +854,8 @@ QemuCocoaView *cocoaView; /* Don't pass command key changes to guest unless mouse is grabbed */ case kVK_Command: if (isMouseGrabbed && - !!(modifiers & NSEventModifierFlagCommand)) { + !!(modifiers & NSEventModifierFlagCommand) && + left_command_key_enabled) { [self toggleKey:Q_KEY_CODE_META_L]; } break; @@ -2002,6 +2004,10 @@ static void cocoa_display_init(DisplayState *ds, DisplayOptions *opts) cursor_hide = 0; } + if (opts->u.cocoa.has_left_command_key && !opts->u.cocoa.left_command_key) { + left_command_key_enabled = 0; + } + // register vga output callbacks register_displaychangelistener(&dcl); From patchwork Tue Mar 15 12:53:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781436 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C75EAC433F5 for ; Tue, 15 Mar 2022 13:26:19 +0000 (UTC) Received: from localhost ([::1]:36736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU7Bq-0008N4-Lo for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:26:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6j5-00067f-MD for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:56:35 -0400 Received: from [2607:f8b0:4864:20::42f] (port=42948 helo=mail-pf1-x42f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6j4-0008Mx-86 for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:56:35 -0400 Received: by mail-pf1-x42f.google.com with SMTP id g19so19516828pfc.9 for ; Tue, 15 Mar 2022 05:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bJ+xYho0owtYa0dAkkWst9IQeYoMpitj3quG69XsFTE=; b=FEt7vJYIU0dLuI6rQPnJnUehNYMEF2DrG2iwESnmN91V82hN9/u+EMpbbtqJsDLsMK ryxDQ7IdURiHBgng91TQBxvl/p2Av9bKfOwHG4T1QIOxQF5qjSafTi4pk49akShcpSDF RAST8CtJO20W3QZfWkqXfXZPqKY9Ezqk54vdwmVjywEhTjfLf/2IPXp51ZV+0jajybOR VizefuUbx2hAHe9KuCWcL1ZCnZ6cK4FlnJB96HZWz0WUFIEDd+67xrYUa8hA6mT2EtAU b/G+ZFs0HQXpdmz6jCy9+2CDRHstJSnxVIE+fJ5IP7aZG6ivUNk4mIwLBQiKu10oYjI5 RA4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bJ+xYho0owtYa0dAkkWst9IQeYoMpitj3quG69XsFTE=; b=oTIF9EUuCqsCao1NsV2tQ4awGW2WWgFFZay56lTERs5wDyl89GFAWuwWpN2KL5ZU2f 5CRjwjHPCClc54FCwdBTpvfWUpH3pLtIZfgamM97EVLEhn267F7e1Q5qX5LrQrY4PtuI Lqe+0JFiLqU6145U4J9uw7kQ7qG24cu3B+L1qnl3mvDyKS1zOhncV91Rj2Li4Bj4tkfq cTOOJ2ufSC+q7HbcLN6q+lzN314oni3JUHq+si1SPUY5i+FqHxK9T0SxLeP9l/HEqm/S Sm536NH2fFh5xGQwLtt9cSR+IIRnCRuQR6WxZ3hZmfag52xCYKMD2tvlG+Za00CJtJeJ HA/A== X-Gm-Message-State: AOAM531XBMp3+v9O03Pvz/fR/cLGwognb5/lug0WXyyDMRdQ8QnTjo+J yLxaPuqkQUhqg8iAqvsxAskuviJqUoY= X-Google-Smtp-Source: ABdhPJzLbVcXv+z6L9N8QueG8Q+9AC3NGhBr2OCoHIdPaFfJY8sa6oUIPGMb+hI1ArVzWIalMv3QeQ== X-Received: by 2002:aa7:9e07:0:b0:4f6:a7e3:1b57 with SMTP id y7-20020aa79e07000000b004f6a7e31b57mr27926193pfq.13.1647348992689; Tue, 15 Mar 2022 05:56:32 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id s15-20020a63af4f000000b0037c8875108dsm20460209pgo.45.2022.03.15.05.56.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:56:32 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 18/21] ui/cocoa: release mouse when user switches away from QEMU window Date: Tue, 15 Mar 2022 13:53:47 +0100 Message-Id: <20220315125350.82452-19-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::42f (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pf1-x42f.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki , Carwyn Ellis Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Carwyn Ellis This resolves an issue where using command-tab to switch between QEMU and other windows on the host can leave the mouse pointer visible. By releasing the mouse when the user switches away, the user must left click on the QEMU window when switching back in order to hide the pointer and return control to the guest. This appraoch ensures that the calls to NSCursor hide and unhide are always balanced and thus work correctly when invoked. Signed-off-by: Carwyn Ellis Reviewed-by: Akihiko Odaki Signed-off-by: Philippe Mathieu-Daudé --- ui/cocoa.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/cocoa.m b/ui/cocoa.m index 1aa51c42dc..d20c74d938 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -1261,6 +1261,7 @@ QemuCocoaView *cocoaView; - (void) applicationWillResignActive: (NSNotification *)aNotification { COCOA_DEBUG("QemuCocoaAppController: applicationWillResignActive\n"); + [cocoaView ungrabMouse]; [cocoaView raiseAllKeys]; } @@ -2000,6 +2001,7 @@ static void cocoa_display_init(DisplayState *ds, DisplayOptions *opts) [(QemuCocoaAppController *)[[NSApplication sharedApplication] delegate] toggleFullScreen: nil]; }); } + if (opts->has_show_cursor && opts->show_cursor) { cursor_hide = 0; } From patchwork Tue Mar 15 12:53:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781426 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1D1B1C433EF for ; Tue, 15 Mar 2022 13:16:41 +0000 (UTC) Received: from localhost ([::1]:42266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU72W-0000sU-9e for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:16:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6jF-0006Ge-DF for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:56:46 -0400 Received: from [2607:f8b0:4864:20::102c] (port=52925 helo=mail-pj1-x102c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6jD-0008Ok-Iy for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:56:45 -0400 Received: by mail-pj1-x102c.google.com with SMTP id v4so17760828pjh.2 for ; Tue, 15 Mar 2022 05:56:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cp2luTFte3kbxSMNp6E3C1qzy0FoiKBclAzxIMfHyn0=; b=cXJ2C+NQQ50S+HtaBaKXHh+m38R02OGuiJrL5TF257tUKAfloqT3OszKD97rP2jJZ5 TditMYQ5fa1AQEukxw4B9pNYDYZfiESWz2ojUnoaWstZzyBW34BdKB4OlP6ZsWx/1rBV XjYCdpuwwnQeWTxQSEivMJi+ERi5LpeRTvd/9+6RS9gxl0p5ARkNIuwgmGnfgMv7ZPXc baYy1CNDtzaVHoEW6cOUtlUSu4gzZ+h3eeHL9xn2dpo2S4aXIqMMlCd70AAPu2IzkiBi gEqkIQ11smxHAuSnb7q1J22wiEhabVlZ8Ofw+tw+cOEXpwD8HDc6ZJz2kkABJgIjcLHj H1DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cp2luTFte3kbxSMNp6E3C1qzy0FoiKBclAzxIMfHyn0=; b=s6D7yTZnKmwJqPwJE5g1jWqAE3VV1kS03BeOvbarqo8tHhQk6aCwJgyQvoePyFJ3F2 spmTmyzsQuohBvY3bVp3RKPXlA3/tM2G1rpYJzWxjmu59/ANsN5jpT0KkmbkxH0kjG3r HedgzrjYOY8A5V/KPnzG42B5UpLlYhVv1U/M2rS+0MW6apkwKNUh6TjqZyusVbIBunE+ /BDhmj6CmhvO4NhJqFOeTLIhqF/iuRGqAQ8hGxUeNFcM+NFVVgkd4Qi9vYH4P6JX0Z4L qv3xRLXq6xjyJOG6pExUW+mJAMi1yDk2/41Itd5v9yLx9A+wN6Dx4IyZKTgbhY6Y4JuK +9Lg== X-Gm-Message-State: AOAM532OEZJa6V0hQv1WbAOMt5rpo43JcGQVdZ+Zgz54XG3S/VcPuyJE tJncD75LKmpmdY8DoGrLXCXb72Ttqc0= X-Google-Smtp-Source: ABdhPJzZ8HPGQqTEly/k39RI+5sSPYQctQNdaMu79YJWYnAyw7SbEcxOpFApoea3PAnNohwcSzYXtQ== X-Received: by 2002:a17:90a:4f0b:b0:1be:e320:3e62 with SMTP id p11-20020a17090a4f0b00b001bee3203e62mr4452674pjh.124.1647349002075; Tue, 15 Mar 2022 05:56:42 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id mt15-20020a17090b230f00b001bf191e6f08sm3140247pjb.9.2022.03.15.05.56.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:56:41 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 19/21] ui/cocoa: capture all keys and combos when mouse is grabbed Date: Tue, 15 Mar 2022 13:53:48 +0100 Message-Id: <20220315125350.82452-20-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102c (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pj1-x102c.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Markus Armbruster , Roman Bolshakov , Will Cohen , Gerd Hoffmann , Akihiko Odaki , Gustavo Noronha Silva Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Gustavo Noronha Silva Applications such as Gnome may use Alt-Tab and Super-Tab for different purposes, some use Ctrl-arrows so we want to allow qemu to handle everything when it captures the mouse/keyboard. However, Mac OS handles some combos like Command-Tab and Ctrl-arrows at an earlier part of the event handling chain, not letting qemu see it. We add a global Event Tap that allows qemu to see all events when the mouse is grabbed. Note that this requires additional permissions. See: https://developer.apple.com/documentation/coregraphics/1454426-cgeventtapcreate?language=objc#discussion https://support.apple.com/en-in/guide/mac-help/mh32356/mac Acked-by: Markus Armbruster Signed-off-by: Gustavo Noronha Silva Message-Id: <20210713213200.2547-2-gustavo@noronha.dev.br> Signed-off-by: Akihiko Odaki Message-Id: <20220306121119.45631-2-akihiko.odaki@gmail.com> Reviewed-by: Will Cohen Signed-off-by: Philippe Mathieu-Daudé --- qapi/ui.json | 8 +++++- qemu-options.hx | 3 +++ ui/cocoa.m | 65 ++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 74 insertions(+), 2 deletions(-) diff --git a/qapi/ui.json b/qapi/ui.json index 4dea35a819..1d60d5fc78 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1270,11 +1270,17 @@ # host without sending this key to the guest when # "off". Defaults to "on" # +# @full-grab: Capture all key presses, including system combos. This +# requires accessibility permissions, since it performs +# a global grab on key events. (default: off) +# See https://support.apple.com/en-in/guide/mac-help/mh32356/mac +# # Since: 7.0 ## { 'struct': 'DisplayCocoa', 'data': { - '*left-command-key': 'bool' + '*left-command-key': 'bool', + '*full-grab': 'bool' } } ## diff --git a/qemu-options.hx b/qemu-options.hx index f464b2fe27..4395378bb8 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1916,6 +1916,9 @@ DEF("display", HAS_ARG, QEMU_OPTION_display, #if defined(CONFIG_CURSES) "-display curses[,charset=]\n" #endif +#if defined(CONFIG_COCOA) + "-display cocoa[,full_grab=on|off]\n" +#endif #if defined(CONFIG_OPENGL) "-display egl-headless[,rendernode=]\n" #endif diff --git a/ui/cocoa.m b/ui/cocoa.m index d20c74d938..b1250b7408 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -309,11 +309,13 @@ static void handleAnyDeviceErrors(Error * err) BOOL isMouseGrabbed; BOOL isFullscreen; BOOL isAbsoluteEnabled; + CFMachPortRef eventsTap; } - (void) switchSurface:(pixman_image_t *)image; - (void) grabMouse; - (void) ungrabMouse; - (void) toggleFullScreen:(id)sender; +- (void) setFullGrab:(id)sender; - (void) handleMonitorInput:(NSEvent *)event; - (bool) handleEvent:(NSEvent *)event; - (bool) handleEventLocked:(NSEvent *)event; @@ -336,6 +338,19 @@ static void handleAnyDeviceErrors(Error * err) QemuCocoaView *cocoaView; +static CGEventRef handleTapEvent(CGEventTapProxy proxy, CGEventType type, CGEventRef cgEvent, void *userInfo) +{ + QemuCocoaView *cocoaView = userInfo; + NSEvent *event = [NSEvent eventWithCGEvent:cgEvent]; + if ([cocoaView isMouseGrabbed] && [cocoaView handleEvent:event]) { + COCOA_DEBUG("Global events tap: qemu handled the event, capturing!\n"); + return NULL; + } + COCOA_DEBUG("Global events tap: qemu did not handle the event, letting it through...\n"); + + return cgEvent; +} + @implementation QemuCocoaView - (id)initWithFrame:(NSRect)frameRect { @@ -361,6 +376,11 @@ QemuCocoaView *cocoaView; } qkbd_state_free(kbd); + + if (eventsTap) { + CFRelease(eventsTap); + } + [super dealloc]; } @@ -655,6 +675,36 @@ QemuCocoaView *cocoaView; } } +- (void) setFullGrab:(id)sender +{ + COCOA_DEBUG("QemuCocoaView: setFullGrab\n"); + + CGEventMask mask = CGEventMaskBit(kCGEventKeyDown) | CGEventMaskBit(kCGEventKeyUp) | CGEventMaskBit(kCGEventFlagsChanged); + eventsTap = CGEventTapCreate(kCGHIDEventTap, kCGHeadInsertEventTap, kCGEventTapOptionDefault, + mask, handleTapEvent, self); + if (!eventsTap) { + warn_report("Could not create event tap, system key combos will not be captured.\n"); + return; + } else { + COCOA_DEBUG("Global events tap created! Will capture system key combos.\n"); + } + + CFRunLoopRef runLoop = CFRunLoopGetCurrent(); + if (!runLoop) { + warn_report("Could not obtain current CF RunLoop, system key combos will not be captured.\n"); + return; + } + + CFRunLoopSourceRef tapEventsSrc = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, eventsTap, 0); + if (!tapEventsSrc ) { + warn_report("Could not obtain current CF RunLoop, system key combos will not be captured.\n"); + return; + } + + CFRunLoopAddSource(runLoop, tapEventsSrc, kCFRunLoopDefaultMode); + CFRelease(tapEventsSrc); +} + - (void) toggleKey: (int)keycode { qkbd_state_key_event(kbd, keycode, !qkbd_state_key_get(kbd, keycode)); } @@ -1281,6 +1331,13 @@ QemuCocoaView *cocoaView; [cocoaView toggleFullScreen:sender]; } +- (void) setFullGrab:(id)sender +{ + COCOA_DEBUG("QemuCocoaAppController: setFullGrab\n"); + + [cocoaView setFullGrab:sender]; +} + /* Tries to find then open the specified filename */ - (void) openDocumentation: (NSString *) filename { @@ -1994,11 +2051,17 @@ static void cocoa_display_init(DisplayState *ds, DisplayOptions *opts) qemu_sem_wait(&app_started_sem); COCOA_DEBUG("cocoa_display_init: app start completed\n"); + QemuCocoaAppController *controller = (QemuCocoaAppController *)[[NSApplication sharedApplication] delegate]; /* if fullscreen mode is to be used */ if (opts->has_full_screen && opts->full_screen) { dispatch_async(dispatch_get_main_queue(), ^{ [NSApp activateIgnoringOtherApps: YES]; - [(QemuCocoaAppController *)[[NSApplication sharedApplication] delegate] toggleFullScreen: nil]; + [controller toggleFullScreen: nil]; + }); + } + if (opts->u.cocoa.has_full_grab && opts->u.cocoa.full_grab) { + dispatch_async(dispatch_get_main_queue(), ^{ + [controller setFullGrab: nil]; }); } From patchwork Tue Mar 15 12:53:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781425 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2E1A3C433F5 for ; Tue, 15 Mar 2022 13:15:58 +0000 (UTC) Received: from localhost ([::1]:39728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU71p-0007UW-5y for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:15:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6jT-0006Qv-EL for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:57:01 -0400 Received: from [2607:f8b0:4864:20::631] (port=39779 helo=mail-pl1-x631.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6jM-0008PQ-Om for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:56:55 -0400 Received: by mail-pl1-x631.google.com with SMTP id d18so1041169plr.6 for ; Tue, 15 Mar 2022 05:56:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vYFANfPw5nDDGgg96defaMHr7oYmGpXFM3N22eSSDec=; b=IFv4c2N+CR/59XMV/PnJT++cTRmXOsQba30oxFk7nE++LyGQ/3s/ymfPUoYv1VDdDA ujfY1Xyi/u9Ihy48jEW/nTsYuBL2fKeIyProDoBKqYAfop+AB2mZNnHrNL3sZKiDkWfV yoIf7DjHS658sH7P7AerXuQtK/vKgVUBV8cSl+3/H3b1FplVgBl8VJwW+mPuxu2oJLci 9UINZ3gdc1DVewGxl03sANF0AVEWmza/2ZyJlGfPYPQ8rETvd9Xyit4CSKxgNF+ywaEc 0oP/rkHHdiumzoJfmIc5/sGYwD9pMlFWG1xb/vhv+f1imLjoobeE/jeLexpnr2zDOeVT qkSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vYFANfPw5nDDGgg96defaMHr7oYmGpXFM3N22eSSDec=; b=GWCgr4X8KLdUUizYWNqhmid7er7TB0n+2HoRbL904oPBhji/vzlf9HnQRmwDXPiI5w umtw5IDlNfLVxTIXyjyx1zMtRgbmpy6ZDVYv+4j8wOaPvnruMrmRr3CU083rbjKErknD GcX6D4ldck3Np3+v0EDC2D/51nzVH9cS2P3ze1kakCFG3QI/sm3Zhe+egHZj2xM8HorV Yx0mkUyGKvG+9Dt7PGNfi+/1+NlS3yMU2DgKxODFnZIUFfQMprGlTRWraIKUWhBk8L0p R1G/JmbDhPjY51gjb8UW01BPhSCrbY6ePOCpFhqyoYYwvJK3Tcz7uKYMRkWaTn7A9iVc 4S3w== X-Gm-Message-State: AOAM5306RFECwHYUlUSUuBisKP2B16zthIfXZna7U78v+V31XrfUWh2K QaTsjE8/Ufe48kV9Io95i3Ii3slrJQE= X-Google-Smtp-Source: ABdhPJynvNRGngGvoed6IoIGM9adoxBtgeg0HQ3ybQbGrDRI1Zze2QSTJxbpxcAXHeuB4kVPDJc9vg== X-Received: by 2002:a17:90b:224d:b0:1bf:73a5:ff7f with SMTP id hk13-20020a17090b224d00b001bf73a5ff7fmr4469924pjb.164.1647349011266; Tue, 15 Mar 2022 05:56:51 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id m11-20020a17090a3f8b00b001bc299e0aefsm2991174pjc.56.2022.03.15.05.56.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:56:50 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 20/21] ui/cocoa: add option to swap Option and Command Date: Tue, 15 Mar 2022 13:53:49 +0100 Message-Id: <20220315125350.82452-21-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::631 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pl1-x631.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Cameron Esfahani , Markus Armbruster , Roman Bolshakov , Will Cohen , Gerd Hoffmann , Akihiko Odaki , Gustavo Noronha Silva Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Gustavo Noronha Silva On Mac OS X the Option key maps to Alt and Command to Super/Meta. This change swaps them around so that Alt is the key closer to the space bar and Meta/Super is between Control and Alt, like on non-Mac keyboards. It is a cocoa display option, disabled by default. Acked-by: Markus Armbruster Signed-off-by: Gustavo Noronha Silva Message-Id: <20210713213200.2547-3-gustavo@noronha.dev.br> Signed-off-by: Akihiko Odaki Message-Id: <20220306121119.45631-3-akihiko.odaki@gmail.com> Reviewed-by: Will Cohen Signed-off-by: Philippe Mathieu-Daudé --- qapi/ui.json | 7 ++++++- qemu-options.hx | 2 +- ui/cocoa.m | 49 +++++++++++++++++++++++++++++++++++++++---------- 3 files changed, 46 insertions(+), 12 deletions(-) diff --git a/qapi/ui.json b/qapi/ui.json index 1d60d5fc78..664da9e462 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1275,12 +1275,17 @@ # a global grab on key events. (default: off) # See https://support.apple.com/en-in/guide/mac-help/mh32356/mac # +# @swap-opt-cmd: Swap the Option and Command keys so that their key codes match +# their position on non-Mac keyboards and you can use Meta/Super +# and Alt where you expect them. (default: off) +# # Since: 7.0 ## { 'struct': 'DisplayCocoa', 'data': { '*left-command-key': 'bool', - '*full-grab': 'bool' + '*full-grab': 'bool', + '*swap-opt-cmd': 'bool' } } ## diff --git a/qemu-options.hx b/qemu-options.hx index 4395378bb8..58f2f76775 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1917,7 +1917,7 @@ DEF("display", HAS_ARG, QEMU_OPTION_display, "-display curses[,charset=]\n" #endif #if defined(CONFIG_COCOA) - "-display cocoa[,full_grab=on|off]\n" + "-display cocoa[,full-grab=on|off][,swap-opt-cmd=on|off]\n" #endif #if defined(CONFIG_OPENGL) "-display egl-headless[,rendernode=]\n" diff --git a/ui/cocoa.m b/ui/cocoa.m index b1250b7408..cb6e7c41dc 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -96,6 +96,7 @@ static DisplayChangeListener dcl = { static int last_buttons; static int cursor_hide = 1; static int left_command_key_enabled = 1; +static bool swap_opt_cmd; static int gArgc; static char **gArgv; @@ -854,12 +855,22 @@ static CGEventRef handleTapEvent(CGEventTapProxy proxy, CGEventType type, CGEven qkbd_state_key_event(kbd, Q_KEY_CODE_CTRL_R, false); } if (!(modifiers & NSEventModifierFlagOption)) { - qkbd_state_key_event(kbd, Q_KEY_CODE_ALT, false); - qkbd_state_key_event(kbd, Q_KEY_CODE_ALT_R, false); + if (swap_opt_cmd) { + qkbd_state_key_event(kbd, Q_KEY_CODE_META_L, false); + qkbd_state_key_event(kbd, Q_KEY_CODE_META_R, false); + } else { + qkbd_state_key_event(kbd, Q_KEY_CODE_ALT, false); + qkbd_state_key_event(kbd, Q_KEY_CODE_ALT_R, false); + } } if (!(modifiers & NSEventModifierFlagCommand)) { - qkbd_state_key_event(kbd, Q_KEY_CODE_META_L, false); - qkbd_state_key_event(kbd, Q_KEY_CODE_META_R, false); + if (swap_opt_cmd) { + qkbd_state_key_event(kbd, Q_KEY_CODE_ALT, false); + qkbd_state_key_event(kbd, Q_KEY_CODE_ALT_R, false); + } else { + qkbd_state_key_event(kbd, Q_KEY_CODE_META_L, false); + qkbd_state_key_event(kbd, Q_KEY_CODE_META_R, false); + } } switch ([event type]) { @@ -891,29 +902,44 @@ static CGEventRef handleTapEvent(CGEventTapProxy proxy, CGEventType type, CGEven case kVK_Option: if (!!(modifiers & NSEventModifierFlagOption)) { - [self toggleKey:Q_KEY_CODE_ALT]; + if (swap_opt_cmd) { + [self toggleKey:Q_KEY_CODE_META_L]; + } else { + [self toggleKey:Q_KEY_CODE_ALT]; + } } break; case kVK_RightOption: if (!!(modifiers & NSEventModifierFlagOption)) { - [self toggleKey:Q_KEY_CODE_ALT_R]; + if (swap_opt_cmd) { + [self toggleKey:Q_KEY_CODE_META_R]; + } else { + [self toggleKey:Q_KEY_CODE_ALT_R]; + } } break; /* Don't pass command key changes to guest unless mouse is grabbed */ case kVK_Command: if (isMouseGrabbed && - !!(modifiers & NSEventModifierFlagCommand) && - left_command_key_enabled) { - [self toggleKey:Q_KEY_CODE_META_L]; + !!(modifiers & NSEventModifierFlagCommand)) { + if (swap_opt_cmd) { + [self toggleKey:Q_KEY_CODE_ALT]; + } else { + [self toggleKey:Q_KEY_CODE_META_L]; + } } break; case kVK_RightCommand: if (isMouseGrabbed && !!(modifiers & NSEventModifierFlagCommand)) { - [self toggleKey:Q_KEY_CODE_META_R]; + if (swap_opt_cmd) { + [self toggleKey:Q_KEY_CODE_ALT_R]; + } else { + [self toggleKey:Q_KEY_CODE_META_R]; + } } break; } @@ -2068,6 +2094,9 @@ static void cocoa_display_init(DisplayState *ds, DisplayOptions *opts) if (opts->has_show_cursor && opts->show_cursor) { cursor_hide = 0; } + if (opts->u.cocoa.has_swap_opt_cmd) { + swap_opt_cmd = opts->u.cocoa.swap_opt_cmd; + } if (opts->u.cocoa.has_left_command_key && !opts->u.cocoa.left_command_key) { left_command_key_enabled = 0; From patchwork Tue Mar 15 12:53:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12781409 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3AC89C433EF for ; Tue, 15 Mar 2022 13:08:30 +0000 (UTC) Received: from localhost ([::1]:49162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU6ub-0003Av-6X for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 09:08:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33316) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU6jZ-0006UK-92 for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:57:05 -0400 Received: from [2607:f8b0:4864:20::42e] (port=42953 helo=mail-pf1-x42e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU6jW-0008Qa-GP for qemu-devel@nongnu.org; Tue, 15 Mar 2022 08:57:04 -0400 Received: by mail-pf1-x42e.google.com with SMTP id g19so19518858pfc.9 for ; Tue, 15 Mar 2022 05:57:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Zubi5RZ0f61EYBlqb1Tf66OZVOTwoIeVsz9h2LG5oA0=; b=gEfDWA3LPAwAJDBs1NlFtlD8hDXb9nb14hIdrTZEVERD88nS2djb4CoRPLBFj4bJXl oxjaMitrb0sqnyYbkV29TTPgYQNXLxjpj8VE4A1cfHHD2EB397vcULF0gKl1E4Xe6/Am GFT8gASEvzc/7bzpoYilBui/wUWZBK1jKrep+cKGP8sUi4kivEiBC4tctfMbWZF02mQ7 85lwwj0E2BBGXqViVcq4NMw8V970FWNjpEsLI/gpsh0WYJPp4Z/vLojop1psSXr9ymI8 5zkd8IoLLGVeI2QvTNpFCEVCol9QAynmLR9vEhdSNhNVhNQ1DFq+1G77AZRfeKC9Tocu k5mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Zubi5RZ0f61EYBlqb1Tf66OZVOTwoIeVsz9h2LG5oA0=; b=QXGiUS8SVNjiAy3d+hRBdgtQxOTQp2mCd4z+U6ORhTE8y7xPtlfYuGTPn1bxBfgDXV wO520LchJyFbLlhmC1zIb843g9j6PjAeGkTqxgxjVN57dnTKHuHMeaBi2yCObZYj7Czu gtix28IZK6OSxmfKfHItirnoFNTWY6hx+SnD6Z9wcfNx18UbnUpatR+h5OnKAiByNH9e N4biI5Yc/nnrnO14q+pKfXWw7CUkPh4E9/K2mBtYnBlL/e8TsEfY1X4BGYm9oITY2MKM FDefDqnYPIVtI95SQpvDsHcj547dfCKiE3fCx6g5DMTPwJb2KCIz2qiEU2fGpi0yvxIV RzkA== X-Gm-Message-State: AOAM5303xzt8RM9k2bkpocbj9yGWo/ta1/tOXVspMh1RkbDrXNhjmJoR +TVtYIMwVPb/kAgDjjmQTsAaHUjH7RQ= X-Google-Smtp-Source: ABdhPJwP4wxIkUT+evCLNTksATwfFsHyUd83qZS1d4xWiXBMEojdxQOEp/BXz8EXvJPUSAmlHNzUNg== X-Received: by 2002:a63:41c5:0:b0:378:3b1e:7ac7 with SMTP id o188-20020a6341c5000000b003783b1e7ac7mr24003539pga.266.1647349020774; Tue, 15 Mar 2022 05:57:00 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id z16-20020a056a00241000b004f3a647ae89sm24104971pfh.174.2022.03.15.05.56.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 15 Mar 2022 05:57:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 21/21] MAINTAINERS: Volunteer to maintain Darwin-based hosts support Date: Tue, 15 Mar 2022 13:53:50 +0100 Message-Id: <20220315125350.82452-22-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> References: <20220315125350.82452-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::42e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pf1-x42e.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , =?utf-8?q?Daniel_P_=2E_Berrang?= =?utf-8?q?=C3=A9?= , Christian Schoenebeck , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , Akihiko Odaki , Joelle van Dyne Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé While I am not an experienced Darwin OS user, I now have to use a macOS based workstation and alike CI, meaning I should easily spot regressions and test fixes. I therefore volunteer to collect Darwin related patches and keep QEMU in good state on macOS, and to some extent iOS. Cc: Gerd Hoffmann Cc: Christian Schoenebeck Cc: Akihiko Odaki Cc: Joelle van Dyne Cc: Daniel P. Berrangé Cc: Peter Maydell Acked-by: Gerd Hoffmann Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index f2e9ce1da2..caea42c259 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -548,6 +548,12 @@ F: include/*/*win32* X: qga/*win32* F: qemu.nsi +Darwin (macOS, iOS) +M: Philippe Mathieu-Daudé +S: Odd Fixes +F: .gitlab-ci.d/cirrus/macos-* +F: */*.m + Alpha Machines -------------- M: Richard Henderson @@ -2414,6 +2420,7 @@ F: audio/alsaaudio.c Core Audio framework backend M: Gerd Hoffmann +M: Philippe Mathieu-Daudé R: Christian Schoenebeck R: Akihiko Odaki S: Odd Fixes @@ -2671,6 +2678,7 @@ F: util/drm.c Cocoa graphics M: Peter Maydell +M: Philippe Mathieu-Daudé R: Akihiko Odaki S: Odd Fixes F: ui/cocoa.m