From nobody Wed May 15 10:22:15 2024 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1711476792; cv=none; d=zohomail.com; s=zohoarc; b=XvUcUejhES4pc/Kdl1ptVZfKztsG2kwVihnhGMyNaWF+YOVKFeg+HBJJXvJgWyYEBEHVQl62Y+kNFR4y7yaFi5JHpGiCo/nLroeZP9efOeGUGmyGzRIPLsX6bD32JWJB0IXAuko6n7bgPLmPz0Nz0AQhpgUvvd6Vc0c7aN3jF8A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711476792; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=m6HlLuZ9zAMNyBTGN/42HjZNTOLBhvdEH6OLOyzfOxk=; b=az2D+6tSsTsA1rccc2xNAB8yuyZuzaIiuWu86b3guTFwUPUR8bXqlALEf6e2GmYALkdyAFvaqahJGJ5IqwbYmMuQmIGzRFw99oHkZX7nlLoCZJkO0CxBQMr4indicnzh58aCgPE/4rFENJGY/LL6El3bBvrcGSlb1gcSojMAKic= 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+importer=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 1711476792331685.7972830908309; Tue, 26 Mar 2024 11:13:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpBHp-0003KV-Es; Tue, 26 Mar 2024 14:12:37 -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 1rpBHo-0003Jd-1M for qemu-devel@nongnu.org; Tue, 26 Mar 2024 14:12:36 -0400 Received: from mail-oo1-xc31.google.com ([2607:f8b0:4864:20::c31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rpBHm-0006Zb-AY for qemu-devel@nongnu.org; Tue, 26 Mar 2024 14:12:35 -0400 Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-5a558d9c33aso1109457eaf.1 for ; Tue, 26 Mar 2024 11:12:33 -0700 (PDT) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id q27-20020a63751b000000b005bd980cca56sm7835336pgc.29.2024.03.26.11.12.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 11:12:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711476753; x=1712081553; 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=m6HlLuZ9zAMNyBTGN/42HjZNTOLBhvdEH6OLOyzfOxk=; b=QShvMTn8irhj+zEn9A4urmA6coJp4gktWS8UsL4dcj219tSbS4h650vxrdQWi9jTgs Qi4765XMLSPmBZaoULBUUOE7pKltx7oKqlYxMHXKGGGxnCo4/BvTwTHZGa6aE2PbmGp8 aKC/4jSlPrDWLQxlaBJGjoNEeDSf2w+QtD0x9OBze4ong/87UhKKApY9Vn8hmvCPe1A2 Tqjojk2jKhaAQBzXo3bZdDK3jIVTBX2du1XBYAhTJqQ3UoXVzP/lAoFu3KtyqFavOquf N9IkeLuEtZTRkJVw4/i7mvFEtbPgI3oO55uMF/revSl2+hjL0Zugeam/UdBMQ6YO74t2 mrPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711476753; x=1712081553; 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=m6HlLuZ9zAMNyBTGN/42HjZNTOLBhvdEH6OLOyzfOxk=; b=VaCFsSCg6566IGAHkp6G/3p+0j2wjuqXDvGZK30waLxtaYqKx8ZwF9ihoR6jzSy7J7 EzQ05YfuaHc7h5vcT0suLfGIh0Nl6J6lZ0Pw6QVqEyd/zj5fi2nnHinCTYQDQm3LOj0Y SnGvEFGpl2W/FK2IqAnEV4GSghf1RQi0W1eYeIGSJt6Oax9I4a95wBdVf6J+m2lta6SL Jk0IAjIIf+X9HIOsyZjbquODSuIP/uObJGX/Ns5JmcoIgcSO35LrynnMVRHiRM0MUJhU ZJBTIylYmIE9AS0KiNxhFTf5fFwiRUAzg1Yx3br7NeeYu+Hov8b+94IPhyD+oeOSGmzy uBpA== X-Gm-Message-State: AOJu0YwaTq+6TDrc2Uk+tcHpr1A/rLOon77aXgtPzlAwiMziLHQQxWZd tMmiyl3CSjgMXMhhahJjKNPHY1Au4gE0f8tAjQ4yditPhaOBGNP2/CQCicYrWO5575B1NPSDoh3 r X-Google-Smtp-Source: AGHT+IFpZzrzYl/Nykmqtvu4hlXXghwVOwvOEZgTNcvZOmEdO3S3kIQXztZEoLBzFIfoIVHOq4XdCw== X-Received: by 2002:a05:6358:5782:b0:17f:58a1:12b0 with SMTP id m2-20020a056358578200b0017f58a112b0mr12776997rwf.9.1711476752858; Tue, 26 Mar 2024 11:12:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@kernel.org Subject: [PATCH v2 1/3] target/hppa: Generate getshadowregs inline Date: Tue, 26 Mar 2024 08:10:26 -1000 Message-Id: <20240326181028.332867-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240326181028.332867-1-richard.henderson@linaro.org> References: <20240326181028.332867-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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::c31; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc31.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1711476792816100002 Content-Type: text/plain; charset="utf-8" This operation is trivial and does not require a helper. Signed-off-by: Richard Henderson Reviewed-by: Helge Deller --- target/hppa/helper.h | 1 - target/hppa/sys_helper.c | 4 ++-- target/hppa/translate.c | 17 +++++++++++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 8fd7ba65d8..5900fd70bc 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -86,7 +86,6 @@ DEF_HELPER_FLAGS_0(read_interval_timer, TCG_CALL_NO_RWG, = tl) #ifndef CONFIG_USER_ONLY DEF_HELPER_1(halt, noreturn, env) DEF_HELPER_1(reset, noreturn, env) -DEF_HELPER_1(getshadowregs, void, env) DEF_HELPER_1(rfi, void, env) DEF_HELPER_1(rfi_r, void, env) DEF_HELPER_FLAGS_2(write_interval_timer, TCG_CALL_NO_RWG, void, env, tl) diff --git a/target/hppa/sys_helper.c b/target/hppa/sys_helper.c index 4a31748342..208e51c086 100644 --- a/target/hppa/sys_helper.c +++ b/target/hppa/sys_helper.c @@ -95,7 +95,7 @@ void HELPER(rfi)(CPUHPPAState *env) cpu_hppa_put_psw(env, env->cr[CR_IPSW]); } =20 -void HELPER(getshadowregs)(CPUHPPAState *env) +static void getshadowregs(CPUHPPAState *env) { env->gr[1] =3D env->shadow[0]; env->gr[8] =3D env->shadow[1]; @@ -108,7 +108,7 @@ void HELPER(getshadowregs)(CPUHPPAState *env) =20 void HELPER(rfi_r)(CPUHPPAState *env) { - helper_getshadowregs(env); + getshadowregs(env); helper_rfi(env); } =20 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 6da9503f33..29e4a64e40 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2385,14 +2385,23 @@ static bool trans_reset(DisasContext *ctx, arg_rese= t *a) #endif } =20 -static bool trans_getshadowregs(DisasContext *ctx, arg_getshadowregs *a) +static bool do_getshadowregs(DisasContext *ctx) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); -#ifndef CONFIG_USER_ONLY nullify_over(ctx); - gen_helper_getshadowregs(tcg_env); + tcg_gen_ld_i64(cpu_gr[1], tcg_env, offsetof(CPUHPPAState, shadow[0])); + tcg_gen_ld_i64(cpu_gr[8], tcg_env, offsetof(CPUHPPAState, shadow[1])); + tcg_gen_ld_i64(cpu_gr[9], tcg_env, offsetof(CPUHPPAState, shadow[2])); + tcg_gen_ld_i64(cpu_gr[16], tcg_env, offsetof(CPUHPPAState, shadow[3])); + tcg_gen_ld_i64(cpu_gr[17], tcg_env, offsetof(CPUHPPAState, shadow[4])); + tcg_gen_ld_i64(cpu_gr[24], tcg_env, offsetof(CPUHPPAState, shadow[5])); + tcg_gen_ld_i64(cpu_gr[25], tcg_env, offsetof(CPUHPPAState, shadow[6])); return nullify_end(ctx); -#endif +} + +static bool trans_getshadowregs(DisasContext *ctx, arg_getshadowregs *a) +{ + return do_getshadowregs(ctx); } =20 static bool trans_nop_addrx(DisasContext *ctx, arg_ldst *a) --=20 2.34.1 From nobody Wed May 15 10:22:15 2024 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1711476806; cv=none; d=zohomail.com; s=zohoarc; b=PiDyHEJ3tlUSsNWoz//Mo2H2u3+VuPQ0xImbzJ2kM33zU7miUIJRNZMOAhhDWUozHEGSMneyvXuwLcNnnXFz2ch7mQA1xQ0sq4g06wreKdg+Ew0GsPGjJues55ZsJd8xL9bv0mtMa7vEOE7YU5giqQvowgYTngymrGxjiIClwdg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711476806; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=I8a9WjWDrqxriphQGGBwyT2pmHKUNZR60B8CaaxBya8=; b=Ae4RvlfJFLJqYvHGmxRYpiVuFdXot2axKFvdPFr5fRH9gnXgfNSGTWXvwdZtKBrYd5cDQxI+SBWynabYsAjiN/LHgaD6aEkqIjtsxSxPxAibzdkA1NXzwx5VUpzn/umeG1Cvdty1g20I6HZh1EBrQ5hEib6+Ppirvkq7CciD3j8= 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+importer=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 1711476806069911.9093205381004; Tue, 26 Mar 2024 11:13:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpBHv-0003LP-Lw; Tue, 26 Mar 2024 14:12:43 -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 1rpBHt-0003Ky-UU for qemu-devel@nongnu.org; Tue, 26 Mar 2024 14:12:41 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rpBHs-0006a1-EG for qemu-devel@nongnu.org; Tue, 26 Mar 2024 14:12:41 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6e6ee9e3cffso57056b3a.1 for ; Tue, 26 Mar 2024 11:12:39 -0700 (PDT) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id q27-20020a63751b000000b005bd980cca56sm7835336pgc.29.2024.03.26.11.12.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 11:12:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711476759; x=1712081559; 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=I8a9WjWDrqxriphQGGBwyT2pmHKUNZR60B8CaaxBya8=; b=WVt4jykCpx6gbf9I74egcVebMaIKOiWVsCvu2lx64rh/hSBRZ548hQrG85bdlVDEsy PujID7zAlqdwHx+GiACJCzJ6Om1RpJZDrTSYRjHJrSVorBwU3r+uzUP9C2kKsn1pgTsy S9QZwsOaHL6eWex5lV2nshcfa7eD3UOxBJCZehfxw4HTg77LF9qRqcXTfoQpOjd2cpQ3 gOUq29uBmq8FaSMUFiy+ebpPtsoyrHgGPCFTQc0HSh7PEC9RorFeQMom/7IGRrVteUQn XMcF4AHYhOoG7fEaUsJlwk6a7q/sLLyEujQaBeoaEEnLuSmhosUYNGs+McWs04D4MeFq MmjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711476759; x=1712081559; 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=I8a9WjWDrqxriphQGGBwyT2pmHKUNZR60B8CaaxBya8=; b=JqOtmd+M7A32IZeNMyqVZt+FEqmjkXUQ7gjdz1XG1r5EPempfNzfY3TjwwKwNfwRYQ ARrOdmJ/W/MmUBD71CsoeJOPDs5uziT1/Ba5xKeabgVRmaGT4g+yAc34hTo7Yg44LtjA ftUFWS9T0Z02LvSxzkXgzxd0tI1jX+Rt1GiPCXtZPYM0wRwbS+IROjW9bqNyjfsg1Koo 4LwAXawJ1Jc1pQi6fPXvkGAWlyJ1fc1sdT+OsrWJzwQbe5+tSqZsnQN2PGLKmG559QTk 3E56D+R+g0i7k5L5SAUW8QeU0cfSKiuv770r7rFMuE0LqsRjjGapFyRODMRSeGOgWH4P LTJA== X-Gm-Message-State: AOJu0YyhU3RtGFfCt3CeUPj7Q27QCJeAua8Keqmv5aLHSYHoBrHzoiPT qC48KyxuyY9i7G/NJaY7P/qzWn49N6NrXCEApQwa108UoQgBf4gpM+nfkrTgDx6N7AS7B8cC5Hp a X-Google-Smtp-Source: AGHT+IEGoWExyyzz9RoZpG9ci/cVludln7p5Z4TdcTcW/7W/qVGZRyZWAtYchJKZPigDV15W3HwfYQ== X-Received: by 2002:a05:6a20:7f84:b0:1a3:b05a:52a5 with SMTP id d4-20020a056a207f8400b001a3b05a52a5mr2752099pzj.20.1711476758779; Tue, 26 Mar 2024 11:12:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@kernel.org Subject: [PATCH v2 2/3] target/hppa: Move diag argument handling to decodetree Date: Tue, 26 Mar 2024 08:10:27 -1000 Message-Id: <20240326181028.332867-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240326181028.332867-1-richard.henderson@linaro.org> References: <20240326181028.332867-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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1711476806830100002 Content-Type: text/plain; charset="utf-8" Split trans_diag into per-operation functions. Signed-off-by: Richard Henderson Reviewed-by: Helge Deller --- target/hppa/insns.decode | 8 +++++++- target/hppa/translate.c | 34 +++++++++++++++++++++------------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 6a74cf23cd..9f6ffd8e2c 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -634,4 +634,10 @@ fdiv_d 001110 ..... ..... 011 ..... ... .....= @f0e_d_3 xmpyu 001110 ..... ..... 010 .0111 .00 t:5 r1=3D%ra64 r2=3D%r= b64 =20 # diag -diag 000101 i:26 +{ + [ + diag_btlb 000101 00 0000 0000 0000 0001 0000 0000 + diag_cout 000101 00 0000 0000 0000 0001 0000 0001 + ] + diag_unimp 000101 i:26 +} diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 29e4a64e40..42dd3f2c8d 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -4572,23 +4572,31 @@ static bool trans_fmpyfadd_d(DisasContext *ctx, arg= _fmpyfadd_d *a) return nullify_end(ctx); } =20 -static bool trans_diag(DisasContext *ctx, arg_diag *a) +/* Emulate PDC BTLB, called by SeaBIOS-hppa */ +static bool trans_diag_btlb(DisasContext *ctx, arg_diag_btlb *a) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); #ifndef CONFIG_USER_ONLY - if (a->i =3D=3D 0x100) { - /* emulate PDC BTLB, called by SeaBIOS-hppa */ - nullify_over(ctx); - gen_helper_diag_btlb(tcg_env); - return nullify_end(ctx); - } - if (a->i =3D=3D 0x101) { - /* print char in %r26 to first serial console, used by SeaBIOS-hpp= a */ - nullify_over(ctx); - gen_helper_diag_console_output(tcg_env); - return nullify_end(ctx); - } + nullify_over(ctx); + gen_helper_diag_btlb(tcg_env); + return nullify_end(ctx); #endif +} + +/* Print char in %r26 to first serial console, used by SeaBIOS-hppa */ +static bool trans_diag_cout(DisasContext *ctx, arg_diag_cout *a) +{ + CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); +#ifndef CONFIG_USER_ONLY + nullify_over(ctx); + gen_helper_diag_console_output(tcg_env); + return nullify_end(ctx); +#endif +} + +static bool trans_diag_unimp(DisasContext *ctx, arg_diag_unimp *a) +{ + CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); qemu_log_mask(LOG_UNIMP, "DIAG opcode 0x%04x ignored\n", a->i); return true; } --=20 2.34.1 From nobody Wed May 15 10:22:15 2024 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1711476837; cv=none; d=zohomail.com; s=zohoarc; b=bEbWvYvWOAoHL7DT3EH5EUwn1P+rtc9IuhtX4ixHkP9Z10fZ/gPxlGMYgPeEV+1Dr25M8pJ1Hf5hdhy1Oxm7Nx+yHmPcsQz0NYqHbzgZot1xVZqEwDGWknQbgLzSDObqy8aPLzVpCSsZmnTaIVkLwc7qDpqNN9xF/s12Z57vaBk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711476837; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=m1ZbZybHY9lhm5Q1WYSajtVJ/Bd2oVTk+eDSnSXGvRY=; b=b/1FMLuU7f8GXevEUww1JBxFCvfSATtmpn4b5OIJvmd5tHpjm6KT9P2RvgiPOXKtYrNtVOuCL3Qfrm7uUvdgzfRdnWwSWkZ8HJfXS0TdPxbf55pRrn3D0LM0xOk3aBcOXeT8R9afucDEVpgsAa0LLfE2GBGaa8DhkyDu38+Ag38= 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+importer=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 1711476837839952.5605910753907; Tue, 26 Mar 2024 11:13:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpBI0-0003M4-J3; Tue, 26 Mar 2024 14:12:48 -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 1rpBHz-0003Le-AH for qemu-devel@nongnu.org; Tue, 26 Mar 2024 14:12:47 -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 1rpBHx-0006aD-LF for qemu-devel@nongnu.org; Tue, 26 Mar 2024 14:12:47 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6ea8ee55812so3467864b3a.0 for ; Tue, 26 Mar 2024 11:12:45 -0700 (PDT) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id q27-20020a63751b000000b005bd980cca56sm7835336pgc.29.2024.03.26.11.12.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 11:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711476764; x=1712081564; 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=m1ZbZybHY9lhm5Q1WYSajtVJ/Bd2oVTk+eDSnSXGvRY=; b=htfheGND1eg1pQLsSoZQksdkx7rhBcmUHfQiKdZeRJ9a+VRQ4+8l5mKd9ji8mbum14 5TvdlQYA3zxMXF7XJNKr9EGrF5lZBqmTRhtQITTkpWRektwdXKxNZ92JMA8gNvlPs+4V lU6b9nR5vjTtC/IP0lHdPSGWtjbuzukzQ0/G75ZzScUdWls+uAnh3+ZwcyETFnHcmJkh UtFxMaMFiqI+AcH1/77/yF3xDquGqweJIsYd2BYyRGxNzxuFZvAqplYd+PCvmNSdOH3U RAToDlwm0d1GUq6dzGvJXzSQIxcnCS/Ro59PI2j0sl2ohuMl4hjb066qNb2v41zz/HXF ++qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711476764; x=1712081564; 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=m1ZbZybHY9lhm5Q1WYSajtVJ/Bd2oVTk+eDSnSXGvRY=; b=Gc44jYbSQ5PZJnGCvW9BcXddU8MyXeN5axccay5eTSI9iMeA1Jn5L/DejtKDFXaREJ 8UAVLJ9Hw3Zd7ErPSGro/xmkNjmm3WAWS1G/hlDRTq2fbP+CQJ9Z8tBW1yyhAe5rrMr8 6F0L+1Ey/zWsB0LSvEf2RD9ngmMQ07eGiRiu6+pIzOYZxIq3DJPfbsKo78GTHvfzrjF2 7jDKxKVpgIALGKeHgWKh6tDwqqAFoGxpfBPOtFq94msPUn5XgrEipzoDRrSdxr1Edgc1 6YCCojtP7bbSOMiNNDoQCEuabDDl1Yj2z3q8xMc8+iLSVF4LnoXBF7TguFjrwgvIu9C5 PWug== X-Gm-Message-State: AOJu0YzmuCh6SWAHWT7l0X1QWOnj+MbPBnHn2Wwup7FQxicxuF/UYmYT 619VWRerqQXiNxg2Wt4F8sbVp1vC4X3Ie+sdhnMxfrO8AeLsJspCyjQCPCgVy/8vHUTcLs1/7/m B X-Google-Smtp-Source: AGHT+IEbIF77nY62uxWh2qWXSh9g+9J+PxqYXph+csroNX7g0QF/xNNcdG8vys+LXj9HUuw5IPl5uw== X-Received: by 2002:a05:6a20:244d:b0:1a3:c404:37fc with SMTP id t13-20020a056a20244d00b001a3c40437fcmr9107588pzc.13.1711476764404; Tue, 26 Mar 2024 11:12:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@kernel.org, Helge Deller Subject: [PATCH v2 3/3] target/hppa: Fix diag instructions to set/restore shadow registers Date: Tue, 26 Mar 2024 08:10:28 -1000 Message-Id: <20240326181028.332867-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240326181028.332867-1-richard.henderson@linaro.org> References: <20240326181028.332867-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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1711476838945100001 Content-Type: text/plain; charset="utf-8" The 32-bit 7300LC CPU and the 64-bit PCX-W 8500 CPU use different diag instructions to save or restore the CPU registers to/from the shadow registers. Implement those per-CPU architecture diag instructions to fix those parts of the HP ODE testcases (L2DIAG and WDIAG, section 1) which test the shadow registers. Signed-off-by: Helge Deller [rth: Use decodetree to distinguish cases] Signed-off-by: Richard Henderson Reviewed-by: Helge Deller Tested-by: Helge Deller --- target/hppa/insns.decode | 10 ++++++++++ target/hppa/translate.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index 9f6ffd8e2c..c2acb3796c 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -65,6 +65,8 @@ # Argument set definitions #### =20 +&empty + # All insns that need to form a virtual address should use this set. &ldst t b x disp sp m scale size =20 @@ -638,6 +640,14 @@ xmpyu 001110 ..... ..... 010 .0111 .00 t:5 = r1=3D%ra64 r2=3D%rb64 [ diag_btlb 000101 00 0000 0000 0000 0001 0000 0000 diag_cout 000101 00 0000 0000 0000 0001 0000 0001 + + # For 32-bit 7300C + diag_getshadowregs_pa1 000101 00 0000 0000 0001 1010 0000 0000 + diag_putshadowregs_pa1 000101 00 0000 0000 0001 1010 0100 0000 + + # For 64-bit PCX-W 8500 + diag_getshadowregs_pa2 000101 00 0111 1000 0001 1000 0100 0000 + diag_putshadowregs_pa2 000101 00 0111 0000 0001 1000 0100 0000 ] diag_unimp 000101 i:26 } diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 42dd3f2c8d..143818c2d9 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2399,6 +2399,20 @@ static bool do_getshadowregs(DisasContext *ctx) return nullify_end(ctx); } =20 +static bool do_putshadowregs(DisasContext *ctx) +{ + CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); + nullify_over(ctx); + tcg_gen_st_i64(cpu_gr[1], tcg_env, offsetof(CPUHPPAState, shadow[0])); + tcg_gen_st_i64(cpu_gr[8], tcg_env, offsetof(CPUHPPAState, shadow[1])); + tcg_gen_st_i64(cpu_gr[9], tcg_env, offsetof(CPUHPPAState, shadow[2])); + tcg_gen_st_i64(cpu_gr[16], tcg_env, offsetof(CPUHPPAState, shadow[3])); + tcg_gen_st_i64(cpu_gr[17], tcg_env, offsetof(CPUHPPAState, shadow[4])); + tcg_gen_st_i64(cpu_gr[24], tcg_env, offsetof(CPUHPPAState, shadow[5])); + tcg_gen_st_i64(cpu_gr[25], tcg_env, offsetof(CPUHPPAState, shadow[6])); + return nullify_end(ctx); +} + static bool trans_getshadowregs(DisasContext *ctx, arg_getshadowregs *a) { return do_getshadowregs(ctx); @@ -4594,6 +4608,26 @@ static bool trans_diag_cout(DisasContext *ctx, arg_d= iag_cout *a) #endif } =20 +static bool trans_diag_getshadowregs_pa1(DisasContext *ctx, arg_empty *a) +{ + return !ctx->is_pa20 && do_getshadowregs(ctx); +} + +static bool trans_diag_getshadowregs_pa2(DisasContext *ctx, arg_empty *a) +{ + return ctx->is_pa20 && do_getshadowregs(ctx); +} + +static bool trans_diag_putshadowregs_pa1(DisasContext *ctx, arg_empty *a) +{ + return !ctx->is_pa20 && do_putshadowregs(ctx); +} + +static bool trans_diag_putshadowregs_pa2(DisasContext *ctx, arg_empty *a) +{ + return ctx->is_pa20 && do_putshadowregs(ctx); +} + static bool trans_diag_unimp(DisasContext *ctx, arg_diag_unimp *a) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); --=20 2.34.1