From nobody Thu Nov 14 17:42:21 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.vnet.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1711653968; cv=none; d=zohomail.com; s=zohoarc; b=Dp4AMGo84/WbA8a/vPkw5rrOI72gcXWo+sRpJ1MVfX8J9M5hGsVIodVyDIniMU67MYDHvslokGl1WUrFzljA58kVt9MOIS7dLu3mcDHJ0Vfkx2hChc08qD1qGii1NB8Jp0wnh34fCNoplMYvhjYHt5VX2fbQpJw7Fv4XmDcXuck= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711653968; 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=Ef4PM3TipPS+SQ3Q87k5uq0UbPfTnh5ekJ5DvOAxajs=; b=VmCoOLtGemTpslXtAXT6p+Vnv1sP/FdHUK+Bv3k4uQ1m+GottELkCPeWd3WHhCLD8Bjeh2TR1i6mAqcUOtm8JGJcOddWv6u0a9IfRH5DZ0l60Sz7VDTJiQReFm7Gz82mhUqf4RNF5uWrQMBx4N6j1JWn4mPAXfvc6PcoO9bf8Ck= 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 1711653968204320.5468201680278; Thu, 28 Mar 2024 12:26:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpvMx-00010M-BA; Thu, 28 Mar 2024 15:24:59 -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 1rpvMv-0000zx-Nx; Thu, 28 Mar 2024 15:24:57 -0400 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 1rpvMu-0001TP-Be; Thu, 28 Mar 2024 15:24:57 -0400 Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 42SJ0glE001640; Thu, 28 Mar 2024 19:24:45 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3x5ccyrc3j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Mar 2024 19:24:44 +0000 Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 42SJOiIf007759; Thu, 28 Mar 2024 19:24:44 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3x5ccyrc3h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Mar 2024 19:24:44 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 42SIGSZA011328; Thu, 28 Mar 2024 19:24:43 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3x2bmmf50k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Mar 2024 19:24:43 +0000 Received: from smtpav04.wdc07v.mail.ibm.com (smtpav04.wdc07v.mail.ibm.com [10.39.53.231]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 42SJOeDv23134832 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Mar 2024 19:24:43 GMT Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BE0C058045; Thu, 28 Mar 2024 19:24:40 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3E4575805E; Thu, 28 Mar 2024 19:24:40 +0000 (GMT) Received: from mamboa4.aus.stglabs.ibm.com (unknown [9.3.84.87]) by smtpav04.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 28 Mar 2024 19:24:40 +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=Ef4PM3TipPS+SQ3Q87k5uq0UbPfTnh5ekJ5DvOAxajs=; b=MmmQyA51aotLPADs8Fp6AtfIDl61VniBQxIAwBekenPDmwthB6gmvaquwhdCbxhbaRpM /tWH2QD+DY+BZhUU536xCThFwq12onODIVqb1A9UW5lwT3aINTFhfo2VinwJJmfcfiYS Ky3KLnHE8Dna6y6OO7rCMTzwVQok++iUIZDIYnLTqbjbRq7x4W8h3BzofTEugKePG/qR 3kVwaQ+gVUnDPXnfFV5cnCbZEkTkVqimD9TRxyFRjovxma6QIBCIgUv4SQMq3ZJvzNSP SNUMCdJ/Eq9YoGOU9hkzNK+lspTZEbrvMBHasR9jSP5Ptv1QoRA1vw/GprLOw4YNwJTe rQ== From: Glenn Miles To: qemu-ppc@nongnu.org Cc: Glenn Miles , qemu-devel@nongnu.org, Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Nicholas Piggin , David Gibson , Peter Maydell Subject: [PATCH v4 4/4] target/ppc: Add migration support for BHRB Date: Thu, 28 Mar 2024 14:23:56 -0500 Message-Id: <20240328192356.2144086-5-milesg@linux.vnet.ibm.com> X-Mailer: git-send-email 2.31.8 In-Reply-To: <20240328192356.2144086-1-milesg@linux.vnet.ibm.com> References: <20240328192356.2144086-1-milesg@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: PSPE5cTU25lEDQVT7lRUN95oMWdLL8vH X-Proofpoint-ORIG-GUID: aBMxUDC4mqcivTj-JKsFCVbuSeYAm4dK 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-03-28_17,2024-03-28_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 malwarescore=0 suspectscore=0 adultscore=0 impostorscore=0 phishscore=0 spamscore=0 mlxlogscore=822 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2403210000 definitions=main-2403280136 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: none client-ip=148.163.158.5; envelope-from=milesg@linux.vnet.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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=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 @ibm.com) X-ZM-MESSAGEID: 1711653969873100006 Content-Type: text/plain; charset="utf-8" Adds migration support for Branch History Rolling Buffer (BHRB) internal state. Signed-off-by: Glenn Miles Reviewed-by: Nicholas Piggin --- Changes from v3: - Rebased onto latest master branch target/ppc/machine.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/target/ppc/machine.c b/target/ppc/machine.c index 6b6c31d903..731dd8df35 100644 --- a/target/ppc/machine.c +++ b/target/ppc/machine.c @@ -711,6 +711,26 @@ static const VMStateDescription vmstate_reservation = =3D { } }; =20 +#ifdef TARGET_PPC64 +static bool bhrb_needed(void *opaque) +{ + PowerPCCPU *cpu =3D opaque; + return (cpu->env.flags & POWERPC_FLAG_BHRB) !=3D 0; +} + +static const VMStateDescription vmstate_bhrb =3D { + .name =3D "cpu/bhrb", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D bhrb_needed, + .fields =3D (VMStateField[]) { + VMSTATE_UINTTL(env.bhrb_offset, PowerPCCPU), + VMSTATE_UINT64_ARRAY(env.bhrb, PowerPCCPU, BHRB_MAX_NUM_ENTRIES), + VMSTATE_END_OF_LIST() + } +}; +#endif + const VMStateDescription vmstate_ppc_cpu =3D { .name =3D "cpu", .version_id =3D 5, @@ -756,6 +776,7 @@ const VMStateDescription vmstate_ppc_cpu =3D { #ifdef TARGET_PPC64 &vmstate_tm, &vmstate_slb, + &vmstate_bhrb, #endif /* TARGET_PPC64 */ &vmstate_tlb6xx, &vmstate_tlbemb, --=20 2.31.8