From patchwork Tue Feb 21 15:30:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 655374 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp156104wrb; Tue, 21 Feb 2023 07:30:56 -0800 (PST) X-Google-Smtp-Source: AK7set9sRo/J9PSwUJ4iKoODlPUIsfhl3Vbew/iHPNuMgEhkLeyD8RwPKzvnOOaoP9prdzw8SPXg X-Received: by 2002:ac8:5903:0:b0:3b8:6ae9:b107 with SMTP id 3-20020ac85903000000b003b86ae9b107mr25929987qty.17.1676993456248; Tue, 21 Feb 2023 07:30:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676993456; cv=none; d=google.com; s=arc-20160816; b=N5mnCrq3ebwCuiOwZG2xs2P+OhEztXF9uO1W4xSU8nJ+mon4f1QyEw6tPF4uR+RK2U Q1Gom8ZhPC+WUfBz50u3AKMZnxlBoEx422bRKOZeMYp1AAHMeeoEQ7tUNp0lKu5m2lEz Thwqlvt6OpaB0VcDvXdoF0PqfcPCJ58EZGc/Vcx5pg9sHgD/2Z1+n1gglaXRnSH4bJqf +s5qdSp/hTlvvO5wygQ+YGahJRG6OiMroz9cJQzLYHtRmI81hTQclTRypKgNQCQL9z2t KH2w7Zj2wpl9+a5w87d+JfWXNwvWuRbTpB/xhRAuf9/dF85XkqkyabJO0fzXke2g0K9L ASAg== 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=JGLiZUBdLguQ8v1zIoAL8gWJ2AVvRrGKswtrTjBu1+w=; b=XHDGm2S7xi+fMYvx21tNtIJjnP6hX+2++TN20ThSWPes/fGPXqBMoLKS0gI6jdTwqa FNfTi5VRtPiIaXvK6tDs8FNasqFdh22MBt3BpFe8CnWEkIa58MF6tSouY3tsRpfde9KI X3QMZktFB7Js57IAi+eKqYxPa1mV8B1RCfgg6PHEWBAjsQ8WiBh8Ud0ZzBg/Ux5Y509R Adhw043XgY9O0rna2bsRTo9bAWuIYTENtyZYjCpHv9hqpHzLtEXfvqdmhGrKrGU3xluw cl5R5KtxkoWbuw0iSIpv8E6r5/ezGN9TAFuNBW8R5obXgU7Et6i/mY2lpTdupS6oUkup Vx5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QjVk0rCA; 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 p10-20020a05622a13ca00b003ba201d92b0si12472160qtk.285.2023.02.21.07.30.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Feb 2023 07:30:56 -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=QjVk0rCA; 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 1pUUbS-0002hE-3a; Tue, 21 Feb 2023 10:30:50 -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 1pUUb4-0002GC-Td for qemu-devel@nongnu.org; Tue, 21 Feb 2023 10:30:26 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUUb2-0000Va-Mt for qemu-devel@nongnu.org; Tue, 21 Feb 2023 10:30:26 -0500 Received: by mail-wr1-x435.google.com with SMTP id 6so4463100wrb.11 for ; Tue, 21 Feb 2023 07:30:24 -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=JGLiZUBdLguQ8v1zIoAL8gWJ2AVvRrGKswtrTjBu1+w=; b=QjVk0rCAum3q/9kpJVw30TOeUo6FvzLqy1Rg2zI5T3femKiwABrXqrQXDaOv4cZnne P9NUEnI4wOv9kuu5X8CEzjh8t5fkCYzpWvH2KVIxomrZb53jQj/T8rHgHvNvfSzV49RQ T0VnPU7wRf7b/f/kbC1mVBlf1EHfG+iJTe6rpISFovMJ2KyswDrVn5VCEljIOslI1mX6 F7sGr68u3UPmtovE8Ms8p+K5fXe6WRJ/cm+o1zkJ40A9CJACuI1H+pjOk1xCqokle4qo xkb1EkR1fWLm3EyQVYEBM4JmviIObjtagJF7o4GYTGukDqFZXwza55DyBO9KQZGrbCZb E6xA== 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=JGLiZUBdLguQ8v1zIoAL8gWJ2AVvRrGKswtrTjBu1+w=; b=a29k/t6yXwBSP05G/nRBSFJbnC2M+L657qDcfM1/eJyZjM5OdXkwnZveYBvURU5E88 +WEVqyp28j+FrLRrZZBH39jIO9GTUC9wQlkLU23j9tpOfFY1UqMxEnYpU1WubQJc34fH 078ST7R1i34QMp3ip6J3nRhE3yFqOvVxLHLxaKWWeG7+LVajqjk6hSR+ubqSq7xyE9o2 3yox4UvFELdXPFVbBbNejP9/ZV0AgvPjdy9kKLgnAcsOfcxXUMRLVvy+NlCVZZ6/vHYz wi2eLh/KQtiPapd7QUX0sMayYGHtwdZ72i0dAO2Q1U900yb5M1WGDU+rGbRWvGoX823U ciTQ== X-Gm-Message-State: AO0yUKXtftLlfixE4EsXPybr/avDsSNWlNNVdtKmsmKWX5P312n6MvZo kyCOCcJVQ1qkBNmplGHQrA8TCAO1HNB6J6X0EII= X-Received: by 2002:a5d:4e0e:0:b0:2c6:8e3a:f701 with SMTP id p14-20020a5d4e0e000000b002c68e3af701mr3632593wrt.56.1676993422981; Tue, 21 Feb 2023 07:30:22 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:c49d:d14a:e6ed:555a]) by smtp.gmail.com with ESMTPSA id r1-20020adfdc81000000b002c5503a8d21sm2803417wrj.70.2023.02.21.07.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 07:30:22 -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, peter.maydell@linaro.org, philmd@linaro.org, Pierrick Bouvier Subject: [PATCH v4 1/4] util/cacheflush: fix cache on windows-arm64 Date: Tue, 21 Feb 2023 16:30:03 +0100 Message-Id: <20230221153006.20300-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230221153006.20300-1-pierrick.bouvier@linaro.org> References: <20230221153006.20300-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wr1-x435.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-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 ctr_el0 access is privileged on this platform and fails as an illegal instruction. Windows does not offer a way to flush data cache from userspace, and only FlushInstructionCache is available in Windows API. The generic implementation of flush_idcache_range uses, __builtin___clear_cache, which already use the FlushInstructionCache function. So we rely on that. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- util/cacheflush.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/util/cacheflush.c b/util/cacheflush.c index 2c2c73e085..06c2333a60 100644 --- a/util/cacheflush.c +++ b/util/cacheflush.c @@ -121,8 +121,12 @@ static void sys_cache_info(int *isize, int *dsize) static bool have_coherent_icache; #endif -#if defined(__aarch64__) && !defined(CONFIG_DARWIN) -/* Apple does not expose CTR_EL0, so we must use system interfaces. */ +#if defined(__aarch64__) && !defined(CONFIG_DARWIN) && !defined(CONFIG_WIN32) +/* + * Apple does not expose CTR_EL0, so we must use system interfaces. + * Windows neither, but we use a generic implementation of flush_idcache_range + * in this case. + */ static uint64_t save_ctr_el0; static void arch_cache_info(int *isize, int *dsize) { @@ -225,7 +229,11 @@ 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) +/* + * For Windows, we use generic implementation of flush_idcache_range, that + * performs a call to FlushInstructionCache, through __builtin___clear_cache. + */ #ifdef CONFIG_DARWIN /* Apple does not expose CTR_EL0, so we must use system interfaces. */ From patchwork Tue Feb 21 15:30:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 655378 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp156336wrb; Tue, 21 Feb 2023 07:31:16 -0800 (PST) X-Google-Smtp-Source: AK7set+zhNtYTamU2yZatsao5mtUosHYwmNHuyYhOriKeOGHMNCuI/L5/ez6nU7ffmrWpDyw6qdp X-Received: by 2002:a05:622a:1343:b0:3ba:19e5:3e47 with SMTP id w3-20020a05622a134300b003ba19e53e47mr6374045qtk.65.1676993476282; Tue, 21 Feb 2023 07:31:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676993476; cv=none; d=google.com; s=arc-20160816; b=Uu1/Df73RXsHRnkj8SBA0d/r2OOn+o2I0CUAqlPcXWLUyBlDlu35ToClA4PnM+Qs6G kTdGGFrDNyvFfpgo/u2vTcv1X1J3YweBWn50cGfuC2YDlA1iOWusqo9HsY4BM5yWJdh4 cseyiuCyVLwrP8v8DLuq/9hMXZ+IE/34+o8zpcjO6EyoUpXHH880A7U8e+bWfvnDSi85 AuMXoYCLkijZA5rAGz++3G0TnzuuBqjDW3/6zA8rHaJDCH7EMZK0Y36scV1ryQWZBb8O bxGIyzRWuiiN41TMjeD5JMVa+iVZmgKCOKrftTz+kCKkPsINZryBVIxHw9osWLoF/j6q 6aYw== 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=uZPnixULi6oi31J0KFtxJqQtIdv2DOflsZD/AW7cSSI=; b=BgydQLCoIZ9y+Uq0aeA/ZxGSls3Ud5vfptaHa7wrD5qSTpJWo+Qa9CoJXiygVJAZDF KHd9hxtY0QisvYyq26ZM6XZWcuidwyTqKzn9tVtMeXYt2ZXTTt9J4Ldpvko0TXnO3IWF ZwIS268RSqfUPosDo5AvCHxPdJJwBF0/wWq46I4uT0SFY5AfjvxY8w6wKCwOOEQ9H1W2 HbvHhXsC1C+MSe6M5WgsgPPq4ejnjtdd4d8xaZyKa5Axgwf+rCmgA0pZZZc5y/P0srUe 04Y63VvntU2blv+Z1C3GI0mEywNaIJHAQIj3RM2LAFwwkXPRkwNJR7hTiGQKo2QWOtQA es2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BxQqYzIB; 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 m25-20020aed27d9000000b003bd1bc10387si3350544qtg.796.2023.02.21.07.31.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Feb 2023 07:31:16 -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=BxQqYzIB; 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 1pUUbU-0002qh-B7; Tue, 21 Feb 2023 10:30:52 -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 1pUUb6-0002Hk-Ic for qemu-devel@nongnu.org; Tue, 21 Feb 2023 10:30:37 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUUb4-0000Vi-ND for qemu-devel@nongnu.org; Tue, 21 Feb 2023 10:30:28 -0500 Received: by mail-wr1-x431.google.com with SMTP id l25so4465338wrb.3 for ; Tue, 21 Feb 2023 07:30:26 -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=uZPnixULi6oi31J0KFtxJqQtIdv2DOflsZD/AW7cSSI=; b=BxQqYzIBpxFR3ZXJGVnQQk4r13ifC2dVus/Q3MNOxr0reLbWBR68Oy/obt4HWOWQ3m rsBWuiYgK7eVyH3Vmkvb+eC0V7YiqQBqsi+UsP5MSfSTsOEhtzu9RbjXFxgE6HPOa9S6 BwpBSN3NgUADsJBTc3CePNlIY9ApVIu+SD/LFXONecaIvgNHSsMlneENRwfd1Nh8gCuT WGlsoZP9xH3xEKAJd1Q9Kx/Lv2wHxfPJhKRfJCwHsxIYxQQkPL0Qzzc200UIfMdNqz2z 9/UDTXNJRM+mesA0AKp81BQsW/bYnQp9UFSJOrbFU9Ykg7Jt56Gey6TQcMvgJT6xCcZc dwxQ== 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=uZPnixULi6oi31J0KFtxJqQtIdv2DOflsZD/AW7cSSI=; b=28BkHpnD3iQfozlCmokSETImn5+m2OMaXWOMxlKmCpkuNtNduHRYJ4iJDI2D78Ji9f 86XtbU3snEqPc8bGXqNnuXGRabof6eYM/Z79lF63r0HXN6/zSS0AJ9Ay33I1L/4fEEdU 3sT5SHGDKsyvNVA7+xNQ90bOsg/Z0ZsuGIru94O/STkejb33tUw5LA+YEuWwImpHQFH3 BfnC7R5cZxSTDnZdh0GVM1w8F/kFwSG6xW/ospyPK4iFSBDF12EUautNyj3WLlz0y0S+ lS5YiXWyIwvweYlLs+vqq8nMAucjQF0o9a/2XF2OuvigKU8TcLxrK1B+Q/olztFqHUcl D5Rw== X-Gm-Message-State: AO0yUKUd5GGtgNEW49ZbxDUc0F1uR5juUDHJDrjk5+GvncR6Zi/cWysY MnQbc7K/WDAGDFAyMXqfNxTBPVL40b2gcZCMraY= X-Received: by 2002:adf:ce11:0:b0:2c5:4d17:f688 with SMTP id p17-20020adfce11000000b002c54d17f688mr5560650wrn.15.1676993423962; Tue, 21 Feb 2023 07:30:23 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:c49d:d14a:e6ed:555a]) by smtp.gmail.com with ESMTPSA id r1-20020adfdc81000000b002c5503a8d21sm2803417wrj.70.2023.02.21.07.30.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 07:30:23 -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, peter.maydell@linaro.org, philmd@linaro.org, Pierrick Bouvier Subject: [PATCH v4 2/4] sysemu/os-win32: fix setjmp/longjmp on windows-arm64 Date: Tue, 21 Feb 2023 16:30:04 +0100 Message-Id: <20230221153006.20300-3-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230221153006.20300-1-pierrick.bouvier@linaro.org> References: <20230221153006.20300-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wr1-x431.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-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 Acked-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- include/sysemu/os-win32.h | 28 ++++++++++++++++++++++++---- meson.build | 21 +++++++++++++++++++++ 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h index 5b38c7bd04..97d0243aee 100644 --- a/include/sysemu/os-win32.h +++ b/include/sysemu/os-win32.h @@ -51,14 +51,34 @@ typedef struct sockaddr_un { extern "C" { #endif -#if defined(_WIN64) -/* On w64, setjmp is implemented by _setjmp which needs a second parameter. +#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 windows-x64, 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. */ + * 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 diff --git a/meson.build b/meson.build index a76c855312..b676c831b3 100644 --- a/meson.build +++ b/meson.build @@ -2470,6 +2470,27 @@ if targetos == 'windows' }''', name: '_lock_file and _unlock_file')) endif +if targetos == 'windows' + mingw_has_setjmp_longjmp = cc.links(''' + #include + int main(void) { + /* + * These functions are not available in setjmp header, but may be + * available at link time, from libmingwex.a. + */ + extern int __mingw_setjmp(jmp_buf); + extern void __attribute__((noreturn)) __mingw_longjmp(jmp_buf, int); + jmp_buf env; + __mingw_setjmp(env); + __mingw_longjmp(env, 0); + } + ''', name: 'mingw setjmp and longjmp') + + if cpu == 'aarch64' and not mingw_has_setjmp_longjmp + error('mingw must provide setjmp/longjmp for windows-arm64') + endif +endif + ######################## # Target configuration # ######################## From patchwork Tue Feb 21 15:30:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 655377 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp156300wrb; Tue, 21 Feb 2023 07:31:12 -0800 (PST) X-Google-Smtp-Source: AK7set8K47n+bDHW82X8Eke73VzhIWtA+3Y+0VTKvWsuKC2bxcHuoW1lFse/moO2RFERpsS/nfq7 X-Received: by 2002:a05:6214:e62:b0:56e:9a34:4eaf with SMTP id jz2-20020a0562140e6200b0056e9a344eafmr5516394qvb.36.1676993472428; Tue, 21 Feb 2023 07:31:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676993472; cv=none; d=google.com; s=arc-20160816; b=BEYTYrPJqnJUKMB38iKZFoCCm4GVH433g0EbsHJ0s2PCU1EnmL4YmBj1Q1YS3PK9Oq 0DfYIGPwePW9+6Y23b/6OWOYnX1Z772ELW1wMmxCUzdQNTqtmjR7tN/v3CxrL1g1EHbu 8rpF3rG9+jG6GHmRzNTJeFGOo5ZK46L/Uu9TTsROtsNSwlJ4pChNa07SbDtHAx+HTW9c 2GQHgqH3Jb4bHy11r/n37+Pn97wN+ctcgDwqoLs2FTJvEvTP5Pt7gr3M8ftogBV2/Gyp vYEOOWP32RUjnZBKfRCQau93oDR5999Fs4vd9B/h2mU+5vZsEVK1LXUUxqzCoSTOW/7S nS1Q== 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=aqBt2Wco0xHaQqloNdEBhTt2U0GhCudNuL+urVRzaIs=; b=EaqveGmfazub9hhazOuizFKHOxX+SZZesVa9CUGpp+fy5K6YGi0/wnq5MObJOhW9a3 kbBjg+DeEIcsmNNbDLJSA7dV39oWa35bcGTePsWS8sy9idR+btWogBDIpMeFDgoKZaBb UhCeDCYxULKGIzQWocYDmGthF8DyOM/v9v5R4zQEuX6HfqAbzNMY3C8TQ+YsqSXXWAQN YAzTYQXWTkIIE5hTCMKTUtWt5WiNGFq03Hu6a8iu3EYFfBP9wgF6I+89eEWtd6EpAFgz PMX1RnCj+vqV9srGtszzEwVdGDxrYXTYnsP29V8HxwM+GOfkDZmw6zYoCb75S0QKHkRA fBAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yFkw8vnO; 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 y15-20020a0c8ecf000000b005526bcd7eddsi1440936qvb.4.2023.02.21.07.31.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Feb 2023 07:31:12 -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=yFkw8vnO; 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 1pUUbT-0002nI-38; Tue, 21 Feb 2023 10:30:51 -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 1pUUb6-0002Hj-9y for qemu-devel@nongnu.org; Tue, 21 Feb 2023 10:30:37 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUUb4-0000Vp-LX for qemu-devel@nongnu.org; Tue, 21 Feb 2023 10:30:28 -0500 Received: by mail-wr1-x42b.google.com with SMTP id p8so4998040wrt.12 for ; Tue, 21 Feb 2023 07:30:26 -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=aqBt2Wco0xHaQqloNdEBhTt2U0GhCudNuL+urVRzaIs=; b=yFkw8vnO0W08mYQXdGF9v//kpmBSkvorlyt8LTQym6NDyBlZETlnf2JRQKDHIXRYl6 Nm28kxr+vL5C2Q4Zo3ggkJtoWsZeIfOz/Q12H3siw52hrmpRbZrBnA871qJSQxFWPvaX mfE6d4bkxujdhIcGTaacdy33bsldCY1nBQ//5blVzmCv6sJE09P4ZlhXbnqXoN3LTH3R j0lDFdYjRcw+fkX3i1d4HvplCgVvUcKwgQVzyfNk2n6B5ZQKWmsiDcIwKouyPW/w98kI Dfl5e2zZxG1eHGDPuSmfewTQ7urlwL9vK9bwBUS5/y4YeiZMZ2C2Okbi2kUo/s6d62TE kMhA== 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=aqBt2Wco0xHaQqloNdEBhTt2U0GhCudNuL+urVRzaIs=; b=E7QPHRqX8Y49wnAtFXm8ijP0aTSMVwE+XaZWZVfBGGLGxekXJCRaOmPhO1jp299Gyz L6+CjAnbygf+T4f2rJEJ+5YSWhZywutMsFwiLjXcrPdHqKIZWXxwg4dAJy8vSdxnyeCE lwlmtvdbCAFafGTBmnjN4MiAApvRYQfViIjzK/3+baZ979/QgwoHK0LRd5p/aq3UrCkv pDNFSmWnfxceThX9IE1Ov0rmmbejBWfQUT+YYUY8+bke1ySp1PhXiXMqcrBPwxd3bbeD tsrt+ax6SmbyvccWuO/X9xMg0tuc1J9IbE0OCz3ABPhwwurPr1yFjTLAouDx5ic/h/Z9 Othg== X-Gm-Message-State: AO0yUKWf5uto/d5N/vU1nOHIjKrcMJRlGeN76juVJ3+aco2n/alObWH2 I+Kbswc6UAMED1/4ym0hcvoEZQ2H0kEFH7VEeLI= X-Received: by 2002:a5d:49c1:0:b0:2c5:5ca4:ef14 with SMTP id t1-20020a5d49c1000000b002c55ca4ef14mr3900482wrs.9.1676993424952; Tue, 21 Feb 2023 07:30:24 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:c49d:d14a:e6ed:555a]) by smtp.gmail.com with ESMTPSA id r1-20020adfdc81000000b002c5503a8d21sm2803417wrj.70.2023.02.21.07.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 07:30:24 -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, peter.maydell@linaro.org, philmd@linaro.org, Pierrick Bouvier Subject: [PATCH v4 3/4] qga/vss-win32: fix warning for clang++-15 Date: Tue, 21 Feb 2023 16:30:05 +0100 Message-Id: <20230221153006.20300-4-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230221153006.20300-1-pierrick.bouvier@linaro.org> References: <20230221153006.20300-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wr1-x42b.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-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 Fixes: 917ebcb170 ("qga-win: Fix QGA VSS Provider service stop failure") Reviewed-by: Konstantin Kostiuk Reviewed-by: Philippe Mathieu-Daudé --- 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 Tue Feb 21 15:30:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 655376 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp156186wrb; Tue, 21 Feb 2023 07:31:02 -0800 (PST) X-Google-Smtp-Source: AK7set9RBrwDdZavoFFFy1HJl+0NkGRbZ/DN3zqx6+Z9U/jorKdZ2+wFu/eOwnA3U159L/sb2LzM X-Received: by 2002:ac8:7d89:0:b0:3b2:365c:9a9e with SMTP id c9-20020ac87d89000000b003b2365c9a9emr8278929qtd.61.1676993462559; Tue, 21 Feb 2023 07:31:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676993462; cv=none; d=google.com; s=arc-20160816; b=0r9Mz/lKIUeMHGJ0yqUJ79pFJz5pOKxcvwrQLK53wkBzfM9U5poAK3ws0RxjMsLsqz mbjRB13M9qAbz0cyS6cLd9NFrpBjHhwmIbQjc7lKo1xr7H5g5kKYWN31sCZnIbxtrKje tuzUZQ41c/Z5/assQ8Ls1a/GB6V+7SmNw7/9zqWB9o8xVPOnLWabOlelIrUGYJIGlQKe wTgcoxiLTby4GNV+rLYYZbkk+w00qpaSxlIN96gZ7ws5mvx4DAFy89/nGtn8DrLhYJBX PjM+qHg/9fg91Qkq39EX4RkivY9xMFy5/X+2pIwdFSQUKiRaITGhy5d01AZepFep4MGx MtJg== 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=6qn/yx6q7lkoNAawrOJ+PdaXBlkustX5jFFPd6NUzvQ=; b=FXByuK9+iqAjqkqtPWY3gXmkItPaLnb5oK/VZlOZEWOSudkjJo5c6hACOK+YpumIBo 6fzg10BnKOYKGXSoSGwZzitZNyql1JLwQbfVNFsa+LqMOarcCBGXIJ6epEeZwIsn+Pgu 3To3aaKhh79nz5GDhN4NzDhdBPhe68oNcSYvHxGcSikt53eqz4t6CIftCXKNHDVyT763 kjPoxnT86T+nzpXKwBRQU93C/uzqhcex0LOXWgWUtwZ3xk+v+8jOevA+HvsFJxHvaFLr dnb8SAyq20bu0cIF7/XaQCfTYZEQVHFhTYxfEkweMjQ6muk77Zo2vc0S1YxQUDSdOUcz r6Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ml40aHav; 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 x20-20020a05622a001400b003bb7aacfce4si23146qtw.444.2023.02.21.07.31.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Feb 2023 07:31:02 -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=ml40aHav; 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 1pUUbR-0002en-CI; Tue, 21 Feb 2023 10:30:49 -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 1pUUb7-0002Kk-JY for qemu-devel@nongnu.org; Tue, 21 Feb 2023 10:30:37 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUUb5-0000W1-O2 for qemu-devel@nongnu.org; Tue, 21 Feb 2023 10:30:29 -0500 Received: by mail-wr1-x435.google.com with SMTP id j2so4689123wrh.9 for ; Tue, 21 Feb 2023 07:30:27 -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=6qn/yx6q7lkoNAawrOJ+PdaXBlkustX5jFFPd6NUzvQ=; b=ml40aHavkBRi/dbzj4cK6sMbIjJ7JFkzV7+TNrTJgbkpCdNYnLWnhPMNYwKz+MYnjN z7BXniOl2kWi58pbWWFOH5yfgLNP378Fl/KazgRzJG/C6al8wrmy7Jlsbcv9tSgHZZw2 oe2dwj9Wm9EbQH+pnxJJTz5qMQQ4BOoumK6tDEXd3N164bkNDJ9CDl4epqLYcRkVZVdW fwfz1k9/lx4KuuGhNkGGR9gj1lFC0x8bEeHWs0NaZNSY3u4jQ1n9ERFhmgMD7McLAjV1 K9FKF7DRZBpItrScj24f5yOavNsMJbFruGw1X/KQ4bgyBDty1XWR4A8O1hpLW7h3nj+0 hZiw== 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=6qn/yx6q7lkoNAawrOJ+PdaXBlkustX5jFFPd6NUzvQ=; b=29Ajy9NSQk8PZ6gnf4Qu4gP7zqCs+802ji3o7YeUhAC7OH/1K/LcCfD5MVLq0WDodU CRDsyV8q77irMw103XjiwU/nZaMCXh3WazA/lLNP1TVDb5sYJdr8CVK7UpVwNkWpvYRx i2ArvniQDarAhcZKgrJuCGPsGLCQYYPcF5EFpPpOmd3YBXq+SCDSUO/5R9FQLxcfzjdw 7AGSOU6NwUsn1DFp/d36DIOxHMgqshd8hk/8XaMDLMRiWtjKe+a4nW/6rpDCNC+Dld3b bTplyHIauwu3sCH51U18EEUHoJQPMZAM4lrWOXH8waryAgldY13lAZxUbn7CH1UdKKhs H7ww== X-Gm-Message-State: AO0yUKUMOC68LGdObG5TQ7JZQDh9alpreI3RrA+0OMyR83b9qSZDK2GT Bb5chnzxJElqOtjv0RoTy/wnyK1xKsmHDuBEkpQ= X-Received: by 2002:adf:f748:0:b0:2c5:534d:eebb with SMTP id z8-20020adff748000000b002c5534deebbmr3036071wrp.13.1676993425859; Tue, 21 Feb 2023 07:30:25 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:c49d:d14a:e6ed:555a]) by smtp.gmail.com with ESMTPSA id r1-20020adfdc81000000b002c5503a8d21sm2803417wrj.70.2023.02.21.07.30.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 07:30:25 -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, peter.maydell@linaro.org, philmd@linaro.org, Pierrick Bouvier Subject: [PATCH v4 4/4] target/ppc: fix warning with clang-15 Date: Tue, 21 Feb 2023 16:30:06 +0100 Message-Id: <20230221153006.20300-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230221153006.20300-1-pierrick.bouvier@linaro.org> References: <20230221153006.20300-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wr1-x435.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-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(0) definition. Change code to g_assert_not_reached() fix the warning. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- 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..5967ea07a9 100644 --- a/target/ppc/dfp_helper.c +++ b/target/ppc/dfp_helper.c @@ -121,7 +121,7 @@ static void dfp_set_round_mode_from_immediate(uint8_t r, uint8_t rmc, case 3: /* use FPSCR rounding mode */ return; default: - assert(0); /* cannot get here */ + g_assert_not_reached(); } } else { /* r == 1 */ switch (rmc & 3) { @@ -138,7 +138,7 @@ static void dfp_set_round_mode_from_immediate(uint8_t r, uint8_t rmc, rnd = DEC_ROUND_HALF_DOWN; break; default: - assert(0); /* cannot get here */ + g_assert_not_reached(); } } decContextSetRounding(&dfp->context, rnd);