From nobody Sat May 18 22:54:10 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=1676555388; cv=none; d=zohomail.com; s=zohoarc; b=P5TUkLYo5FSXLkL4b7C+cvxbZP9lqVlv6tC/+T56R4xVhoaVfAB1jwlGJHg0rbIjGHRfYJMvhRGOuA+8lAxc9u4mCW+ri/7v+18UQ1KxQPg3hWQPYF7bzQ1QFxFcWGbBJdXEWfU8oRYDE4kShMkpPqOdBYcSJiF8KSG24cpya80= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676555388; 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=B2dYUbNSjmgpVDD1OmNWATFHbh0VLr0h9CMNVrcVRPQ=; b=RosT6w2Dk15/3jWo0R/fUhAzy8tAFzf/xzH7ZzsQBqq+W+/9ToyE9XZCKbWyXDZr+fMvlXospJI+wWCswRLvjOezMvP9s7D3xOD1cE3RlPukdAlickaQjAICcHH0S2fivBSUn1TLcpUbLbaEdaTO+ZkzlK97xASLJTixzWJnUO4= 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 1676555388065498.78335662280585; Thu, 16 Feb 2023 05:49:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSedT-0001XC-8h; Thu, 16 Feb 2023 08:49:19 -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 1pSedR-0001TY-UJ for qemu-devel@nongnu.org; Thu, 16 Feb 2023 08:49:17 -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 1pSedQ-0001aA-Br for qemu-devel@nongnu.org; Thu, 16 Feb 2023 08:49:17 -0500 Received: by mail-wm1-x32a.google.com with SMTP id f23-20020a05600c491700b003dff4480a17so4073129wmp.1 for ; Thu, 16 Feb 2023 05:49:15 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:c49d:d14a:e6ed:555a]) by smtp.gmail.com with ESMTPSA id y11-20020a05600c364b00b003dc0cb5e3f1sm1557933wmq.46.2023.02.16.05.49.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 05:49:14 -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=B2dYUbNSjmgpVDD1OmNWATFHbh0VLr0h9CMNVrcVRPQ=; b=oXENBCjN1ukbeODkUqkkj2do0qY8rWYSpJkU89n9qxsiiLWRqlLvfRQX0XRUYhxLAq 8t9Cuj7KOwgLNt4a0uSocNG8dGufiIwYRxt9LDibhr6p5gcnynJN3abhNP2Q0sV20MHc PAZcbI5xsL7z5WzEGCwQckZ6vP0aq+A6txwwatRsUxlAsNXlh5N6he5E67sXYnV6bix1 /j4zhM2wYUe0XmWb06b6MYecO8vefxNdOXDbqGzZhXe7nTZx/5ggewdBMHStndgxpDld WcCAB/yeZZZ0PbOUDMSzr0xkTyHhqSscHT0vyLS+GW68rGBSDmUZWi+7/RywdVVwqIcW NWNQ== 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=B2dYUbNSjmgpVDD1OmNWATFHbh0VLr0h9CMNVrcVRPQ=; b=oQfPDa4uCnavfBkcPU1YM3zpBkOPxTHP7v93d4g61O3B2P4LJlECkMPux0FG3nYlYu B5Wnw9y6F8y81kmSs6c6fh46edaH5bxePQ8Umbo2s/e0FI6OGpml5zmozb/VdXmbxhKN JrpX3jUsP6AaavEDWiM+ldQlsZ4ZP3JESDZ1nqGFwVjrlRlNEQkKnjtBZT/wWCkWidLT E/L7dRxh07edV7dlrZ6GPknsoqOVXBPATK7/9cau5+TIeDBqz637ig1255/9YtbuFxi4 XhFitbX2AIWmcWUa0/cF7DAJ1U+lkNMGBGcEp6gHqm2lM+DGKJb0x4Z1hcozLzlpOs+I Xzaw== X-Gm-Message-State: AO0yUKXaSubBoMiOLqSasA0goVqnWoQkCC0ESJnRp3cTDg2sdGl9onbA AFkeyvvbvtlKyURwHRZsj7uGIAYk9BXHUQlz9xM= X-Google-Smtp-Source: AK7set9ls/J/qRbu2Zt9/ui9CEGdqmyck92eMNymJA82Z3XoqsnC1LRCoF/vu+4iciBa7DxKPoGe1A== X-Received: by 2002:a05:600c:1987:b0:3dc:52fc:7f06 with SMTP id t7-20020a05600c198700b003dc52fc7f06mr4864869wmq.41.1676555354461; Thu, 16 Feb 2023 05:49:14 -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 v2 1/4] util/cacheflush: fix cache on windows-arm64 Date: Thu, 16 Feb 2023 14:49:08 +0100 Message-Id: <20230216134911.6803-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230216134911.6803-1-pierrick.bouvier@linaro.org> References: <20230216134911.6803-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-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: 1676555390128100001 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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/util/cacheflush.c b/util/cacheflush.c index 2c2c73e085..0a0acd70fa 100644 --- a/util/cacheflush.c +++ b/util/cacheflush.c @@ -121,8 +121,10 @@ 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 +227,9 @@ 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) +/* 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 Sat May 18 22:54:10 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=1676555399; cv=none; d=zohomail.com; s=zohoarc; b=b6AjrAv9xPUd68vr2+S9MZd+SdWirMp9XfMqFUoH+rXbu+5aBAFtDlGKYcZ6MkG9cqyhp+mdEVbzuL7G1ByXpSXKZbp4gACBZmhVQnOwPmGSLOD7xE/l2D2EI4cvPrHN3PYC2qirBn6/TE6OwDBhJCqrIonf95GyCetYL8Iz+3c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676555399; 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=OmRSGsOLRR4SdMYF46j6nl7BWaAZNtQ19hvx9YK2z9A=; b=H8SR7YxExHdyIeDN8Ks544EfHVl0rJ+28bVTT3yb6uIdFMkMW7bEO2UUgY4i2vlmFnqiHatRlHgPbuyiOPL3LM/WAhyrkT6cyIfjQLnuXW+N+uyYUkjLWADf2evGqSuY5TpkGcekuKpwpmvZ3xSI0gRtV1u6VE7j9T5FiBJ7aec= 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 1676555399595139.98383299006377; Thu, 16 Feb 2023 05:49:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSedU-0001eg-Le; Thu, 16 Feb 2023 08:49:20 -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 1pSedT-0001YZ-HS for qemu-devel@nongnu.org; Thu, 16 Feb 2023 08:49:19 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSedR-0001aK-Mh for qemu-devel@nongnu.org; Thu, 16 Feb 2023 08:49:19 -0500 Received: by mail-wm1-x332.google.com with SMTP id s13-20020a05600c45cd00b003ddca7a2bcbso1691204wmo.3 for ; Thu, 16 Feb 2023 05:49:17 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:c49d:d14a:e6ed:555a]) by smtp.gmail.com with ESMTPSA id y11-20020a05600c364b00b003dc0cb5e3f1sm1557933wmq.46.2023.02.16.05.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 05:49:15 -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=OmRSGsOLRR4SdMYF46j6nl7BWaAZNtQ19hvx9YK2z9A=; b=EHuUmuwedH1kFD/MC9J4nW8K4T+HDmmWh7yNfdfG99bvLzuU0jeBf2II8nXtUhj8pZ idO2kOFBczCsTu3ipHVkzQRmU2q6uzLy7V+PFKjR0UnO2Wdw3QBoK5DUoetCnshS89Kc XI3e/TjIx0H27FRF3YflXb3MG1hPHhtiUHsHxHRTLPC77yXX6dyl1ngg+pXMzcMnY71C EPd6pt4CLTkEdo92UWcQHVW3DwcrQupWFsZxn8Y3XvjIoLJSaCz3WE1SngXGNXdKhd5e NKmcPfRhZYlorkZmr+2JUF6cg6dhd3Av7QVLYde5jQ6t/N3n3aVXMOfiA20liFtsNRuz aN6A== 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=OmRSGsOLRR4SdMYF46j6nl7BWaAZNtQ19hvx9YK2z9A=; b=YPJwYOOyiusNsH24tv4XxMi6vHf65Wruf3GOMOsCSCjS25mnI1TDjP+YaYl/4HJR9H AKF0w7NHgbb1G6DRBdeOHQVP5eAJL+uDcu0c9/SoeaqDn3RvenfHnFeVZIqh5dmR1v/9 7NQHLxzmkwOszO79BB6fpabWYf8pEmT26lSLAVF1LJadkdqUt1Net2jBBcHnBLJ7WfDy 8RI0JxMXjCvBLwKrtBbjYW05BFREBor/5fyMbDO41pTIYbKmyxQ86QlrPKr4ZxRxHNWD R8feSlgOd0Km9uS3B1fj4ViH87SWNVxMkhPgJtxUDVzHahYsOibTfTMmh1VM4ik8Ev3t D6tA== X-Gm-Message-State: AO0yUKXBDUjpCdpDrm8S35W3Gg9VQxX/G5iXVh3p/KHNFEnQePm10L9e PdYPpdF2F7yn613Da/UADEyQdH4dKG+tpnfRP9E= X-Google-Smtp-Source: AK7set8LX13K3ERQbxnQMJ56umCCJymRXBJe8Ox3xXMdWYqAgGRZ5psmutyyr0RtKcHa7laGlBLNmA== X-Received: by 2002:a05:600c:1c10:b0:3dc:3f51:c697 with SMTP id j16-20020a05600c1c1000b003dc3f51c697mr1934793wms.18.1676555355652; Thu, 16 Feb 2023 05:49:15 -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 v2 2/4] sysemu/os-win32: fix setjmp/longjmp on windows-arm64 Date: Thu, 16 Feb 2023 14:49:09 +0100 Message-Id: <20230216134911.6803-3-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230216134911.6803-1-pierrick.bouvier@linaro.org> References: <20230216134911.6803-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::332; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wm1-x332.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: 1676555400079100001 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 | 21 +++++++++++++++++++-- meson.build | 22 ++++++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h index 5b38c7bd04..634931a387 100644 --- a/include/sysemu/os-win32.h +++ b/include/sysemu/os-win32.h @@ -51,14 +51,31 @@ 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..7f55205437 100644 --- a/meson.build +++ b/meson.build @@ -2450,6 +2450,28 @@ 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 Sat May 18 22:54:10 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=1676555377; cv=none; d=zohomail.com; s=zohoarc; b=Bq7zK3U2s+0ZG2bXf9qdKrR3XWTr0leeZ/2g3U51aQa6lkAD+cEl24v3SKZJDjgKCBlYMxkSIBeNs+lC0DXK6PT+nazVpdU8Yfj6g4h47J2LEDdkiwcH0PpeHpO8HuDHyzZZjvaMBK/wBF/blbHEk3Tza2yZsch6AjPQF9z2I2E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676555377; 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=TyJK71DO3FYWRrQliXqBdYvtmUBZ8wrl4OQJqMThvGQ5bRnqgUlRbVCgYy0RE01knaFt+BQh1GdOw5zbejw0z8uHfMyDdK8YwgKLs8tcvw2Mwqcrmb7/REcb4sVL/W8AR2fxB9EMKBtzCQp0wCc+12PqGlXSRtrQeAGkVjTC3gg= 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 1676555377000516.3163020460639; Thu, 16 Feb 2023 05:49:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSedV-0001fU-Hx; Thu, 16 Feb 2023 08:49:21 -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 1pSedU-0001e5-Gy for qemu-devel@nongnu.org; Thu, 16 Feb 2023 08:49:20 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSedS-0001aY-JW for qemu-devel@nongnu.org; Thu, 16 Feb 2023 08:49:20 -0500 Received: by mail-wm1-x329.google.com with SMTP id f18-20020a7bcd12000000b003e206711347so1738587wmj.0 for ; Thu, 16 Feb 2023 05:49:18 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:c49d:d14a:e6ed:555a]) by smtp.gmail.com with ESMTPSA id y11-20020a05600c364b00b003dc0cb5e3f1sm1557933wmq.46.2023.02.16.05.49.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 05:49: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=oCtcRsma4Lb/eGzY1J2Zycrim3J1natcTOS1qZitV64=; b=C1MfzGHNVCp+pBBYhVUS0NTNG9RwririohC33e773ZBpWMUMPROJJk1aiSI13Mnkgv xfNp84P09NCy8k6rmkB1W8SKALeoscPNgPkK3UW2oWpfjIWmoO7V8t8G7N3wZfs37SsX bx9AR6uZCTkvsgITvAQb5SzwYXWQecZaBXf07Bq64OExGwgjliZ/kI6QBPghqkF7yfBu W27wVWueBGNiMfaMIUNAvZoHh1wJjnAE24Y2GvIgv8/+Xu5yEnEgKNH2Kxt9RQ3JMFi7 rDdamuSQMFauisCYnoKV5uYLlMHk9z77S1wJnTCFo1AHw7tKCZHg0HmfqqJ7dedHJNqi QwCA== 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=WafZl3Zcr7l6Sm8cCQcrMMWRNC03cV/CTMgwziBupPV1sBaKbAZpENl2/smB7FaVlj IdrTKMlljI9sS+ZLBPXiB1vtJSW3k4tyJotWwVyKB4DyM81+02CGtP64xjnvMj5Rf4Qk umoNeWmbjpjJH8ULMZri5zhTuabXcnwOXvbALpEx+o17Y178Pv0OSPLrpBL9cyTghlfO JcUIDKFXakTLql2EXd8Qbp3cMr5LM4b8ax724sODjpvy8QUgdZ0P5/X2VLEm1fr5sI1a jZodKbRenKwhFAyqsU2ShXohGoPEEyQXK8We28ho58pcjo9DZH2601O5PLO+HTzghOvZ WNVg== X-Gm-Message-State: AO0yUKWB/I1shQzAO4fzhjnFB+VtG80z1adH75YU6axZUY7UZVyQgCHt 1nY6pVSTjvWRzNVexCWd/fcp5p2wzE5Hy5YRGLk= X-Google-Smtp-Source: AK7set+80B1mbcZ2UtDiBHFl0Y62ELvc7k+hEC/ju9e5WD9eqbKmQN0Vk/erKURGY7Kle/sb0kqTvA== X-Received: by 2002:a05:600c:3d92:b0:3df:ee44:e45a with SMTP id bi18-20020a05600c3d9200b003dfee44e45amr4938641wmb.15.1676555356886; Thu, 16 Feb 2023 05:49: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 v2 3/4] qga/vss-win32: fix warning for clang++-15 Date: Thu, 16 Feb 2023 14:49:10 +0100 Message-Id: <20230216134911.6803-4-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230216134911.6803-1-pierrick.bouvier@linaro.org> References: <20230216134911.6803-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::329; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wm1-x329.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: 1676555378302100001 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: 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 Sat May 18 22:54:10 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=1676555421; cv=none; d=zohomail.com; s=zohoarc; b=Za0vyYLYQqZb7cBO54IofA2cYcHRC6wcCkUl43Qtj8t4+w+DuL0vu/y7yr8WbX4Y7dN3GYB8dLwX9bQluH+E5UvWhQuglr12nBwxj9nbJUkmXMmPBh7i4yS83twBcE42wexz4seOf6dIH0ssrk/A/5nRciMMhkC4pYY0uhkOnCs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676555421; 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=m1JlyKJ0JjjfiqaxHOYT0DE0uPZ4Z9yVFsyaFL5lMP4=; b=nAiZqYjJcuedwicvNX94wNLgtxF00DiIMVFpYDbgt2fuTG+QS5gvc4ytBLk+W0Apc3lyA66gx1yB2n3wW5fC2nJqbEDG1r+FKEKr1/AQ8Exgq3QAenLYaeoosLaWwQjoATHibuhcT+pXSoFMA5SsG7VxodbjoOKCGuz3v43ej5o= 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 1676555421772728.3493914385705; Thu, 16 Feb 2023 05:50:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSedX-0001n2-9P; Thu, 16 Feb 2023 08:49:23 -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 1pSedV-0001g6-Jx for qemu-devel@nongnu.org; Thu, 16 Feb 2023 08:49:21 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSedU-0001an-0n for qemu-devel@nongnu.org; Thu, 16 Feb 2023 08:49:21 -0500 Received: by mail-wm1-x336.google.com with SMTP id s13-20020a05600c45cd00b003ddca7a2bcbso1691282wmo.3 for ; Thu, 16 Feb 2023 05:49:19 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:c49d:d14a:e6ed:555a]) by smtp.gmail.com with ESMTPSA id y11-20020a05600c364b00b003dc0cb5e3f1sm1557933wmq.46.2023.02.16.05.49.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 05:49: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=m1JlyKJ0JjjfiqaxHOYT0DE0uPZ4Z9yVFsyaFL5lMP4=; b=z8OyNv6PwLbA9qZHBXREfFO8nE6v+4rbm/IwW6JEBro0GMRcOUJ9xY3X3fu+NEsgDf GS+ajDqzPASWryvzDT8PEFC8R4BUKlyzj+ZXxTcxSz5YlWYlR6EELh7BtvF2vwHSK16I 1ygZCLo4zR1/JcSYwkRvpdHXvEhI8hN2dwMEPpRedgKZXE0+e0Vh6C9Raw41Der0wcNi dg+7TGMYt3WxCDHU4Vs5AhSK48d/xB7/pnShNkxWJS0h4zmd7+uRBcjFVzwHZfjk5AnE gkmowx0GUgBwKAE6lMsVglBtPU16k8oC9RQkJMgDA0dxZ2Yny9CIJDbVMKvbwv+TEwAM ZL5w== 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=m1JlyKJ0JjjfiqaxHOYT0DE0uPZ4Z9yVFsyaFL5lMP4=; b=ak1RHpiz/xUX8pP1AuhUR0SMSWF+Dzzr3oY6rkQplvp+fnbQXWzVUiyEKlD0zB5SuL G2CgYQljUYwJg1f0FFj9we2qwV6ujmAOpDTt4vt8ecN48nX+Yb/RtgOmj/BwC2iiqD1r wVE6l17jK1XaY0x0ucZogOwz2M/Wox13kwuKeN3zyJ2mEObvIymdRBkF/nKaJPpHOFxU pb5UwdGEV3CSyY6d6r/NuuOwCeBmj+dp20ZEp0pF9bAxm5PRZW3nE1qF7lbL+rrFMyga p7VwQ4DCDbw1WxKBsWWo56RW8eDYEo/zVM26cb8yVJfrzvzZ5dwjkURYPVSVFYQEKfA8 r8BA== X-Gm-Message-State: AO0yUKWJUOgH3t/L58smIQQZF2jgPUrYlGMIctO6irpNJeF5kg0Y/fgC IKrtg+3srk9Kt9dB86B4pti/SAFXt6/RBJteFxU= X-Google-Smtp-Source: AK7set/Nm4iQrfnh+Kvy7sswpGkcuNOwYKH74hKGX1ULfTiP6OIVM6BEqiTjPSCCsTyl1XjnwXQNaQ== X-Received: by 2002:a05:600c:5104:b0:3dc:16d4:a99f with SMTP id o4-20020a05600c510400b003dc16d4a99fmr4988318wms.8.1676555358051; Thu, 16 Feb 2023 05:49: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 v2 4/4] target/ppc: fix warning with clang-15 Date: Thu, 16 Feb 2023 14:49:11 +0100 Message-Id: <20230216134911.6803-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230216134911.6803-1-pierrick.bouvier@linaro.org> References: <20230216134911.6803-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::336; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wm1-x336.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: 1676555422168100001 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..0a40bcfee3 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(); /* cannot get here */ } } 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(); /* cannot get here */ } } decContextSetRounding(&dfp->context, rnd); --=20 2.30.2