From patchwork Mon Feb 13 16:13:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 653225 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp2639219wrr; Mon, 13 Feb 2023 12:50:33 -0800 (PST) X-Google-Smtp-Source: AK7set/m4oPeHT4FgHsIH/GRFTHWJdRxDMSZhwNcr91dKlyR9SzP3OFw9rcUM3YJ891+1wd7iLTQ X-Received: by 2002:a05:6214:29ce:b0:56e:a2a1:a4b3 with SMTP id gh14-20020a05621429ce00b0056ea2a1a4b3mr499716qvb.20.1676321433793; Mon, 13 Feb 2023 12:50:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676321433; cv=none; d=google.com; s=arc-20160816; b=J0JWAsAjcmDfyZOCjphQ6FVZFvkuMS2J1zR3PQ1om4JEKHGR1xanmdHAKX7yDSXFe+ 79sNbB2yonMoiq9fOSTvODXh6p5dQBwQOhlBA2hb0+5XCDYt+R6Iiv1SP99HJpZhzPUu AhdbsKBZHmWMyi8q0mcPZ/g0K2/x1JSUMB5HyZ+4m55v4sr+oxL/6YdWYqSXfArgqpZZ R6o80LNx+v9+zjTEXWaCdkZhzmCSzjLx+1F5fJ1xEfgvjtpE4jsuZzlTUelCtriUqQXO 83TVxmEKmqiaYlcGfBq9aIHGL/SSvoz+GPCU8xkPwnUa99wZEZDg4ngIGsayFJDbPpun tV0g== 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=/Fnuvphrd4KcPyS3DWGw7YsNit5qQSnqPK9bRR9NFcg=; b=I5YNp+rw2XyRQq64mYIkKt7U+I5Ur636jE1sUnDmLD7QbHO+1KVpZ+7XRTZK24fNBe Kok0VsQEnqZppNgpXPFommgA2HNfrCgypBBv04emtFZ1NkgCbdj0doL98YSxdz5cDJvn 7FyCkQILsmo6Bwx0WzKgdTedKTFqKtwoGrpJo8yliIsNWu5eRFVpZF2CowQbBH3mxRFZ rYivDIwPMZXvXKi7KfxtW2B9aZ/q7jlaiw9kxb015nJq/d9KHay68Tjvr4OtqElbuJkW IUUh7JiaPVYf0rRCWUZu2qMSsM4h2y8ydSdBpi8SCFOnTxofM/u9pFQ2TDYzERPrY5Kt sHlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VgN6Qgs0; 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 n12-20020a0ce54c000000b00534f9174377si4781772qvm.219.2023.02.13.12.50.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Feb 2023 12:50:33 -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=VgN6Qgs0; 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 1pRfkt-0000pN-Nf; Mon, 13 Feb 2023 15:48:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRbSz-000831-T8 for qemu-devel@nongnu.org; Mon, 13 Feb 2023 11:14:09 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRbSy-0005ja-BX for qemu-devel@nongnu.org; Mon, 13 Feb 2023 11:14:09 -0500 Received: by mail-wm1-x32a.google.com with SMTP id az4-20020a05600c600400b003dff767a1f1so9450578wmb.2 for ; Mon, 13 Feb 2023 08:14:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/Fnuvphrd4KcPyS3DWGw7YsNit5qQSnqPK9bRR9NFcg=; b=VgN6Qgs0HFBq67W9Lx1KkMneFTChFIoflNB5bpvRbNpmrl8kPdXhI0IR/MayOSFxCg tAvhEvxiABIzN9XbCTwXNRVJwVJmkkdzgPEh27mrNOq7oYqNh5mIRTgOPUqW3gcEzNCU dhXo9ph6yzrsBDBDQcJW1nuT5luCjoFUY3RaEFjQ83UTdw5LQhlYTeO/Porx4a95kaff EyeJ/1kAbFb+UfTogLuKMwheXj6uvMEwn9+IjojZBXNfnsSEE2U0iV9pcrLekmX73doX rCXETdhVF5UYTb6/ENGfNxXSIT6PBjRcV7dM7CruxZe+Zy7ecZkIdVVM2P7NwECbyizS NTFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/Fnuvphrd4KcPyS3DWGw7YsNit5qQSnqPK9bRR9NFcg=; b=B+cvKvLGr1JH6MITIeQlwUsYyvrscn+JsMlUXeibX2Wjjibnb/sh4IiGCcEmH8wq2S pBIwbQIyqyn9yz0o8TATDB7ZmhHG3YkJWLvnaGNE6/F21lbzckUvgIxnteVVT/LzVDPk TtaBbJXQETF+Q15319UQqX1mR/GQ+8A780dpmkJ2zBLUHhSUTGDjrUF3D07Vm+SNbLmJ PX0MCtlSlBWuyEKtYE7fTzlW3Nd9v6XBtnHxiTLWwe1XWiXrSh+NBWzysmr3uxEtd76m 0y/GTzLijJ58aVbdJK4cnR++AXDx+GSkfxr/P+/VnBjbkfwQ4cBAMCUo8hXYncPmE3Gv E+YQ== X-Gm-Message-State: AO0yUKUjhs8Bg3LSCJq52IKS+53AuuhIrZC0i7XgDi4g7yemHvG05b8L 4BmlR0gHzsp+5uzlmPQIC+KiB9qsEpOKnHsWkxA= X-Received: by 2002:a05:600c:2b45:b0:3dc:561a:79d8 with SMTP id e5-20020a05600c2b4500b003dc561a79d8mr23532947wmf.35.1676304846618; Mon, 13 Feb 2023 08:14:06 -0800 (PST) Received: from volterra.localdomain ([2a01:e0a:5cc:caa0:8df5:e191:f2b0:5825]) by smtp.gmail.com with ESMTPSA id t13-20020adfe44d000000b002c557f82e27sm3582882wrm.99.2023.02.13.08.14.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:14:06 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: sw@weilnetz.de, kkostiuk@redhat.com, clg@kaod.org, richard.henderson@linaro.org, alex.bennee@linaro.org, Pierrick Bouvier Subject: [PATCH 1/4] util/cacheflush: fix illegal instruction on windows-arm64 Date: Mon, 13 Feb 2023 17:13:49 +0100 Message-Id: <20230213161352.17199-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230213161352.17199-1-pierrick.bouvier@linaro.org> References: <20230213161352.17199-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 13 Feb 2023 15:48:53 -0500 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org mrs instruction fails as an illegal instruction. For now, no cache information is retrieved for this platform. It could be specialized later, using Windows API. Signed-off-by: Pierrick Bouvier --- util/cacheflush.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/cacheflush.c b/util/cacheflush.c index 2c2c73e085..149f103d32 100644 --- a/util/cacheflush.c +++ b/util/cacheflush.c @@ -121,8 +121,9 @@ static void sys_cache_info(int *isize, int *dsize) static bool have_coherent_icache; #endif -#if defined(__aarch64__) && !defined(CONFIG_DARWIN) +#if defined(__aarch64__) && !defined(CONFIG_DARWIN) && !defined(CONFIG_WIN32) /* Apple does not expose CTR_EL0, so we must use system interfaces. */ +/* Does not work on windows-arm64, illegal instruction using mrs */ static uint64_t save_ctr_el0; static void arch_cache_info(int *isize, int *dsize) { @@ -225,7 +226,7 @@ static void __attribute__((constructor)) init_cache_info(void) /* Caches are coherent and do not require flushing; symbol inline. */ -#elif defined(__aarch64__) +#elif defined(__aarch64__) && !defined(CONFIG_WIN32) #ifdef CONFIG_DARWIN /* Apple does not expose CTR_EL0, so we must use system interfaces. */