From patchwork Tue Oct 17 06:40:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 734362 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp332295wro; Mon, 16 Oct 2023 23:48:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHxJpk7MK+fYYSx3qEFa+OxSAuVHM1DC7NBPhkYVzzpRWfsA32tro2TMGsW1NJ1hZHOaxI1 X-Received: by 2002:a81:49c4:0:b0:5a7:ed69:120 with SMTP id w187-20020a8149c4000000b005a7ed690120mr1445960ywa.6.1697525282815; Mon, 16 Oct 2023 23:48:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697525282; cv=none; d=google.com; s=arc-20160816; b=A/xivcDvHYtZu8LunQgp3obua7H+na9MI/JwL9XP334awoC4dCJG/HSI7MJc1UInS8 oR2FkttZJ9HkAN5ktw6xXuf588LmkpsoKi2yPhwB1Y8wotlmQy5e963jusQXuppIGnvK pdJTCvBIF8LVyt5XQFIJ/atFczQ8eRA30TuWWugbosICnMOClGHUy9c9mrriaJa3TLhK RL4x9JgKR/IrFpq5hnMLDH1OKEJTkUWLNUnk9pMp/ozJcrIXrMOE7UuxPiUTafUK3GZt nVxbdpVz8nvDl43ct97KPol5QwfVAlJu7wGO6lkgSnzoJpSYw4krK7ynFNPj2D2gUw66 GT5Q== 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=HeMyfJcx+peR5itTdqsCZ9Xkp/oHQ/IkwnAHAyhPKRo=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=F1Je5VxyQNZBTF1dDhXBolCcK6uHkBCtM7dae2YxFhSGGkYAlLlCXMlS914w4SWmtw UsX8whhE6EDxcFOR3/uFRTUXdeMyF+w5oYWsCa1Em90/E6EHaNV0v/bFl2s3HIPtZRa+ K1LN+vw/lAWX/+QL1+P3hrM3XHjQUqqFDjr1gEotbqveWUulyqJkt/fhLFqzb+f5p+If CJgTaBlixWHtz7Gfuyj7o+17tTT0dcI8d+M+78Dk9AB/E1wLdLPztyrXlXHf9ma3I4xh H9OyFL+6zfEylIbafiiUMRqCE+0tpWYbXHPN5gO+QvH7DRyRwyDgR0FRBw+XNS3cvKt0 8l9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y9zUgqM8; 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 m12-20020a05620a290c00b007741b0f3fd8si652658qkp.283.2023.10.16.23.48.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2023 23:48:02 -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=Y9zUgqM8; 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 1qsdlV-0007qu-7z; Tue, 17 Oct 2023 02:41:17 -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 1qsdlT-0007q3-24 for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:41:15 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0: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 1qsdlR-0001pi-8b for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:41:14 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6b87c1edfd5so2331316b3a.1 for ; Mon, 16 Oct 2023 23:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697524871; x=1698129671; 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=HeMyfJcx+peR5itTdqsCZ9Xkp/oHQ/IkwnAHAyhPKRo=; b=Y9zUgqM8DPfJ0UdCyLoToyFn4fUjhbImQsQjgHV9kUgsCbeBoWgtBT4lKeQfMcc9sG cSj1g75mSeTR/ZzILARcR03YrsBo0UaPYVYcmCHf74+bLhE6NyHZV7Vu+ZJJl18weAxO ce6h9jYTlzradoib8UNl83hkWtD1pSNcP6JU1va+52fzggrp3AkSfi0HYBKNl7c/8F3p RgRYjH8qlqvThJMTI69OPHvjGY0ayDJpV+towNCBx6kGf3wCK0cc6Epea/DyvJUI8UDm TBEKbb8iqqGK8NnokFfrHvTNWX+UfY0CZtbSsVTOu6AD3rWafo0zmCai2tUXEZx36AK0 koBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697524871; x=1698129671; 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=HeMyfJcx+peR5itTdqsCZ9Xkp/oHQ/IkwnAHAyhPKRo=; b=D6fzwX2h3P71zoldNQYW8V54eF6/qZvfiEvF2FPcoLT6rCAnST6j9Uh3B981w2rJG9 n7H4N8fdZDtS40tglFXtFrebplg5M345l2JEkhn4GaDyyPlBgtV1fV5ftTnMBY3+HxHx NfO/ZBSZ/fFFn+iRpU2HaRSJ5ct0tUUwv0Pxp+Yp/WANMJzHUAUUcBTkSoHytAKOpZwn bUStCm8yn7Iks1hc/JwDK7+ojCC6jnmLgvgs9zhllDaP74pDh/SR6E56h5hXbcSByCvi 9XN39EmxtXZoF9JQS+1IJGTPQt6fZB9INoZc2rx34JdV321H90K8+vFUptJ7v7yX4i7X z85A== X-Gm-Message-State: AOJu0YyqrOID4ekTUp2YytTzN9ojLOmRl9ZiYVsK7ZLfIvGRry6lBr/k uZSt7cHX7KNzZlJlJP7Bt5ygnko0FbcIZgM66Y4= X-Received: by 2002:a05:6a20:ceaa:b0:140:a25:1c1d with SMTP id if42-20020a056a20ceaa00b001400a251c1dmr1097705pzb.51.1697524871031; Mon, 16 Oct 2023 23:41:11 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id x18-20020a17090300d200b001b891259eddsm685682plc.197.2023.10.16.23.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 23:41:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH 01/20] target/sparc: Introduce cpu_put_psr_icc Date: Mon, 16 Oct 2023 23:40:50 -0700 Message-Id: <20231017064109.681935-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231017064109.681935-1-richard.henderson@linaro.org> References: <20231017064109.681935-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-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 Isolate linux-user from changes to icc representation. Signed-off-by: Richard Henderson --- target/sparc/cpu.h | 1 + linux-user/sparc/signal.c | 2 +- target/sparc/win_helper.c | 7 ++++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 758a4e8aaa..955329f6c9 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -619,6 +619,7 @@ void sparc_restore_state_to_opc(CPUState *cs, /* win_helper.c */ target_ulong cpu_get_psr(CPUSPARCState *env1); void cpu_put_psr(CPUSPARCState *env1, target_ulong val); +void cpu_put_psr_icc(CPUSPARCState *env1, target_ulong val); void cpu_put_psr_raw(CPUSPARCState *env1, target_ulong val); #ifdef TARGET_SPARC64 void cpu_change_pstate(CPUSPARCState *env1, uint32_t new_pstate); diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index 2be9000b9e..dfcae707e0 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -164,7 +164,7 @@ static void restore_pt_regs(struct target_pt_regs *regs, CPUSPARCState *env) */ uint32_t psr; __get_user(psr, ®s->psr); - env->psr = (psr & PSR_ICC) | (env->psr & ~PSR_ICC); + cpu_put_psr_icc(env, psr); #endif /* Note that pc and npc are handled in the caller. */ diff --git a/target/sparc/win_helper.c b/target/sparc/win_helper.c index 3a7c0ff943..bf2c90c780 100644 --- a/target/sparc/win_helper.c +++ b/target/sparc/win_helper.c @@ -67,9 +67,14 @@ target_ulong cpu_get_psr(CPUSPARCState *env) #endif } -void cpu_put_psr_raw(CPUSPARCState *env, target_ulong val) +void cpu_put_psr_icc(CPUSPARCState *env, target_ulong val) { env->psr = val & PSR_ICC; +} + +void cpu_put_psr_raw(CPUSPARCState *env, target_ulong val) +{ + cpu_put_psr_icc(env, val); #if !defined(TARGET_SPARC64) env->psref = (val & PSR_EF) ? 1 : 0; env->psrpil = (val & PSR_PIL) >> 8;