From nobody Fri May 17 09:01:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676321434; cv=none; d=zohomail.com; s=zohoarc; b=NHzr/RNqRPShoIH/UKmhBhfNqGsoa0CmKYoEaRtUUewJKbOrHm/3KDisuAczZugKi290asOwVxnuXLAhKFUcHe5odFD/jSteTD/ahZhNE3WB3K2d4cBOecSPoAFb4AVFuhRcdiho6x6LPFDu8/5B/cW/4jyz5X3LB5Qc+D5TMuk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676321434; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/Fnuvphrd4KcPyS3DWGw7YsNit5qQSnqPK9bRR9NFcg=; b=MkRzgxZdl7hU5nrgqYGqEaJMrPhPPvSlLQo/UjohXKiTIImF9e2QGHMcQ40HU903uX3o3FyDK98y9qqWR9ropMQX0s5yOa78hivITXssrjTtsWx+rGNX/Fe7jF0zWGoGLpFtsrQA+fkK1DKhACamS8ZqDkaPCUfFZjkfNQjJ1KA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1676321434214209.37300037046077; Mon, 13 Feb 2023 12:50:34 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AK7set8FqqPFU2NyGp22ANdw5rvMBXO/sKqn+mvfO3AgtT0nfV79NRGa14elkn0gTHorEAaWh02SMA== 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) 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676321436201100003 Content-Type: text/plain; charset="utf-8" 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 =20 -#if defined(__aarch64__) && !defined(CONFIG_DARWIN) +#if defined(__aarch64__) && !defined(CONFIG_DARWIN) && !defined(CONFIG_WIN= 32) /* 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_inf= o(void) =20 /* Caches are coherent and do not require flushing; symbol inline. */ =20 -#elif defined(__aarch64__) +#elif defined(__aarch64__) && !defined(CONFIG_WIN32) =20 #ifdef CONFIG_DARWIN /* Apple does not expose CTR_EL0, so we must use system interfaces. */ --=20 2.30.2 From nobody Fri May 17 09:01:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676321435; cv=none; d=zohomail.com; s=zohoarc; b=YeUORXfUzuwbLICbeThbE0z3LfZahglU+ZAmy385lbZYiq6QWl6hRrkuZys7tz4X8Y2Uqo8qBz8ifktlX0InKqMvFDej5u1Sgn8Otu5/LqWws74iZwcpoEUw8aTtaKCrwv5/NvrvxcssxD3hnIsdTvG/Jhaa/evNROeKyPeJEuI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676321435; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vGXouOChIYjl8AkJ3HhGb5U80hOl0zPVyYzc37vy0jM=; b=Oy+7TLw+kUIxk4DVnYjr137rYppDi9bfkOxm4MyqEzgUZyuiZ1z71VTNAHJhmG5rWSYY1sHLdoJk+3/BDUmxgZRi6ffHgTugMYzYJRzATxaORrY4Co8pehyOxfpQWw4S5vVyfzH7nhwr1Bw1q0y5W8DM+AZXH0R76L/qw207wWc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1676321435346990.0800340971416; Mon, 13 Feb 2023 12:50:35 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AK7set+l9mZ/R7TkEOpA945CuAcNHoni2h6uzFjgIRSH85LaT07xpNzg3O3A9OSVsaRgl26lNF7TfQ== 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) 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676321436287100005 Content-Type: text/plain; charset="utf-8" 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 =20 -#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 libming= wex.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 (defau= lt) * 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 --=20 2.30.2 From nobody Fri May 17 09:01:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676321435; cv=none; d=zohomail.com; s=zohoarc; b=YWhMf7K5kO6DyZk2GMlkBbCUVlReTxZCojyiH3wVpNBpGcxiT/IVoMWGSkEZs2/WxoWTvNgpSz5ho3c4ss+1a8oEgWMwyUZa2NyKBsXCw5ba0ES5fWt9lQKwiLHAhQVk2lY+lvC4PesGW4d5hLJAKazDPZTx7PdazVFxAPDy1UY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676321435; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oCtcRsma4Lb/eGzY1J2Zycrim3J1natcTOS1qZitV64=; b=f9WsHHFcZwB1oN56baAAF6hA70vSoTSBWyWvGzpABu2+JKFJiUbBsxvUgpmGoeHhKgCDAK6DZ/Gltk4wsUdcUTzEmvSmcMzSGpylI8gwDYIPx5vIoBFti5+uJQoiv2lRJLiGxbKRXh3mi70krbCyyHhy4nSQIxNLiPKWeqGdlaA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1676321435549639.002348606009; Mon, 13 Feb 2023 12:50:35 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AK7set8vMfndlR8S9+sV+oOSmRQ2UJ1kmuJg3X96hcV6MTEye76BO4l3y42L5qHXigDyEMFqtG3fMQ== 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) 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676321436212100004 Content-Type: text/plain; charset="utf-8" Reported when compiling with clang-windows-arm64. ../qga/vss-win32/install.cpp:537:9: error: variable 'hr' is used uninitiali= zed 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 Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Konstantin Kostiuk --- 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 =3D S_OK; SC_HANDLE manager =3D OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); SC_HANDLE service =3D NULL; =20 --=20 2.30.2 From nobody Fri May 17 09:01:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676321409; cv=none; d=zohomail.com; s=zohoarc; b=ctMUTGMjrHoaBotPvzTK4DWvfawvuBbz84t7S2o8sRXTG1P3CULBU0AxPKjUgAsfXGANzFZtz5lTKQigXSUoQuoKyLKrhUAB2nhZMNDRqwkTBbnqU9M3Wh9JLHhDGH25lFo+AhVA9KNP2BdMQ7VKIX8edIOVE41J8HPCgZjYWtA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676321409; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tJhjoJrgbkz6/pE4uSBB6RIn4rUqwO2CFL7SGx4wCgY=; b=Mmi8MT8SNjJbIBJtaCvr5tkIm3s6/E0eMwl0/sRowuX2qciN5wCfG0v7gqTu7+pATWKyZwahlLO0zdMaaN+ecsfBg3FfYLcl9TCZH9/qSJvD7hkKtfiiTgK2VusSEtMeALCjCkA0G4yV6hPiraolmr0k7lSBoA2wYwbcR5sBwmQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1676321409817206.63821444186783; Mon, 13 Feb 2023 12:50:09 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AK7set+t4ZwnPSPambYtgI/1V+vR0qBVbLDV4YT1JFzxNbX6WtS2RMPXwB9z/HrRVNZ56/OjC0MhkA== 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) 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676321412329100006 Content-Type: text/plain; charset="utf-8" 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 uninitiali= zed whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] = a= ssert(0); /* cannot get here */ = = ^~~~~~~~~ ../include/qemu/osdep.h:229:20: note: expanded from macro 'assert' = = #define assert(x) g_as= sert(x) = = ^~~~~~~~~~~ /clangarm64/bin/../include/glib-2.0/glib/gtestutils.h:235:49: note: expande= d 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 Reviewed-by: C=C3=A9dric Le Goater --- 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 { =20 static void dfp_prepare_rounding_mode(decContext *context, uint64_t fpscr) { - enum rounding rnd; + enum rounding rnd =3D 0; =20 switch ((fpscr & FP_DRN) >> FPSCR_DRN0) { case 0: @@ -106,7 +106,7 @@ static void dfp_prepare_rounding_mode(decContext *conte= xt, 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 =3D 0; if (r =3D=3D 0) { switch (rmc & 3) { case 0: --=20 2.30.2