From patchwork Fri Mar 29 22:31:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 784101 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp3429360wrt; Fri, 29 Mar 2024 15:33:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXp5jUY607o3USyZPFhrSSLdL1T8K/rtiDbTO5j2Gvl7elRnIMc0StYO3HhTU6y21kYsd2WDKPaoayO7jAsEXEK X-Google-Smtp-Source: AGHT+IFc1d05qbFabtEUfWulF1zaPSelOxmAAlJn1WGIGoOsUM4J1KiwGicdzUBM+rsgSuzbHLwq X-Received: by 2002:a0d:e7c6:0:b0:611:30a2:1758 with SMTP id q189-20020a0de7c6000000b0061130a21758mr3670726ywe.37.1711751621444; Fri, 29 Mar 2024 15:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711751621; cv=none; d=google.com; s=arc-20160816; b=JXgmRTIHBM117HBikqkhPUXM5OSOZfFQD/2MSkhz8gfh8sFTviqCa3D6rsMVChvJCq aurzB9FwHqwxyUe+j7iDRYIrfjKh8DABRRT6UsElygAfxnWPBoLBMdL4hg3ok+X8tVDl C4s7Mi1Ph4P+6XC0ejqaoHTXyPvOde6/JZ7ROGXo7GGb+5Ndxl6HWYqrMg3y+tPjwh5j 7J6Ml1peiy3xjaOzBqbSE9p5zEyoaTJYcxXuxckQtaAI9v/ONepgf4tZIJWMlNAOeG8Z BSZVXR1TMDUGYVHK2J14YsC4eodLsaLnV9bZpK1C/6vTIVq1NdQKilpUGNkK4te1IXJ0 Ujow== 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=3k8lclmQQ4F8nUAdVeP5eeR9f55SSu6v457WolvggHw=; fh=wDljmxUHXfz9MGj2//jPHYRc53BMWF157v8rVKELrf4=; b=TeJK/1YiVPeAMsla/BZWc/YYbyaIyVSnP1yAc4ii0ODYW+F51wLlScibuNG1VBhBdv w5+g0wscwiFUTeHmb4lUehHZM6XrsffMDfVA7StUoAGcVJ+t9l78eIWCM+vGLVWHdnDt wBAP9EvfUhoVRP/btRSoTbIBfzO4kF5Q8eX97XPQ1QvAyiINKxa/ReZlgzisG3LxMj4O mE8NTy1trTkwZKBKGZuhZrUbPtZg8H6ly4+JgweRjBNAA1dZ1+37AQIoDFp3ajJL2IQ9 C47hVbpoXzDofVYGxULGuQDbfXRIGTPNi/DyQOyEbjFmmktCaqh7DOMiSY9ofxNdQgZR zaCA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MrPgI1jP; 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 t2-20020a05620a034200b00789fb8a608dsi4616746qkm.433.2024.03.29.15.33.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2024 15:33:41 -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=MrPgI1jP; 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 1rqKlO-0002dm-MX; Fri, 29 Mar 2024 18:31:54 -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 1rqKlA-0002aX-Kn for qemu-devel@nongnu.org; Fri, 29 Mar 2024 18:31:41 -0400 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 1rqKl8-0003YG-VU for qemu-devel@nongnu.org; Fri, 29 Mar 2024 18:31:40 -0400 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-2a07b092c4fso1847308a91.0 for ; Fri, 29 Mar 2024 15:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711751498; x=1712356298; 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=3k8lclmQQ4F8nUAdVeP5eeR9f55SSu6v457WolvggHw=; b=MrPgI1jPVK2ZeMAkOVKZ++573BpCmNzciLfeHzow6CaENov8pQ2yBIP+sI4bOWa8+4 JPIe2ZIvSABnXHLIHcJXM8sQOimtKNKuBogrUbF2ny7GOEFQ2bqCYIYQYNpBmkOja29i 5E7S4grm1gHFp4UdC5yG/ke/2wIqAbqM3X8pAkL/2N/BB6Rnwa1Ly+rIHKdHKuZ0Tykk AOu/oGD/N5s67pie6p+NvAB6UTN5UCpTt5+wnMDDHeVoUyiawCcU2UmQqx6CAMStp7/v kK3YAPTx5srAQ5u6kNWPCwpJTAbLYWTykpip7HzhAFrgj0QeRp7qqc8huhU/9cS99w1q retA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711751498; x=1712356298; 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=3k8lclmQQ4F8nUAdVeP5eeR9f55SSu6v457WolvggHw=; b=ZnluM28aH/MbNwZzK1iNBAhPlMdJtACLFJIERtnJ6G0drmrlXsP9DZs6qu0LrKQVKg Mxj0T69xb9MsK1jm8Y5PPt0h+APDxkck0BsDl84M6LcBpUapt8z7yX06ixDy1k5oOlN1 vEZEM+DBAsVQMSlNVYglKzEAyH4HcGw8kj61e3ySss3yQv68ISzwcZN/XbH/qXmPD03u sYUufTnA4pe3Ei2IbZ+EXbciQz4JplNWHJMhC0jYf1zIrTLnrpoh7eMbtrQ0AlNTtibB CmxCX+pvF9L8pMKxiDO+tFLxDZitVz9E58sb8xrpB2byYhruS10F4HdLrnIHesFCen7K tM8A== X-Gm-Message-State: AOJu0YxXRLyvcJQUmiNFnPmOe0EPdC5zaBJYEIG3fDQyusAsaHJY9K5P eX3XeKJmp/14n8geWPqpmLHl6Yr4khz1yBofpGMy+dlgGluD0eFkJ9zcmiASJap18Y9mmvG5jfh O X-Received: by 2002:a17:902:ec8b:b0:1e2:2e93:10ef with SMTP id x11-20020a170902ec8b00b001e22e9310efmr3293580plg.52.1711751497666; Fri, 29 Mar 2024 15:31:37 -0700 (PDT) Received: from stoup.. (098-147-007-212.res.spectrum.com. [98.147.7.212]) by smtp.gmail.com with ESMTPSA id f8-20020a170902684800b001e09b636cafsm4000955pln.287.2024.03.29.15.31.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 15:31:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Helge Deller Subject: [PULL 16/18] target/hppa: Move diag argument handling to decodetree Date: Fri, 29 Mar 2024 12:31:09 -1000 Message-Id: <20240329223111.1735826-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240329223111.1735826-1-richard.henderson@linaro.org> References: <20240329223111.1735826-1-richard.henderson@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Split trans_diag into per-operation functions. Reviewed-by: Helge Deller Signed-off-by: Richard Henderson --- 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=%ra64 r2=%rb64 # 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); } -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 == 0x100) { - /* emulate PDC BTLB, called by SeaBIOS-hppa */ - nullify_over(ctx); - gen_helper_diag_btlb(tcg_env); - return nullify_end(ctx); - } - if (a->i == 0x101) { - /* print char in %r26 to first serial console, used by SeaBIOS-hppa */ - 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; }