From patchwork Thu Sep 12 05:30:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 827772 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1109384wrc; Wed, 11 Sep 2024 22:41:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXRJKPd00mWx9ocVE9wKVt3G20JwMkUPr/0TEemVXfj/EJ45i460sv1CHJwPIgHwFClmJzi4A==@linaro.org X-Google-Smtp-Source: AGHT+IH+zbf3km7l31Xgd7Vv5FCtg37SUFHEr5svB94IRxw/BwgZfyh1NDoyvSzGqFOTwXhPWcrI X-Received: by 2002:a05:620a:4550:b0:79f:148:d834 with SMTP id af79cd13be357-7a9e5fba58emr336800185a.59.1726119667539; Wed, 11 Sep 2024 22:41:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726119667; cv=none; d=google.com; s=arc-20240605; b=EO6lAoiWJUhGhjP59KYChhLM5+sVe9EzZi7IMQO440CLWt7PRSHfacW5Sow4qnr6CJ ioWf2p7ghhPYpjrU+aPoqh2aoRQLeg+iPBVVU5WH9q2llnUxZAQ85ICTlFC+RlDbyVhC Umd8MZ9LuuNkNPSKFNrtU6iFjP1g4BG0knNGnH9868PRFPshYCNDd50BVSMhCHIpZx8p t6TGgBD9PhfGJsKDXZWf/UN0pgwQCFgm0RzGR7eVNf/AbdLFfL6PPCNK4kZ7l+OdESnN k5tGvR/oMTAbXFIH/EaQsn7f6Bg55chSsmFiwUUbHoqLTETJd4BakbMgz5E3zBmZgy5c Mdig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=BGVnotTiwj5mkzBWCHImX70kcvKNSfH8JZUj7NW2zwM=; fh=LLvEFzlFz+My7oCm3EvdwJ2L6kg14z4bbmpCzxdnMa4=; b=IF2LS85SuK44En6/9BdFb9ElN/v84tax/TIKuZDyvgVMt15yL4kgjrFJqaNsa5cYeh kQkuo1N/6SuSHOmFRAyh1WbsmQw9gcTnDHDrvV2mgrtbV0QIHtUH9Q2uf8bPypfHWWPo kwOplLZJBQM18zf7IEtvJpEGVCtyTkpOITiZ8Tsi3LfpgYpG/tIvx6Nb0YfTLmFu9/D9 7GEJ+aILz/HRb9XfnyErEZiE+qt9glcoIh2/zL8e7r2kjV8dnz7OfeUA1enn6MxZ5NDd APCbTnBnhJA9iTWzHaw/9kU0xx68SF2alB7dFlYsIZDJmGImbmuM9Ynsqlknezyv/8E8 NP/g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mVvRp8zK; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6c5347c31edsi120739326d6.546.2024.09.11.22.41.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 22:41:07 -0700 (PDT) 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=mVvRp8zK; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1socPw-0002GE-HK; Thu, 12 Sep 2024 01:30:56 -0400 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 1socPr-0001vM-JO for qemu-devel@nongnu.org; Thu, 12 Sep 2024 01:30:52 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1socPp-00032K-IT for qemu-devel@nongnu.org; Thu, 12 Sep 2024 01:30:51 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-20696938f86so4703295ad.3 for ; Wed, 11 Sep 2024 22:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726119048; x=1726723848; darn=nongnu.org; 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=BGVnotTiwj5mkzBWCHImX70kcvKNSfH8JZUj7NW2zwM=; b=mVvRp8zKyhs7udJQkk4Ia23XkCc7QVrv8+h7SUIfaT+EcyoRwYDJ7lZJrONoKzgQ6y nzUv8dNwDHmbkBRkEBsfYAZES1pWtOcbb4XqGpWcfGq0XfQL1lAkQ9DZNjEu9vt9qgZm XmFb92qskb/PRVyIu1Xr2N6ofT+EElidXELhD8ttmRjQ9sthuWUVQOhelb44D3UPtt9c DiRncxvPe08+Mya8kk2ZG+2sBwB6wzttmtyB6O0/3iBKqk550o+vzYSTyTJULB5FPjIV ZeKjMxXAjbgR9RLfUNqNloeM+xd/sJfk1YdyQuL/++IiVgnHGEPIXZMkN0G3fWp/LbwO 1lTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726119048; x=1726723848; 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=BGVnotTiwj5mkzBWCHImX70kcvKNSfH8JZUj7NW2zwM=; b=bvOAEcEVgPPh4hNM5BjoSix+FFagM6zG9J92ZfYAJghb8VI6z2rexq8V51J2HivhyY w2DFwyeeQYKnykqj3y33M/whZ5jd6GNayZXE+xGUVhQucHSDaRqN/oEOeQ7eLs8ZZJuP LsOAwCz4E/Wb97B+rubd3GlUKzIMBHEtB5Vb0y1qrQmjhSgZIOOernP1UcUGlv6sYccS 468AFrLbMopaVtFnP5MLP4TJAm3kMZFWg099f9KXgqkYf6EMf2IJ8XVJIEq3ufSD4vhM v5hXZOcAxiOPrYciMEjTuTuabdeFfUV5VsJjDkcoKEFL8NRuxf2emczM2q6tg7qVuBOS d5WQ== X-Gm-Message-State: AOJu0Yxq/x2kTU8BL8pl3PDzdJZignIzA/mXLK4rJmLq35Wp+UxBoy3w dNJ6vBj0glyoCiEv2WcGKirw+ezkOLe9JZMp381tQ5/UU09wbN5ZxZFXAGdwhsi1pOZ3hWgxvT1 Q X-Received: by 2002:a17:903:2302:b0:207:6e8:1d84 with SMTP id d9443c01a7336-2076e415244mr20663115ad.42.1726119047822; Wed, 11 Sep 2024 22:30:47 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2076afe9e1dsm7513155ad.236.2024.09.11.22.30.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 22:30:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Carl Hauser Subject: [PULL 3/5] target/sparc: Add FSR_QNE to tb_flags Date: Wed, 11 Sep 2024 22:30:41 -0700 Message-ID: <20240912053043.1131626-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240912053043.1131626-1-richard.henderson@linaro.org> References: <20240912053043.1131626-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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 Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Acked-by: Mark Cave-Ayland Tested-by: Carl Hauser --- target/sparc/cpu.h | 8 +++++++- target/sparc/translate.c | 10 +++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 9f2bc44722..f517e5a383 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -744,6 +744,7 @@ trap_state* cpu_tsptr(CPUSPARCState* env); #define TB_FLAG_AM_ENABLED (1 << 5) #define TB_FLAG_SUPER (1 << 6) #define TB_FLAG_HYPER (1 << 7) +#define TB_FLAG_FSR_QNE (1 << 8) #define TB_FLAG_ASI_SHIFT 24 static inline void cpu_get_tb_cpu_state(CPUSPARCState *env, vaddr *pc, @@ -775,7 +776,12 @@ static inline void cpu_get_tb_cpu_state(CPUSPARCState *env, vaddr *pc, if (env->psref) { flags |= TB_FLAG_FPU_ENABLED; } -#endif +#ifndef CONFIG_USER_ONLY + if (env->fsr_qne) { + flags |= TB_FLAG_FSR_QNE; + } +#endif /* !CONFIG_USER_ONLY */ +#endif /* TARGET_SPARC64 */ *pflags = flags; } diff --git a/target/sparc/translate.c b/target/sparc/translate.c index c803e8d1ba..eb0158a11d 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -185,6 +185,8 @@ typedef struct DisasContext { bool supervisor; #ifdef TARGET_SPARC64 bool hypervisor; +#else + bool fsr_qne; #endif #endif @@ -5596,13 +5598,15 @@ static void sparc_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) dc->address_mask_32bit = tb_am_enabled(dc->base.tb->flags); #ifndef CONFIG_USER_ONLY dc->supervisor = (dc->base.tb->flags & TB_FLAG_SUPER) != 0; +# ifdef TARGET_SPARC64 + dc->hypervisor = (dc->base.tb->flags & TB_FLAG_HYPER) != 0; +# else + dc->fsr_qne = (dc->base.tb->flags & TB_FLAG_FSR_QNE) != 0; +# endif #endif #ifdef TARGET_SPARC64 dc->fprs_dirty = 0; dc->asi = (dc->base.tb->flags >> TB_FLAG_ASI_SHIFT) & 0xff; -#ifndef CONFIG_USER_ONLY - dc->hypervisor = (dc->base.tb->flags & TB_FLAG_HYPER) != 0; -#endif #endif /* * if we reach a page boundary, we stop generation so that the