From patchwork Mon Feb 20 11:12:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 655072 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1333495wrc; Mon, 20 Feb 2023 03:12:55 -0800 (PST) X-Google-Smtp-Source: AK7set+9oegn14BKCDnkvn4fFgroFgzmGdM5S3xdnPx/rE/M8i2yl1ItpYVT53NvPs64Pww1kFCI X-Received: by 2002:ac8:7c46:0:b0:3bd:16a4:6adf with SMTP id o6-20020ac87c46000000b003bd16a46adfmr73801qtv.19.1676891574987; Mon, 20 Feb 2023 03:12:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676891574; cv=none; d=google.com; s=arc-20160816; b=NDx4buVKEMHMM0xfYjDpttnLEqMGqdAg3Fap8ooFFo1Nnm/j3fNoGEm5LcJrVq3aHY VqDO03XZGv2kwu80vZSz3pXXqRHnN+LdNJmdC4R1po4P/C7q83KMANbl4OcPixl+5poe cZ8gZA7ay4YG+JpeauXVLcbQmuIBQh9FGlTw+SdM82h+bMpueSmvdF5AMdI3EGEnAJzL jiPCfYL2NmzETnL9/a7gd3VvIPzpifGTBw7fIuti8jG/T+Y9+r8ZwKaePoFtXZfiOWUL 8mx5xx01tHk/3DX4l4E/5Lqb9k/T+UqtJAwykLJwVP7gwVGk7UlTKMNCN8ud5s/OtadC ZsAA== 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=FmnWoNMHciP793cEremK0wUfHJtfeQ2W0yr8vbgY8Xk=; b=OkXcSvX2atYTzl6WaUqh6Hemg0S75ct8Brn6M9rHzgOFbT51VuaXHwZ2sZDlQZYXGP d9VSdUFxZP8RmieM+weHuj5GfVLUGMtLn8dQLuLxlPPppt/J4p6HFxnzu99vd8FbwjFR Ch3dg3ZZL765j/pi1G7IFGreOmZ4+VXqqWeslLUhjr+Jj0qQJ4lxNFWHY1inMxiLe8iw 2eY+bJjy0eQKA8CD/mMwUUeDBr6c4R3LHo44/sQu/hSN1Oik3dhEtlUgXBUK6HTU6GCK i5cmBySmCeUnPOTk6JYDkNBXrcj0JivGESOfsewOi+zXtsOP05dJStW237JkmsDyw4BX lXzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vEGFUJ9V; 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 q14-20020a37f70e000000b00706bf3b45b1si8936377qkj.507.2023.02.20.03.12.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 03:12:54 -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=vEGFUJ9V; 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 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) 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-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) 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) 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 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+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 Mon Feb 20 11:12:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 655074 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1333663wrc; Mon, 20 Feb 2023 03:13:13 -0800 (PST) X-Google-Smtp-Source: AK7set/lBk97GmQvP3pdl5xwbLBa3mmpv18uVLc0od8vETNszN0HiLOUzBJaOLrgRiHVtsyq9/c9 X-Received: by 2002:a05:6214:b63:b0:56e:b2ad:e2ea with SMTP id ey3-20020a0562140b6300b0056eb2ade2eamr6059720qvb.27.1676891593649; Mon, 20 Feb 2023 03:13:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676891593; cv=none; d=google.com; s=arc-20160816; b=psVYu+Ejy5FwTllZVo9BDug43mkXgJGMbFYNj/h3SHj0adHhOtebghCUCAEm9fM6Qm TsMSucEofSjqZiOjWf73GQAik3db5Hw3uPWXQDj1ReMBSUdJ3SJlQaepQdVOfvea5Abz q/w8qyLF3FBJai4TIE/aFMaKo4SMJWZhtiB+vVpLjLTOZymWvIOSIRWR2fNU25G00pgY +yYaU7H1D+x8spGDJpnF00GZ30teZfWeA1gcILlpjGWIJaxHEJEJltpiRvh16nCXHQag F33nowmwCPoiQfFvnfDndwQ5w0nBEjVsBY1ATbd/vike1TtyQBr2q8wRn6cxu3WgTJn5 3FUA== 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=D8LrzaSz6ElJrxd4cI99a7LkIk5CnLxRYnoODRf0SCQ=; b=FyoggPtdMNqxy3jIeldacZgCY4BqtA3SS6Me5dPiKBsga/qwXD38X7vKxDSzVO9sBg dZZvAC5WzU7IjEINRXxNA7c4EMYJYEXW5lfeTekapuzqiEp+8x9KiCJB7JijLx5JiWKE 8lzgWU3yWpGdOHvelx+UswornodNXqeADNhhEjimDd0jsjckn92jmZhvoi6HAf9wUpax G6Qqwjmo2prPONjmOkRQKIHL4nIqqG6fHPimCulTYefmO05ZJFPB9j4YHMS1QRIhE3CZ jfNkYAje8zGFAd17noIJ8lIH1WYbrwoCoL7JtWLkXzmIux1PzWE64pP+cGErGfm8735h Z8Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kktg3pof; 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 a10-20020a0ce38a000000b0056e9470eaa9si1026120qvl.546.2023.02.20.03.13.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 03:13:13 -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=kktg3pof; 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 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) 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-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) 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) 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 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 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 -#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 libmingwex.a, + * which gets linked automatically. + */ +extern int __mingw_setjmp(jmp_buf); +extern void __attribute__((noreturn)) __mingw_longjmp(jmp_buf, int); +#define setjmp(env) __mingw_setjmp(env) +#define longjmp(env, val) __mingw_longjmp(env, val) +#elif defined(_WIN64) /* On w64, setjmp is implemented by _setjmp which needs a second parameter. * If this parameter is NULL, longjump does no stack unwinding. * That is what we need for QEMU. Passing the value of register rsp (default) * lets longjmp try a stack unwinding which will crash with generated code. */ # undef setjmp # define setjmp(env) _setjmp(env, NULL) -#endif +#endif /* __aarch64__ */ /* QEMU uses sigsetjmp()/siglongjmp() as the portable way to specify * "longjmp and don't touch the signal masks". Since we know that the * savemask parameter will always be zero we can safely define these diff --git a/meson.build b/meson.build index 4ba3bf3431..e968ed9e7a 100644 --- a/meson.build +++ b/meson.build @@ -2450,6 +2450,30 @@ 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') + + config_host_data.set('CONFIG_MINGW64_HAS_SETJMP_LONGJMP', + mingw_has_setjmp_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 Mon Feb 20 11:12:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 655073 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1333527wrc; Mon, 20 Feb 2023 03:12:58 -0800 (PST) X-Google-Smtp-Source: AK7set/sm3fqsXVhXnsQwtBEFHyvsSFuazfGs9FNEwB61kxPJlgOH3Fsw6APUNAf50Nw50kRsmq4 X-Received: by 2002:ac8:5914:0:b0:3ba:265d:6793 with SMTP id 20-20020ac85914000000b003ba265d6793mr13576451qty.42.1676891578387; Mon, 20 Feb 2023 03:12:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676891578; cv=none; d=google.com; s=arc-20160816; b=QG1s3GvU3BhX62QK+uxKQvywicn60MoLPUgCUSszy73cK6YHpWU6XDMs5lONzN0HO0 RX5vr++FCQcHku3W+5flTH2AFZQ+QRqi0QwfaFXfzv6ToIAHcWmigGfma+TESZiPwGee jA/PtNxeKu7gqjA6cZpZDeNUFDPx345UqQjmGw0i04inJLzg6l4mXaC9KrnYevU33Rm+ 7Ihx/a4+I+lOL0tIRbibmFHOg0LpvXK/zLZVfKUGyUszHJIffOMu/ZpRACPH74l95lJk j75gkghQwr1YeEJ4IGbmfs0s1ezAozCsCIwiOoDRJ5EZb95eG5wIIFXjaA57NztSMZbf Km2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oCtcRsma4Lb/eGzY1J2Zycrim3J1natcTOS1qZitV64=; b=qhdhruQaX9ctshKuZBp4/i0kd4dyMcwaC4CV4/GojikM6m1AKKpkgoFhyBo730YXdg jLzOjNEyJhFeJbmFNQDHdKMe/EuI3jYq5aZLm/DAadCYhJ1P+8pVrPx5B+2RlvI3hiub 6pTpgJlQn+ElVSb8xMYj+faD1jku3LvvWWa0Gvl5FtntD0R12RQT61xKMc2A/U97/cP5 iegSEeCcmpfb14JsgFWLv//yJ41Xfe90ExZvwq7VaEzhNa2gM8lBtHRQbcb26vuuSneA e49hEmtefEgKx8qqp0yex9zyGozASbJX29rR9qRX7tfsotRSdF8AuPAUKPJU5Qz87spH WikQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="YiqsXv5/"; 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 m10-20020a05620a290a00b007107e3bb636si10424425qkp.191.2023.02.20.03.12.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 03:12:58 -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="YiqsXv5/"; 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 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) 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-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) 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) 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 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+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 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 Mon Feb 20 11:12:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 655075 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1333668wrc; Mon, 20 Feb 2023 03:13:15 -0800 (PST) X-Google-Smtp-Source: AK7set8IbV6EiP2NA/tb7H2z+3uEw0zo/TEHHCksGAC8INfcYDZ1dSBoHyAigVCvEHVvec6/Raa/ X-Received: by 2002:a05:622a:1342:b0:3b9:bc8c:c1fa with SMTP id w2-20020a05622a134200b003b9bc8cc1famr1672080qtk.5.1676891595716; Mon, 20 Feb 2023 03:13:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676891595; cv=none; d=google.com; s=arc-20160816; b=CDLStFFlntyJ9NgEHSEfebChz7ORLzZpTfDP4rAcy8v87NTcMTBINPrRah5gGQ3n8/ 71OWVZalZJ0TIcyEmqYzognV4y9yYJhGqx3Oa8cxbHSyVkDr8t+G2YIYEbPXdxk0wpqk dcrr6oYwfXZhatU3R/1MUaB33Jseq8rOxZiEHo5ZHcM3fZ+e2a1iwrlp+yTqfCNdv7eN k3IaavY93I1Hp4Y3IDLxLceTxHKHTOKGmYs6uV27/eGlwI0CM3ke9t2P9wiukW+bh07T DK8OJ3vH+kJ9pexbJqeDjE349D4rk0M2aDaZPhoZvUZ04WOC2m/OyGI2wpYvl5xDuxNV ZqLw== 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=7h6E11Jxo8IiawWK95L0Dw59rMSl1d8e8Ox3uSUoz/Q=; b=0c+ENZnB2fvUON5ctuUlqXgxisDqKymtVB/IDnY3vcT1IaSAbqDgaJ1UtrWG6X9/0q KEjZBdFOHQvxAE7ZFnx6b4LC+BmqLKprh+pwKIEPgfZbztTi136X421NvrSn+QneH+4b E4x9/z8eTkK8+P6IYmsTpwwcWmkB0Usb8+LsVIgtsxu8pPD0SUoEsrhcOr2czy8GgYSu C0YQmc6lH7Vf9GCbL4FobqqRZurSn8DdITybaYvdtUTEb6ccaqyTl2vleqtA81DKI3T0 LwP1iKGIY0TPiL0uHkdNajehq7dqhQbuQkNaqXWaz2SdAcvRvmLNTTVWsSOXPzy/IiOq XIIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B0bPPjau; 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 f19-20020ac840d3000000b003b9d185d14asi8947690qtm.340.2023.02.20.03.13.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 03:13:15 -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=B0bPPjau; 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 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) 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-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) 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) 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 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+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 --- 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);