From nobody Mon Dec 30 17:03:09 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675299239; cv=none; d=zohomail.com; s=zohoarc; b=NB0okmmQ0br1ep3cs3YOtpD0yNvIXeTGqlCx10GV89tXh2o9ICeyjxXpNTdC8EIPMBszqax6YqQDhGfzpX105BmaC3iEooW5LsEUsxEh5YyhzeH5VorMO2EKhap3P4FrJP0aFlDVFWx6DpuYC7OBhlZA7mgehpTqGa2Xp3n7KU8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675299239; 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=89UUaeY0rrKedYNMf8jAgL7z2598RbZiMA1VfAZ8r+I=; b=PgxwYAq1JrMYtZQ3n5RD0rOFOTdEl04KJC4/dvDxFkQmWm1/95iV1BnINZ56/YtLt/xL5v5QzhWw+x9ycsyubpmetDJnpp4ewg54ZSHpD0y/yDS8kYv2j9bDn+DTxvVb+SjYKkwyX9hMJmd8KHX8m7G31kup0/Vr6nKiMrKLlM0= 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+importer2=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 1675299239028442.6750190535622; Wed, 1 Feb 2023 16:53:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNNpr-000606-PP; Wed, 01 Feb 2023 19:52: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 1pNNpq-0005zg-DG for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:18 -0500 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNNpo-0000P6-LD for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:18 -0500 Received: by mail-pj1-x102a.google.com with SMTP id e8-20020a17090a9a8800b0022c387f0f93so4033194pjp.3 for ; Wed, 01 Feb 2023 16:52:16 -0800 (PST) Received: from stoup.. (rrcs-173-197-98-118.west.biz.rr.com. [173.197.98.118]) by smtp.gmail.com with ESMTPSA id z3-20020a1709028f8300b00192cf87ed25sm12391334plo.35.2023.02.01.16.52.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 16:52: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=89UUaeY0rrKedYNMf8jAgL7z2598RbZiMA1VfAZ8r+I=; b=W3AqVJa3EyhuH3IiE4Dlqu974rTnJiX4yKGX0JHI4gR/0avYMUrBJMBATPaCV9BBkM NEs85dsBrMI0vZfqoydIm6LzjO0tc1gRFlQMNjQjL96pLI57BG9zArMrOXtroKxvG5pj NK/5LGguZ68N4iYf2gF/r+ofwYhEzfJAJBjgwJXij7lIobHAeKcB86PL1MRTVkqSL+zd aadKLm2fraR+COmnYH3Z/K1GKYN+pNvHPh5Bj7g+dJK+t0lgudrqe0+5SZRSRbpmsIVf 49/7YWS6g3NwxmhuBPwG1sM0nb1AU9JiSopYSeRAdUxznTlR/p6/nWGp9Bb5OeSdcxQV Vu4A== 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=89UUaeY0rrKedYNMf8jAgL7z2598RbZiMA1VfAZ8r+I=; b=yf+egGH8X2jnsXqto/8Jc5qErNouyhV+phcjctkbAdNeSrODYc/nItNVspsmPTmErt Q2tcZS4kI0f20qNKyERldYVr4JKC7yKDXr4IgwxjrMzb3m5a/8WTQ44TVi2hwBrZ+jFF beN92O0AUdOA7n2ICUWCpWSoHTLkeVVDCqyiEcwiFRubagw3biZfGRKLuPv8NjUf244W YmEKMGjznfbr5aCQka3meGQt1XyS/LNlddtItCx6GF6UNVvpN3EOMJZwiwVlyxT5X7Et FgzOXw0NHokr/32rNdmQBUGCZRXq49jotLOtv4+HW/BlWn/Qpj+TwIlvL9NRpwiBwQg5 cxwA== X-Gm-Message-State: AO0yUKVgS2lny8mnzpK6nsV7Aedi5W32DRbCpVVdRGGsq4/P8sDXIUM7 wgXObHNVOdUiRXLk1P/IikmjpYid9YaSz8u0 X-Google-Smtp-Source: AK7set8yFgBNXbERioKDuqrIB1/Tvvuw/Sb9HeUBbG/rqE7aQLllKd6fnF0WHGXUryEk3EZgxwkDzg== X-Received: by 2002:a17:903:283:b0:198:96d2:9181 with SMTP id j3-20020a170903028300b0019896d29181mr544014plr.56.1675299135348; Wed, 01 Feb 2023 16:52:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, laurent@vivier.eu, iii@linux.ibm.com Subject: [PATCH 04/14] linux-user/sparc: Tidy window spill/fill traps Date: Wed, 1 Feb 2023 14:51:54 -1000 Message-Id: <20230202005204.2055899-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230202005204.2055899-1-richard.henderson@linaro.org> References: <20230202005204.2055899-1-richard.henderson@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675299241050100010 Content-Type: text/plain; charset="utf-8" Add some macros to localize the hw difference between v9 and pre-v9. Signed-off-by: Richard Henderson --- 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 a94bffc583..efc0fa64d5 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -149,6 +149,15 @@ static void flush_windows(CPUSPARCState *env) #endif } =20 +/* 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 =3D env_cpu(env); @@ -208,20 +217,14 @@ void cpu_loop (CPUSPARCState *env) env->npc =3D env->npc + 4; break; =20 -#ifndef TARGET_SPARC64 - case TT_WIN_OVF: /* window overflow */ + case TARGET_TT_SPILL: /* window overflow */ save_window(env); break; - case TT_WIN_UNF: /* window underflow */ - restore_window(env); - break; -#else - case 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); --=20 2.34.1