From nobody Sun May 19 02:38:21 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=1676891575; cv=none; d=zohomail.com; s=zohoarc; b=cs+xjzaNb3v49p0ZmVRRYfus8JkBYSZbB1KNbYwjxFtZ9feIBmld/LJtS8geB4QYgblLtq2Fnfjo1sT5FgemvPUaPPxgHHuTlMuygUw+9/JhSfbzGesKuc1hffPk9k6eHdF7agMD0ObiQSDPU1glB1FJ0jQl4Dckk6TYRLhsAOg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676891575; 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=FmnWoNMHciP793cEremK0wUfHJtfeQ2W0yr8vbgY8Xk=; b=dfGIaQgkuzl4YQes/K3Klxl+po7AWZWtn0rYo63ihvXbfc9wYyQSqFE9FC/U/arp3l/BNT8fBCSLJZXxYDUKX7UP52njZcAhCMyrEnyhLzxiOj8KRP7+jZlv3RUCAEtMvx/2z9j3dmXzZa7Opgza4vVXPstqPlvbcF3E2HNG/sE= 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 1676891575570796.8307308990559; Mon, 20 Feb 2023 03:12:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU45y-0004X2-6m; Mon, 20 Feb 2023 06:12:34 -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 1pU45l-0004SJ-OJ for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:12:21 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU45i-0006Ry-Ix for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:12:20 -0500 Received: by mail-wr1-x42c.google.com with SMTP id j2so568710wrh.9 for ; Mon, 20 Feb 2023 03:12:18 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:c49d:d14a:e6ed:555a]) by smtp.gmail.com with ESMTPSA id q2-20020adff942000000b002c573778432sm5046656wrr.102.2023.02.20.03.12.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 03:12:16 -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=FmnWoNMHciP793cEremK0wUfHJtfeQ2W0yr8vbgY8Xk=; b=vEGFUJ9VkfzzxRZjMUpioBhLlyynrAO7j/MyUY9n6e9fsObuZwT0d7Kz3al0cue8OM 1jaSfwNctxjU/gutmKD9kCwPBch4oeyp8QOrJoKzUlouUredBOqKFlq38PsuQzo9oymq u9JZrz1T38IosGMyFroMpqgI4WnquKlzEZ+ZUZtP2P7hEbYlM9+JyaDVpMdrpYUarVN2 cBgkPfHbbSx8akEmLgmfeujmdmR5lOnu27xrhHNvIm/Yv661swqj+UoaZ7rKk9cQzLgq I46cuwpDJ5uaX9WRc7TTQH3TMf3gLSEXJhX4VYYH8cNwVA+P5u4cXJ78wvxIC8XSCNVG Vu5g== 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=FmnWoNMHciP793cEremK0wUfHJtfeQ2W0yr8vbgY8Xk=; b=8Hyfd3ZfazWR9EG4OeVnYxabXD0CWN57TacHYLYjOXu6zZ0RviQkg+FwWZgSpuLFfA l8m1tWFds3itTQ56vGQXl/gwjrjC4HWIAWJb8HjpA1J373ARwVxZMYcMegLOWaY+M/lA wc5R9PlgDZW8+zIj+0X7/kCeRrCIMX6FlV+7AC9cqpkbr2NtW4er5y9T2p1+0d9oxcGt 0nX7tbJBl1F/keTEy1DuU/BKLoYIED6L1bZptVUaRU3Q1gBm0qoAVp0qhHTkmnPaaNbh TMf4+Bf7qU7aenA4sbaSu4eoLwTAEmjUJR1o9ID9pkMPM0HHKH30u2v+HqvtrWLRQTcU q2Ig== X-Gm-Message-State: AO0yUKUO7ntRsN6/bel3pA/LfIIrpGyxs8Nbnef7G8ODpQULVv8ilQYP lgL/aYuwTpIIQU3aNv0+Xsjm70WdCiobDJf15ZY= X-Google-Smtp-Source: AK7set/dW1KunvhC9Nj5FfKrt6J7ImcJhGkEf7etAuJum0Gyw5Jnf0rO37WiwY35QKCw8PBSBKR+mA== X-Received: by 2002:adf:f108:0:b0:2c5:561e:809b with SMTP id r8-20020adff108000000b002c5561e809bmr994028wro.66.1676891536589; Mon, 20 Feb 2023 03:12:16 -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, Pierrick Bouvier Subject: [PATCH v3 1/4] util/cacheflush: fix cache on windows-arm64 Date: Mon, 20 Feb 2023 12:12:12 +0100 Message-Id: <20230220111215.27471-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230220111215.27471-1-pierrick.bouvier@linaro.org> References: <20230220111215.27471-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::42c; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wr1-x42c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676891577434100002 Content-Type: text/plain; charset="utf-8" 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 =20 -#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_WIN= 32) +/* + * Apple does not expose CTR_EL0, so we must use system interfaces. + * Windows neither, but we use a generic implementation of flush_idcache_r= ange + * 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_in= fo(void) =20 /* Caches are coherent and do not require flushing; symbol inline. */ =20 -#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_cac= he. + */ =20 #ifdef CONFIG_DARWIN /* Apple does not expose CTR_EL0, so we must use system interfaces. */ --=20 2.30.2 From nobody Sun May 19 02:38:21 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=1676891594; cv=none; d=zohomail.com; s=zohoarc; b=kTRbX6rm+Y4yZJ6Y7+ZnsugzZYZR4SjvAFgaoxA80SfGVBMhdp1Z7QsgCCubYXkarFlyDpz/e6Rbte+EhJEHyTdIc1vBiCjJdJva42u2Xj2hh1OVgJEyaKvvzDvtnyp8F0jvWBNYW4XAUFsUzEIvSc9wwGy7//U19/z55NiQ7KM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676891594; 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=D8LrzaSz6ElJrxd4cI99a7LkIk5CnLxRYnoODRf0SCQ=; b=SLuovpdKRKRAVFzt0GXfIpdWT7g9XqMmjVi8zerwbouftrHf5UMzzN0GgrnN3GzYSFJBD0m2o3Ge2gDXlGdn6NXN4OMgN8O3WFF+BegQzcT2YC9JKTXFV8hmT5XnejzVSDCoZFoFuKQBSzcnLD++73tFxLOh1YPrg2rrWbWqBfk= 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 167689159415457.11850774524669; Mon, 20 Feb 2023 03:13:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU462-0004Ym-NC; Mon, 20 Feb 2023 06:12:39 -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 1pU45l-0004SK-NF for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:12:21 -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 1pU45j-0006SB-LK for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:12:21 -0500 Received: by mail-wr1-x42b.google.com with SMTP id v3so663660wrp.2 for ; Mon, 20 Feb 2023 03:12:19 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:c49d:d14a:e6ed:555a]) by smtp.gmail.com with ESMTPSA id q2-20020adff942000000b002c573778432sm5046656wrr.102.2023.02.20.03.12.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 03:12:17 -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=D8LrzaSz6ElJrxd4cI99a7LkIk5CnLxRYnoODRf0SCQ=; b=kktg3pof6D9jzO2enrL0zdIChx0k8bN1VGg2liwzyO74kpFH94Zvo0W+pPXkP6IP4k T7y/UeXIXoWTNRJrTxGFyLDQtMSWPDzSsB8WOaW3AWy1CfO9R8o+IAbtm6hkRpkBbMkQ AzfMAjZuQcLkjJCr0I8IIPuRQIKa9vxmFYlyKsvxvN0DXeXDEvRp7pPrYv5dDxdteru2 i0CFG6CQKb4Jwb3RHu9erZLNl2Z+OXj9vouvpRJmPmD/pg2onJQUxq1T1KnzYtNSCeEv OGHRyjnn8UshEsr7g/hwMLs/h963LrTAwcEKTqrA2AFpdulmGKbsMCtyuRvyURfd2k6/ 0EWQ== 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=D8LrzaSz6ElJrxd4cI99a7LkIk5CnLxRYnoODRf0SCQ=; b=1PJ3icngeAJjr0Q3DlltaM/bGTyamPjE6B9QGT/9qYGslJSTJK3PlPQ8aHPe7vx3bu cIIPuulBtP6RkooYwkGfzTjy+2z0J12T1rLdCkTzzIVRviSR6cUBMrt2arNjk5DZE+ai 5YX18CFI2jLD7I5S64MVkKQH6txmbuPn/ZgGngMcss08tCACo/RnxhiJTgin2m948GDj 6Iv8OaDY9h2vakIO9Yc/Ni9k6XBpmoeofHlq5xFCyhVAB2Biv+eknsvn5/vD5P7k5/eF BZVtIXMDH20+3eCpXg0qpT8R3bv3dcJm0j3jk78g7qieQql9bd8dr7Ee1CxUR3AX4WD8 VxeA== X-Gm-Message-State: AO0yUKXvgVp29Jm+8VriFiMttPAQNNaQuM+OGG4wacfBpO9F2OF7tmTX beiNSexnRy5HdmpEOAXkDgdf2/yQfVyRg31gYvQ= X-Google-Smtp-Source: AK7set+o0gYiRQIL/fvSR/xeSfHfOdmUeqQp1MFUx2hnvt5e66grqbhWtaKnqZFBBCGErwklrCZG8A== X-Received: by 2002:adf:e241:0:b0:2c5:4e77:62d with SMTP id bl1-20020adfe241000000b002c54e77062dmr1710832wrb.58.1676891537630; Mon, 20 Feb 2023 03:12:17 -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, Pierrick Bouvier Subject: [PATCH v3 2/4] sysemu/os-win32: fix setjmp/longjmp on windows-arm64 Date: Mon, 20 Feb 2023 12:12:13 +0100 Message-Id: <20230220111215.27471-3-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230220111215.27471-1-pierrick.bouvier@linaro.org> References: <20230220111215.27471-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::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676891595876100003 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 Acked-by: Richard Henderson --- include/sysemu/os-win32.h | 25 +++++++++++++++++++++++-- meson.build | 24 ++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h index 5b38c7bd04..1f6c141d39 100644 --- a/include/sysemu/os-win32.h +++ b/include/sysemu/os-win32.h @@ -51,14 +51,35 @@ typedef struct sockaddr_un { extern "C" { #endif =20 -#if defined(_WIN64) +#if defined(__aarch64__) +#ifndef CONFIG_MINGW64_HAS_SETJMP_LONGJMP +#error mingw must provide setjmp/longjmp for windows-arm64 +#endif +/* + * 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 diff --git a/meson.build b/meson.build index 4ba3bf3431..e968ed9e7a 100644 --- a/meson.build +++ b/meson.build @@ -2450,6 +2450,30 @@ if targetos =3D=3D 'windows' }''', name: '_lock_file and _unlock_file')) endif =20 +if targetos =3D=3D 'windows' + mingw_has_setjmp_longjmp =3D 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') + + config_host_data.set('CONFIG_MINGW64_HAS_SETJMP_LONGJMP', + mingw_has_setjmp_longjmp) + + if cpu =3D=3D 'aarch64' and not mingw_has_setjmp_longjmp + error('mingw must provide setjmp/longjmp for windows-arm64') + endif +endif + ######################## # Target configuration # ######################## --=20 2.30.2 From nobody Sun May 19 02:38:21 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=1676891578; cv=none; d=zohomail.com; s=zohoarc; b=OjsoNcioXod7/RscsnWpIlhmEH81we9b80Absj9WFur/kcgMcwImuuW8zNqwnuuC7kRnKSv1fMGEezZFW8rlF0dToRao19x2ptpP0X9Y5EdHIfcEVLFJ4Zfk1bK837jAun5wQIlkRP3CLENp9AsxS7hLiTJu8/x6yUE7WzYCfNY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676891578; 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=HjI/MXcFQX0sLnHEiW3oJXXkPL+0jGt42NhiNlhT21pFwzBfyyMWWo2a15MQX7OdLpZXTRpUf4KmPLGs8YVbhc2ILFxqCwqjZX5eC1iNqGr50WGivR7ZWveRwCluLKnZDk/Z4kOi4NMVhR9RcjnYzCZoctAaEqPr+GZjE3ePons= 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 1676891578800436.13350952319854; Mon, 20 Feb 2023 03:12:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU45w-0004WD-Gi; Mon, 20 Feb 2023 06:12:33 -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 1pU45n-0004VX-5f for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:12:23 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU45k-0006SM-DJ for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:12:22 -0500 Received: by mail-wr1-x42f.google.com with SMTP id v3so663707wrp.2 for ; Mon, 20 Feb 2023 03:12:20 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:c49d:d14a:e6ed:555a]) by smtp.gmail.com with ESMTPSA id q2-20020adff942000000b002c573778432sm5046656wrr.102.2023.02.20.03.12.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 03:12:18 -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=YiqsXv5/8fCXXrxCbjyyVZnYGN4SrEUp4FmVu87iPXcLVF/g2LekwYjF4aFm0sPiN3 srpgwSuCAJG+8SAQHRJUm/olRTr+pNAU+SKkGiPvkGJ4uhN+hPWzrcF0oZ2fu7Gaktlt RjuhFeaMJO5tKSnQ0pS7IF8LCHiSc7aPXUNDDtkrEcCdEBp+YOLGsJGSr9G7RaMFX/jo mOMUp2PVNTaRJWyzGbfj4gPOMPGws/grh71LCsxkOWjQ8a9urPEs6x28kTEQkKPW4Wjq olJ1FhSpaOke9Ro0xpnRJztoBOUMRk0gFemcAAPdp7Mlw/FmnNcCkvJ9uJ0GePKWQPA8 9lgw== 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=MInuthzZzS3DbgRdI/uiPgW0l9HbWTV44dhBnkpnSGadFQgPEESzr0Zg5JvUsR6KON dl30OmkV83BR/kFQZgn3+c9C79uM6W2qCREnk9yXhQMf6khnXU1oD2DFKzrIHuSbS15d CKoE3lEWN37BZxS6sKSrzIk+KzFHErlhdFGmURq0tiIUFpjBoPGgxfo/iotCL9j9bpq9 VuzRMXAM4lDFQL8//gpVupkzNzl1QRW4IkUcKGLL+ZfwVCTz0jqBszj0M1yNTQSTtgUa qDla8t/DhFGl8xbk3LX9fZgkmPlBsOM3dY3Y8zUTW/yQV3U5j9Y2rB90eZPp+eYPP4DS 6DVA== X-Gm-Message-State: AO0yUKUWQob+6evKQoDZU/2Ua5pU5XFEk762oKICRH3wihoevcdq9wE4 TAeOeh0lS3ph7/9LOonVVHMdEowAMJCpmK5NNqU= X-Google-Smtp-Source: AK7set+3fbQcQ9yCXovUvzBWLImfOtPl4jdMoj/cUmGYsZ4DYcvq6vpERfSEAJYSXZMvNhCa54q5Jw== X-Received: by 2002:a5d:4b07:0:b0:2c5:4480:b590 with SMTP id v7-20020a5d4b07000000b002c54480b590mr898506wrq.54.1676891538569; Mon, 20 Feb 2023 03:12:18 -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, Pierrick Bouvier Subject: [PATCH v3 3/4] qga/vss-win32: fix warning for clang++-15 Date: Mon, 20 Feb 2023 12:12:14 +0100 Message-Id: <20230220111215.27471-4-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230220111215.27471-1-pierrick.bouvier@linaro.org> References: <20230220111215.27471-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::42f; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wr1-x42f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676891579792100011 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: Konstantin Kostiuk Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 Sun May 19 02:38:21 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=1676891596; cv=none; d=zohomail.com; s=zohoarc; b=bxjPZrVq5bPxAiLywmFFbWh4pqwl2X1IN+UOzkKJ+R7GN+SO1+vCfJnsT9GvEPSJaTEHJ/3vG5W8JK92C5lw8JqKIxGVhUrwMVhCqiIKIrKDxpiZaUdYQxpn0W6wICujP6Geyz1XTril507PIiwOoteCeCsjwEGT21pmluwErho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676891596; 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=7h6E11Jxo8IiawWK95L0Dw59rMSl1d8e8Ox3uSUoz/Q=; b=HdVhLXahKQqYUAYWFo8Y+ygNxg9ySRlVh+53wSA6D9b/5Vg53SL3P2/Vgwcl0TkTWRoiZhVS9PlD7TQYxhRotE7S4hJ88+fwBjTyHwZsUzECDbhi0cNw8cnnz8h0+esa1vR0BtEKlWHyQ1QbGRohWmbVDzDaoQi+GDFLYCSZKOk= 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 167689159609888.21566864211024; Mon, 20 Feb 2023 03:13:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU45x-0004Wd-W1; Mon, 20 Feb 2023 06:12:34 -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 1pU45n-0004VY-6L for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:12:23 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU45l-0006Sf-Gy for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:12:22 -0500 Received: by mail-wr1-x432.google.com with SMTP id p8so876564wrt.12 for ; Mon, 20 Feb 2023 03:12:21 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:c49d:d14a:e6ed:555a]) by smtp.gmail.com with ESMTPSA id q2-20020adff942000000b002c573778432sm5046656wrr.102.2023.02.20.03.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 03:12:19 -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=7h6E11Jxo8IiawWK95L0Dw59rMSl1d8e8Ox3uSUoz/Q=; b=B0bPPjauP6+ElCVi5bWLWVfK/oaX4U0igbAE2EKOS2kOI1B0/MyWHM/DyMe20IyvUC FZgzufAdlItbQ9HAGuSJdHMIyfn7b/EDw5DNP+aDg31/jOkA+vNjMJtPEhRTBFLVXp7z yNeMeTHN0SmiR4NnTQuQEHNPSinYHpFQ7BA1DQ4FgTT1CgPjwRd7IWW+tVgYWTjqgO9I o+k1w0iMnNTFLSQ13QP6PYgIBR7EUL9yGykxmkhadeLXFdjIb05ewSLDgxBBomTMSYnC ObE2H98gw9zDhO7Po62Pi9/dvRH7IHmrSR79l3vm7Uqxjao3YvvcI3wRlMqWCO5FxMPk G7iQ== 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=7h6E11Jxo8IiawWK95L0Dw59rMSl1d8e8Ox3uSUoz/Q=; b=rWHCjesiNmqgQS0vT3jHGa4iJWoJdedeJ/EL5sxNzh3KA/Bd8XwJnVdiDNlgnoHlj/ I4vYfcbwYxBD2mr5IrCDhCj9fE1xwSzO6pO7QSM5qAIPVKg+czYeVb/RVoJ/ccDqTvcF 8c5/Ap1xIvM/w+lAnSQajMMB22/2vlHJ6Uq4rYlwpNKawKzK8B1M6np3bINUwDJ2QCj2 RV7P6Azih9N9dFBLYKaQSIwQVfaeRMIM/+ILPfC48k3z0noiZN2CDfOdvAugTOPmdBeA JXlt51L0yFBC1TxSsxkmi6jv4adxVjLwCFeei945wqd4jwMIqU/vawB7M0yhLXQNttt3 f0Jw== X-Gm-Message-State: AO0yUKUwR7rhe4SE6JD8n4nBnxqr/+PVMhLvOar2N4d4hphqiOUDJvQl UpfgHCYUSLNO/5qax2XgaxKHqn6xaTyzpx+/g4o= X-Google-Smtp-Source: AK7set+MWopFzrDcEQcyJOA1MZwTJWQTvwxsxJbIKP8De3Xc810zs2zks3o21Myb9L07HxUuuzZPnw== X-Received: by 2002:a5d:44d2:0:b0:2c5:588f:c5c4 with SMTP id z18-20020a5d44d2000000b002c5588fc5c4mr2158549wrr.37.1676891539636; Mon, 20 Feb 2023 03:12:19 -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, Pierrick Bouvier Subject: [PATCH v3 4/4] target/ppc: fix warning with clang-15 Date: Mon, 20 Feb 2023 12:12:15 +0100 Message-Id: <20230220111215.27471-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230220111215.27471-1-pierrick.bouvier@linaro.org> References: <20230220111215.27471-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::432; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wr1-x432.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676891597862100007 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(0) definition. Change code to g_assert_not_reached() fix the warning. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- 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 =3D=3D 1 */ switch (rmc & 3) { @@ -138,7 +138,7 @@ static void dfp_set_round_mode_from_immediate(uint8_t r= , uint8_t rmc, rnd =3D DEC_ROUND_HALF_DOWN; break; default: - assert(0); /* cannot get here */ + g_assert_not_reached(); } } decContextSetRounding(&dfp->context, rnd); --=20 2.30.2