From nobody Thu Nov 14 17:56:11 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=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1708418304; cv=none; d=zohomail.com; s=zohoarc; b=DTZmrQ5RyR4Da8GrEJEVYPmUu/wsUBz6fmVGyTWWU+rRnaeLXitEd0j+prQbGTJhM6K2mAZ/Y/hvZjLZp67bL5+Tw3119T4HFMr8ewJ642z9Qli6/zaRjxzLyqgVIN+VoSUr7gbrHa0b9hG98GxWbLulEzlKYlEwy5a16u5vAW4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708418304; 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=n7GSfBZQ39XlfDegYqb0HzSLBVyTSEC4ZsbpnRhUlcw=; b=VoAFtwZpNGn51QkBTL5vi4lxjI/wiu3wEBBaKVL2G235Rc9OifoFd5Zcvb0sY2O9CTxiYWnevZ3GmoooHULuzoIuJhJAKGgHTsufgIqJAkadboQCqJEApLDeWq9PnZz3dQmixqVHmfpPww6Su4K3c6ZhvfZfiR/vPp6VmbcQ7bI= 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=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1708418304084154.39553430443755; Tue, 20 Feb 2024 00:38:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcLd6-0003un-Dj; Tue, 20 Feb 2024 03:37:32 -0500 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 1rcLcV-0003D0-CI; Tue, 20 Feb 2024 03:36:55 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcLcS-00057j-MQ; Tue, 20 Feb 2024 03:36:54 -0500 Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41K7re1d006928; Tue, 20 Feb 2024 08:36:48 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3wcquw9cqe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Feb 2024 08:36:48 +0000 Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41K874Og018762; Tue, 20 Feb 2024 08:36:47 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3wcquw9ck4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Feb 2024 08:36:47 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41K7cVad003606; Tue, 20 Feb 2024 08:36:29 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3wb74tf99p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Feb 2024 08:36:29 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41K8aO3k42991976 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Feb 2024 08:36:26 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 407422004D; Tue, 20 Feb 2024 08:36:24 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9ABE72004B; Tue, 20 Feb 2024 08:36:22 +0000 (GMT) Received: from li-1901474c-32f3-11b2-a85c-fc5ff2c001f3.in.ibm.com (unknown [9.109.243.35]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 20 Feb 2024 08:36:22 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=n7GSfBZQ39XlfDegYqb0HzSLBVyTSEC4ZsbpnRhUlcw=; b=SzzLbPNyLw5cz6UtlAopTUrMFZKqqsIChWEL106gyeXmdvuXh2yWURKlc8yweUjBdf/6 q+S7Z5C/23jC3DWiXNXFG4VKeDIm/aIlVWx16CePORouyLixGWb1luuh8tnk+AYWuxIV 5e5Kk4vq62rd2S0+DGInXtQp+3FAaFuH6u48wjOjvP+JOq6VvPhizJNQOynwj29Uhegt TSvuWwz1hLa1nFEM2UYeoSXB3Q38PMn+2KSt3QeJxcDHZ9784zRLK8poZX3ABvSfPm+R Dr//Dmaanez+1rlN6Royn5YK+TiGp16wConooYhpvax9Bu6qCN3SQRPHipV86/YeTNli uQ== From: Harsh Prateek Bora To: npiggin@gmail.com, qemu-ppc@nongnu.org Cc: clegoate@redhat.com, mikey@neuling.org, amachhiw@linux.vnet.ibm.com, vaibhav@linux.ibm.com, sbhat@linux.ibm.com, danielhb413@gmail.com, qemu-devel@nongnu.org Subject: [PATCH v4 03/15] spapr: nested: Introduce SpaprMachineStateNested to store related info. Date: Tue, 20 Feb 2024 14:05:57 +0530 Message-Id: <20240220083609.748325-4-harshpb@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240220083609.748325-1-harshpb@linux.ibm.com> References: <20240220083609.748325-1-harshpb@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: PYZMqFkG3IPY37AqLl-QXmw5S6Sx5FGx X-Proofpoint-GUID: 3PTj_xJdJyrtf9qCM2O9WihhzXewuMba X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-20_06,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 bulkscore=0 impostorscore=0 priorityscore=1501 phishscore=0 mlxscore=0 spamscore=0 adultscore=0 suspectscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402200061 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=148.163.158.5; envelope-from=harshpb@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 @ibm.com) X-ZM-MESSAGEID: 1708418304638100001 Content-Type: text/plain; charset="utf-8" Currently, nested_ptcr is being used by existing nested-hv API to store nested guest related info. This need to be organised to extend support for the nested PAPR API which would need to store additional info related to nested guests in next series of patches. Signed-off-by: Michael Neuling Signed-off-by: Harsh Prateek Bora Reviewed-by: Nicholas Piggin --- include/hw/ppc/spapr.h | 3 ++- include/hw/ppc/spapr_nested.h | 5 +++++ hw/ppc/spapr_nested.c | 8 ++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index b7ad2a0360..63e9d4c476 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -12,6 +12,7 @@ #include "hw/ppc/spapr_xive.h" /* For SpaprXive */ #include "hw/ppc/xics.h" /* For ICSState */ #include "hw/ppc/spapr_tpm_proxy.h" +#include "hw/ppc/spapr_nested.h" /* For SpaprMachineStateNested */ =20 struct SpaprVioBus; struct SpaprPhbState; @@ -213,7 +214,7 @@ struct SpaprMachineState { uint32_t vsmt; /* Virtual SMT mode (KVM's "core stride") */ =20 /* Nested HV support (TCG only) */ - uint64_t nested_ptcr; + SpaprMachineStateNested nested; =20 Notifier epow_notifier; QTAILQ_HEAD(, SpaprEventLogEntry) pending_events; diff --git a/include/hw/ppc/spapr_nested.h b/include/hw/ppc/spapr_nested.h index 1df1ce14f6..2488ea98da 100644 --- a/include/hw/ppc/spapr_nested.h +++ b/include/hw/ppc/spapr_nested.h @@ -3,6 +3,10 @@ =20 #include "target/ppc/cpu.h" =20 +typedef struct SpaprMachineStateNested { + uint64_t ptcr; +} SpaprMachineStateNested; + /* * Register state for entering a nested guest with H_ENTER_NESTED. * New member must be added at the end. @@ -96,6 +100,7 @@ struct nested_ppc_state { }; =20 void spapr_exit_nested(PowerPCCPU *cpu, int excp); +typedef struct SpaprMachineState SpaprMachineState; bool spapr_get_pate_nested_hv(SpaprMachineState *spapr, PowerPCCPU *cpu, target_ulong lpid, ppc_v3_pate_t *entry); #endif /* HW_SPAPR_NESTED_H */ diff --git a/hw/ppc/spapr_nested.c b/hw/ppc/spapr_nested.c index b38e2d0be5..e43e867295 100644 --- a/hw/ppc/spapr_nested.c +++ b/hw/ppc/spapr_nested.c @@ -17,8 +17,8 @@ bool spapr_get_pate_nested_hv(SpaprMachineState *spapr, P= owerPCCPU *cpu, =20 assert(lpid !=3D 0); =20 - patb =3D spapr->nested_ptcr & PTCR_PATB; - pats =3D spapr->nested_ptcr & PTCR_PATS; + patb =3D spapr->nested.ptcr & PTCR_PATB; + pats =3D spapr->nested.ptcr & PTCR_PATS; =20 /* Check if partition table is properly aligned */ if (patb & MAKE_64BIT_MASK(0, pats + 12)) { @@ -55,7 +55,7 @@ static target_ulong h_set_ptbl(PowerPCCPU *cpu, return H_PARAMETER; } =20 - spapr->nested_ptcr =3D ptcr; /* Save new partition table */ + spapr->nested.ptcr =3D ptcr; /* Save new partition table */ =20 return H_SUCCESS; } @@ -187,7 +187,7 @@ static target_ulong h_enter_nested(PowerPCCPU *cpu, struct kvmppc_pt_regs *regs; hwaddr len; =20 - if (spapr->nested_ptcr =3D=3D 0) { + if (spapr->nested.ptcr =3D=3D 0) { return H_NOT_AVAILABLE; } =20 --=20 2.39.3