From patchwork Wed Mar 8 13:28:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 660442 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp329886wrb; Wed, 8 Mar 2023 05:34:24 -0800 (PST) X-Google-Smtp-Source: AK7set+mTKBrsM7D2Ex6lKTttsHb26+B+xiXBz4ptfExbI0CpLBLmOAM+8qjwpAXolSetk9nwcfm X-Received: by 2002:a05:6214:d06:b0:56e:f4e0:a4ea with SMTP id 6-20020a0562140d0600b0056ef4e0a4eamr28061189qvh.17.1678282464728; Wed, 08 Mar 2023 05:34:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678282464; cv=none; d=google.com; s=arc-20160816; b=HwmMsLjhUTD5+nLg80FM1lZxsw1aQnM294sM/7ytkk0ZpoPS2sdEHfqekXAjq3iXre pmV6gUBoSwnJggXcYwBsFnNjNYJYNI6Xlmv8zkpCucGbcmOHt3WGM+ZqFagNrHIoUf3J CtFI6AdgeARFquwzPVBZJKSqiWQvfEhoOqzM7d/12XUdIuyR2We4IHBDaoPHpbVinM8S adEmOLrPsCR3IZwTN+CsundZyPf1rJmRGRI/4GLb8sawzsFnx2OdI9SauAfAK1i2e29x Xhu5z8AM/ZXMuCOp38IopQScjK8rdvb9Dl2x6yLUdNhP9Fyyl8J3nb3NuTm4zAadwymu lnBA== 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:ui-outboundreport :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=RlMIAlm3yps0Lx3D4n3/0xxgAHztK6MOe+V+w5A/zbE=; b=lDrDbsfi+omFMNcGJzvwKVgR3YCCQ+UR000vYabZkLDpqrKvY3p7KBfoeTPriXbFO1 lAHS22tHWW1QbnKVsIqoIo7oXCv5wGBfVy11jOaJZC0OmFpkqqf/+rCS3VjaP7dMtfiK +K6X6yXqXew1vkg7127d6VF1IGpXo7ZRCdaCnQrrOXjJ/WW72vimKC+mM2XenuUlKj4t tqDr4+0csPHbjlzyMWSsOPpV72PQfuKpEUFDTi7x9PO/xJ5QGhtQ1a0LmLDI7PcXtb1D gOPiJ7nvX746UtUVbfIoC/BYdDM/2XV+FQo51jOFQKz2Dx7c/Vu5MghQqNK9pPhBrcgd tq9A== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k25-20020a0c9719000000b0056e8ecf84cdsi12268400qvd.490.2023.03.08.05.34.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Mar 2023 05:34:24 -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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZtsX-0003Xp-MJ; Wed, 08 Mar 2023 08:30:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZtr5-0001kl-7F for qemu-devel@nongnu.org; Wed, 08 Mar 2023 08:29:19 -0500 Received: from mout.kundenserver.de ([217.72.192.75]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZtqz-00066d-SO for qemu-devel@nongnu.org; Wed, 08 Mar 2023 08:29:18 -0500 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mbj7g-1q8OnD2xiA-00dF3y; Wed, 08 Mar 2023 14:29:09 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Laurent Vivier Subject: [PULL 17/28] linux-user/sparc: Tidy window spill/fill traps Date: Wed, 8 Mar 2023 14:28:46 +0100 Message-Id: <20230308132857.161793-18-laurent@vivier.eu> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230308132857.161793-1-laurent@vivier.eu> References: <20230308132857.161793-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:qF8BqfTZHyvBEz/BQyLZFKI+mzZylXNGIarDwpwSKTKkWOqV7bU uMKoYl430EjOjcxPUefjCFKFTpM0u0uJG3R3jTfzy2wWneoMzQxMblACjC3dVn7Mltq6bqX jslMOPwyei/B9KwtSxbOoAvDgzNJ6QxkJzHp1NjVBKgHWlSymWjg/9OJq97mYwAx28CUfnK m7ojPAJRRF33bFf5gRUkQ== UI-OutboundReport: notjunk:1;M01:P0:dt6hapDWLQI=;9ZejsjhzCDBV0tkNeTywNGh8PFv qmCStgz6qB1u0t8oLh8kyA4tMJI9Yk5/u04CHstU9KDlfwaOxSr6cg521yIcHrk6s65a5N6XO sQC1AicVFyMRG4vDsOCR3p9egb+RzADD2dDfkBoggGmW9UVdEl+qNvfmGYcjzIgUkwRH3XMAa mc1JG2X0GS41B6tLJRYzXeYEv+TamN2I1jtMBgMX2iB5OgVCfqcmWya+Ew4MHqHTN17oF2X9e bcbeVAXagMFLF/kkmEylFyM1XuTz8Ea5SpEoKhyQaVmHaql3iUvg7apXQqsnNDxaBG2qqZczK wW0c8vuCTRhIMq+dYoqAf5/3sx5KUyPqb5U8PVdcwGQkqUMAPYI6m0chjCWLCDQ2RnGtq7FKM MwUopPdzqX+3T8srPyuSnZhANFwlYoYB3XjspMaWojEyj9d9R2IkGr4gTy7AjGkVXCBdUw/UQ 6VhXOaU0Co/KNGFixwtsEYoSW4+n9Pwv4+jb9QEzfDnMUqfqSiNgANvQ8pruCShIfCLrqvUIy HB//AlxBU1keCUh1UeHl/JopSW8/jOXSrM+L3qtK2v0BT8b04ZN7T32m9pE5n/IOumzJVe7Fr HacfSVGiF7qRzLIbW7dgzGshAReATK/W0EHj5EfJIYQ2fwfxRnfR5dfUFQOYHdsLivh3qkpwn dcTjTUbCGG5GsgVzY9YI5Gg/Dk1FEw4QlV1MF56eDw== Received-SPF: none client-ip=217.72.192.75; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=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 From: Richard Henderson Add some macros to localize the hw difference between v9 and pre-v9. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230216054516.1267305-6-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/sparc/cpu_loop.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index e1d08ff2045c..2bcf32590fa1 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -158,6 +158,15 @@ static void flush_windows(CPUSPARCState *env) #define syscall_cc xcc #endif +/* Avoid ifdefs below for the v9 and pre-v9 hw traps. */ +#ifdef TARGET_SPARC64 +#define TARGET_TT_SPILL TT_SPILL +#define TARGET_TT_FILL TT_FILL +#else +#define TARGET_TT_SPILL TT_WIN_OVF +#define TARGET_TT_FILL TT_WIN_UNF +#endif + void cpu_loop (CPUSPARCState *env) { CPUState *cs = env_cpu(env); @@ -204,20 +213,14 @@ void cpu_loop (CPUSPARCState *env) env->npc = env->npc + 4; break; -#ifndef TARGET_SPARC64 - case TT_WIN_OVF: /* window overflow */ - save_window(env); - break; - case TT_WIN_UNF: /* window underflow */ - restore_window(env); - break; -#else - case TT_SPILL: /* window overflow */ + case TARGET_TT_SPILL: /* window overflow */ save_window(env); break; - case TT_FILL: /* window underflow */ + case TARGET_TT_FILL: /* window underflow */ restore_window(env); break; + +#ifdef TARGET_SPARC64 #ifndef TARGET_ABI32 case 0x16e: flush_windows(env);