From nobody Tue Feb 10 09:25:06 2026 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1691464383; cv=none; d=zohomail.com; s=zohoarc; b=LH+mbj/gNfx+a+O1fytV3ofrynLahQ/LM5pYF3Zv9G2b90C5XhLoLpzpt1EtDqf++7j9VAJSwbdJCLwhKhIwGDBHaNdVEDWmiUSKnseZKdpQ9Ew3DZm6ULbGXyUvtI03SmCJf1a6tSF5amSE2wxonQ0xgkgrffCMU9Cc7TGorPY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1691464383; 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=EXoNaDMEIb16Of1z+9cYJroeocVZ6F6dzNKf9wLt4a8=; b=QwuyiBInqAp+UNnOcrWvQObg2oXZcAdM4FERn4qrRPOfr7PszJTk+lzxyiix6+E4bIDEBrJwZVkI7JtmiED3zTu4BERu7m5iP1HtayDMKXT880VBtCOg/kO8w+aUaQC/zbzb6zFrJLB5q1UJZPPqxLC5aHzeUUXGq7+c4O2w8hY= 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 1691464383518530.3395638417203; Mon, 7 Aug 2023 20:13:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qTD8f-0000hK-Vb; Mon, 07 Aug 2023 23:12:06 -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 1qTD8d-0000R6-8k; Mon, 07 Aug 2023 23:12:03 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qTD8T-0000C8-LC; Mon, 07 Aug 2023 23:12:02 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-686b643df5dso3542108b3a.1; Mon, 07 Aug 2023 20:11:52 -0700 (PDT) Received: from wheely.local0.net (61-68-137-140.tpgi.com.au. [61.68.137.140]) by smtp.gmail.com with ESMTPSA id i21-20020aa79095000000b00687ce7c6540sm482642pfa.99.2023.08.07.20.11.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 20:11:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691464312; x=1692069112; 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=EXoNaDMEIb16Of1z+9cYJroeocVZ6F6dzNKf9wLt4a8=; b=dDEKvxkUHvFwcuhC2e1u4F19bxYR3bGDiaTPAWV6/HdMUBd1g28M9Kb8avbhbKUBko MOLL08FLMRTlmcqfJfR79vLiB/7Qkw7wrgwX/ibDdlqa4sVmu3XZT7P3mS2Qe+MLK645 Cza54tjG258mFeU+2RMlPvebycr0XHY5uhptXCtwlBUtJt24S2k6m0wYTTfUpS6wsJsy MXQVF8ildWZFVT10n3pjootLr/5NEOGRcy++vldQCwjQbb+2vrUztO5ElqUv4pSiQvwI kDpeBPJ05pq4ZzLQ/Ek2Q2IgJJeE+Q0lWoMkNtBZ3WohqKW3icK1fT5SYTGn/1WYIPXy XAhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691464312; x=1692069112; 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=EXoNaDMEIb16Of1z+9cYJroeocVZ6F6dzNKf9wLt4a8=; b=kloEuYnrB+06mysdsBQT+lYAADn2k+Yu7Jj1Sz+B/KMda0S/KYKfPa89ZfU+Gyv3jk 3gaEhdLu2+fPOWNDTcpjXvfJZMVm4+A02nNL0sAqrcpIT6OGxMzV8uHxvrZOz+RjszyA AZ5MmR9eaR1/NrVM0Hj7LKmZGj1Eg4tbpXoU8m2+klGVjbFt0xTbrRqQYGHzsHMjSar/ f82gkiQwdsSDVqe1TrFngkaES7ZhsGrgrDKu5Ndk8VtXnIVNKRDze8b0NGBgiJoi0z66 FdwkxneInLX92LndSo8je/WtKIlVWe5SM0HsmV/UW4DgkNSD0CqWfPPLickZHkQhG79o YI9w== X-Gm-Message-State: AOJu0YymzY6ZL8Gl39dLuccnaSiapsV3PuCYu/Z9qoyg36zZVLLplYBC sNqaBUNgfd1VSAU6hTI9WXyZ+fImNPY= X-Google-Smtp-Source: AGHT+IFjwmj+sRni1CyvSSVUX3oab5G1rxwYphtMGjlvUPIbcr1VsLiAMC1EuGoq8wSrw0rXATjxtg== X-Received: by 2002:a05:6a00:1810:b0:686:25fe:d575 with SMTP id y16-20020a056a00181000b0068625fed575mr10134947pfa.11.1691464311982; Mon, 07 Aug 2023 20:11:51 -0700 (PDT) From: Nicholas Piggin To: Daniel Henrique Barboza Cc: Nicholas Piggin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson , Greg Kurz , Harsh Prateek Bora , Shivaprasad G Bhat , qemu-ppc@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 6/6] spapr: implement H_SET_MODE debug facilities Date: Tue, 8 Aug 2023 13:11:16 +1000 Message-Id: <20230808031116.398205-7-npiggin@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230808031116.398205-1-npiggin@gmail.com> References: <20230808031116.398205-1-npiggin@gmail.com> 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::435; envelope-from=npiggin@gmail.com; helo=mail-pf1-x435.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, FREEMAIL_FROM=0.001, 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 @gmail.com) X-ZM-MESSAGEID: 1691464385232100006 Content-Type: text/plain; charset="utf-8" Wire up the H_SET_MODE debug resources to the CIABR and DAWR0 debug facilities in TCG. Signed-off-by: Nicholas Piggin --- hw/ppc/spapr_hcall.c | 57 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 9b1f225d4a..b7dc388f2f 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -3,6 +3,7 @@ #include "qapi/error.h" #include "sysemu/hw_accel.h" #include "sysemu/runstate.h" +#include "sysemu/tcg.h" #include "qemu/log.h" #include "qemu/main-loop.h" #include "qemu/module.h" @@ -789,6 +790,54 @@ static target_ulong h_logical_dcbf(PowerPCCPU *cpu, Sp= aprMachineState *spapr, return H_SUCCESS; } =20 +static target_ulong h_set_mode_resource_set_ciabr(PowerPCCPU *cpu, + SpaprMachineState *spapr, + target_ulong mflags, + target_ulong value1, + target_ulong value2) +{ + CPUPPCState *env =3D &cpu->env; + + assert(tcg_enabled()); /* KVM will have handled this */ + + if (mflags) { + return H_UNSUPPORTED_FLAG; + } + if (value2) { + return H_P4; + } + if ((value1 & PPC_BITMASK(62, 63)) =3D=3D 0x3) { + return H_P3; + } + + ppc_store_ciabr(env, value1); + + return H_SUCCESS; +} + +static target_ulong h_set_mode_resource_set_dawr0(PowerPCCPU *cpu, + SpaprMachineState *spapr, + target_ulong mflags, + target_ulong value1, + target_ulong value2) +{ + CPUPPCState *env =3D &cpu->env; + + assert(tcg_enabled()); /* KVM will have handled this */ + + if (mflags) { + return H_UNSUPPORTED_FLAG; + } + if (value2 & PPC_BIT(61)) { + return H_P4; + } + + ppc_store_dawr0(env, value1); + ppc_store_dawrx0(env, value2); + + return H_SUCCESS; +} + static target_ulong h_set_mode_resource_le(PowerPCCPU *cpu, SpaprMachineState *spapr, target_ulong mflags, @@ -858,6 +907,14 @@ static target_ulong h_set_mode(PowerPCCPU *cpu, SpaprM= achineState *spapr, target_ulong ret =3D H_P2; =20 switch (resource) { + case H_SET_MODE_RESOURCE_SET_CIABR: + ret =3D h_set_mode_resource_set_ciabr(cpu, spapr, args[0], args[2], + args[3]); + break; + case H_SET_MODE_RESOURCE_SET_DAWR0: + ret =3D h_set_mode_resource_set_dawr0(cpu, spapr, args[0], args[2], + args[3]); + break; case H_SET_MODE_RESOURCE_LE: ret =3D h_set_mode_resource_le(cpu, spapr, args[0], args[2], args[= 3]); break; --=20 2.40.1