From nobody Mon Nov 25 09:40:24 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1716506480; cv=none; d=zohomail.com; s=zohoarc; b=JjrpIdvQUoFp9mNefjJYhKEqnxB2PS3TuTMDGNLuFtrbrdJbmht5HHjGnoBa4OvuZJP+cRySmR1o1M/qQ44pS861EnbtoYmn3T9mEjireyLGmspR0Bbdn89zvj+5LNivniQgx/b1C2XPOqG9s7HkCHmLSW6jK++7a4PwFgTfP6g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716506480; 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=A8QQ/AJtkeULSDr3gij8vyBo422tzP42h8e8oFokH9I=; b=gRPfKr7GRjfdt1oBISfQ/GiVmXbrI4+jp+0DhVi75QqKlOx7puWgcCWrO7wyL4w4OsQC56qCHaWLMQqNt17Dw6R7fCCdg0oOkWz1cW2q7aQKARAKHIBEuRytNY1QdSRsZq4ZhERPXv3Ey/zHGOT7RA//VXWMu09xv1gp5LHXAYk= 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 1716506480797679.6569007491157; Thu, 23 May 2024 16:21:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAHZL-0001Y7-Og; Thu, 23 May 2024 19:09:56 -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 1sAHYz-0000IT-Eq; Thu, 23 May 2024 19:09:38 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sAHYm-0005np-CN; Thu, 23 May 2024 19:09:32 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1f332511457so2160655ad.2; Thu, 23 May 2024 16:09:18 -0700 (PDT) Received: from wheely.local0.net (110-175-65-7.tpgi.com.au. [110.175.65.7]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-682227f1838sm87041a12.46.2024.05.23.16.09.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 16:09:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716505757; x=1717110557; 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=A8QQ/AJtkeULSDr3gij8vyBo422tzP42h8e8oFokH9I=; b=hTj1UyaGkmoAr8HzFntAyFqug9PUzClnCA7uc41uVIpwXkKtQppQ/Vgz5SVP7lIYWe s7l9OCv2uwsxhXkaTKJWuWhTBgilHWsrjWFsfKEZyr3q7289VsdWSaj7M5ToS92KNEW8 Adi1SncfyQ/FStQxFQy/LAIEZG3EM+O8Tw1O4/69hScvQHbRZfrkp6tHlWESS3Su4TdL ER4fOLXp33gV5RTMhm7KaNf5Xt2cgK0923KJTgCuHEO6ZC+6Lvi57hO3D9mhc0CG8hZ3 IwKXsZoiUTogeIeNcxaQNGT0EbM0SUw8CT74k3PJ/PxMSLpXBSf69g5/CplkQQBgnQgg ob7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716505757; x=1717110557; 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=A8QQ/AJtkeULSDr3gij8vyBo422tzP42h8e8oFokH9I=; b=cJbBG/XnrA81PRwzDYa9TT5AWa7iE6KuNnhhwywBMtUwCV55ONoLPnI0elxKxYRc8U Qpe9KpROVmiIBOJWMQL1CxRkMQHwAnIaKOeWhb6k+5tq2n+k9wvMUNvTj7m8ckMgn/zA afGGHnYr/cGqUcpxM9pZvVcT4LEA81zYnD5MFXpja4nBHBqrv73Qb1dqc0+6PDcAlzwt Eio8q2QZksU6uZZEzq4v56Oj29BjlAHHqM1t5UljHNAw24sVTTZgETa/fCAykStLqNVt ZpdZiiwW9u/v6zUM6ltzKSk6nDMEERFihFKQBdUFjo2mPGyG7rYE+l5a0NeBM+Ao33UX nv/Q== X-Forwarded-Encrypted: i=1; AJvYcCXcu1H8TVdLUXMq08QgJgKWX/v8OQr7T80OyppJcnfgYuMe/baRpOg0/NHkzLDbtcugjpSYog3fBicdydwdamV41xeU X-Gm-Message-State: AOJu0Yx/L4gD1gW5qR8dkbPTg2GqNPMgEdjy07DJo/INiZn3qPPK5e2Q TsJ+DAUD9edyOdA/P8GwXldeNalwC88yQBKLAyF+WuaEBRKULsZFC3Oqig== X-Google-Smtp-Source: AGHT+IGmeaeQesyDkP8VxdJWHhaqasn9N16CRcUJrtqPZYNrGancK2ypvUbNgHOgICuZqIN/LbEuew== X-Received: by 2002:a17:902:f688:b0:1e8:6614:51cc with SMTP id d9443c01a7336-1f4486d51e7mr9212415ad.5.1716505756921; Thu, 23 May 2024 16:09:16 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org, Glenn Miles Subject: [PULL 25/72] Adds migration support for Branch History Rolling Buffer (BHRB) internal state. Date: Fri, 24 May 2024 09:06:58 +1000 Message-ID: <20240523230747.45703-26-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240523230747.45703-1-npiggin@gmail.com> References: <20240523230747.45703-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::62d; envelope-from=npiggin@gmail.com; helo=mail-pl1-x62d.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, 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: 1716506481143100001 Content-Type: text/plain; charset="utf-8" From: Glenn Miles Reviewed-by: Nicholas Piggin Signed-off-by: Glenn Miles Signed-off-by: Nicholas Piggin --- 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.43.0