From patchwork Mon Feb 13 16:13:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 653225 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp2639219wrr; Mon, 13 Feb 2023 12:50:33 -0800 (PST) X-Google-Smtp-Source: AK7set/m4oPeHT4FgHsIH/GRFTHWJdRxDMSZhwNcr91dKlyR9SzP3OFw9rcUM3YJ891+1wd7iLTQ X-Received: by 2002:a05:6214:29ce:b0:56e:a2a1:a4b3 with SMTP id gh14-20020a05621429ce00b0056ea2a1a4b3mr499716qvb.20.1676321433793; Mon, 13 Feb 2023 12:50:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676321433; cv=none; d=google.com; s=arc-20160816; b=J0JWAsAjcmDfyZOCjphQ6FVZFvkuMS2J1zR3PQ1om4JEKHGR1xanmdHAKX7yDSXFe+ 79sNbB2yonMoiq9fOSTvODXh6p5dQBwQOhlBA2hb0+5XCDYt+R6Iiv1SP99HJpZhzPUu AhdbsKBZHmWMyi8q0mcPZ/g0K2/x1JSUMB5HyZ+4m55v4sr+oxL/6YdWYqSXfArgqpZZ R6o80LNx+v9+zjTEXWaCdkZhzmCSzjLx+1F5fJ1xEfgvjtpE4jsuZzlTUelCtriUqQXO 83TVxmEKmqiaYlcGfBq9aIHGL/SSvoz+GPCU8xkPwnUa99wZEZDg4ngIGsayFJDbPpun tV0g== 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=/Fnuvphrd4KcPyS3DWGw7YsNit5qQSnqPK9bRR9NFcg=; b=I5YNp+rw2XyRQq64mYIkKt7U+I5Ur636jE1sUnDmLD7QbHO+1KVpZ+7XRTZK24fNBe Kok0VsQEnqZppNgpXPFommgA2HNfrCgypBBv04emtFZ1NkgCbdj0doL98YSxdz5cDJvn 7FyCkQILsmo6Bwx0WzKgdTedKTFqKtwoGrpJo8yliIsNWu5eRFVpZF2CowQbBH3mxRFZ rYivDIwPMZXvXKi7KfxtW2B9aZ/q7jlaiw9kxb015nJq/d9KHay68Tjvr4OtqElbuJkW IUUh7JiaPVYf0rRCWUZu2qMSsM4h2y8ydSdBpi8SCFOnTxofM/u9pFQ2TDYzERPrY5Kt sHlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VgN6Qgs0; 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 n12-20020a0ce54c000000b00534f9174377si4781772qvm.219.2023.02.13.12.50.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Feb 2023 12:50:33 -0800 (PST) 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=VgN6Qgs0; 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 1pRfkt-0000pN-Nf; Mon, 13 Feb 2023 15:48:55 -0500 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 1pRbSz-000831-T8 for qemu-devel@nongnu.org; Mon, 13 Feb 2023 11:14:09 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRbSy-0005ja-BX for qemu-devel@nongnu.org; Mon, 13 Feb 2023 11:14:09 -0500 Received: by mail-wm1-x32a.google.com with SMTP id az4-20020a05600c600400b003dff767a1f1so9450578wmb.2 for ; Mon, 13 Feb 2023 08:14:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=/Fnuvphrd4KcPyS3DWGw7YsNit5qQSnqPK9bRR9NFcg=; b=VgN6Qgs0HFBq67W9Lx1KkMneFTChFIoflNB5bpvRbNpmrl8kPdXhI0IR/MayOSFxCg tAvhEvxiABIzN9XbCTwXNRVJwVJmkkdzgPEh27mrNOq7oYqNh5mIRTgOPUqW3gcEzNCU dhXo9ph6yzrsBDBDQcJW1nuT5luCjoFUY3RaEFjQ83UTdw5LQhlYTeO/Porx4a95kaff EyeJ/1kAbFb+UfTogLuKMwheXj6uvMEwn9+IjojZBXNfnsSEE2U0iV9pcrLekmX73doX rCXETdhVF5UYTb6/ENGfNxXSIT6PBjRcV7dM7CruxZe+Zy7ecZkIdVVM2P7NwECbyizS NTFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=/Fnuvphrd4KcPyS3DWGw7YsNit5qQSnqPK9bRR9NFcg=; b=B+cvKvLGr1JH6MITIeQlwUsYyvrscn+JsMlUXeibX2Wjjibnb/sh4IiGCcEmH8wq2S pBIwbQIyqyn9yz0o8TATDB7ZmhHG3YkJWLvnaGNE6/F21lbzckUvgIxnteVVT/LzVDPk TtaBbJXQETF+Q15319UQqX1mR/GQ+8A780dpmkJ2zBLUHhSUTGDjrUF3D07Vm+SNbLmJ PX0MCtlSlBWuyEKtYE7fTzlW3Nd9v6XBtnHxiTLWwe1XWiXrSh+NBWzysmr3uxEtd76m 0y/GTzLijJ58aVbdJK4cnR++AXDx+GSkfxr/P+/VnBjbkfwQ4cBAMCUo8hXYncPmE3Gv E+YQ== X-Gm-Message-State: AO0yUKUjhs8Bg3LSCJq52IKS+53AuuhIrZC0i7XgDi4g7yemHvG05b8L 4BmlR0gHzsp+5uzlmPQIC+KiB9qsEpOKnHsWkxA= X-Received: by 2002:a05:600c:2b45:b0:3dc:561a:79d8 with SMTP id e5-20020a05600c2b4500b003dc561a79d8mr23532947wmf.35.1676304846618; Mon, 13 Feb 2023 08:14:06 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:8df5:e191:f2b0:5825]) by smtp.gmail.com with ESMTPSA id t13-20020adfe44d000000b002c557f82e27sm3582882wrm.99.2023.02.13.08.14.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:14:06 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: sw@weilnetz.de, kkostiuk@redhat.com, clg@kaod.org, richard.henderson@linaro.org, alex.bennee@linaro.org, Pierrick Bouvier Subject: [PATCH 1/4] util/cacheflush: fix illegal instruction on windows-arm64 Date: Mon, 13 Feb 2023 17:13:49 +0100 Message-Id: <20230213161352.17199-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230213161352.17199-1-pierrick.bouvier@linaro.org> References: <20230213161352.17199-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 13 Feb 2023 15:48:53 -0500 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 mrs instruction fails as an illegal instruction. For now, no cache information is retrieved for this platform. It could be specialized later, using Windows API. Signed-off-by: Pierrick Bouvier --- util/cacheflush.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/cacheflush.c b/util/cacheflush.c index 2c2c73e085..149f103d32 100644 --- a/util/cacheflush.c +++ b/util/cacheflush.c @@ -121,8 +121,9 @@ static void sys_cache_info(int *isize, int *dsize) static bool have_coherent_icache; #endif -#if defined(__aarch64__) && !defined(CONFIG_DARWIN) +#if defined(__aarch64__) && !defined(CONFIG_DARWIN) && !defined(CONFIG_WIN32) /* Apple does not expose CTR_EL0, so we must use system interfaces. */ +/* Does not work on windows-arm64, illegal instruction using mrs */ static uint64_t save_ctr_el0; static void arch_cache_info(int *isize, int *dsize) { @@ -225,7 +226,7 @@ static void __attribute__((constructor)) init_cache_info(void) /* Caches are coherent and do not require flushing; symbol inline. */ -#elif defined(__aarch64__) +#elif defined(__aarch64__) && !defined(CONFIG_WIN32) #ifdef CONFIG_DARWIN /* Apple does not expose CTR_EL0, so we must use system interfaces. */ From patchwork Mon Feb 13 16:13:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 653227 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp2639228wrr; Mon, 13 Feb 2023 12:50:35 -0800 (PST) X-Google-Smtp-Source: AK7set9+wURxTyHCdTSK3KIkTRfwzxnhwGBGbj6F/DFRJRPQrOo/qTUup2B8eE3F7UsgR3iCwdbQ X-Received: by 2002:a05:622a:c2:b0:3b7:fafc:73e3 with SMTP id p2-20020a05622a00c200b003b7fafc73e3mr44846015qtw.41.1676321434971; Mon, 13 Feb 2023 12:50:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676321434; cv=none; d=google.com; s=arc-20160816; b=h2l+daSDHgMS4IuXl6ZRoOHV5bd1hDQd8VfSrBZ+2ByslNxkAAqhDwfQk4baiFj1xC wWwejVGKIsbmWpS9G8fzbw2Xt5b+SMz7e4FlKyke80fNle2mmt+VxZ4H0VRHvMNSlipJ 558Sm+n2Mx/aFw2Q3QqO0LEx1vrQZXS2FB5yLgCUx7kmGWqU+RbfuscULRHIVtYg9Svt rOfJK2JTip0oxVUKr0iVSXrAlwsnIJWdKQJG+ZAomBaDiTwF0Uoc7Znl7VVdNrQy+OwL alzJgoCjE1FB4QreSFOMGyxnRGSwyfBAIY5KPKMz6rHK801aSawXQktdoscar5B/30hy XkfA== 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=vGXouOChIYjl8AkJ3HhGb5U80hOl0zPVyYzc37vy0jM=; b=yHsPEb2WzYO35mi3rmX6/wSLnYfdYTWCokGdEICFvZxZV3QnWrKrPrz85bvuDa4jMF Zcv8PP6sigrB6g7Jf31afm7ZYJx9XJSHKjE7VvCGXjZ8UCfy1/iBhYDDvwO428j7F65Q F6s1PkI79eOs/UqKf8jtd2b6xy6Cz/YZ1aVoeTajuNMFfBGtwvIlGzMlBfOnnX6VihS8 X7cvxFG83SFYgIv4/a6tpYRm/c8qoMzEObvkxOQOwH7d413nWpYwg9i5UiacG3mQSy3m xpNzqmJ9vIXm1QtfRIdQNRX/RcJrQgZSi8wI8E8F6h06I0G143jPmcfbGteaJArnPdfC NsTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WCllbPTY; 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 y7-20020a05622a120700b003ba03ca1174si10102246qtx.711.2023.02.13.12.50.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Feb 2023 12:50:34 -0800 (PST) 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=WCllbPTY; 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 1pRfku-0000qO-Bs; Mon, 13 Feb 2023 15:48:56 -0500 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 1pRbT1-00083I-3c for qemu-devel@nongnu.org; Mon, 13 Feb 2023 11:14:11 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRbSz-0005jr-FQ for qemu-devel@nongnu.org; Mon, 13 Feb 2023 11:14:10 -0500 Received: by mail-wm1-x32e.google.com with SMTP id j29-20020a05600c1c1d00b003dc52fed235so9448003wms.1 for ; Mon, 13 Feb 2023 08:14:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=vGXouOChIYjl8AkJ3HhGb5U80hOl0zPVyYzc37vy0jM=; b=WCllbPTYj7Vud2F7vQj3yhg1D6dziLwm9+gftTJRayUZkPCwHjUJJ/oW2/3I7ekMmn WNA9xORPbErgpzxxDiJmdL43ghuPBPo6t1Tc9zjrZ5cLj0+Cwi8pcz0VZQ5J/R5LJX7H 7HH9N03LgWjwJCtix/BKouIEBsBQpaUWRApqsdwfghCYw1d9TmRX2wNZsE3SiCCoiKoQ SUx8oeY/aCkfvkEyvgKRi4IgkXdsVjItfaiQqdJmOqBhXe3HByQBQ2VfEofERucQIaoW qPe+dWcXHRk0j3Df89KzAT+7mFDpVkhIekoiBNipFvUyliFHjnwH9wuWV6JL6upcMhYA 1qWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=vGXouOChIYjl8AkJ3HhGb5U80hOl0zPVyYzc37vy0jM=; b=VmUqJJECDnyIizQMTmfm7VKEKdBw6R6vfcV6ybo/pbxzE1s9M9bufxNX6KZnw6QOFk UQ+wv1pE57f3tfHHVSTZg/aRU0c5HoHaMQI12yXM6DpDfTOYHuO32Ylae+tsEKLWSDEH kCPp6JetYVd1s3hxjca2IQvld0vfNU+seEPK3bc6ndBUPCkbcNUPRL/7vj4Td4KXETxi CCEi4MkFGiwhNyTfGhUqqA0xF+f//tq1Ljj5vHpNaTDMeqIsAFy8eiZscXCY9zf0Aegq 8KUi1H/TraAKGZn+wZ7bNsfSuVnjkTebfU/wdpAU7yQ8jQFFomUkg3CbFkJ0vQFmC1vw H0Lg== X-Gm-Message-State: AO0yUKUntrigNgjyEVmYarkLpqpI1BoBvsOWd2wp0iiAQ9GUCSSsj26w 2y5HRsESVelYVghwcfTnfGocjNfyd6ULeziKK5M= X-Received: by 2002:a05:600c:4da4:b0:3dc:443e:420e with SMTP id v36-20020a05600c4da400b003dc443e420emr18549209wmp.2.1676304847598; Mon, 13 Feb 2023 08:14:07 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:8df5:e191:f2b0:5825]) by smtp.gmail.com with ESMTPSA id t13-20020adfe44d000000b002c557f82e27sm3582882wrm.99.2023.02.13.08.14.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:14:07 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: sw@weilnetz.de, kkostiuk@redhat.com, clg@kaod.org, richard.henderson@linaro.org, alex.bennee@linaro.org, Pierrick Bouvier Subject: [PATCH 2/4] sysemu/os-win32: fix setjmp/longjmp on windows-arm64 Date: Mon, 13 Feb 2023 17:13:50 +0100 Message-Id: <20230213161352.17199-3-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230213161352.17199-1-pierrick.bouvier@linaro.org> References: <20230213161352.17199-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 13 Feb 2023 15:48:53 -0500 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 Windows implementation of setjmp/longjmp is done in C:/WINDOWS/system32/ucrtbase.dll. Alas, on arm64, it seems to *always* perform stack unwinding, which crashes from generated code. By using alternative implementation built in mingw, we avoid doing stack unwinding and this fixes crash when calling longjmp. Signed-off-by: Pierrick Bouvier --- include/sysemu/os-win32.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h index 5b38c7bd04..84f62d0a17 100644 --- a/include/sysemu/os-win32.h +++ b/include/sysemu/os-win32.h @@ -51,14 +51,28 @@ typedef struct sockaddr_un { extern "C" { #endif -#if defined(_WIN64) +#if defined(__aarch64__) +/* On windows-arm64, setjmp is available in only one variant, and longjmp always + * does stack unwinding. This crash with generated code. + * Thus, we use another implementation of setjmp (not windows one), coming from + * mingw, which never performs stack unwinding. */ +#undef setjmp +#undef longjmp +/* These functions are not declared in setjmp.h because __aarch64__ defines + * setjmp to _setjmpex instead. However, they are still defined in libmingwex.a, + * which gets linked automatically. */ +extern int __mingw_setjmp(jmp_buf); +extern void __attribute__((noreturn)) __mingw_longjmp(jmp_buf, int); +#define setjmp(env) __mingw_setjmp(env) +#define longjmp(env, val) __mingw_longjmp(env, val) +#elif defined(_WIN64) /* On w64, setjmp is implemented by _setjmp which needs a second parameter. * If this parameter is NULL, longjump does no stack unwinding. * That is what we need for QEMU. Passing the value of register rsp (default) * lets longjmp try a stack unwinding which will crash with generated code. */ # undef setjmp # define setjmp(env) _setjmp(env, NULL) -#endif +#endif /* __aarch64__ */ /* QEMU uses sigsetjmp()/siglongjmp() as the portable way to specify * "longjmp and don't touch the signal masks". Since we know that the * savemask parameter will always be zero we can safely define these From patchwork Mon Feb 13 16:13:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 653226 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp2639227wrr; Mon, 13 Feb 2023 12:50:35 -0800 (PST) X-Google-Smtp-Source: AK7set9khvZrJxoNurSLtCz0ujtpmpy4K6WtSOtLHVDm1PRJZNmV058hy2mwzGYT4PVuVwpbBrNb X-Received: by 2002:ad4:5c45:0:b0:56e:9a34:4eaf with SMTP id a5-20020ad45c45000000b0056e9a344eafmr570654qva.36.1676321434894; Mon, 13 Feb 2023 12:50:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676321434; cv=none; d=google.com; s=arc-20160816; b=rMveTYl3T0EYc0yR2UwxChXWqvtOUlWBRiWHhVg7J67QkFdnukGqiFDI6L3E1m4jVn tP2Du4qlwjNjeg/vYQP342WlFYU1U4qFxMPR7mQ9pE2qq9ZrEGJzWmWVTNp9SQ1/hsu4 NJzRV2rGk/TZWPCJWeyGQdmmPRGormdjrmFLMEhgXGXgST6jF3qfhWyXKdZHIOLavdFC t1lURnv/4Uq6yHj+GKEWtblEPAhlHt8TQTB/04RWdApekoDtg2/ZslNsvUtIL/xJu4R9 /p9NXteGVs5Q62OvSlrLJbg/cDHoSatmQUyeLbLaQ3UfyCE7IqUAHJKFWmhhmXVPkHfb HR/g== 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=oCtcRsma4Lb/eGzY1J2Zycrim3J1natcTOS1qZitV64=; b=CwqeZ21fqRedTBGvP/O7Lgzr+itd5luPycB8u5QmAedUrOox5drr/Z1fXTd7DepzSV 0g/Sr7MRlX7DbgJ7iXIS8A4ZcmydWXINIkCDUa9I0VlN4UFt8X96S7BUJLVnpFFTNxpm c8H7ecvULfT/lI/C4+lliqdMY93GOJK3XM//9gdww4hZkZliwsSDQK/XuG43f64/REkU RHrZuc8+Cte1DmR1yVJmPi1eywn/1xzOA1AuL1ISDTCYprNF+Tvly0jaGyjmD8bJKxAt 3yzNY0M5JNga56AVCGPkPXFpv9Cv/Hy38XV53NQuyRHGYXvt590Gkes5fcECnxtEIOMD 4fDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZhhgDXVN; 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 t8-20020a0cde08000000b0056bff80c91csi10264760qvk.379.2023.02.13.12.50.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Feb 2023 12:50:34 -0800 (PST) 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=ZhhgDXVN; 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 1pRfku-0000rb-Vg; Mon, 13 Feb 2023 15:48:56 -0500 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 1pRbT2-00083U-Iq for qemu-devel@nongnu.org; Mon, 13 Feb 2023 11:14:12 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRbT1-0005jy-2k for qemu-devel@nongnu.org; Mon, 13 Feb 2023 11:14:12 -0500 Received: by mail-wm1-x331.google.com with SMTP id j29-20020a05600c1c1d00b003dc52fed235so9448036wms.1 for ; Mon, 13 Feb 2023 08:14:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=oCtcRsma4Lb/eGzY1J2Zycrim3J1natcTOS1qZitV64=; b=ZhhgDXVN7p55YgzqReoCQBHVWmTiH9uwZ4CAumPnALVEk3RTKDJluWi7l1P48y3X// 7K7xCMRrzhLYgiAMcDioXViq2Vt/za3+Gik6EKdwMYn+qsscJLpjyZTQKY6gdPAMFoKJ rna9pTHdd13UJkZoxmNZoXhD7gn86kftqtKmpbOX92hijF2cfoekec4V5dWg+aCdebHc xf6gB/NSjuREWh+j109sASh8uGWdwWgp9TX2O1RG2HuuU9xmysSAtdT9tgRcG7aNoiXe pn6VwhvReLzFGjUt7/C/PFVv8y3nPWK3XHp1X3E/du9nQ/B6CoS7xux1qJPEQ/ru5S+k iNeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=oCtcRsma4Lb/eGzY1J2Zycrim3J1natcTOS1qZitV64=; b=XGEOLKA9uZFGcs9jBSBOZq0x4bTIHTGAT86dPVFXbm/7dgUm4jff4gSXx2cyF3yndc mboujcJKaZ69DNPAPdPNLvE7Qjn98vtf8GzJi5p/ohWnHsm3Pl+vvtA2dFispDAqyrq0 fpHFIwd2mlGXazdVmqftw0bO6UhTfIDY/6k/ifMxKfrAGrQuEn5QTBTtir2oYKEVPv68 m7tbgqYusk+gToIQv+SUIPrbFv8KzyNMA6w83BPCqRavDdHODT/TRcT6nWEzF7nIKcSv d3jonUoMFSrAvu7jyef0N3t6HHiCvVWO56W/pRRul7j6OI73PHiY5lv/AqikoQiEjEnK JxZw== X-Gm-Message-State: AO0yUKWaOqEMLq+IbvctbgugLHt5NYDFC9c9Lh5Txwd3CEc/fdwEboQM et97XN9Ke3KD8A20n8Y80ueBm4k+Jtuw+9UNt9s= X-Received: by 2002:a05:600c:4a9a:b0:3dc:5b48:ee5 with SMTP id b26-20020a05600c4a9a00b003dc5b480ee5mr19187770wmp.2.1676304848584; Mon, 13 Feb 2023 08:14:08 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:8df5:e191:f2b0:5825]) by smtp.gmail.com with ESMTPSA id t13-20020adfe44d000000b002c557f82e27sm3582882wrm.99.2023.02.13.08.14.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:14:08 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: sw@weilnetz.de, kkostiuk@redhat.com, clg@kaod.org, richard.henderson@linaro.org, alex.bennee@linaro.org, Pierrick Bouvier Subject: [PATCH 3/4] qga/vss-win32: fix warning for clang++-15 Date: Mon, 13 Feb 2023 17:13:51 +0100 Message-Id: <20230213161352.17199-4-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230213161352.17199-1-pierrick.bouvier@linaro.org> References: <20230213161352.17199-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 13 Feb 2023 15:48:53 -0500 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 Reported when compiling with clang-windows-arm64. ../qga/vss-win32/install.cpp:537:9: error: variable 'hr' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (!(ControlService(service, SERVICE_CONTROL_STOP, NULL))) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../qga/vss-win32/install.cpp:545:12: note: uninitialized use occurs here return hr; ^~ Signed-off-by: Pierrick Bouvier --- qga/vss-win32/install.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp index b57508fbe0..b8087e5baa 100644 --- a/qga/vss-win32/install.cpp +++ b/qga/vss-win32/install.cpp @@ -518,7 +518,7 @@ namespace _com_util /* Stop QGA VSS provider service using Winsvc API */ STDAPI StopService(void) { - HRESULT hr; + HRESULT hr = S_OK; SC_HANDLE manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); SC_HANDLE service = NULL; From patchwork Mon Feb 13 16:13:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 653224 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp2639086wrr; Mon, 13 Feb 2023 12:50:09 -0800 (PST) X-Google-Smtp-Source: AK7set9Ol8nQqPyiu0Q6gGJtYXWPvij/tjpx14/HFE22RfJWxM9RVMcZ3vnXsltR7ZnAzKU24vp/ X-Received: by 2002:a05:622a:1455:b0:3b9:b7e8:3b38 with SMTP id v21-20020a05622a145500b003b9b7e83b38mr41044835qtx.50.1676321409359; Mon, 13 Feb 2023 12:50:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676321409; cv=none; d=google.com; s=arc-20160816; b=Zh9qQr8A8c2JYhQ/5llg6ImB7sSMT14ccNTI3QZmsbxJQSxp5KlaZi7qLFh1zlSsKj w6I4kII5VUkW11b5v2ucFyGj82XDh09TV/2hl+EgKZJlBEp7CgEJlZ4EL9x8y5eDztVx pwBPWgxfucaK/Byhv7i76QBB2By0ONohixbYPyca9axBhr0rsF7NRUuScoaS/eFuBUhm FUGxfyaTsAsid5ys/gKRqkMw82KtuUFI79LnQI9lM5kqdS1ebHioQYAyjZzyeKaqLEqy 7j0xS6rZWXe81s4ICExpNGsou3S9J+XgWuA+1TorqMGuRp5SjwoKZ/p2DjpAKXg3p9cl A/7g== 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=tJhjoJrgbkz6/pE4uSBB6RIn4rUqwO2CFL7SGx4wCgY=; b=PFwLQt/XZG+qLtfzDVvTUDdRNrUxiRrB6CujXaZKxHwe/BaQYjUCYFBzq0HMyRA7F9 RQNJJB9QECcrBQpsGqPXav20nmxMoT1vrkx09o/s8b3mIjmJyP40piNBCZyTjzSPMcGA PrOjzcSFjpAMwbyevlOuCa0Ws3Hy4aIg61erSMSTwwUhi5i4w9ESse4Dl+RT3IElEKSZ 59NxegealRLp4MCPqhKBAKlyKL5Nqd6Ad8zP6TxgVgWSoVzkjxeoEqIblEdTuL/5nAT3 iASGYCg4MOg93LbIaRFD4PzEb/bdJ4/aApZ+os422EjcCd6ngX3Uh0eHJvtCQ6b6nmNL vXgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EpJ3TrQu; 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 w11-20020a05620a424b00b0071077285bacsi11516337qko.338.2023.02.13.12.50.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Feb 2023 12:50:09 -0800 (PST) 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=EpJ3TrQu; 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 1pRfkv-0000rc-1G; Mon, 13 Feb 2023 15:48:57 -0500 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 1pRbT2-00083V-Lb for qemu-devel@nongnu.org; Mon, 13 Feb 2023 11:14:12 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRbT1-0005kL-2t for qemu-devel@nongnu.org; Mon, 13 Feb 2023 11:14:12 -0500 Received: by mail-wr1-x42e.google.com with SMTP id o18so12827482wrj.3 for ; Mon, 13 Feb 2023 08:14:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=tJhjoJrgbkz6/pE4uSBB6RIn4rUqwO2CFL7SGx4wCgY=; b=EpJ3TrQuQe57RQnquZYYMtWOWpF9CbvRMSTvXjk5cNab+SYDEqJY+vbTrD78J3t9F9 LZfEgXVdK6l2WFyRoiysIbX0RmX0MjOBLb3suPegGPb02Sh7wa2p9FbVbSWcpYNro/3k Dx3DSZwDfZeCjW7lRJ40Q5eGBE/VbSJnMXl0KqRQwe2NyBB+j7zLDAWfPsywMZb0D3Za DPPeHktfsc7hQnqdNoKIU6T2ycjuSDwTu0UIx8kwXUF4cNIpok+fYoWw3lkxsvAdb/SX WvQWDN94YlMQGW7Kf8NzQdIalco2Xy51Rn4vW3Um+YHaM3hyXJx+58KPlAxrVe6uMVM3 +Y2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=tJhjoJrgbkz6/pE4uSBB6RIn4rUqwO2CFL7SGx4wCgY=; b=OR6HVnAgV7HgWJFfbtMSfcIoyO5UJ7hG99xq6nxX1ZiEcFHsB5nKnW2tMJZM1XfAmA Ye8t7NnXPDomU8bF7kgjyokUW1ABImqQUK/smRm4oLBX0yIgjcY0ujzZeKJgYW/o4n2o IQYBP/dObiSF7XfxGG658V7FDI0oFR/D7Bve9gVRmhmFwtCKxTl/22c7comLdtA4vnPe CxZqI94ctFNwKTzq0J7+qAaiYjsVOGzoB0xLvweb5/q7t4mHySxL5liP87BERGQAdoEP So0N8o5coEJXPmVDoutHaSZvx/BMDHj8nAQlaS/3tNnQXPJiOuJvVtXV3j097Bm5fd0i DnSw== X-Gm-Message-State: AO0yUKXLvEzqE4yx0KhAiJyFbtYwG1HN07QUqK5SCvCPp2BNpDPA1YFx txMolOiT+Bei+ON8AE3w6sW6Xa38gljDNWB4j5I= X-Received: by 2002:a05:6000:1007:b0:2c3:e993:9d7d with SMTP id a7-20020a056000100700b002c3e9939d7dmr20081969wrx.30.1676304849480; Mon, 13 Feb 2023 08:14:09 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:8df5:e191:f2b0:5825]) by smtp.gmail.com with ESMTPSA id t13-20020adfe44d000000b002c557f82e27sm3582882wrm.99.2023.02.13.08.14.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:14:09 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: sw@weilnetz.de, kkostiuk@redhat.com, clg@kaod.org, richard.henderson@linaro.org, alex.bennee@linaro.org, Pierrick Bouvier Subject: [PATCH 4/4] target/ppc: fix warning with clang-15 Date: Mon, 13 Feb 2023 17:13:52 +0100 Message-Id: <20230213161352.17199-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230213161352.17199-1-pierrick.bouvier@linaro.org> References: <20230213161352.17199-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 13 Feb 2023 15:48:53 -0500 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 When compiling for windows-arm64 using clang-15, it reports a sometimes uninitialized variable. This seems to be a false positive, as a default case guards switch expressions, preventing to return an uninitialized value, but clang seems unhappy with assert definition. Setting the rnd variable to zero does not hurt anyway. ../target/ppc/dfp_helper.c:141:13: error: variable 'rnd' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] assert(0); /* cannot get here */ ^~~~~~~~~ ../include/qemu/osdep.h:229:20: note: expanded from macro 'assert' #define assert(x) g_assert(x) ^~~~~~~~~~~ /clangarm64/bin/../include/glib-2.0/glib/gtestutils.h:235:49: note: expanded from macro 'g_assert' if G_LIKELY (expr) ; else \ ^~~~~~~~~~~~~~~ /clangarm64/bin/../include/glib-2.0/glib/gmacros.h:1186:25: note: expanded from macro 'G_LIKELY' ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../target/ppc/dfp_helper.c:144:42: note: uninitialized use occurs here decContextSetRounding(&dfp->context, rnd); Signed-off-by: Pierrick Bouvier --- target/ppc/dfp_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/dfp_helper.c b/target/ppc/dfp_helper.c index cc024316d5..0b4b280683 100644 --- a/target/ppc/dfp_helper.c +++ b/target/ppc/dfp_helper.c @@ -69,7 +69,7 @@ struct PPC_DFP { static void dfp_prepare_rounding_mode(decContext *context, uint64_t fpscr) { - enum rounding rnd; + enum rounding rnd = 0; switch ((fpscr & FP_DRN) >> FPSCR_DRN0) { case 0: @@ -106,7 +106,7 @@ static void dfp_prepare_rounding_mode(decContext *context, uint64_t fpscr) static void dfp_set_round_mode_from_immediate(uint8_t r, uint8_t rmc, struct PPC_DFP *dfp) { - enum rounding rnd; + enum rounding rnd = 0; if (r == 0) { switch (rmc & 3) { case 0: