From patchwork Tue Jun 13 09:38:06 2023 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: 691972 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp362678wru; Tue, 13 Jun 2023 04:32:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6yg+0PnNzWzIPJdJUIZs4+VGVAMfE3NGGXp/q7TGMMuo1PiOMPVSAlmR9uGWQInWRDrOoq X-Received: by 2002:a05:6214:21ad:b0:5ef:5138:1e5d with SMTP id t13-20020a05621421ad00b005ef51381e5dmr11610127qvc.49.1686655923909; Tue, 13 Jun 2023 04:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686655923; cv=none; d=google.com; s=arc-20160816; b=kycUUukOf4/d6yJ8oam8IAUtHBEKa33PCdCbBFAARGkDqBEAubVRH7kmtYmuCvqLlw 9oMFCvk1F8dqxQyqIFIzbn6Re0C9svphGMQ3w6Rjp92VlaMv43BKTOMF6OoUzEWWss09 bN9z4eIyKvI4BK2AwRuCcf3BiMuxYbpXECW/F2xUOuY4CNcZusCNEBic55jx5dYSqMmf 5jKxQjQfC8CK34yNKMMaRDolHCYAn+R3SBoCmEsZs68PE5kVC4GfioAe8Gaf7Zo0dv5h /TtUpQrwblguANknnpetquHusN0yfRJZQakewM26dkUEwwPHy7oN8NJ7soGwfbBMKIxo rAhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sITmXYQVztiFV0Fz7LLqlyOlCvRo8CYW3jqFEkjFY7A=; b=zq7LXC4hKAG47UDezEzjwrn+rFuE/aNQMXS+m+HKfdOLWEQqTMlDcEz2nzZynP6MUE DStfNBuUsMIwvqMB2V0wZwXVErQ8STm0kGsyISqMwH/Tw3/JH6RbLu79jN+HOWP81oY6 AUPMjR0iiezNejxGX16vO2ncLbH5AF8zVY5EOqoTlkVaPp14n+whvOveKiddB5Tj0Oje U5uL9karGhu8DEXhFj3zJ0F2YJCKwNqgt+LXPTUFHZvjWXTqBWI1Sxra4uCiC39HYRyv tqI/w49BRpcgM/xICpm+CbTV/MzRvWWLKhQBJvgsNWslPx/dLJBs9Cl6LB9aL6L15Q2e 8QRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T1InBtrB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 11-20020a0562140ccb00b0062b7a93eef2si3192663qvx.347.2023.06.13.04.32.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 04:32:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T1InBtrB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q90U8-00055Z-Mu; Tue, 13 Jun 2023 05:38:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q90U5-00054a-PF for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:38:43 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q90Tw-0005Uy-EB for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:38:41 -0400 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-977d4a1cf0eso757518966b.1 for ; Tue, 13 Jun 2023 02:38:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686649108; x=1689241108; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sITmXYQVztiFV0Fz7LLqlyOlCvRo8CYW3jqFEkjFY7A=; b=T1InBtrB0winLJ23Quu7ivDlnmZDNGABI/CrerU2/H5RfXdeuvS6Nx0+hQTxqNfjQz cQ2G0PXKXegcXDvF0YlROhBqQ9Q4xwQ1JZhA5vKeqVXhE2kONcgc4ETXU8tE+zBr2JN2 op5muaNnR+FhjhrqIaPSpA+QFkDHp5TC3amNwfBijCB2d4vxENCLB0SGM3TA2y6+BhOC t6Ce8ZiZbgnPAYcnVWMaPDuIj5ly7HfWQT0zBn8sMYue6grEbSVVWK9PQJVmxXgL0Zrw UiAwJsIQa8oarjA/ypaEQmUljTQXYJA08HdDHc8Ck40oxV9gkTXG3j0z4iKixnSQXLKT hLJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686649108; x=1689241108; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sITmXYQVztiFV0Fz7LLqlyOlCvRo8CYW3jqFEkjFY7A=; b=TSHid7VS2UIwaSh21OWVIrjwv8kh19ffXTHto4dpGqZNx8GIVxrzgcABDM78oyhnw6 agQ9cyjzrPRKhe8ib2ngudUGRMXqCErJaloly/ZhhPdlpKUerMI3OYWXy0X4GZMwixVZ lQLrZ5h590LIg4ohAFwO9tEordWssh73tWD25Vgj5IjbEdRR+7D2d9axImohaZ5xutz2 5w5p1tTXjc4PbTLupRu8BFHr975rF6HUrkAh62RmnYxsghZn/T13hX5KPpgBdFr9Fih0 9kITcOvG9sBrU4UrWHyyWJCBnXqlCKFNfON8ftdTUDfoe9dwNfBe7v1Cp+F0Wl73Hyfi pEaQ== X-Gm-Message-State: AC+VfDxorRxbLFyo0BQELaQpAtWQPAmYMeC++Q+7NYux/i+uDUAdQMB7 gDhuXvbxvO3Y/abn7YCd2A6Xx6hnwxUKbUmjLGjjQw== X-Received: by 2002:a17:907:9617:b0:974:1f03:fcd1 with SMTP id gb23-20020a170907961700b009741f03fcd1mr11708489ejc.3.1686649108675; Tue, 13 Jun 2023 02:38:28 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id s24-20020a1709060c1800b00969f25b96basm6363606ejf.204.2023.06.13.02.38.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 02:38:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Andreas Schwab , Warner Losh , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 01/17] linux-user, bsd-user: Preserve incoming order of environment variables in the target Date: Tue, 13 Jun 2023 11:38:06 +0200 Message-Id: <20230613093822.63750-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613093822.63750-1-philmd@linaro.org> References: <20230613093822.63750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=philmd@linaro.org; helo=mail-ej1-x635.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Andreas Schwab Do not reverse the order of environment variables in the target environ array relative to the incoming environ order. Some testsuites depend on a specific order, even though it is not defined by any standard. Signed-off-by: Andreas Schwab Reviewed-by: Warner Losh Reviewed-by: Philippe Mathieu-Daudé Message-Id: Signed-off-by: Philippe Mathieu-Daudé --- bsd-user/main.c | 10 +++++++++- linux-user/main.c | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index cd8b2a670f..b597328118 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -295,8 +295,16 @@ int main(int argc, char **argv) envlist = envlist_create(); - /* add current environment into the list */ + /* + * add current environment into the list + * envlist_setenv adds to the front of the list; to preserve environ + * order add from back to front + */ for (wrk = environ; *wrk != NULL; wrk++) { + continue; + } + while (wrk != environ) { + wrk--; (void) envlist_setenv(envlist, *wrk); } diff --git a/linux-user/main.c b/linux-user/main.c index 5e6b2e1714..dba67ffa36 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -692,8 +692,16 @@ int main(int argc, char **argv, char **envp) envlist = envlist_create(); - /* add current environment into the list */ + /* + * add current environment into the list + * envlist_setenv adds to the front of the list; to preserve environ + * order add from back to front + */ for (wrk = environ; *wrk != NULL; wrk++) { + continue; + } + while (wrk != environ) { + wrk--; (void) envlist_setenv(envlist, *wrk); } From patchwork Tue Jun 13 09:38:07 2023 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: 691977 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp367330wru; Tue, 13 Jun 2023 04:43:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4UXP9+n7AH/Ld/e/M9DbPprfz0UaUBgRcFPuRmDTQmPh8BeNAdQSTFkM9LcHsFhq0Wj3tG X-Received: by 2002:a05:622a:1754:b0:3f8:6bf6:745e with SMTP id l20-20020a05622a175400b003f86bf6745emr15135143qtk.62.1686656588894; Tue, 13 Jun 2023 04:43:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686656588; cv=none; d=google.com; s=arc-20160816; b=uaAkoClz7Q7A6cccTJ/DFmR0q9fJCBNLR2q6AyYRWEzGojNGBaJT8Cevwg0JR8oOTl /TsBUuDKbauUIQX/VdKXEVqDL8gTbv8DzN6hpOOhwpkBwfIFKyi4ASWrQPY78vTzrFcX YMOdxVcgSoWSyrfyN38T0TZZqWxfXIqOPVtmlPp5OtUEgPEW8y0JJy33QQlCGJCxnypX IzTMYHfct97ggFO6GKXb+pIcuAEdyj4FnwaxrgVbbVScoOPhc62N9c/05wjlLFUlxX6V esFMahtW7TOgwdgpGYYnfMd1akrRz0/7Scop0FxBVNmcr202Vsdx1Y9P7gkzanvy8wId qmMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=coCYRAX/D0a1lARgSgpQz1zwILEZC/GYBuzI7kzZU2k=; b=uFWH/E8dV6DLQzu5FAoeZ1CpJvaDRn/s1Kt0XGABG9/8tJoHEORD84Ek8+qKMYFA6I rUH7tJVBEFgeL28AtVo/TrxgxbT4YzNPlf9gaD15P4wRN/4/KPtdDr+agtdEp/9EAmgw KvVtQle/Ds2GeU2o7N1FokafumD9dcC/ogQzq4nG3V4DiP08s7CM8n+ImzyjQr1kdZce ZalR+ogtKIpGNGlTOhmr59v7TRJAWTR58HFAVcK6nOBn2elpfgsYsvafQ2MXKFV88SAU MQtbmtOmE5H4JxPKVSbEszkSeuz8glLP75JnKMDi9uSz8kqPyGLX0P1j/AMtb6ZSkTQR w2BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fvYNJGEl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c21-20020ac85a95000000b003f38d40cdc3si7352959qtc.561.2023.06.13.04.43.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 04:43:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fvYNJGEl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q90UC-00059V-0b; Tue, 13 Jun 2023 05:38:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q90UA-00057F-MM for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:38:46 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q90U0-0005VC-Nj for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:38:46 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-97454836448so755280966b.2 for ; Tue, 13 Jun 2023 02:38:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686649113; x=1689241113; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=coCYRAX/D0a1lARgSgpQz1zwILEZC/GYBuzI7kzZU2k=; b=fvYNJGElWOZz1CVYoJHpvlpNEdZJHYJgVoa3xXhSVBqQoAE6+fe57f1ahMXjFN/Cjl zSmTpPCklpHaSZtxD3geMnY7qUOgZzixJWsp98MDJYA2sErZg78PuwjPxTdyYX+EiiwD t5yokU+RWa0v7UVqzdCsgUDV8VwuNRQsEqHbv1JlUF+CblMnSAdFunig8UYkxSsRG0hN ShdE+2+jHegDisA8I8hPgcoK9ucbVoBShcnoIiWKDpJMMtGE358fnv/RmCP3K6hQGzH7 eFT/JpvF8lY9ZXMQMKXsYYJj9RnhU578SD8ujcYd/+DD4zDay6oBgqPp4Jw9DABlOkoJ 7EMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686649113; x=1689241113; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=coCYRAX/D0a1lARgSgpQz1zwILEZC/GYBuzI7kzZU2k=; b=AdbYeR5ZKl1e6joq2+jE/T236X2hOAI8y/eIE1aRinYW6Hz6eFeYJbYNurmG/l34O2 cj0buW7mf6iTmLhjoZERrj61mS0nGUxNR1mQt8uRturf4gJFSTAD9jN28HQKrLDBLNwm 0Xdmf7ObFZHv1/R8d9zPZvyGukl9sLm0/L4yQ0Z/J2wkgoLQ4zDI3IbISGG9OxgwnM6k JqEuzb5rx6oWB+DNPuxeOHKUIELoGz/07niDThWHJHgutpggS7pN6bfkdIjPSKxwb8kJ f+TTCPRV59i0zMlh7Mo96fzS8WN9h82F+lOjYjlFMkhknahvPvhDgZE5okTaV/MzO+6u lnvg== X-Gm-Message-State: AC+VfDwITanNPc2z9GWe1q6Y52Yt/ng2oL25uvDPktBtIO18wsmcBphg WZ8RwfHen0i+4yjKpFIRBjjxC8nDeXSp/ABZpAebUg== X-Received: by 2002:a17:907:6daa:b0:973:cc48:f19c with SMTP id sb42-20020a1709076daa00b00973cc48f19cmr11331108ejc.56.1686649113701; Tue, 13 Jun 2023 02:38:33 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id g12-20020a1709064e4c00b00965e1be3002sm4801468ejw.166.2023.06.13.02.38.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 02:38:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Akihiko Odaki Subject: [PULL 02/17] cocoa: Fix warnings about invalid prototype declarations Date: Tue, 13 Jun 2023 11:38:07 +0200 Message-Id: <20230613093822.63750-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613093822.63750-1-philmd@linaro.org> References: <20230613093822.63750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=philmd@linaro.org; helo=mail-ej1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Fix the following Cocoa trivial warnings: C compiler for the host machine: cc (clang 14.0.0 "Apple clang version 14.0.0 (clang-1400.0.29.202)") Objective-C compiler for the host machine: clang (clang 14.0.0) [100/334] Compiling Objective-C object libcommon.fa.p/net_vmnet-bridged.m.o net/vmnet-bridged.m:40:31: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] static char* get_valid_ifnames() ^ void [742/1436] Compiling Objective-C object libcommon.fa.p/ui_cocoa.m.o ui/cocoa.m:1937:22: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] static int cocoa_main() ^ void Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Akihiko Odaki Message-Id: <20230425192820.34063-1-philmd@linaro.org> --- net/vmnet-bridged.m | 2 +- ui/cocoa.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/vmnet-bridged.m b/net/vmnet-bridged.m index 46d2282863..76a28abe79 100644 --- a/net/vmnet-bridged.m +++ b/net/vmnet-bridged.m @@ -37,7 +37,7 @@ static bool validate_ifname(const char *ifname) } -static char* get_valid_ifnames() +static char* get_valid_ifnames(void) { xpc_object_t shared_if_list = vmnet_copy_shared_interface_list(); __block char *if_list = NULL; diff --git a/ui/cocoa.m b/ui/cocoa.m index 168170a8a6..0c2153d17c 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -1934,7 +1934,7 @@ static void cocoa_clipboard_request(QemuClipboardInfo *info, exit(status); } -static int cocoa_main() +static int cocoa_main(void) { QemuThread thread; From patchwork Tue Jun 13 09:38:08 2023 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: 691967 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp360648wru; Tue, 13 Jun 2023 04:27:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4+XIH9EiC0t6FxvfTgLdtHqKeN/iNA1eBJh00d1t/WPEzZjI9buZ9xR4m1wMCm1VBICIh3 X-Received: by 2002:a05:620a:2906:b0:75d:a0d:b27d with SMTP id m6-20020a05620a290600b0075d0a0db27dmr16091538qkp.20.1686655633539; Tue, 13 Jun 2023 04:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686655633; cv=none; d=google.com; s=arc-20160816; b=0vTiyscDpaEFlDN1EJGoxQI7TcrV/Ua1nsgFMTj4PmGBO8d7YkT3EU+0fDBjoOTryy t3ntYT+PQJmriqDdSs6bBMgnNPpi6x5uXAW/53oKTjz4FF39Ysqm4kjaAt3aAZVW/JIV EzG/D49B0CSsjLsWOZbtdU671dMyGRlZ40TblE1S4tUTGHwOD1dXSwpNnJ0dPwW5UY7P U/mFfK1Rm8engBuMN6qgaWjC8xbJXRcnYLOF32tmeqsk64sK/1F/wzQNQFgx7Ij49ggl PPupTqYVoP53dwrg13ixdLkj5lR1Qmgsc+CubbnQmx03qR3JM26TSf4anMGVwmdwl4zr Sglw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6qJ7BQ2qR0lwowzhuJJ58u1mhSulIi2t/OhI5+4Ytsc=; b=bdrPTxFfOo6l9jmmTQWlUxUkimfvcG0jDKhkgdx1Pgp6lUUtnnscVCHjNfP60kxO69 YrzMP2/36XyWV48aCY9v5Z0mnHCzfBI/ONEAmEK2R89BOANZaTLPWxeAgVeazqzHakcn Sjnn7BXrF1YeK5TRqUuC2pNevwfbG/+DI8V+Gt2mPK9C0drcL8ueS7/5U06/QBqU07U6 ugL2GoUZ85+pTPNvAd+uLpDyFEWWFDdZSKu0VGzs8+YplmLxg7jgi2G6RS7UWDQ2Bvym Q7WlGGLMwbSujZehk/37Ae6iuGfV1NhmnbNA5Yo5dhnzD1ViqIq6u+hGAv8SyUqQ2nzI /qJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c9Izl1KH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id pe27-20020a05620a851b00b0074e4e7c418fsi7184105qkn.784.2023.06.13.04.27.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 04:27:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c9Izl1KH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q90UE-0005DH-MM; Tue, 13 Jun 2023 05:38:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q90UC-0005BE-I0 for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:38:48 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q90U9-0005Vn-BK for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:38:48 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-977cf86aae5so804699066b.0 for ; Tue, 13 Jun 2023 02:38:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686649118; x=1689241118; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6qJ7BQ2qR0lwowzhuJJ58u1mhSulIi2t/OhI5+4Ytsc=; b=c9Izl1KHKJhcbr5C3nlKdHCh+00vRVp0dpdltvxdil5wL1EC+bTdpLZXT34iiG7VTO Uvlzoi0uqngg0nem7b3mMOWqpASbTsbm6wUeq3WLHRvn2G8FXpDmaGc6ZgQ3yH3mVxjK Ar72bu+DdY1Ijks+zrx2TfmhZBKBgjCsLAiJ6GSlzGRRNRSwPlnFwpctWOZ+Qh1Xir9F AwkL1b8mQXtHyiLBQ8aDHv2LP+g4LfxfvSXDfIbHDwjOfCtW+apq6D3HwTTvv9385+Qd ebdw0JyV21T7pSJFvlk15/7ZfJrxT7ILNkZrp3a2ABTrmXGLrvsy+Z8bzuPoYXRvGfv1 HHQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686649118; x=1689241118; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6qJ7BQ2qR0lwowzhuJJ58u1mhSulIi2t/OhI5+4Ytsc=; b=ffpZ5bYLuT5pEE33c0GpBlvDwVegmAs2N+u5N9YRWEgRf8At+obwsdPd7mZsIf+2af nu8piND6sOP5+bWaUGEzDM60g3JTGrTk2n321/thfktDL9vEqCVC5BcpyOX3yw5mV3e5 JeBnc/NeZWQbh19/FyC/fqcWod48U3WIjo9LhvAfe7E1juIQz8eD5EhymH/RljjJH0RL v+dSrI5fmhEgnlHWiNneVK3wXXXO0N1cu163dyDOcO3Qc0nBOjQ2RGBYtCIZwgTOk2sF aGlQAs0sFwgEWZpDq/+g4Z9ACyKZ4eALIkHgk01/uIcxr5q4spH7hYpz1GnHsxuYvw70 EOHA== X-Gm-Message-State: AC+VfDx27P9i7BJRiJlyD0DZywRaCd/LFIf8o7Lttv3NhH48wh0zIhLo U/DQHpoZ/qvHQoAgqy6QrghairUSYZVThy4xZWkJQA== X-Received: by 2002:a17:907:9342:b0:973:91f7:508a with SMTP id bv2-20020a170907934200b0097391f7508amr10909380ejc.4.1686649117880; Tue, 13 Jun 2023 02:38:37 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id n11-20020a1709062bcb00b00977eec7b7e8sm6395760ejg.68.2023.06.13.02.38.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 02:38:37 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 03/17] util/cacheflush: Use declarations from on Darwin Date: Tue, 13 Jun 2023 11:38:08 +0200 Message-Id: <20230613093822.63750-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613093822.63750-1-philmd@linaro.org> References: <20230613093822.63750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=philmd@linaro.org; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Per the cache(3) man page, sys_icache_invalidate() and sys_dcache_flush() are declared in . Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230605175647.88395-2-philmd@linaro.org> --- util/cacheflush.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/cacheflush.c b/util/cacheflush.c index 06c2333a60..de35616718 100644 --- a/util/cacheflush.c +++ b/util/cacheflush.c @@ -237,8 +237,8 @@ static void __attribute__((constructor)) init_cache_info(void) #ifdef CONFIG_DARWIN /* Apple does not expose CTR_EL0, so we must use system interfaces. */ -extern void sys_icache_invalidate(void *start, size_t len); -extern void sys_dcache_flush(void *start, size_t len); +#include + void flush_idcache_range(uintptr_t rx, uintptr_t rw, size_t len) { sys_dcache_flush((void *)rw, len); From patchwork Tue Jun 13 09:38:09 2023 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: 691968 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp361144wru; Tue, 13 Jun 2023 04:28:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7qb8OD2SDjN3RephqiPbJ/yjbfcUxRD7JylcfNGzI7WRiRsgk5ewFikMuMWKjT1TR70AmR X-Received: by 2002:a05:620a:271b:b0:75e:2a17:2893 with SMTP id b27-20020a05620a271b00b0075e2a172893mr12804893qkp.32.1686655709037; Tue, 13 Jun 2023 04:28:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686655709; cv=none; d=google.com; s=arc-20160816; b=vX+7Bh8YLwrCveW9mWt2U08eUXHyCkDqq909uyQq5ETPd67T679qxI1yxX+LVMImfr e/XFEsAqUXE6KeQNq3S4C3JKnPAq38gIrqXSzUvffcJi2UaEj7CsUl24H+ww7LlNUUfn L2TGdDkv691qA9Hw1S601gagvE5Lla4zSDrnmzx1UPek/XL+8qkAkVvBh/dAh7zywoeN mTYviSSkVCzqFmAEPrJvtiffdH8siQiVQumfAoO7DbDc0r3nLj0MhDT43yAYyjyGfTBZ xL7lRZohHH7DDjG9EJ4kkFpQ9Aiwfrv0qBs5l51j9MrG9BcTwLs6Gd3qMBqX+Th4iRq9 ZZVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/rEEeIVSi5VMBmvRHFJo6Mhl1pwYu3f8je5JbYKc4lc=; b=oHupDzSF+O/wpujIDgh1tHXSPCx4ktDfUNoaM8wXUaI2lc94J1u/WyCkUyVcQjJfil UHwmgyG36tzNBLbjC3S9en9TqroRNa6AG7N+OIVCl6mWRvrz/EJ6egMmu9TFLgoOjn0K eAATRnZn1ZdG38u5UoKKnnkjGt9lGz0etLoHgygEKMBQ9vKyhyfFc7TNzFi81mj3x0Rp 9Jo5X1duV9LMF5tF3zD6rnB+NhZ89qKMvfJJN9j0F0++45tj77jsjaKldkw3hhyMGANA OeCgXCaEgTBOCT3fawuIXgD46hutDPHlkCzdJS4umJLBtM/aSr1hxRPmUyS5RUrrtjm9 rrKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vN8cYI9j; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z7-20020a05620a100700b0075b367f2c98si7280133qkj.85.2023.06.13.04.28.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 04:28:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vN8cYI9j; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q90UL-0005Qf-D6; Tue, 13 Jun 2023 05:38:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q90UJ-0005Og-Hb for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:38:55 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q90U9-0005Vp-2h for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:38:55 -0400 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-514953b3aa6so7407178a12.1 for ; Tue, 13 Jun 2023 02:38:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686649122; x=1689241122; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/rEEeIVSi5VMBmvRHFJo6Mhl1pwYu3f8je5JbYKc4lc=; b=vN8cYI9jW0YpIeMjga+hw/yspaOnkJJfHu2IbDcuLLQtMDFx3jl6Syn8fBWGVuKxVM G0Hsqd4Tc/DXPG8zhL9zc6BNwSbcJWTYXtJBToG2wMhvhUeyFKZoVle8Vm0hXPgwSB/8 AGQ8KUJRYIYwavVUl8WwunJiFg1nQAo3/J2M3Vs29ZjTefE1aRgY6AweC6vvgIGCWXBj LJZF8KERLQVUKw7yubREO3UuSkZwZ+tzB7nZ+idEmlt6NfUgiypkGvOeZ3YNParqBBT5 lShk8QUE6R6ebYIn04xHEkHqeem5iQ+TVfQ/hDrPlH4XDyCfTn6ETnM7pQdje/VdmB1p k1Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686649122; x=1689241122; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/rEEeIVSi5VMBmvRHFJo6Mhl1pwYu3f8je5JbYKc4lc=; b=RwHDrWLT4zQLX5Weq6ijMcVmp1SMdX4XZAJrVCPkbo+bF2SVPL2GVAPhLEClEq3vz4 5a/MKurlZT+NUU56SR4EHgM5C3j+aB70fUdyBM1CgkRR89Uo9Ac0sT9EBgXfx+R5KQ2h HEcsM5EbpoRrlDfqqq6qT/0vlN2NtB6gUBqKmTEzsLhgYb+kBp9GEem11kqHBa7ogMj4 EAH7r/DPXEjJBouZ9aAPEO0a/Nn8UZWBLPh31QIqwz7JOiihFB3r3CnX/QHaSwi0SDPm /Rpa1FSi5duZTFTtdeNUXLvSiNFo/cL1tuyn0aLLjxOCeJBGqI6gCumEn8FQA1NFqpQi stJA== X-Gm-Message-State: AC+VfDzR+vVnWRCI50I+Y5uVN/NrlDq9xn3/hypk9EF/Fpnx6G9UX2iv qPUdMrmRWcijcVdeNvapo+5R+PuZKINeRyseXTp4fA== X-Received: by 2002:a05:6402:70b:b0:504:b177:3ef3 with SMTP id w11-20020a056402070b00b00504b1773ef3mr6738675edx.3.1686649122229; Tue, 13 Jun 2023 02:38:42 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id u11-20020aa7d0cb000000b00514a97b6b80sm6185031edo.78.2023.06.13.02.38.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 02:38:41 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Akihiko Odaki Subject: [PULL 04/17] util/cacheflush: Avoid possible redundant dcache flush on Darwin Date: Tue, 13 Jun 2023 11:38:09 +0200 Message-Id: <20230613093822.63750-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613093822.63750-1-philmd@linaro.org> References: <20230613093822.63750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=philmd@linaro.org; helo=mail-ed1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org describes sys_icache_invalidate() as "equivalent to sys_cache_control(kCacheFunctionPrepareForExecution)", having kCacheFunctionPrepareForExecution defined as: /* Prepare memory for execution. This should be called * after writing machine instructions to memory, before * executing them. It syncs the dcache and icache. [...] */ Since the dcache is also sync'd, we can avoid the sys_dcache_flush() call when both rx/rw pointers are equal. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Akihiko Odaki Message-Id: <20230605195911.96033-1-philmd@linaro.org> --- util/cacheflush.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/util/cacheflush.c b/util/cacheflush.c index de35616718..a08906155a 100644 --- a/util/cacheflush.c +++ b/util/cacheflush.c @@ -241,7 +241,14 @@ static void __attribute__((constructor)) init_cache_info(void) void flush_idcache_range(uintptr_t rx, uintptr_t rw, size_t len) { - sys_dcache_flush((void *)rw, len); + if (rx == rw) { + /* + * sys_icache_invalidate() syncs the dcache and icache, + * so no need to call sys_dcache_flush(). + */ + } else { + sys_dcache_flush((void *)rw, len); + } sys_icache_invalidate((void *)rx, len); } #else From patchwork Tue Jun 13 09:38:10 2023 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: 691979 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp367963wru; Tue, 13 Jun 2023 04:44:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4bDhCxYFz2fcTdmRXBqJ0FobZ8vO+PoJfcNhBaQtfihYYZK1eoeV35fg3EoDuXwQl+p4KP X-Received: by 2002:ac8:5bc2:0:b0:3f6:aac1:ebee with SMTP id b2-20020ac85bc2000000b003f6aac1ebeemr16501800qtb.23.1686656697650; Tue, 13 Jun 2023 04:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686656697; cv=none; d=google.com; s=arc-20160816; b=bC2itexBE47jvRRB+9vCYjwlZfm8BorHYODlUtbyTeKJi0rjSXuCF31A2CxOYowUjT SSRG8vY9K+4UcetajoNqnZLffq5fGeOD/jh8dOjJuLNrX/JEwmeMWba6Lyxk9fbVByT/ mTeD1reYawi3BZgnykefACerr+btlrLrMLlvZDZ84F6S/NXOsFNZ/tCOoFpJ+L6vUWDu 8rUE03fEHNsntmv1AkoblO30qePJxj6psforqhuJIEitzeB7WXyeHCs4sX1m1zJSN200 gbcbnebi86gS+A1GebQuRQAWfIfq17svcSp2WMUJgXZKleBR6+q0qUJBkbsSKMZNUgFY 44gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YSCMOMiEbLUM1Wk1LAbR+FG1B8HkFWQqVaD6LVaKVVI=; b=J0IOr5U0CQyaztCszTwh6gAilU2zo/qrqcSWYZwYu61rgkElGdVF3zyfGsW6eECWo4 MzTvSjQLY68aokNPlwy54ZZUPdND7weQ+0OGAYuJ1yIfURyZUjZWXVE/nKjQ7AStCuUa 7hCwnFOyg6L1/2eJxkDWiB+WIw1OVzBsjnCNIUucrxJvWMPap3PpzgmRkbo4fQv03Gyc vAlRUTMycHxTmlNvWx00rehM/9oQ52pPqrFNuwvJpc4yV56GTfBwMMmCPNstNoJSYzCV MVqxuK5rwt4kMzCBMvdZG0mCHnvfS9vAFkMYPFl8MO67Qk6XrMfjBeV8+BmYPPY1TFqU cmRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fbx+Y2sT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l2-20020a05622a174200b003ef37486d9csi7481792qtk.321.2023.06.13.04.44.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 04:44:57 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fbx+Y2sT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q90UK-0005Pt-Kf; Tue, 13 Jun 2023 05:38:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q90UI-0005M1-B5 for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:38:54 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q90UE-0005Yg-Kz for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:38:54 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-9745baf7c13so781169266b.1 for ; Tue, 13 Jun 2023 02:38:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686649127; x=1689241127; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YSCMOMiEbLUM1Wk1LAbR+FG1B8HkFWQqVaD6LVaKVVI=; b=Fbx+Y2sTOWlOzGtF+XOqdQ4xEH5zruDmrJtMnBiflePZ5DCREag2JlKofH+6PdUQwi 5sJLb50AhBsk/zSAl9yN+kpF5I28dIpL2fM1v7B+i0jEl0rMeOux6y2xlxpKf1qacl6r GI5iDqFJz/bYQ/HKzgp7ay2YRpGdwFGZCnHCZIHR7cpjU5kEKi3BO2SLzmcr9P4OHeWW N9YTE1SXJGN3OrLQUD5de+PJyQUJj8agOabGVTkfkLMrk9+pNlJUd2KHiVGPH6VxK4HL BXHx11A2ALhFDNLLWW90m5acF0TgOl3Hh2X7I7Qj1HxCwJeWgtZ5lCyfnYeeaJMynFkJ YvuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686649127; x=1689241127; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YSCMOMiEbLUM1Wk1LAbR+FG1B8HkFWQqVaD6LVaKVVI=; b=L3AH7HgD9kb7ufqFCKJJPmu8WrD0g7cXwkF3Ilfg6I1lIiUCF2ofk7LRdPPOJLiwd9 hCaCv7FpYMDm3IqGsaQxHFtxHbXMFVOXbxBsi9KQG2qOHunaGDgEWWmSXU1sKtoqrVw5 kE5UppMawH1AG+gtRrFTgNgoEUJCPBkOrjJg23Mru3Nt3zEkatJ9j19W5Ie70qD1Jzfz 8X+VcbyAlegXderMg0Zv/GE8U35kUkUgnP5w/3kUvlPWI9f9SvI2P7UTTS2OfGUChzCp VyRwFnlF+TtCnnMD3UxZVq2kxVbaV2xisPfLsijhdpBRMKYOlmLTZSyLEW3meSqveR/u hUcQ== X-Gm-Message-State: AC+VfDwkBXS/kozi89f393spH4x28M2tgB9pvs1lWdFy/dst1gHsrkDq E3v5YOi83jpuoYC20mhycqruCl3BI/Tsf6SuLxiMAA== X-Received: by 2002:a17:907:97c5:b0:982:45ca:ac06 with SMTP id js5-20020a17090797c500b0098245caac06mr335280ejc.60.1686649127569; Tue, 13 Jun 2023 02:38:47 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id qc11-20020a170906d8ab00b00977d7ccd9fdsm6532138ejb.95.2023.06.13.02.38.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 02:38:47 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Antonio Caggiano , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 05/17] accel/hvf: Report HV_DENIED error Date: Tue, 13 Jun 2023 11:38:10 +0200 Message-Id: <20230613093822.63750-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613093822.63750-1-philmd@linaro.org> References: <20230613093822.63750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=philmd@linaro.org; helo=mail-ej1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Antonio Caggiano On MacOS 11 and subsequent versions, in case the resulting binary is not signed with the proper entitlement, handle and report the HV_DENIED error. Signed-off-by: Antonio Caggiano Message-Id: <20230608123014.28715-1-quic_acaggian@quicinc.com> Signed-off-by: Philippe Mathieu-Daudé --- accel/hvf/hvf-all.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 754707dbfb..4920787af6 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -38,6 +38,12 @@ void assert_hvf_ok(hv_return_t ret) case HV_UNSUPPORTED: error_report("Error: HV_UNSUPPORTED"); break; +#if defined(MAC_OS_VERSION_11_0) && \ + MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_11_0 + case HV_DENIED: + error_report("Error: HV_DENIED"); + break; +#endif default: error_report("Unknown Error"); } From patchwork Tue Jun 13 09:38:11 2023 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: 691978 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp367545wru; Tue, 13 Jun 2023 04:43:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ51R1STHFST93SGsC3VXBunU74wO+z59nhqDZ9z47FIbAXIz2n1mV1q1pkVo+IbnC1suVmd X-Received: by 2002:a05:622a:4b:b0:3f5:aa3:ad09 with SMTP id y11-20020a05622a004b00b003f50aa3ad09mr15846183qtw.16.1686656632360; Tue, 13 Jun 2023 04:43:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686656632; cv=none; d=google.com; s=arc-20160816; b=SDbAqW4EdPfGQE6D4nxXEHrJGpIFNhsXX/66KXkuRMeQJEvWefpWFUf6dRqpfc+xeM WeZ0t6cHAfOTxtl80FeBknXxBEduSxqciErMq8INaxdvujfn/BxXalL4fnmaHL/8+0Xx MEXPxmK1Bph/B69bOACJ4GmSWcolhErXhPFGfYjJqZ+vTeT/airBFTtE/ig18o1/MgBk mc6wi7RPt5BDNVG2b0xogId/lqsT+Yh2qFo4dQh+K9H+8yjcHmxXTfTnG/M2u/OtdfH1 fDDA7zFFxIzug2QMXXwjEQw0dCPROGSfdoF/c9h6uMDNU1PaudpCoZGRviNd5w7zMKl2 wa4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7g0Yqy2wB54am4pKsVZHqGyVbbprfwoeuCpS8UNAr/Q=; b=tf/eAYBDfpqusWsRI4ryYwoXLb2nOCxCCDrW0l1q8aEBXnDNAeyR7grHOy9vP3gWp+ BcNN+lJbib83y1lOBA2xUYnpyJYNCwVAJFO2QZd3LHPwDR/oZu64JRLzqYWcUYartnmq AkSQT+aIDrxjzdI2zd8/hYUU+RiQrVDF9VGOChkPj6zht/7rGw2Xpg4e8QTgB0xY5/ew T5eg4jfqw2fLVakg4IM4IKxyE21H1kp1h+vHn9WCO169gYRxGB/K5fhB40LYwyAAr28X DKve62t3fcn1N/gLLVD2dXXK9LDD+VozohE1soSPRedtWt92KICaEuzbKH3k6HBQ/0Wh FYVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VhQ6tJsM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o10-20020a05622a138a00b003f6a701ae03si7531191qtk.630.2023.06.13.04.43.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 04:43:52 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VhQ6tJsM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q90UQ-0005V9-JU; Tue, 13 Jun 2023 05:39:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q90UO-0005Tm-RV for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:00 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q90UH-0005Z8-LA for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:00 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-977d02931d1so782493066b.0 for ; Tue, 13 Jun 2023 02:38:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686649131; x=1689241131; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7g0Yqy2wB54am4pKsVZHqGyVbbprfwoeuCpS8UNAr/Q=; b=VhQ6tJsMl7jtmM9J/i0BhJWFESqjyFFPRIDg00QiFGA/kB7sR0c8ml+n31REt1EuB5 taYdKTcZmPEc1q9/OC4fvocy1dvnJNBDmCSMfgYHMRfqxixfe9BGIS+AXnPZtQbZsmmH ADFzxJ6NM/jcqeF17RTpZBxFn2zQD/VjfxmxctYAw9edtGNGDky+Rqa/KyK3NOMh5xsk LMnB+8jUmC62uhf75GS2/61UD5C7Osn6kkBOHgS1HQRGR7DMVZhTxGga3vMK6ovc+w0H YkEodPlXW5nOillgGgNPZ7qPZRZMm6lp5LevBW9e8Vxcs0SbdyEeUWCXGKSbu/P3q8sQ fE3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686649131; x=1689241131; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7g0Yqy2wB54am4pKsVZHqGyVbbprfwoeuCpS8UNAr/Q=; b=UDNyC+Qmoz0XdXc2W0ELjjbwq7IcNNMxpd5a+vPMCzorWHOe3XKnTjhtGGXM9zA4n4 E2HxTaW/n5HjB3nLqiTFTrkp4omq+laLYIoGvLFdwsvLmfU/LkdUzF8apwOrSUWHrvUi ut42e5D131JQPYXHu76HshGIbqXnl/ODE+GnhXRGAgMkNYeBWzEKEdRwAdHMiMOt9w00 ydo+esB/6romQYkdnh8oO2SYS+Yr2rPgo2WIxCHzHZ6ziERmAdqUEcN9tW5DkL9ENOHo 8idKNKtuvK9NEcSa2O8zrWEBVPm9zT1dDlpET8ClRYNEqtm+y1uL8xmlEqIqZcA0fYM8 QbKw== X-Gm-Message-State: AC+VfDzCWehowscLe9yZrAdgZ0BI7S4mXm1w8hRawu246RF0IEVEZd4W 2fUalYqtxBLrAnx4WpuLizR7UKrdU4+/LPU5yQCRuw== X-Received: by 2002:a17:906:ee82:b0:96a:ca96:3e49 with SMTP id wt2-20020a170906ee8200b0096aca963e49mr13379120ejb.13.1686649131840; Tue, 13 Jun 2023 02:38:51 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id k7-20020a17090627c700b00977da9d4ef9sm6527305ejc.18.2023.06.13.02.38.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 02:38:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 06/17] target/hppa/meson: Only build int_helper.o with system emulation Date: Tue, 13 Jun 2023 11:38:11 +0200 Message-Id: <20230613093822.63750-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613093822.63750-1-philmd@linaro.org> References: <20230613093822.63750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=philmd@linaro.org; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org int_helper.c only contains system emulation code: remove the #ifdef'ry and move the file to the meson softmmu source set. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230602223016.58647-1-philmd@linaro.org> --- target/hppa/int_helper.c | 3 --- target/hppa/meson.build | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c index f599dccfff..d2480b163b 100644 --- a/target/hppa/int_helper.c +++ b/target/hppa/int_helper.c @@ -25,7 +25,6 @@ #include "hw/core/cpu.h" #include "hw/hppa/hppa_hardware.h" -#ifndef CONFIG_USER_ONLY static void eval_interrupt(HPPACPU *cpu) { CPUState *cs = CPU(cpu); @@ -273,5 +272,3 @@ bool hppa_cpu_exec_interrupt(CPUState *cs, int interrupt_request) } return false; } - -#endif /* !CONFIG_USER_ONLY */ diff --git a/target/hppa/meson.build b/target/hppa/meson.build index 81b4b4e617..83b1e0ee7d 100644 --- a/target/hppa/meson.build +++ b/target/hppa/meson.build @@ -7,13 +7,13 @@ hppa_ss.add(files( 'fpu_helper.c', 'gdbstub.c', 'helper.c', - 'int_helper.c', 'op_helper.c', 'translate.c', )) hppa_softmmu_ss = ss.source_set() hppa_softmmu_ss.add(files( + 'int_helper.c', 'machine.c', 'mem_helper.c', 'sys_helper.c', From patchwork Tue Jun 13 09:38:12 2023 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: 691976 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp367325wru; Tue, 13 Jun 2023 04:43:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ462tWwal8fxgNp+hDOGW+K80gQrxhnf+pud/rvBmQFCKkWRQ6EKr5ZugKQhndaD8hSxvBr X-Received: by 2002:a05:620a:17a1:b0:75b:23a1:412 with SMTP id ay33-20020a05620a17a100b0075b23a10412mr12932496qkb.40.1686656588325; Tue, 13 Jun 2023 04:43:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686656588; cv=none; d=google.com; s=arc-20160816; b=z9qSaqFEGJM8SBxKpS0x5xPiigONHYYBefEl0Sdn88yUvCBQeIQiIoyKPg00qkbaVt iqkHifLFzUzGVpoVZfDRT37/vVleItKMsfRUSMHu0xxSIM5z3Yko51UHonODL64xLnJO pO+XfkjNJg6M5wBuQxMkpPDcq1LP/Fa8Ho3N9MhAY72caRyGf0K3Xq93ZQXIIZNbVh23 pn95S78mTiRl3pAIQ1ga9J+RmrZwFdZA5wSyjR9eoKfEVXAhkPcF2lLLHe63NqKt1zJ1 6ne1xKCzkVkt2fo8GxRwML0fqhl671SM5hGcmqnWlWguyu1s3pxMtbjtrej8Ks907WrQ kD4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=myeX5Dw6+waNCZWCgIspsiK+vpR5MfiXN6PuO0NeKtA=; b=RXlt/xSUHzaTQ2Zemor2Rv5nccD4TtoRus5UpY6//BVKLcuCj/xZugSx8kHI+xXnZu /B1AtU57xu4PlRRcixMoj3bFvAuYWM7M+K7uAF3wSDCc+pSZC7yoAq91llULSW0A1bPV Sp6UHn6offXNAHXQrYQIOYPPpJgViDWKTxIsXNegJL6jYYzwLImfzsUU7/d9bKKvZkZE zrRZ5yUNfvYbyoaD8Jx/fxTnBBwJ4zUtGeEXBrwXBGAQ/ovIY9lqygIMPo3togmtiCie iaszApk8r5lziTbKQddfctqa6yWNrqgx50xYGHovhbpCqaNirwIOpq5q/pbfJGNZSOJb fQRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aayT79RN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i17-20020ae9ee11000000b0075afaac62e8si7385171qkg.131.2023.06.13.04.43.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 04:43:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aayT79RN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q90UQ-0005Ud-0A; Tue, 13 Jun 2023 05:39:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q90UO-0005Tq-Um for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:00 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q90UN-0005Zh-3e for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:00 -0400 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-51879362bbfso503033a12.0 for ; Tue, 13 Jun 2023 02:38:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686649136; x=1689241136; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=myeX5Dw6+waNCZWCgIspsiK+vpR5MfiXN6PuO0NeKtA=; b=aayT79RNVZJvyM4TSEwqccDtz37EF6lAxwjzp1q2y3xw1LoNPZcm/ZjxNYiqz83rlR v0sKG07t4QVa1JQEbIdQtNNWUVPloFdxfjjNa9NlrvSqhgh0xWFGOy0ejiQvx0LjkZ9z XagIMvddP1J6VeYnhNq4j0PTyJE7Nn9UFFyy1c2cqpRRrWRotb6FwMg3wN+XSbN/2C0J 0y8R7FyQWACGJPfDDX0UlEYXU70HbWaUYyTtXmeitCHHJkm/1qzn/PUU/QCH70Sv7oZm V0pisw+drAkf5nGnzypyY3fxhkWsMPEZgojIt4AkYvyewVpga1SHwj+e99Rzwuz37l43 +r3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686649136; x=1689241136; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=myeX5Dw6+waNCZWCgIspsiK+vpR5MfiXN6PuO0NeKtA=; b=HPEH7dq4DaHyDVNACJaPBDd7QSXw2MBBK9I1/4Jzcroil4oCLySlU/NJEhetnY4meh AOMb4fKdh2BXIHt2L2TJcfsBne3E3JmUiksgwWKxEE8glIVJ+8oiuA7cOsazCIRpqYTg J6ec6QIAgGhDzL7f9z6yBmRVz1DYn8GUtf5UpssgCW4cHKxYcMYVR0vIoDeOQ2xqaDd/ 1SiFDqepBxY7gBOnOkbyCPQ0UsmZZh0p4WNyUfy2qaCBnYlTi4IOW87T6usp+TTXF0nU oe6xQoB2xhrAxFYm4pOyLHVdnvV+7lbWu0GF4VSSkiJvpTcbwIj/ZXRYEgjbOfXiqA5E IWzw== X-Gm-Message-State: AC+VfDwUkU5WASqse/il/SpBLmYCgmmDZFDu4caRSaZKdOONfBLL4m0w p2iSkYNCDuu9nqazPlH1Dv95WQ3HL458+qdVN4DY+w== X-Received: by 2002:a17:907:5cc:b0:96a:9467:1dc7 with SMTP id wg12-20020a17090705cc00b0096a94671dc7mr10626009ejb.25.1686649135979; Tue, 13 Jun 2023 02:38:55 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id k22-20020a1709067ad600b00973ca837a68sm6381930ejo.217.2023.06.13.02.38.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 02:38:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 07/17] target/i386/helper: Remove do_cpu_sipi() stub for user-mode emulation Date: Tue, 13 Jun 2023 11:38:12 +0200 Message-Id: <20230613093822.63750-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613093822.63750-1-philmd@linaro.org> References: <20230613093822.63750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=philmd@linaro.org; helo=mail-ed1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Since commit 604664726f ("target/i386: Restrict cpu_exec_interrupt() handler to sysemu"), do_cpu_sipi() isn't called anymore on user emulation. Remove the now pointless stub. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230602224628.59546-2-philmd@linaro.org> --- target/i386/cpu.h | 3 ++- target/i386/helper.c | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 7201a71de8..cd047e0410 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2285,7 +2285,6 @@ static inline void cpu_get_tb_cpu_state(CPUX86State *env, target_ulong *pc, } void do_cpu_init(X86CPU *cpu); -void do_cpu_sipi(X86CPU *cpu); #define MCE_INJECT_BROADCAST 1 #define MCE_INJECT_UNCOND_AO 2 @@ -2419,6 +2418,8 @@ void x86_cpu_set_default_version(X86CPUVersion version); #ifndef CONFIG_USER_ONLY +void do_cpu_sipi(X86CPU *cpu); + #define APIC_DEFAULT_ADDRESS 0xfee00000 #define APIC_SPACE_SIZE 0x100000 diff --git a/target/i386/helper.c b/target/i386/helper.c index 36bf2107e7..792c8eb45e 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -611,9 +611,6 @@ void do_cpu_sipi(X86CPU *cpu) void do_cpu_init(X86CPU *cpu) { } -void do_cpu_sipi(X86CPU *cpu) -{ -} #endif #ifndef CONFIG_USER_ONLY From patchwork Tue Jun 13 09:38:13 2023 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: 691971 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp362512wru; Tue, 13 Jun 2023 04:31:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4TTvcvxkefRleJfUQ1Q+UXoQxFOq8+jVpmuiDRaMl4S6sc2e/BMJWMjI0gt04hpdya4owH X-Received: by 2002:a05:622a:3c9:b0:3f6:b1e9:843c with SMTP id k9-20020a05622a03c900b003f6b1e9843cmr15921373qtx.44.1686655899911; Tue, 13 Jun 2023 04:31:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686655899; cv=none; d=google.com; s=arc-20160816; b=PSV9rjwPMubVJRzCqGedF1aRdxXbXE1NcFm4tKN60BLxGH96GQmkrnO+L7HQJ9pqf/ ksMjngerelOUaMIcRDEE4FLigCUUBdIHzFCy7tLIyp39zHJ78d+5Y+xLDvHF6Ma7TP8o lJ3/uBL2DzTUZg2f8QczeuYK2wmqZjCJ3Za8EbNcVHuxJJWUaCBdl4mB7wJnNppMmXfJ LpaZeMYfC8B4f8nxrLfz3TrOckanYRNpfdhaQPClSGY3GtQ4mBeNkpClLFTpOWLCVXHB vUnI0SuePlTFmuTrGDuXgs2CJrIFojJ3U1wVgl7vahJb8GsfKFCnzJMH6IfDQhg8Mdb2 c3Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/ozRwFUKWRP9SpYUuH4++21vufDHRVG5o5zoM8NlA8A=; b=l+IgvxB6I1bOpCxhQ+PsS71j32QJa5xpIuA4jjPEroabKJcHWvuYq+CHuxXkJkUGoN bxSRe+AzvDBnHWIFalss+kslHguW1w8GWxEyo1WsVivmwVLSxOYuel0NfPSSD/sG6H50 lpL95iERpySHYun9KFv8KJz+Q2p9zVRrvdHNESqYeFqgG81TThVEYkLRGyjsX/0nAVWk wAUCEFC1ItdXeKDrm5lGfIjQnDT8+ui3dVHYY23yFXJ9ldFll2UGQt4vtyjSjB10WrWq SokHgK/p1tPRsDu02WmjDR8XSx9H1qIbDxgUfLhq73YPz/hj8Yt6FDzUMLx9pI9NwAAN 4c+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EqmIHAlO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w17-20020a05622a191100b003f9a72b690bsi7077988qtc.451.2023.06.13.04.31.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 04:31:39 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EqmIHAlO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q90UU-0005Xi-RH; Tue, 13 Jun 2023 05:39:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q90UT-0005X7-Bf for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:05 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q90UR-0005aL-Fq for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:05 -0400 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-977ed383b8aso853475266b.3 for ; Tue, 13 Jun 2023 02:39:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686649141; x=1689241141; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/ozRwFUKWRP9SpYUuH4++21vufDHRVG5o5zoM8NlA8A=; b=EqmIHAlOkhSVXOi34f3WHCE3KVNRFobnObL15ntex6WmrhLzofdoibUznIGGpU5JCN c4QN6CF8MclNTUYCWHeIPpWEeuGrWUWCRWBqsMCxucOhPLXXU3K7cIWg/O4wOtLRA0H3 yIOFNPMi66wAwt1S0b/QMogRq/ISbTaWWmdESgq3o+JzBKs7REV/gcIAEGuVHeX3ekQo BUcYnaNt09ye6kMZVuYRcmDtFG/aGiYloOricp+hoa7K7j7z619/SFdDT6Up0TfZOrFD vMj2TuW1cJFUpa65KKSwR0/6t4EvRryajf5saQNG2RXbIQuifA6rwxqN8uI2X1OaLxTd mWvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686649141; x=1689241141; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/ozRwFUKWRP9SpYUuH4++21vufDHRVG5o5zoM8NlA8A=; b=gT3g+rW7VqTTqy+z9jAnHnTj8L0NvtdtDfjQ5uWyzQmZx0s38hl6x/gnuTRcCkim1B iWgOFUFixfQBbpveU0c348sbz1V0hATL80KDM36tYwO0Hyp6Im95o0PAir3C2FLgelF1 +Rj70Wiyvh6FjpSnXTZjTz5QbDYtMVhrQCKl5gs39MS1MiBrkuDFATXwDAbc9M+kfPl6 ge3NkOWeh97ucYhhaDAkpiiwJnQwtK+yPIcTpOQa+139WYdaeZ64Kzk8OSox+v/KAzhF 5VT24AAZr5BrAbmZnWFYRMUCJn48nEIjbomft/d9BwTFu0M7hybAyaf7CIf0apLGbWVd XTQA== X-Gm-Message-State: AC+VfDyOGbohGDLzJtSSVyZWMx29xwEKusun9tI6lL6XBGeoZIAcGhpA ZlOK3zSeeDO9+omKYV99PiDCzX0NsqTX3adUtLwFAQ== X-Received: by 2002:a17:907:94ca:b0:979:dad9:4e9 with SMTP id dn10-20020a17090794ca00b00979dad904e9mr11591549ejc.50.1686649141524; Tue, 13 Jun 2023 02:39:01 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id k13-20020a17090627cd00b0096f6647b5e8sm6386417ejc.64.2023.06.13.02.39.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 02:39:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 08/17] target/i386/helper: Shuffle do_cpu_init() Date: Tue, 13 Jun 2023 11:38:13 +0200 Message-Id: <20230613093822.63750-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613093822.63750-1-philmd@linaro.org> References: <20230613093822.63750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=philmd@linaro.org; helo=mail-ej1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Move the #ifdef'ry inside do_cpu_init() instead of declaring an empty stub for user emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230602224628.59546-3-philmd@linaro.org> --- target/i386/helper.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/target/i386/helper.c b/target/i386/helper.c index 792c8eb45e..89aa696c6d 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -580,9 +580,9 @@ int cpu_x86_get_descr_debug(CPUX86State *env, unsigned int selector, return 1; } -#if !defined(CONFIG_USER_ONLY) void do_cpu_init(X86CPU *cpu) { +#if !defined(CONFIG_USER_ONLY) CPUState *cs = CPU(cpu); CPUX86State *env = &cpu->env; CPUX86State *save = g_new(CPUX86State, 1); @@ -601,19 +601,15 @@ void do_cpu_init(X86CPU *cpu) kvm_arch_do_init_vcpu(cpu); } apic_init_reset(cpu->apic_state); +#endif /* CONFIG_USER_ONLY */ } +#ifndef CONFIG_USER_ONLY + void do_cpu_sipi(X86CPU *cpu) { apic_sipi(cpu->apic_state); } -#else -void do_cpu_init(X86CPU *cpu) -{ -} -#endif - -#ifndef CONFIG_USER_ONLY void cpu_load_efer(CPUX86State *env, uint64_t val) { From patchwork Tue Jun 13 09:38:14 2023 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: 691973 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp365711wru; Tue, 13 Jun 2023 04:39:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7q/O/wovTjx4j/oylhsFoQexvBDuhN3ScqxJ7IIxeh/kA6Gdtr4I0CyvWkOeLxu6DBSb1z X-Received: by 2002:ac8:5a0b:0:b0:3f9:d6a2:d34b with SMTP id n11-20020ac85a0b000000b003f9d6a2d34bmr17455332qta.53.1686656339871; Tue, 13 Jun 2023 04:38:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686656339; cv=none; d=google.com; s=arc-20160816; b=YsRQPtNNWGfsApzdfI++SVf71FsiR2nY/sQOPNmVprnBElP3IwtfSBNYDwVPrE/KOp +7fmDVqt9W23U6LF3g/HcI81wkJKy+agKDYw09WK/SvLKKVgLu8wk3qx3w1IzBRw557e yzGZ1h3CCBNJMtKIScLmb5BJEWkN0ZA5quGdFUvUcN7EfoZ6lfaKwzZfhd+ENlDy3siK nSl11AVffbbBWF8EJwDdboRTlX4LTunnHkSVD09JLYL12e2qE5v/7jcQgGL73DvjRBvt a5NmHM2q2cwv4joI6I7hhz/J+2YuXeLCNlVE5I/2CgUxya1JcH0uEKVXxSSC9HSNY5vX FElQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rHrcXRiCbN+BH2DRfEnwQXK6yfm4A30MJfpoXN1BebI=; b=WB4diC4BOMXdgKxsncA8khLhJagBzC01d5lOuoLWsPdD/O4ve6STDJdQjkStEkQLXY H4Eotuc8coXpwGnPjXTfccbuuNG+LWJVdfKRBJDjEs1cgtmaKxaDqZytp6JRG/KuqTES vvAWuZA9FhpkYWoeAJFIrAeON6klNbhrH/Da8dfZfGDtlBu8TRcgKVOWse5DrwZ7BUFg t0yGVwOag0ZXp1RcL7yQJc+OVfL2ri3GheVDQdrqegjJcBerDp83ZphGiLjfOfGQPCHW PSQ4aS4q7EejZ0o2lJVQoVS8Am28tbvk049mBn9jgctg0pUhneBB+3ATIk1ekEthfnaE 5S2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Uxl4dn5o; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h17-20020ac87d51000000b003f9c255fa03si7306702qtb.400.2023.06.13.04.38.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 04:38:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Uxl4dn5o; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q90UZ-0005Yn-Dt; Tue, 13 Jun 2023 05:39:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q90UX-0005YP-PD for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:09 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q90UV-0005aw-7s for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:09 -0400 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5169f920a9dso10849915a12.0 for ; Tue, 13 Jun 2023 02:39:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686649145; x=1689241145; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rHrcXRiCbN+BH2DRfEnwQXK6yfm4A30MJfpoXN1BebI=; b=Uxl4dn5ovOJmJAUv6ODkGAf4umvAEAxumdIhkeAYQVquTw7yrUatHJyPKojN3GsBRi Balc1lXqfTyeKEp9S+D1z2eDKkqRKv7zXpleP6C5ZGyU/aBEdUdW0LabCig+J9fYxugt 58BJMN//atHclN/VpDgDCdZJ/Krjq+FQxzf6mzlPczJdWKHG7HHq6fffXx8XSzZm3R4H vrk2JrJ+wzov4eKVwivn34nE/TpgyyIzB4JUCL3d/af9INfAE++tzFSES8mCbmWDHMb5 yRI++YXpvf27wack8fMH+9pA23nLGHPvasgzVimf1ahAlPIFNp9M2LjmebOLYvVf8jX4 Rngw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686649145; x=1689241145; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rHrcXRiCbN+BH2DRfEnwQXK6yfm4A30MJfpoXN1BebI=; b=jUEUFAFVhFFsOipE4wCId6XZk5MGee9R9h+56piiyAxjdjfZrqE0IBt8D/QjX1BBBG mJupzEc8hik57yWLSX9MhxOYDZpAz3P/RBNYhzZ2R1JAskg0k1emLrhbVvKSytaXSg/k KbsIpajJYyItKF0t1ubDzKP58BfMharZ09nhNSKVi/cHV9dqLpXZVrgZ3JI1/Xs5yEK0 bpWVNGYN/Vbp8AF3Mvm/N8qxGF4ddRY03xyIj/B7jY3RRJL8pIalLJCJIqhhMMbjo8zl UPa2ZTdibSRPucjsaAtcekZiTBgAFyXnToTj7tCDkdX4gjLtAAQpuzSEaGwTZUnDPqti wY9w== X-Gm-Message-State: AC+VfDzOP38Fa/Syy5MnQZGj1WlN1rQvyCTFqRbUkaQ7P0VIeYyrIqVT 6HWI34AA8xQWyAgEymMYkGoQhAJiPR8/olvCGgQVYg== X-Received: by 2002:a05:6402:35d1:b0:514:94be:323c with SMTP id z17-20020a05640235d100b0051494be323cmr8704889edc.10.1686649145606; Tue, 13 Jun 2023 02:39:05 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id v4-20020a056402184400b00515c8024cb9sm6307552edy.55.2023.06.13.02.39.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 02:39:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 09/17] target/i386: Rename helper template headers as '.h.inc' Date: Tue, 13 Jun 2023 11:38:14 +0200 Message-Id: <20230613093822.63750-10-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613093822.63750-1-philmd@linaro.org> References: <20230613093822.63750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=philmd@linaro.org; helo=mail-ed1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Since commit 139c1837db ("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc. Besides, since commit 6a0057aa22 ("docs/devel: make a statement about includes") this is documented as the Coding Style: If you do use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion. Therefore move the included templates in the tcg/ directory and rename as '.h.inc'. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20230608133108.72655-5-philmd@linaro.org> --- target/i386/helper.h | 6 +++--- .../{cc_helper_template.h => cc_helper_template.h.inc} | 0 .../i386/{ops_sse_header.h => tcg/ops_sse_header.h.inc} | 0 .../shift_helper_template.h.inc} | 0 target/i386/tcg/cc_helper.c | 8 ++++---- target/i386/tcg/int_helper.c | 8 ++++---- 6 files changed, 11 insertions(+), 11 deletions(-) rename target/i386/tcg/{cc_helper_template.h => cc_helper_template.h.inc} (100%) rename target/i386/{ops_sse_header.h => tcg/ops_sse_header.h.inc} (100%) rename target/i386/{shift_helper_template.h => tcg/shift_helper_template.h.inc} (100%) diff --git a/target/i386/helper.h b/target/i386/helper.h index e627a93107..48609c210b 100644 --- a/target/i386/helper.h +++ b/target/i386/helper.h @@ -203,11 +203,11 @@ DEF_HELPER_1(enter_mmx, void, env) DEF_HELPER_1(emms, void, env) #define SHIFT 0 -#include "ops_sse_header.h" +#include "tcg/ops_sse_header.h.inc" #define SHIFT 1 -#include "ops_sse_header.h" +#include "tcg/ops_sse_header.h.inc" #define SHIFT 2 -#include "ops_sse_header.h" +#include "tcg/ops_sse_header.h.inc" DEF_HELPER_3(rclb, tl, env, tl, tl) DEF_HELPER_3(rclw, tl, env, tl, tl) diff --git a/target/i386/tcg/cc_helper_template.h b/target/i386/tcg/cc_helper_template.h.inc similarity index 100% rename from target/i386/tcg/cc_helper_template.h rename to target/i386/tcg/cc_helper_template.h.inc diff --git a/target/i386/ops_sse_header.h b/target/i386/tcg/ops_sse_header.h.inc similarity index 100% rename from target/i386/ops_sse_header.h rename to target/i386/tcg/ops_sse_header.h.inc diff --git a/target/i386/shift_helper_template.h b/target/i386/tcg/shift_helper_template.h.inc similarity index 100% rename from target/i386/shift_helper_template.h rename to target/i386/tcg/shift_helper_template.h.inc diff --git a/target/i386/tcg/cc_helper.c b/target/i386/tcg/cc_helper.c index 6227dbb30b..c310bd842f 100644 --- a/target/i386/tcg/cc_helper.c +++ b/target/i386/tcg/cc_helper.c @@ -58,21 +58,21 @@ const uint8_t parity_table[256] = { }; #define SHIFT 0 -#include "cc_helper_template.h" +#include "cc_helper_template.h.inc" #undef SHIFT #define SHIFT 1 -#include "cc_helper_template.h" +#include "cc_helper_template.h.inc" #undef SHIFT #define SHIFT 2 -#include "cc_helper_template.h" +#include "cc_helper_template.h.inc" #undef SHIFT #ifdef TARGET_X86_64 #define SHIFT 3 -#include "cc_helper_template.h" +#include "cc_helper_template.h.inc" #undef SHIFT #endif diff --git a/target/i386/tcg/int_helper.c b/target/i386/tcg/int_helper.c index 599ac968b0..05418f181f 100644 --- a/target/i386/tcg/int_helper.c +++ b/target/i386/tcg/int_helper.c @@ -448,20 +448,20 @@ target_ulong helper_pext(target_ulong src, target_ulong mask) } #define SHIFT 0 -#include "shift_helper_template.h" +#include "shift_helper_template.h.inc" #undef SHIFT #define SHIFT 1 -#include "shift_helper_template.h" +#include "shift_helper_template.h.inc" #undef SHIFT #define SHIFT 2 -#include "shift_helper_template.h" +#include "shift_helper_template.h.inc" #undef SHIFT #ifdef TARGET_X86_64 #define SHIFT 3 -#include "shift_helper_template.h" +#include "shift_helper_template.h.inc" #undef SHIFT #endif From patchwork Tue Jun 13 09:38:15 2023 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: 691964 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp359549wru; Tue, 13 Jun 2023 04:24:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6UlhcDIckWLQQopaqkJeuFa/2jUCkklMalvqC5D8RO4XV0jSQiLjtAamr0TJu6puFEaV4i X-Received: by 2002:a05:622a:40c:b0:3f6:b95e:f700 with SMTP id n12-20020a05622a040c00b003f6b95ef700mr18611716qtx.57.1686655459918; Tue, 13 Jun 2023 04:24:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686655459; cv=none; d=google.com; s=arc-20160816; b=G8lwm76xxo2PTFQ6WQOE6TVuaRX5iJLk0qUGsr7RULjTkfuX/bFLHFFfgMwjpmjPbA iUKIKNC1CPv1G97ADoIAZCdhZG4v5LKVpY4ikQgYArbU70JRIsqXLLE5xw0YZYNfwd5E gJO31OKKn1mkEEUbhHHhIQT9Qw0AqySdPQNTNfyv7TyWWxPQWYAP7gd2LL83B5uA93oY AxUnjUgQUWghnrx0mEyHttg3XlrSTMW9LOwhDVD5HCwV4w3BPJZ8n6e+C5msGEcoqifc Kx0x2wEwGIkyR/KEyIk67G036FUsm7OlwX8OflRfpQftVCfYvl5cko3833WbI90wI4r0 VhiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/D7wkI1JesyjQo8qFwOoKcnfGvIlymgwtmf2GQlKJIc=; b=AGaysonAczIIPNR9FTbv9Nt8pi8dsm9Iw7CViy9ITKkv2LgHAR8NBAnH9aJGZzS5yX tOXcQcRukERgLSJ4x/uDPKlidrF2NdUMyK3kYryDRtvMLIgxIewLGIMDQWRSWeFrGdyo tT0q97p/xgOgx2O+E9eOuYIxZCv9UIki/AqoYTfjfkU9t+YZ+uoarQR7Mu70WMa9ihrc hRcOiItLQIZEYAytU4l0yl8zDYBnRrYbRJQN0eLFNSu4dQIC6Uzxa8X82URhikdYrNAM j4BaQepR2JK0hO97DCE32EJWS126g9B4CFOayjqe6x5gUf8908G32elUaPFN05c1+PU/ 21lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="fq/uTziq"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r18-20020ac85c92000000b003f6baac3610si7566083qta.377.2023.06.13.04.24.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 04:24:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="fq/uTziq"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q90Ue-0005Zt-0W; Tue, 13 Jun 2023 05:39:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q90Uc-0005Zc-GR for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:14 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q90UZ-0005be-Ff for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:14 -0400 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-9786fc23505so778218566b.2 for ; Tue, 13 Jun 2023 02:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686649150; x=1689241150; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/D7wkI1JesyjQo8qFwOoKcnfGvIlymgwtmf2GQlKJIc=; b=fq/uTziqCef/oigNwOx9ee1rF0B1HfKKLDByBWHosf8Qghsd7AGtYqSrMdRs2xISSD kIbNbd7kgxBpiLctHOKykmDUkzvWzVNRKoLq+2gM7vDrHdv10XadNjkqAju+jmO6kLI9 R9+Tt0qucT1DkwnL9Vybo1b+j81Fff14Sb1mM5vdBW0GzSF7MaZo0Mp2eqFf4Ox1t8aa E/dC/X//80g3rFgNzqC0A5XebbpQnG27UbH1dyQIFh0HRQtHUwMddQh54MeChPl+vSwq iAGCznSt5aPC7oLkOQoYu1DQ3c/bvWDBg6AHjOHJfQhOpyq5/Fz7aA+y4I5SIexycWSM BLMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686649150; x=1689241150; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/D7wkI1JesyjQo8qFwOoKcnfGvIlymgwtmf2GQlKJIc=; b=FCzzfaDKJtAA6VtzwZT5k7dtAShdUNcWwYDrkcZr9Yru9YQAJKmH/cmEMFDf3cuJg2 iDObeMcXTnhgrrq0UyzdoWNL0cUWH5D+qIyDv/yhIJIvR0kmSxJqR3SpNo66XSNj3LmW l+vv6DzshlAYO+MzOhQSdTh0/8JW1f3zxlxKkhFVCIkuVjka3gMzFapt2SkRdM0kUZYt MEHnGaEnYDQnl86TkR2klQU4ki7IHvKClfZPNFiMF1+P/9sxUU+j/Gg3vxmylTODsHyX one/e60uKBxxiy5QBOx+tcmBhRxefQN8D4nk79vnlsel4stjLGFzkQ6haBSyYIe6tc/6 rPUg== X-Gm-Message-State: AC+VfDxrwWsa+3s/mIgM8j3gdE4UdaUebCIEisnrNKpDpRHTwTzUx2iV +3j4IecitySzJvIhyOt7zeME59o5oSwbyX9GH/nBZA== X-Received: by 2002:a17:907:7f0f:b0:97e:ab93:b246 with SMTP id qf15-20020a1709077f0f00b0097eab93b246mr8731430ejc.66.1686649149808; Tue, 13 Jun 2023 02:39:09 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id w23-20020a170906b19700b009746394662asm6403119ejy.53.2023.06.13.02.39.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 02:39:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Patrick Venture , Hao Wu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Corey Minyard Subject: [PULL 10/17] hw/i2c: Enable an id for the pca954x devices Date: Tue, 13 Jun 2023 11:38:15 +0200 Message-Id: <20230613093822.63750-11-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613093822.63750-1-philmd@linaro.org> References: <20230613093822.63750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=philmd@linaro.org; helo=mail-ej1-x629.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Patrick Venture This allows the devices to be more readily found and specified. Without setting the name field, they can only be found by device type name, which doesn't let you specify the second of the same device type behind a bus. Tested: Verified that by default the device was findable with the name 'pca954x[77]', for an instance attached at that address. Signed-off-by: Patrick Venture Reviewed-by: Hao Wu Reviewed-by: Philippe Mathieu-Daudé Acked-by: Corey Minyard Message-Id: <20230322172136.48010-1-venture@google.com> [PMD: Fix typo in property name] Signed-off-by: Philippe Mathieu-Daudé --- hw/i2c/i2c_mux_pca954x.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/hw/i2c/i2c_mux_pca954x.c b/hw/i2c/i2c_mux_pca954x.c index 3945de795c..db5db956a6 100644 --- a/hw/i2c/i2c_mux_pca954x.c +++ b/hw/i2c/i2c_mux_pca954x.c @@ -20,6 +20,7 @@ #include "hw/i2c/i2c_mux_pca954x.h" #include "hw/i2c/smbus_slave.h" #include "hw/qdev-core.h" +#include "hw/qdev-properties.h" #include "hw/sysbus.h" #include "qemu/log.h" #include "qemu/module.h" @@ -43,6 +44,8 @@ typedef struct Pca954xState { bool enabled[PCA9548_CHANNEL_COUNT]; I2CBus *bus[PCA9548_CHANNEL_COUNT]; + + char *name; } Pca954xState; /* @@ -181,6 +184,17 @@ static void pca9548_class_init(ObjectClass *klass, void *data) s->nchans = PCA9548_CHANNEL_COUNT; } +static void pca954x_realize(DeviceState *dev, Error **errp) +{ + Pca954xState *s = PCA954X(dev); + DeviceState *d = DEVICE(s); + if (s->name) { + d->id = g_strdup(s->name); + } else { + d->id = g_strdup_printf("pca954x[%x]", s->parent.i2c.address); + } +} + static void pca954x_init(Object *obj) { Pca954xState *s = PCA954X(obj); @@ -197,6 +211,11 @@ static void pca954x_init(Object *obj) } } +static Property pca954x_props[] = { + DEFINE_PROP_STRING("name", Pca954xState, name), + DEFINE_PROP_END_OF_LIST() +}; + static void pca954x_class_init(ObjectClass *klass, void *data) { I2CSlaveClass *sc = I2C_SLAVE_CLASS(klass); @@ -209,9 +228,12 @@ static void pca954x_class_init(ObjectClass *klass, void *data) rc->phases.enter = pca954x_enter_reset; dc->desc = "Pca954x i2c-mux"; + dc->realize = pca954x_realize; k->write_data = pca954x_write_data; k->receive_byte = pca954x_read_byte; + + device_class_set_props(dc, pca954x_props); } static const TypeInfo pca954x_info[] = { From patchwork Tue Jun 13 09:38:16 2023 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: 691970 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp361585wru; Tue, 13 Jun 2023 04:29:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ71j9k2qTSnqGMG9YQ7sV30rtToESV+wk0hYW27N7OEq4C0wcDMnBZwLAqNIz9uKI1c9kGd X-Received: by 2002:a05:6214:27ce:b0:5ef:8161:cb9a with SMTP id ge14-20020a05621427ce00b005ef8161cb9amr18214661qvb.7.1686655786275; Tue, 13 Jun 2023 04:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686655786; cv=none; d=google.com; s=arc-20160816; b=ZX600zxtu3CFz/kie8h/EECEaVbFbYrjtnH54q0rikVMLIF8lTcDQ60y9JOtijRlLe w6RLwAIfn3sKa3GYl6MHbyOSLL55wFKybNmxTGmI49V9Ufay6wXckRugEiXnX9Vwycn8 BYPYMXpoJrryiVKv4QsLQ8srJxAhE3XbBmH17/mwWLLAnvjQzC0iMFmtGo5hszdVQgGu x8JX3Hg0oygx60BKL3dLqbYM4cC+J7TY215NbherL0RyCxqYfnUcWbj6GALNYddyQ15r FvNHXM6H65cuq6hODg9D8j2Zc9sj5DpDGebUf/vmtQQSUWZC9Mj3n3Fjm7A7jDcXwGzo mrkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=x2jo3NykLrkWBJhw7LXeamiV1DdBMNZRbXtGEhY4Rnw=; b=aASf9NTcC5DVMv3uhzIf3SHsaSDcdKadnJuE2MmIxTQsHSsnozX6VkExL7bopUe+Hy XSojKE2xc7PzacDMqzhgQ8+oHh1uPmoBXaHf3DtOLLuMOyxTDOyFhlbuNdHjaOEZL+SZ rYvYB9Yw5EZTcZBDlhBmyL6oV3EaRjW8i9P01Xv3tW29dFRMJMlW29EiZaR+tXGrrYY6 X/VPGhwp8yS7bhguBTpBSbH26iZBnwyHji+UxE+RL57TCWBunb3ADaV7sgvHicwKWEf8 800JOW/djpCmKRe6htRxIRg7fOjDSluL61UOTQOIYGGwwkQ5sdtX+8/qDnlpDLzz7wdg eexQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XxVex2w7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id eq4-20020ad45964000000b0056ea3d10d19si1670276qvb.396.2023.06.13.04.29.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 04:29:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XxVex2w7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q90Us-0005fV-Ij; Tue, 13 Jun 2023 05:39:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q90Ur-0005f0-6A for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:29 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q90Uf-0005d8-JG for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:28 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-977c89c47bdso955833766b.2 for ; Tue, 13 Jun 2023 02:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686649155; x=1689241155; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=x2jo3NykLrkWBJhw7LXeamiV1DdBMNZRbXtGEhY4Rnw=; b=XxVex2w7HrwCcsJHDkTat5UBtXx7F53UseaDsE59/7S3Gv7w0rPJQLX3sESivWEGJz VJiNx/Ke3kOAaolsPwMkw9AzLMhyPYK/eXx5Ao0xtMxqaa/nspQeNadKJqfELtlQZlEe NH+Tv/g6r8UBm0ItJ57QtLBHkb3qJxVmiTh+pFSyG7fPkTYaGXmkXLguv2HDyMLStZ0T L7tB9xiDX2wOxnqpmQXcuGINYwRRjOydCC1YywQ7SBVgViaCny3n1+LlXK0LHSrJaaLy CUOAtjqdVrGT39jmkp3tzgED1mNyHDHf9btgv0ePr1NW2XTFM5X/el0QyqjyG3x5Qncl ddmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686649155; x=1689241155; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x2jo3NykLrkWBJhw7LXeamiV1DdBMNZRbXtGEhY4Rnw=; b=f75kgILF6BO0zlMUOGzTPqiK93jOLkhrSsXLdQDUJHln2EQvMzQhk04OmzDWvQHTLh ODHlbLIO4Id+/ssB2e/Ca+PTdzWYfpW/7KsdEzdyw6zGpk4O1rm+cR5xtaGQqt+auz4a kzimLzWw8asazVecTF2771yriSkjzWzfH1zsiERRJSJ9eB9UQqN3POSLjVoVtwUrbAXq HmyVP52jMtOXp5HqP18IYhGV2NMYL9qzmBZWwWMkhEieJB0sJ7n8jrqd5oRfQP/grCT0 iaLebsDBQ2pz8YGWWyCXZQv6jDpC7aJjtIia3WZLHy3OsNg1quXnUym/P+w8kyW7y0c4 mwGA== X-Gm-Message-State: AC+VfDykKeJWFX2lM4oi3z+Lpf96OEyE90Px+DJ6cY3pzUW5g7MXWdUO +uVINDWp+6MWAsOisPkEFUlURwXBiFGUhhW5H82cRw== X-Received: by 2002:a17:907:7b91:b0:977:d48f:97ad with SMTP id ne17-20020a1709077b9100b00977d48f97admr14304901ejc.75.1686649154952; Tue, 13 Jun 2023 02:39:14 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id w15-20020a1709062f8f00b009534211cc97sm6358163eji.159.2023.06.13.02.39.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 02:39:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Niklas Cassel , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow Subject: [PULL 11/17] hw/ide/ahci: Remove stray backslash Date: Tue, 13 Jun 2023 11:38:16 +0200 Message-Id: <20230613093822.63750-12-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613093822.63750-1-philmd@linaro.org> References: <20230613093822.63750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=philmd@linaro.org; helo=mail-ej1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Niklas Cassel This backslash obviously does not belong here, so remove it. Signed-off-by: Niklas Cassel Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: John Snow Message-Id: <20230601134434.519805-2-nks@flawful.org> Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/ahci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 4e76d6b191..48d550f633 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -690,7 +690,7 @@ static void ahci_reset_port(AHCIState *s, int port) s->dev[port].port_state = STATE_RUN; if (ide_state->drive_kind == IDE_CD) { - ahci_set_signature(d, SATA_SIGNATURE_CDROM);\ + ahci_set_signature(d, SATA_SIGNATURE_CDROM); ide_state->status = SEEK_STAT | WRERR_STAT | READY_STAT; } else { ahci_set_signature(d, SATA_SIGNATURE_DISK); From patchwork Tue Jun 13 09:38:17 2023 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: 691966 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp360582wru; Tue, 13 Jun 2023 04:27:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4xbWBRxaV4skFhmOsnmcoLDQCmOu536YD1zn36fcdt0XUA49oR7KyZOJ76wrHvMMKUeC9g X-Received: by 2002:ac8:5b4f:0:b0:3fc:7ef:c9d0 with SMTP id n15-20020ac85b4f000000b003fc07efc9d0mr1704652qtw.62.1686655624934; Tue, 13 Jun 2023 04:27:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686655624; cv=none; d=google.com; s=arc-20160816; b=MpOSzzjoq612qKxvPOz+A6zFK3W62ke/N7MIlWifyvlt7T+vXrWGllFBKSfbfiiDco I7zrS/763znqIwU3gtan0RUVW2AfnaveukN1+rx4fY5TJpRuBwmHixEhsbtYtDHgsJzq +mvb6SvdNbUnEXlJ277m0H1H/mXADv+pbHL/G2DR7HgmMNMt/sFrKLxUHPBxJJ0Uex3o V8461CdQbLoUhX9jkt6yO+fL8Nh8TPvyuuvyh2Rhr9PG/lmxYYP0O5ARKIfvF4BAUj/q LkaV9Les7c0OlyThnYMaVCzMI3wz6YxFKROk7KxI9cVg/6ylOyBiMJ42mpx5gyZalqs1 f9vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eupMI3Meu8cffWS+qjznZxnt/lkJ4Ptq7I5pw8yZlMY=; b=IQFFw0nuH7YPWhjCzB/qFd/oO8PJhVxdaulRXkYdOO6lGjJJ5QyXP+vlPh6ckkTd5u EYggTibrn6YcU+zn4cROiKUU3YcG8LyREdGouCugSMBDOM7iXepL2k18wetjJ5fattQP kyoSm1RugyMcShRfWWmRfTguJFhcqKVcsYSVG7pY1vkUXFiueHj90OncHYlEP0dMvraj CfPMODA5otHp4PULbCpX13bti6/Wne6qHD+0f9fASBF7NuDpy8fDI1zy6O57FOhREnvI 1sTOgjCsZfPbn+RohoCluUJ47iaRFWXSBQG4b5HH4jQ9qpHhDV7bZjpVbXx4d7JmkNn+ 4boA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K2Vb46AS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z15-20020a05622a028f00b003f6a9bea941si7348033qtw.567.2023.06.13.04.27.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 04:27:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K2Vb46AS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q90Uq-0005ew-VW; Tue, 13 Jun 2023 05:39:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q90Up-0005eZ-SB for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:27 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q90Uj-0005df-SQ for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:27 -0400 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-9745d99cfccso937839466b.1 for ; Tue, 13 Jun 2023 02:39:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686649159; x=1689241159; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eupMI3Meu8cffWS+qjznZxnt/lkJ4Ptq7I5pw8yZlMY=; b=K2Vb46ASF7WJ45/pWoE+CvyqBsi3zplG7pR4R2HR8XgsS2gLwQatnABew+2l3dLof6 Qt/X4cnfNlq0xpKVhZaADfy6XfTiEJLjguRDeMSHd4ztui73693xVi21mEiF3Uhqx0pR YRKirmzTgX1GertNwhFYaosB4qTLbxJMFTJPXwIi2uh5WlLKtfSZCVFc76KMjoCpqa2S v+JhWM0wZaHHZgyDBzGpIAtp3DRhGyqLzwxCm+CCsFuNSRyC3mcF1RbSmbExTOYscn9C 2JwNAWJHHLB02mCN05ZqkoybJbblASlRNnOSmlA9etqxksl6DHDQvtNa/2+aO+d9AH67 UGsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686649159; x=1689241159; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eupMI3Meu8cffWS+qjznZxnt/lkJ4Ptq7I5pw8yZlMY=; b=ZIYvoKvIC6/lwYAafAbPzdwwIMbBhoaHsBptW53XNciBjsnxJP+ehI7PgAA1L0Of/9 oS4kZY4/EygVbDoyWySnGGvMVhsw27es09AUXjmDHqOebL82aNXU2jb96FZuy8pUVoAu X682xcKVQLv778Gfsb3bmZaGYKSIiI/S2HYMEZOK8uHcMcLurTBZ72lULG+LDbP3O6Qp oxpw/4lw08Y0iZ5yB9b3fTi4czHeh+j92QKnC+PRJxCqH8R6qnPJVobctQfkR4MsgEG5 /b2K7JGwUiaF8lp3IpJf/Gs2wHfd/SVBDQstLsHQK9AHo742kZ0sonvVWTa2Cf/iiaen BbUw== X-Gm-Message-State: AC+VfDwzXMeYFvh0Vc6rQUulCUhpFC3y3XKmVFKP32BE8waCx0y2tfK7 kSpYIcnQJfHqWTyVwjQnTuMO1tY//bGsDsMK+ejEHA== X-Received: by 2002:a17:907:7da9:b0:973:93d6:189f with SMTP id oz41-20020a1709077da900b0097393d6189fmr14472263ejc.61.1686649159550; Tue, 13 Jun 2023 02:39:19 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id m25-20020a1709062b9900b0096637a19dccsm6318257ejg.210.2023.06.13.02.39.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 02:39:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Hannes Reinecke Subject: [PULL 12/17] hw/scsi/megasas: Silent GCC duplicated-cond warning Date: Tue, 13 Jun 2023 11:38:17 +0200 Message-Id: <20230613093822.63750-13-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613093822.63750-1-philmd@linaro.org> References: <20230613093822.63750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=philmd@linaro.org; helo=mail-ej1-x635.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé GCC9 is confused when building with CFLAG -O3: hw/scsi/megasas.c: In function ‘megasas_scsi_realize’: hw/scsi/megasas.c:2387:26: error: duplicated ‘if’ condition [-Werror=duplicated-cond] 2387 | } else if (s->fw_sge >= 128 - MFI_PASS_FRAME_SIZE) { hw/scsi/megasas.c:2385:19: note: previously used here 2385 | if (s->fw_sge >= MEGASAS_MAX_SGE - MFI_PASS_FRAME_SIZE) { cc1: all warnings being treated as errors When this device was introduced in commit e8f943c3bcc, the author cared about modularity, using a definition for the firmware limit. However if the firmware limit isn't changed (MEGASAS_MAX_SGE = 128), the code ends doing the same check twice. Per the maintainer [*]: > The original code assumed that one could change MFI_PASS_FRAME_SIZE, > but it turned out not to be possible as it's being hardcoded in the > drivers themselves (even though the interface provides mechanisms to > query it). So we can remove the duplicate lines. Add the 'MEGASAS_MIN_SGE' definition for the '64' magic value, slightly rewrite the condition check to simplify a bit the logic and remove the unnecessary / duplicated check. [*] https://lore.kernel.org/qemu-devel/e0029fc5-882f-1d63-15e3-1c3dbe9b6a2c@suse.de/ Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Hannes Reinecke Message-Id: <20230328210126.16282-1-philmd@linaro.org> --- hw/scsi/megasas.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index 9cbbb16121..32c70c9e99 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -42,6 +42,7 @@ #define MEGASAS_MAX_FRAMES 2048 /* Firmware limit at 65535 */ #define MEGASAS_DEFAULT_FRAMES 1000 /* Windows requires this */ #define MEGASAS_GEN2_DEFAULT_FRAMES 1008 /* Windows requires this */ +#define MEGASAS_MIN_SGE 64 #define MEGASAS_MAX_SGE 128 /* Firmware limit */ #define MEGASAS_DEFAULT_SGE 80 #define MEGASAS_MAX_SECTORS 0xFFFF /* No real limit */ @@ -2356,6 +2357,7 @@ static void megasas_scsi_realize(PCIDevice *dev, Error **errp) MegasasState *s = MEGASAS(dev); MegasasBaseClass *b = MEGASAS_GET_CLASS(s); uint8_t *pci_conf; + uint32_t sge; int i, bar_type; Error *err = NULL; int ret; @@ -2424,13 +2426,15 @@ static void megasas_scsi_realize(PCIDevice *dev, Error **errp) if (!s->hba_serial) { s->hba_serial = g_strdup(MEGASAS_HBA_SERIAL); } - if (s->fw_sge >= MEGASAS_MAX_SGE - MFI_PASS_FRAME_SIZE) { - s->fw_sge = MEGASAS_MAX_SGE - MFI_PASS_FRAME_SIZE; - } else if (s->fw_sge >= 128 - MFI_PASS_FRAME_SIZE) { - s->fw_sge = 128 - MFI_PASS_FRAME_SIZE; - } else { - s->fw_sge = 64 - MFI_PASS_FRAME_SIZE; + + sge = s->fw_sge + MFI_PASS_FRAME_SIZE; + if (sge < MEGASAS_MIN_SGE) { + sge = MEGASAS_MIN_SGE; + } else if (sge >= MEGASAS_MAX_SGE) { + sge = MEGASAS_MAX_SGE; } + s->fw_sge = sge - MFI_PASS_FRAME_SIZE; + if (s->fw_cmds > MEGASAS_MAX_FRAMES) { s->fw_cmds = MEGASAS_MAX_FRAMES; } From patchwork Tue Jun 13 09:38:18 2023 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: 691980 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp368705wru; Tue, 13 Jun 2023 04:46:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Pqegk5VZjPU3VjDM/13SQHGjqncXh1BHkWX8xXPFiuDj/cIjwBBhnzUsEDk80EwG13ldM X-Received: by 2002:a05:6214:130b:b0:626:2bd8:b67a with SMTP id pn11-20020a056214130b00b006262bd8b67amr15159647qvb.21.1686656812094; Tue, 13 Jun 2023 04:46:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686656812; cv=none; d=google.com; s=arc-20160816; b=brtGaCyH3O4xQR+HeuY37tgEJvVTxOz1Xtnlpe1uDUj8PNEIZwJhVgiSgonFDG0PMJ dMVT67UeYhhgZQOtj4HiuLBmp9sCeqnfjUiLbayTBVCEThfogxvb8O8/OepynxCy3TpH SI6hIytWmCNhRnV09237YvFsTNLEWkKlqrBPA3z47ld0d3g9jp7ee0zBpn/Lk++ry0gH dKNPM3VfmGv1iEHhkIqu304AkMyjWFy0zKtDwx0+Yeu0iV5O5n5bhNOWa94Edx+S+EaG 0M55hWSJVtLh3m8SAbTza7OsPeLI3poUpneIazOguQGKjrIB4kZpAmHl9zAZb4LpnNzD KONQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KTisvpy141VHl6Jl8IdlijmeVIKSJjM3R7YZNyvUfc8=; b=lqYc+cypuZBHw6jFmmRccdEKeRnyM74rA0J28zyQnrXD/b1h9h056wr7PfMy1GcUOn 8xhzkfz9+6WRlAPGy94+/WuU9KHd/zho45HVHEuPMJBnhf4cD9ucwtZVktIia8t0cl6B 9N9xk6VMCUPqmICsFlKzv+GAUyLq4CcvzFBb6CW7/1000LMn2xZroU+Oxm5cfOqrJ3u7 bmEPXe0FoA3Bub4yOqNkAED97bEx2xwOcwsiTgGW4ulqRZeuVCJQWLHUstTyhaUaIT73 ykR1nGjJSo1ffLX13cYdVbCDTOvxMDONsB0xkd+V8iyndGrZFRM4cNSaMwjlCjOZVj1R Uj1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=psp5IXJg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z5-20020a056214040500b0062ddaff2cf5si4471379qvx.464.2023.06.13.04.46.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 04:46:52 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=psp5IXJg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q90V2-0005jd-2P; Tue, 13 Jun 2023 05:39:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q90V0-0005j5-52 for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:38 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q90Uq-0005el-2e for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:37 -0400 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-51492ae66a4so7515895a12.1 for ; Tue, 13 Jun 2023 02:39:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686649164; x=1689241164; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KTisvpy141VHl6Jl8IdlijmeVIKSJjM3R7YZNyvUfc8=; b=psp5IXJgfMdSJYnwqTBwlddCd7bqiI6xXCMYQwJUbZYy5d7h9ZUZBRjlyuNpMl2CyN E7Se8ZKfCthsEnV+OhT56ogVP69iE9HNea2ZfRctV6yRpetCsmV5NaT2j/LlUVBiwGzP vmvJQx9JqalNNAoT/afiF7iGIpOL2j/hewHY6QG+P3Ira/7sze3F+kltL54Q4xdlobII Il8IPfOxXTNgxsabQNrMRAj4EU7twYFqN9tymNsRjLYiikrPgR9butz5nc9eR0BCy7gQ IuSLteAufcBPcJyzYybreR+lOS616uOWm+9GOuCUQVMbXvsOxtXcvXhblRmMyX9jT8jq fUsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686649164; x=1689241164; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KTisvpy141VHl6Jl8IdlijmeVIKSJjM3R7YZNyvUfc8=; b=NklZ8/4ySSpA8H3AKbS3lOzxkP3ea+CULe+rx3TlSAvTqDeW4nj5k20j7T4RG2xNND QWQ3/gudZEQvZ3SZXmEYQ8BMSuhQrMscx+LNnNaT7E0MRFZEAeRMIp6B8HF3FxyWqQ1S eE+oWfTskiWFI2cKcYpuuHKEtqyUZ5Pm1ndv7O+C9O4eJfwksBOYyjFpqIO8gfVdjnIF 8IHJRBos8mRU5QmGCkS5ai/Dk95BHK/b4gpnDW9HYL8gk59mpI571JislY2QKKE0ayHY D7j2mGhXy3ajIJaf17G4K/VeDo0Xsl0gTi2av9x6zw588R9dkdj7Ex75+p5XoZuloAiO e8vA== X-Gm-Message-State: AC+VfDy+rdaTPKwdqd8lbDmpY1MkDo+KoUP6N1EkHuqvYLUo2T1CbirV JI9PXeZ1HNbmNg78IJIdwIwoVHS8tDley2cfQM8GTg== X-Received: by 2002:aa7:ca4b:0:b0:518:797c:6bee with SMTP id j11-20020aa7ca4b000000b00518797c6beemr624427edt.5.1686649163810; Tue, 13 Jun 2023 02:39:23 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id z20-20020a1709064e1400b009745eddf997sm6334993eju.198.2023.06.13.02.39.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 02:39:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Bernhard Beschow , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PULL 13/17] hw/char/parallel: Export struct ParallelState Date: Tue, 13 Jun 2023 11:38:18 +0200 Message-Id: <20230613093822.63750-14-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613093822.63750-1-philmd@linaro.org> References: <20230613093822.63750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=philmd@linaro.org; helo=mail-ed1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow Exporting ParallelState is a precondition for exporing TYPE_ISA_PARALLEL to be performed in the next patch. Suggested-by: Mark Cave-Ayland Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230612081238.1742-2-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/char/parallel.h | 21 +++++++++++++++++++++ hw/char/parallel.c | 20 -------------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/include/hw/char/parallel.h b/include/hw/char/parallel.h index 29d2876d00..9f76edca81 100644 --- a/include/hw/char/parallel.h +++ b/include/hw/char/parallel.h @@ -1,9 +1,30 @@ #ifndef HW_PARALLEL_H #define HW_PARALLEL_H +#include "exec/ioport.h" +#include "exec/memory.h" #include "hw/isa/isa.h" +#include "hw/irq.h" +#include "chardev/char-fe.h" #include "chardev/char.h" +typedef struct ParallelState { + MemoryRegion iomem; + uint8_t dataw; + uint8_t datar; + uint8_t status; + uint8_t control; + qemu_irq irq; + int irq_pending; + CharBackend chr; + int hw_driver; + int epp_timeout; + uint32_t last_read_offset; /* For debugging */ + /* Memory-mapped interface */ + int it_shift; + PortioList portio_list; +} ParallelState; + #define TYPE_ISA_PARALLEL "isa-parallel" void parallel_hds_isa_init(ISABus *bus, int n); diff --git a/hw/char/parallel.c b/hw/char/parallel.c index 3d32589bb3..e75fc5019d 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -27,10 +27,7 @@ #include "qapi/error.h" #include "qemu/module.h" #include "chardev/char-parallel.h" -#include "chardev/char-fe.h" #include "hw/acpi/acpi_aml_interface.h" -#include "hw/irq.h" -#include "hw/isa/isa.h" #include "hw/qdev-properties.h" #include "hw/qdev-properties-system.h" #include "migration/vmstate.h" @@ -76,23 +73,6 @@ #define PARA_CTR_SIGNAL (PARA_CTR_SELECT|PARA_CTR_INIT|PARA_CTR_AUTOLF|PARA_CTR_STROBE) -typedef struct ParallelState { - MemoryRegion iomem; - uint8_t dataw; - uint8_t datar; - uint8_t status; - uint8_t control; - qemu_irq irq; - int irq_pending; - CharBackend chr; - int hw_driver; - int epp_timeout; - uint32_t last_read_offset; /* For debugging */ - /* Memory-mapped interface */ - int it_shift; - PortioList portio_list; -} ParallelState; - OBJECT_DECLARE_SIMPLE_TYPE(ISAParallelState, ISA_PARALLEL) struct ISAParallelState { From patchwork Tue Jun 13 09:38:19 2023 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: 691974 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp366205wru; Tue, 13 Jun 2023 04:40:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6WHdbdZkcbY8xBBmLQwq2IS9u5jnP4FeIvtAcKUVDCES2bluXWnQvU7Mpcl0imZRNhv710 X-Received: by 2002:a05:6214:4118:b0:62d:e87b:aba4 with SMTP id kc24-20020a056214411800b0062de87baba4mr5865074qvb.47.1686656410665; Tue, 13 Jun 2023 04:40:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686656410; cv=none; d=google.com; s=arc-20160816; b=zxYKtXsSj70rSvDpu03Ftu0E1MUBExJD8iLCIesqfD4YlUiHkRyRbUcNpahUjm9uQx yplaGL1GHCAGS6pl3CFnqRlk2UHSKwAKAwQPYelM3qXu8hMDcjmXZIOqvW/GDyd0tdY3 AE5yfdYjseAGIZQZlLHaulUwMmPgtjZfJGq3iytzrD5/gmSkvxgTWJHSPFzeERiutDBz UDfDrPMVUuql8Pz/Lrrm+foCPkC8K5H74s5ig85AGAYkjxDymfJHct0WLzeoSHprdw4w GpGYcYA74ZtJimDz2L686Pd0hIkcuFcwZkw8wmrFdzZmdw8m4kTarbN6necC6djHLbgo +m5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2UvD454+E/4A8Q/LAPF1RA7H96fHdTps7nh2m1LLDUQ=; b=sZ7WvQLi/otHCBnM5UHF0n9e7S/kuyDFbPFy8lS/3CKVwfzAISoGQYaIDBn0FspYWg AxHG5r7901Oa2MVS1qeIc0HjJym/AukHxCm7JjifIpNH81XNgTG58v+9JOKNVWrE09x4 Pi/7KS1cp0OM5/va16gA7UUOyrev7IvXj1Lsr9EDzMctccSbyPXUnNWa44naPXUiyqRP bWoSBgY9MUVxyuwmsY7MTgcTHOp1Jb0Vu9e025USwTQwwhMSd4AJwwlJYqam7drPIxy4 4eLmEWR8QOoX7uIjIN9oBZ8gA1s43obu9BobUveqHs6NR3SZ0GET6UGcG4pK7F1oQAhN XhLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yfB922hV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id iu7-20020ad45cc7000000b006164d69cc36si7589024qvb.307.2023.06.13.04.40.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 04:40:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yfB922hV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q90Wj-0005vT-8M; Tue, 13 Jun 2023 05:41:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q90Wh-0005vE-G9 for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:41:23 -0400 Received: from mail-ed1-f45.google.com ([209.85.208.45]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q90Vu-00062w-Eb for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:41:23 -0400 Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5147e40bbbbso8018214a12.3 for ; Tue, 13 Jun 2023 02:40:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686649169; x=1689241169; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2UvD454+E/4A8Q/LAPF1RA7H96fHdTps7nh2m1LLDUQ=; b=yfB922hVWq/dpgM5cDzY0Y4iKv2hNGBW6agoFw1UHGnEfO57BSaG6BmpNOgG5adKxb TIlV0tTmGvLNdvwFqfKrDIZ/Ha8UXW0rJTglQGJiLy79vlMGPBGS1VwSb6oKNoA6xVnZ dieOUi0osJiHmUp0b9KSunWgET00P+Si4sGzuBELwEJOVd/VBk+Shk6JwcPu2cmvzp1i ovaHCkLWpcGOzmUNEWIA8YOmXbLUylSSNKXzLN3ZBK9gYrCr0Ud91pOKanYjj/d6cZ0r NIjXbUvkQip0wYzn69F/leUbpXb5BUO2UZdSJoDTYsjSrG+Q5YZJGnQjMtCxKzraNL4C 6Uiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686649169; x=1689241169; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2UvD454+E/4A8Q/LAPF1RA7H96fHdTps7nh2m1LLDUQ=; b=Yjop5uvflPTbsWpnrt940ikZgRCYHWp6Gl1dRiZ/7P6ck+N9jCVFOf1zPBqO8XV1LA +LRjg5JCNwSj/PnKQFmDU+N0OFx0menlhH9h4hjEjjuokoyyuzsxseUaZ8HC5QQRPG6Q A9BVyNzlV0opc7pyL9PlO8pRAXXcdtvl+ykNeM6jnZvi+ImxPqzmufv6IdRU86MRrMPJ 4rknQ+8srN7xQ9QbIjbjory+KbD+HerOj3p/vLj121wOqmcaf3URZAuqFwXr3jqT/0bR OV5fPlY4zZmNKLmyh4Gs0n5psFj3W/n1fGaewnCB72MsD+yOz6Xt+UVBrZdOwUF9cQmE 0Vrw== X-Gm-Message-State: AC+VfDxyes5RCYNgLWCtGzMp7kWMSLe2oLCDibnJhjnujj2dY0iGhRrF 2ud+0Egh9CWPIAfzqruKIhETrTw8hsf+HsIqVeecmg== X-Received: by 2002:a05:6402:44d:b0:50b:d553:3822 with SMTP id p13-20020a056402044d00b0050bd5533822mr6106458edw.7.1686649168926; Tue, 13 Jun 2023 02:39:28 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id k10-20020a056402048a00b005149e012658sm6181916edv.34.2023.06.13.02.39.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 02:39:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Bernhard Beschow , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PULL 14/17] hw/char/parallel-isa: Export struct ISAParallelState Date: Tue, 13 Jun 2023 11:38:19 +0200 Message-Id: <20230613093822.63750-15-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613093822.63750-1-philmd@linaro.org> References: <20230613093822.63750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.208.45; envelope-from=philmd@linaro.org; helo=mail-ed1-f45.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow Allows the struct to be embedded directly into device models without additional allocation. Suggested-by: Mark Cave-Ayland Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230612081238.1742-3-shentey@gmail.com> [PMD: Update MAINTAINERS entry and use SPDX license identifier] Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 2 +- include/hw/char/parallel-isa.h | 30 ++++++++++++++++++++++++++++++ include/hw/char/parallel.h | 2 -- hw/char/parallel-isa.c | 1 + hw/char/parallel.c | 12 +----------- hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 2 +- hw/isa/isa-superio.c | 1 + hw/sparc64/sun4u.c | 2 +- 9 files changed, 37 insertions(+), 17 deletions(-) create mode 100644 include/hw/char/parallel-isa.h diff --git a/MAINTAINERS b/MAINTAINERS index 4a80a38511..88b5a7ee0a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1740,7 +1740,7 @@ F: hw/rtc/mc146818rtc* F: hw/watchdog/wdt_ib700.c F: hw/watchdog/wdt_i6300esb.c F: include/hw/display/vga.h -F: include/hw/char/parallel.h +F: include/hw/char/parallel*.h F: include/hw/dma/i8257.h F: include/hw/i2c/pm_smbus.h F: include/hw/input/i8042.h diff --git a/include/hw/char/parallel-isa.h b/include/hw/char/parallel-isa.h new file mode 100644 index 0000000000..d24ccecf05 --- /dev/null +++ b/include/hw/char/parallel-isa.h @@ -0,0 +1,30 @@ +/* + * QEMU ISA Parallel PORT emulation + * + * Copyright (c) 2003-2005 Fabrice Bellard + * Copyright (c) 2007 Marko Kohtala + * + * SPDX-License-Identifier: MIT + */ + +#ifndef HW_PARALLEL_ISA_H +#define HW_PARALLEL_ISA_H + +#include "parallel.h" + +#include "hw/isa/isa.h" +#include "qom/object.h" + +#define TYPE_ISA_PARALLEL "isa-parallel" +OBJECT_DECLARE_SIMPLE_TYPE(ISAParallelState, ISA_PARALLEL) + +struct ISAParallelState { + ISADevice parent_obj; + + uint32_t index; + uint32_t iobase; + uint32_t isairq; + ParallelState state; +}; + +#endif /* HW_PARALLEL_ISA_H */ diff --git a/include/hw/char/parallel.h b/include/hw/char/parallel.h index 9f76edca81..7b5a309a03 100644 --- a/include/hw/char/parallel.h +++ b/include/hw/char/parallel.h @@ -25,8 +25,6 @@ typedef struct ParallelState { PortioList portio_list; } ParallelState; -#define TYPE_ISA_PARALLEL "isa-parallel" - void parallel_hds_isa_init(ISABus *bus, int n); bool parallel_mm_init(MemoryRegion *address_space, diff --git a/hw/char/parallel-isa.c b/hw/char/parallel-isa.c index 547ae69304..ab0f879998 100644 --- a/hw/char/parallel-isa.c +++ b/hw/char/parallel-isa.c @@ -13,6 +13,7 @@ #include "sysemu/sysemu.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" +#include "hw/char/parallel-isa.h" #include "hw/char/parallel.h" #include "qapi/error.h" diff --git a/hw/char/parallel.c b/hw/char/parallel.c index e75fc5019d..147c900f0d 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -31,6 +31,7 @@ #include "hw/qdev-properties.h" #include "hw/qdev-properties-system.h" #include "migration/vmstate.h" +#include "hw/char/parallel-isa.h" #include "hw/char/parallel.h" #include "sysemu/reset.h" #include "sysemu/sysemu.h" @@ -73,17 +74,6 @@ #define PARA_CTR_SIGNAL (PARA_CTR_SELECT|PARA_CTR_INIT|PARA_CTR_AUTOLF|PARA_CTR_STROBE) -OBJECT_DECLARE_SIMPLE_TYPE(ISAParallelState, ISA_PARALLEL) - -struct ISAParallelState { - ISADevice parent_obj; - - uint32_t index; - uint32_t iobase; - uint32_t isairq; - ParallelState state; -}; - static void parallel_update_irq(ParallelState *s) { if (s->irq_pending) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 42af03dbb4..44146e6ff5 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -26,7 +26,7 @@ #include CONFIG_DEVICES #include "qemu/units.h" -#include "hw/char/parallel.h" +#include "hw/char/parallel-isa.h" #include "hw/dma/i8257.h" #include "hw/loader.h" #include "hw/i386/x86.h" diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 6155427e48..a9a59ed42b 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -30,7 +30,7 @@ #include "qemu/osdep.h" #include "qemu/units.h" -#include "hw/char/parallel.h" +#include "hw/char/parallel-isa.h" #include "hw/loader.h" #include "hw/i2c/smbus_eeprom.h" #include "hw/rtc/mc146818rtc.h" diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c index 9292ec3bcf..7dbfc374da 100644 --- a/hw/isa/isa-superio.c +++ b/hw/isa/isa-superio.c @@ -21,6 +21,7 @@ #include "hw/isa/superio.h" #include "hw/qdev-properties.h" #include "hw/input/i8042.h" +#include "hw/char/parallel-isa.h" #include "hw/char/serial.h" #include "trace.h" diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index e2858a0331..29e9b6cc26 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -35,7 +35,7 @@ #include "hw/qdev-properties.h" #include "hw/pci-host/sabre.h" #include "hw/char/serial.h" -#include "hw/char/parallel.h" +#include "hw/char/parallel-isa.h" #include "hw/rtc/m48t59.h" #include "migration/vmstate.h" #include "hw/input/i8042.h" From patchwork Tue Jun 13 09:38:20 2023 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: 691955 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp324084wru; Tue, 13 Jun 2023 02:51:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ciUTR0SXMSIhKO9MYJ2VzCP3A/Iz0qMFnDkcxjCIZQICzpryXLQ1kj1mkjzpLooYwZa34 X-Received: by 2002:a05:620a:24ca:b0:75e:c383:18a1 with SMTP id m10-20020a05620a24ca00b0075ec38318a1mr15592082qkn.7.1686649884800; Tue, 13 Jun 2023 02:51:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686649884; cv=none; d=google.com; s=arc-20160816; b=wHBW/9XF8sbgILbomeUdHNWE7jjKYq5fwt7kC+PNHRLrGKLsJAkYHqVeilByqd7tJt ULnwoR/ss2D3e5ltxzkON3LoT0zi9E6+m+S4YHPi5vX5I+bZ/V6LYgz3BbWUgpu5dX73 lWm4t9YC6ZlxqFgJ7h+tm4GubDwaqURix76pEsYJQfPPnAFfkHScR3HTF74UMzq9DXU+ IPsEXkpjMx6+2iCwROVBu5YZj5Qlwfr+Q7JfQk43HumvQ7/wSKMgFRZ+IReWkgtZSJKk LT1MJFJBLd36ATeln8Md8U05BeNKII9vn15ZWSARFtF7gYE0cYEIlnIgDzSH+3aA4X0I K4Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=G228fEEG3KGPqTypnQQNKK4WYtjAfFhy5BxWLUD+e/U=; b=AYWuQ2fOw7WmVf0R6ehbvQ2fn31p9DKTU+4LF0n1vejlahBp/KxGpuSoUpWVfrTsgo xupEEUed/bgvQ6/wzKDb9kEjouM2BQ/CZ/7ubDwfCxQZPaA6y3PH5JoJ5L8j8COk2HRO RyyWZI1UqdqBPGreVpKIqdkSKnjOyW3WgX6uAMFs7mDUrixtYMBB53c+B8Q9wd6p476I BId0rBfHYzCY27CVr/p++Kyu+9YCoaMwEAfHAX3Cbc8+gfMMuU+WhAOHqeOP3TbzQ+Hf ++4u8kEQzE0755N/QoyXcqQVIYaaltwukqYZFLo1V4fn8UHPfvblty42zSU7HQFq2Ggs bMkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R4rj8sg6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id oq23-20020a05620a611700b0074e014414b7si7272728qkn.775.2023.06.13.02.51.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 02:51:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R4rj8sg6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q90V8-0005km-Kq; Tue, 13 Jun 2023 05:39:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q90V6-0005kG-Qc for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:44 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q90Uy-0005gc-Ku for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:44 -0400 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5147e8972a1so9235104a12.0 for ; Tue, 13 Jun 2023 02:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686649173; x=1689241173; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=G228fEEG3KGPqTypnQQNKK4WYtjAfFhy5BxWLUD+e/U=; b=R4rj8sg6Hi0kVUyzc1faFJ1L557UaQ0xAO9Hcf5jAjeQNBD0weg2dfiyBC/CWE3CuF YyiRdR253zu7VNRtRXEVkN08gzWpP3rcxmvCzd8Uj1JAcJah1F9ZbOK6rhXL/H7UzZrH b5ehSPregSQXwUfmwJ/k2yREToZMONAfs/8rntWN4nVV+oolcSSsm+sukGNyQNoLg68j hJ1gVCUEERKe6/RqpsDTjPv9A5JJ56P/pGC4cI/kX7thT0+VubPuDpnYGqw/1wovPbVV HiFaGv2BJb3rrcT+QNld8RBkK9cc3yb5f/VFIcYhe78q6a2dYRttBASU3FrrhMcO1VRS Esog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686649173; x=1689241173; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G228fEEG3KGPqTypnQQNKK4WYtjAfFhy5BxWLUD+e/U=; b=I1K8yjzF0vqpDHCWiBVUwdosaDNvKNcNn4J+p4Dy5aSUbAjtMfWuRSeA6b5xBhEJUd C5NyiSdNaHuSV+LrN46sH8LmBZuDizJqo8l101N3yQnqTAqKZhPrR/dTMTeoUXfh+Cxk duKZwSGiQqcdAR0HDKmV4kkCi8+uZVejdOV5w9EAlqYoIHUJaAbkt2lXxslRTCoy6iBU Ot9MrOCX1Yl0PxynhGuTnBihwGuHye0k1gmRTZV717yMuYY8gdI+jelKeb/nqGGeL7aE 1h6IM82nywJ/U36+rcO0mxVaG/KpC8/gDiTF0Mfh2w6uvctN67om+KR0g3p2N8Ty3MMP 805g== X-Gm-Message-State: AC+VfDx+D1FNGpjwnzgEVICuREL29Q5t+0f/NozBNHLPzKs+DqaxGGNU mqGknLmBcjH52xOc+GHt0xYRRNzEplkWl479wXCLrw== X-Received: by 2002:a05:6402:1487:b0:518:670a:7c57 with SMTP id e7-20020a056402148700b00518670a7c57mr2243685edv.14.1686649173369; Tue, 13 Jun 2023 02:39:33 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id a25-20020aa7d919000000b00511aea132b9sm6198912edr.3.2023.06.13.02.39.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 02:39:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Joao Martins , Peter Xu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 15/17] exec/ram_addr: Return number of dirty pages in cpu_physical_memory_set_dirty_lebitmap() Date: Tue, 13 Jun 2023 11:38:20 +0200 Message-Id: <20230613093822.63750-16-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613093822.63750-1-philmd@linaro.org> References: <20230613093822.63750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=philmd@linaro.org; helo=mail-ed1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Joao Martins In preparation for including the number of dirty pages in the vfio_get_dirty_bitmap() tracepoint, return the number of dirty pages in cpu_physical_memory_set_dirty_lebitmap() similar to cpu_physical_memory_sync_dirty_bitmap(). To avoid counting twice when GLOBAL_DIRTY_RATE is enabled, stash the number of bits set per bitmap quad in a variable (@nbits) and reuse it there. Signed-off-by: Joao Martins Reviewed-by: Peter Xu Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230530180556.24441-2-joao.m.martins@oracle.com> Signed-off-by: Philippe Mathieu-Daudé --- include/exec/ram_addr.h | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index 90a8269290..9f2e3893f5 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr.h @@ -334,14 +334,23 @@ static inline void cpu_physical_memory_set_dirty_range(ram_addr_t start, } #if !defined(_WIN32) -static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, - ram_addr_t start, - ram_addr_t pages) + +/* + * Contrary to cpu_physical_memory_sync_dirty_bitmap() this function returns + * the number of dirty pages in @bitmap passed as argument. On the other hand, + * cpu_physical_memory_sync_dirty_bitmap() returns newly dirtied pages that + * weren't set in the global migration bitmap. + */ +static inline +uint64_t cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, + ram_addr_t start, + ram_addr_t pages) { unsigned long i, j; - unsigned long page_number, c; + unsigned long page_number, c, nbits; hwaddr addr; ram_addr_t ram_addr; + uint64_t num_dirty = 0; unsigned long len = (pages + HOST_LONG_BITS - 1) / HOST_LONG_BITS; unsigned long hpratio = qemu_real_host_page_size() / TARGET_PAGE_SIZE; unsigned long page = BIT_WORD(start >> TARGET_PAGE_BITS); @@ -369,6 +378,7 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, if (bitmap[k]) { unsigned long temp = leul_to_cpu(bitmap[k]); + nbits = ctpopl(temp); qatomic_or(&blocks[DIRTY_MEMORY_VGA][idx][offset], temp); if (global_dirty_tracking) { @@ -377,10 +387,12 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, temp); if (unlikely( global_dirty_tracking & GLOBAL_DIRTY_DIRTY_RATE)) { - total_dirty_pages += ctpopl(temp); + total_dirty_pages += nbits; } } + num_dirty += nbits; + if (tcg_enabled()) { qatomic_or(&blocks[DIRTY_MEMORY_CODE][idx][offset], temp); @@ -409,9 +421,11 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, for (i = 0; i < len; i++) { if (bitmap[i] != 0) { c = leul_to_cpu(bitmap[i]); + nbits = ctpopl(c); if (unlikely(global_dirty_tracking & GLOBAL_DIRTY_DIRTY_RATE)) { - total_dirty_pages += ctpopl(c); + total_dirty_pages += nbits; } + num_dirty += nbits; do { j = ctzl(c); c &= ~(1ul << j); @@ -424,6 +438,8 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, } } } + + return num_dirty; } #endif /* not _WIN32 */ From patchwork Tue Jun 13 09:38:21 2023 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: 691975 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp366206wru; Tue, 13 Jun 2023 04:40:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5/qnZqvYpEMFdduyi6XxEG7X9rokXkM7hnIPQ8C9cLiDKpEjha3LWKssn2fk9FGyymCXpv X-Received: by 2002:a05:622a:646:b0:3f6:bffe:3c0d with SMTP id a6-20020a05622a064600b003f6bffe3c0dmr15401389qtb.4.1686656410655; Tue, 13 Jun 2023 04:40:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686656410; cv=none; d=google.com; s=arc-20160816; b=Vr+A85aq5+CVRx91YC7R6aU/WIYvf1+YLGIF34fCw5HYkgH+aFJE1DNMoGbl8+wJK2 CKVvW0hfsfL+S/2BG2GRYh8UAOoB29zwfWrFJTzNX6/sQa8CFUdagwqai6Z04LCtjWlz LQ4mYIQQPCIPxqVk4EhzGF/bwrrzS4HoL2Vj1x93pLtpIBO2a+yguPAv4EL5/pLpCTK9 E1jEOMaVc9a0a2RDuzvxdvNNtD8TNCeRFhCK/RzqdQ8DX917vhT9pYG4R3d58rFOWR9o Mk6pbdplqZ9cT/ASooELE+P7dGsjZEJQQBmzT+lq25T26nFZcazhPRcNKLRTeT+qnBAN Dqzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8Fjis3842wl6k6Jb8zbXdSMkjzpqKuYtbmTIrMzfnM0=; b=Hv3Kt/P4XGXAHoHTR37dB2fUrsO5XeqWzzFiKXtNEWwZbIDvd1cJlYYGBZHO+IylC+ 4v/BSC+AbCA7bGwXQFsT+L+/5M+OOEbsPWlOUB+hH+dnqJe8lwFTZz7R1tw3rSubPasU g+JZK4NtlKyhLRe3RhlYoFs01hU73pGolD+ixkGTt/iDFxQAXlVzYZ2SswxdH5RvT5tB xjzjsHJJp1i7xgnmZCI5Ecbi8/wmFZC7Rg6L6w180Vj7FhNjR2Bi21lTrpGdrg5y6Wwf p9l5KNuOaKzays0CLoHQeErFARDqj06K8rLyhJ6wIhweSrYtCoH3zs/fq7TAQMjZTegB TZ7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OUkVQgen; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f12-20020ac87f0c000000b003f3902c836bsi7519120qtk.758.2023.06.13.04.40.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 04:40:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OUkVQgen; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q90VI-0005lh-0L; Tue, 13 Jun 2023 05:39:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q90VB-0005l0-AE for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:50 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q90V2-0005h5-JX for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:49 -0400 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-51492ae66a4so7516164a12.1 for ; Tue, 13 Jun 2023 02:39:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686649177; x=1689241177; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8Fjis3842wl6k6Jb8zbXdSMkjzpqKuYtbmTIrMzfnM0=; b=OUkVQgen/DpXQjJCyv+7Wc21rqOVVrYEtLKIei3XPNpqNBDPdYo5WgOqt0X6qZxuFe uiTWNJE6azCgrmwocOiwQai8TCt32TlQcWldN40ZOsyWLybmV1b3OSqcZbHK66RvSu+e XFl8OzphodCT/t3t7ELWzdyXqsfnZeZY8NvTOzRk7yZCJE3N9cGvb2vjkIthOMvWn9vZ HO+ccKtETR+nRbndECWZUbsgcNQGxZqLk05lmO4s/ULitYbsp3BhtpbLmiq8mwzcPmCN EHP9wF9UEE2KtTy1VFOyEUXsi9c2wIY/AnWfplFp4jVwwIcbv6wHsRfrf9d8B8KPvfbw yHqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686649177; x=1689241177; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8Fjis3842wl6k6Jb8zbXdSMkjzpqKuYtbmTIrMzfnM0=; b=fItBDqDTr+FBIH0d+vES/9BWB32NAMyJXFU9k+N8cTpX7g9akRW9r3H8ntHT8YMeft VDeY+CI86mi+UHZdF2sKQOAwpg2UDENosVwrywmhlQp9bxHDxyV2kUwD4ek2ZKqEpLXI 0ulddSSsSbCHBwEAh9LBc2+vncHYFjJv1ylEcXVR7ZBiGh/QDRZe6z0puj8XwUiu4VKm MIaBqFD4UvltK36SbZIg4ZPMf2WbCsTOC1BBhdHxAQwkfneSI0vAtd72aAD8OBvaUQVO AnLBD3aO1fAqqzVwWv6M1XnH4Zc/ZXzmv3fB8Ew4MbufoM0iQLS/is0GF4wsbQgMVxyx OQ3A== X-Gm-Message-State: AC+VfDxMIroR5ay96NVP7m/Yxwo6sHZMo78UZYA8LAaYUgX8bKCAJ/m4 mtbXTmF0zs/EoqYzWHR+VPOokZgDvAnnP+taiEYkHQ== X-Received: by 2002:aa7:cfcc:0:b0:514:bc92:8e1d with SMTP id r12-20020aa7cfcc000000b00514bc928e1dmr5755920edy.14.1686649177550; Tue, 13 Jun 2023 02:39:37 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id o7-20020a056402038700b00514a6d05de9sm6169282edv.88.2023.06.13.02.39.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 02:39:37 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Joao Martins , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= , Alex Williamson Subject: [PULL 16/17] hw/vfio: Add number of dirty pages to vfio_get_dirty_bitmap tracepoint Date: Tue, 13 Jun 2023 11:38:21 +0200 Message-Id: <20230613093822.63750-17-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613093822.63750-1-philmd@linaro.org> References: <20230613093822.63750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=philmd@linaro.org; helo=mail-ed1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Joao Martins Include the number of dirty pages on the vfio_get_dirty_bitmap tracepoint. These are fetched from the newly added return value in cpu_physical_memory_set_dirty_lebitmap(). Signed-off-by: Joao Martins Reviewed-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé Acked-by: Alex Williamson Message-Id: <20230530180556.24441-3-joao.m.martins@oracle.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/vfio/common.c | 7 ++++--- hw/vfio/trace-events | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 78358ede27..fa8fd949b1 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -1747,6 +1747,7 @@ static int vfio_get_dirty_bitmap(VFIOContainer *container, uint64_t iova, { bool all_device_dirty_tracking = vfio_devices_all_device_dirty_tracking(container); + uint64_t dirty_pages; VFIOBitmap vbmap; int ret; @@ -1772,11 +1773,11 @@ static int vfio_get_dirty_bitmap(VFIOContainer *container, uint64_t iova, goto out; } - cpu_physical_memory_set_dirty_lebitmap(vbmap.bitmap, ram_addr, - vbmap.pages); + dirty_pages = cpu_physical_memory_set_dirty_lebitmap(vbmap.bitmap, ram_addr, + vbmap.pages); trace_vfio_get_dirty_bitmap(container->fd, iova, size, vbmap.size, - ram_addr); + ram_addr, dirty_pages); out: g_free(vbmap.bitmap); diff --git a/hw/vfio/trace-events b/hw/vfio/trace-events index 646e42fd27..cfb60c354d 100644 --- a/hw/vfio/trace-events +++ b/hw/vfio/trace-events @@ -120,7 +120,7 @@ vfio_region_sparse_mmap_header(const char *name, int index, int nr_areas) "Devic vfio_region_sparse_mmap_entry(int i, unsigned long start, unsigned long end) "sparse entry %d [0x%lx - 0x%lx]" vfio_get_dev_region(const char *name, int index, uint32_t type, uint32_t subtype) "%s index %d, %08x/%08x" vfio_dma_unmap_overflow_workaround(void) "" -vfio_get_dirty_bitmap(int fd, uint64_t iova, uint64_t size, uint64_t bitmap_size, uint64_t start) "container fd=%d, iova=0x%"PRIx64" size= 0x%"PRIx64" bitmap_size=0x%"PRIx64" start=0x%"PRIx64 +vfio_get_dirty_bitmap(int fd, uint64_t iova, uint64_t size, uint64_t bitmap_size, uint64_t start, uint64_t dirty_pages) "container fd=%d, iova=0x%"PRIx64" size= 0x%"PRIx64" bitmap_size=0x%"PRIx64" start=0x%"PRIx64" dirty_pages=%"PRIu64 vfio_iommu_map_dirty_notify(uint64_t iova_start, uint64_t iova_end) "iommu dirty @ 0x%"PRIx64" - 0x%"PRIx64 # platform.c From patchwork Tue Jun 13 09:38:22 2023 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: 691969 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp361581wru; Tue, 13 Jun 2023 04:29:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4I6ZJh7cjpynUUJfV0l4rB9KPnSN+VDdmqLPvKF+/bY9dzkze+yt2n/dadtBfDPeAPbWyO X-Received: by 2002:ac8:5f14:0:b0:3f8:67d7:e99a with SMTP id x20-20020ac85f14000000b003f867d7e99amr13305017qta.11.1686655785616; Tue, 13 Jun 2023 04:29:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686655785; cv=none; d=google.com; s=arc-20160816; b=gDAVaHXi3lVRljr0p6D2/bTnBsb+Wmrj1zscbihWh5pimnJEP/Gu3E8nW/FC9bcPiI 45Z9GP2q5Y3HfqX90dpqI3+tPcECcjXOlbrIW4NDGCRg2kb9HHPGyGynr4WpGQA334Ns hAPW+q6P2a7WvLhYDSocWdONYWqN9W8XE8WlAuH2sDc96VcAklsabbs2YHYLZ046rGCs 9SRtlyeNF+wW+zv6PnMEKnyJAKANZzXU2yU+RxCBMUFxdlC9yiiFvYz7JO3hTx4S245H KLYg3y+bal9qpRaE04YPbXPqQxRiXlVXbewP3QcF2Ne/XzmpJH6BA63gys5hrW/7Jxdc R36A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tn6UViqugu1iPM5CBgyVG1U7YWBaY3WOqVleP4qvVWg=; b=YuJiy+AN751FZ7OOjmknF/k1SR9PFvBKP2NGwEsSnJtw7kRiQqKLzGWe7s1IB4StK6 tIsONXqM0Oevo5PHs9E1YPpH9tJGfvaklvcs9yiucMI2OzD4sda4GKhadbZuc3/UolK/ 1qlW9Q8vaVDw2/XvdLLQktxOSutThKkA1n5Qm7q9Eaj8zbH95eh9iMvm3fR60ll7OCyg gpX52WaW0NYz2m6pyseTCM0NNboLLNqX0xUx0nf7wtkZOK1C4Fy4dEZafxRO5xgSs34O 9lzlbXuxFF+0Q3ZPuBwxuv754oT2HG7i0oZPpDb7PcrkaVSxjqL5tT2wB0AmzvuS6q1G /qZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R0zb4M9R; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i18-20020ac85c12000000b003ea3e861b40si7184968qti.399.2023.06.13.04.29.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 04:29:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R0zb4M9R; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q90VO-0005oB-9V; Tue, 13 Jun 2023 05:40:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q90VF-0005lY-Ah for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:55 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q90V6-0005hT-7w for qemu-devel@nongnu.org; Tue, 13 Jun 2023 05:39:53 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5183101690cso5400457a12.0 for ; Tue, 13 Jun 2023 02:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686649182; x=1689241182; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tn6UViqugu1iPM5CBgyVG1U7YWBaY3WOqVleP4qvVWg=; b=R0zb4M9RAEzXPO7CQcnjo+h9pA3mCXQsgY4HVYTWp9uenStcAbDsJL0rhChV09HK6c mSe9xV5k6iQ3ldd/Ra103M5Gloi4fMWnW8TWEa0I2n81LJINDg8EdIpxK46bEY1EJikK BbYw848lKam6Sbw9Byw9JRmlfcpR6Da2rnLAiZpbq8ndAxKpL/nxBjrVHeGzlJcI/ai8 TqfL8YQhoBDCNGeteVj8asmCATFxJW1ERdRbCgv+IB1YNRO5A4XOJjPvfiLZtu0Afx2I AM13GAhWf1SfRQdc5PRSHwRaY/3uw52EXBzKMwEOVchBQTzGkgJGQ3jLayOfHJPFdiba jCcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686649182; x=1689241182; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tn6UViqugu1iPM5CBgyVG1U7YWBaY3WOqVleP4qvVWg=; b=bfdCkoiL+CL5kVEmvVUTDZwYoI101W3qsJidSYZwlcyn9YBji7e1cGqkomAWG2DiRT 17OUUuFm9aPWrq/GJy82sNdtXh0HJOjPRqbKq4Soa8KVV+YSM42o9beiU+/1FzIIkymW LT4Rdm8qtNP+S19QOrRjix+/0xIzHUjBP74RIqzyFDOpf2BZhgonbrn5lVzTA0LcHA9f 754JeciSvpu6oCfD2GYH6iRWglKaaHdhDivRyV6U5gTVHXOCMkvPseqLkd6OddSJeqly b3rkYZ70AEGeTn3FLPdd+fSESgVlY4KA2xxd+zzeLucIiVsaU6EI4IWDECTQGysdeTIL wkMA== X-Gm-Message-State: AC+VfDz2Fd7AdIra3+cKXVMnscs9RpPaxIAktBfUmYp2izAkzRr0AqDN wKqkqfPvyCMuf2LzTR1Pnx1dyJghJau4h9vJIYmunQ== X-Received: by 2002:a17:906:5d09:b0:978:af9d:c004 with SMTP id g9-20020a1709065d0900b00978af9dc004mr10809240ejt.4.1686649182368; Tue, 13 Jun 2023 02:39:42 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id ks9-20020a170906f84900b009786c83d5d6sm6384144ejb.25.2023.06.13.02.39.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Jun 2023 02:39:42 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Steve Sistare , Peter Xu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 17/17] exec/memory: Introduce RAM_NAMED_FILE flag Date: Tue, 13 Jun 2023 11:38:22 +0200 Message-Id: <20230613093822.63750-18-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230613093822.63750-1-philmd@linaro.org> References: <20230613093822.63750-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=philmd@linaro.org; helo=mail-ed1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Steve Sistare migrate_ignore_shared() is an optimization that avoids copying memory that is visible and can be mapped on the target. However, a memory-backend-ram or a memory-backend-memfd block with the RAM_SHARED flag set is not migrated when migrate_ignore_shared() is true. This is wrong, because the block has no named backing store, and its contents will be lost. To fix, ignore shared memory iff it is a named file. Define a new flag RAM_NAMED_FILE to distinguish this case. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Message-Id: <1686151116-253260-1-git-send-email-steven.sistare@oracle.com> Signed-off-by: Philippe Mathieu-Daudé --- qapi/migration.json | 4 ++-- include/exec/cpu-common.h | 1 + include/exec/memory.h | 3 +++ backends/hostmem-file.c | 1 + migration/ram.c | 3 ++- softmmu/physmem.c | 7 ++++++- 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/qapi/migration.json b/qapi/migration.json index 179af0c4d8..5bb5ab82a0 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -465,8 +465,8 @@ # block devices (and thus take locks) immediately at the end of # migration. (since 3.0) # -# @x-ignore-shared: If enabled, QEMU will not migrate shared memory -# (since 4.0) +# @x-ignore-shared: If enabled, QEMU will not migrate shared memory that is +# accessible on the destination machine. (since 4.0) # # @validate-uuid: Send the UUID of the source to allow the destination # to ensure it is the same. (since 4.2) diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index e5a55ede5f..87dc9a752c 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -93,6 +93,7 @@ void qemu_ram_set_uf_zeroable(RAMBlock *rb); bool qemu_ram_is_migratable(RAMBlock *rb); void qemu_ram_set_migratable(RAMBlock *rb); void qemu_ram_unset_migratable(RAMBlock *rb); +bool qemu_ram_is_named_file(RAMBlock *rb); int qemu_ram_get_fd(RAMBlock *rb); size_t qemu_ram_pagesize(RAMBlock *block); diff --git a/include/exec/memory.h b/include/exec/memory.h index c3661b2276..47c2e0221c 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -232,6 +232,9 @@ typedef struct IOMMUTLBEvent { /* RAM that isn't accessible through normal means. */ #define RAM_PROTECTED (1 << 8) +/* RAM is an mmap-ed named file */ +#define RAM_NAMED_FILE (1 << 9) + static inline void iommu_notifier_init(IOMMUNotifier *n, IOMMUNotify fn, IOMMUNotifierFlag flags, hwaddr start, hwaddr end, diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 38ea65bec5..b4335a80e6 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -57,6 +57,7 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp) ram_flags = backend->share ? RAM_SHARED : 0; ram_flags |= backend->reserve ? 0 : RAM_NORESERVE; ram_flags |= fb->is_pmem ? RAM_PMEM : 0; + ram_flags |= RAM_NAMED_FILE; memory_region_init_ram_from_file(&backend->mr, OBJECT(backend), name, backend->size, fb->align, ram_flags, fb->mem_path, fb->offset, fb->readonly, diff --git a/migration/ram.c b/migration/ram.c index 88a6c82e63..5283a75f02 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -197,7 +197,8 @@ static bool postcopy_preempt_active(void) bool ramblock_is_ignored(RAMBlock *block) { return !qemu_ram_is_migratable(block) || - (migrate_ignore_shared() && qemu_ram_is_shared(block)); + (migrate_ignore_shared() && qemu_ram_is_shared(block) + && qemu_ram_is_named_file(block)); } #undef RAMBLOCK_FOREACH diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 588d0d166b..6bdd944fe8 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -1570,6 +1570,11 @@ void qemu_ram_unset_migratable(RAMBlock *rb) rb->flags &= ~RAM_MIGRATABLE; } +bool qemu_ram_is_named_file(RAMBlock *rb) +{ + return rb->flags & RAM_NAMED_FILE; +} + int qemu_ram_get_fd(RAMBlock *rb) { return rb->fd; @@ -1880,7 +1885,7 @@ RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size, MemoryRegion *mr, /* Just support these ram flags by now. */ assert((ram_flags & ~(RAM_SHARED | RAM_PMEM | RAM_NORESERVE | - RAM_PROTECTED)) == 0); + RAM_PROTECTED | RAM_NAMED_FILE)) == 0); if (xen_enabled()) { error_setg(errp, "-mem-path not supported with Xen");