From nobody Sun May 19 17:42:46 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=1690399261; cv=none; d=zohomail.com; s=zohoarc; b=k3z2I4mwYwP31CzyO0S4iRm5vcGQdLPpsndeLvoL6AQlJ+fQVJj6xG9nBKrH80bwttEFp7rl2bGXD/GIsu9a3fOrhnV9ktAUPVMJ+ATl1Ku0yfuhdiYf7wGycEy4PHMJbOW3TNQDKwnBEi6WN/iaGIe7cm+STe5WMRmFq2jXxkI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690399261; 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=qQcYlfJ1g+AfvOYwtN/gl8mmYP+jyHxbUuizv7xOcwM=; b=O6YaPY82Jsd0eN6Jdfx+YuqLjEklODN8Cl4xPUuOskTZkWR/rHmI7OXZf7RBvqXZN9exUyW4VnGR7oaTBLTpQL+Z+/mzkPxP/jRyXy4M5kN3+9stdAmhTvhRlXy0TNGlEhGURDBuo2PAItAp+jZSroXUGWZKAuU6qUy21s06Ywg= 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 16903992610023.9907948351741425; Wed, 26 Jul 2023 12:21:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOjMV-0000B1-Ih; Wed, 26 Jul 2023 14:35:51 -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 1qOjMT-00008u-HU; Wed, 26 Jul 2023 14:35:49 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qOjMR-0008Eh-RL; Wed, 26 Jul 2023 14:35:49 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1bb9e6c2a90so716945ad.1; Wed, 26 Jul 2023 11:35:47 -0700 (PDT) Received: from wheely.local0.net ([118.102.104.45]) by smtp.gmail.com with ESMTPSA id e13-20020a17090301cd00b001b83dc8649dsm13485670plh.250.2023.07.26.11.35.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 11:35:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690396546; x=1691001346; 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=qQcYlfJ1g+AfvOYwtN/gl8mmYP+jyHxbUuizv7xOcwM=; b=eY3nnYw3UJjmVYgNMT7Vl42xwPQPTghClhKhTlAQlPjJ5I335peitRzg2eQ7VXq89c MpIM5+1dnpDRDYvypmKRHHK0cTxJBt9Sy3Cm7yJ7lhRfEeqGSDb4OALe8CYqjuHmR1nr 6KsZsiskvclWiEYUIhVxvPtgDdKH6qlJ0okUBRDEMcg7aazjtFA9XOWip6sn/6l/zeTb H8q6G9yy53GIbkCKGqAlr/ZaF0Q8BALDwPTjj6T092pAr+GqbyzwQOY5Y1ynQlbahivw jDk8ZjO7hZWzNhmgNfJ1ot83UPK3hNEU5MFJESovmFUGUw1C6Rqpyj2BKrZvWvkTKqRo OYfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690396546; x=1691001346; 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=qQcYlfJ1g+AfvOYwtN/gl8mmYP+jyHxbUuizv7xOcwM=; b=ADBdXv1zb/U1xrtRPvaPxfMlH7GShwj+ATaxYQ8+/mb7UOJJLsCPbeFuQ3VTInzmK6 5trbpJ5DcJrF6VwhGiittEp4NiNJil26l04w8SB71e/clcu/J0vJ1NaGo1hH1T2Oz434 qkZ/GpvLPxMvyOw02uJJ0GWgBeLzJayAuMYAkDrDcAKDcymG2R+fJNfWck8ZwTZC3tnW UI0KZFHvd/xan/hJ3f2xPBIrPc9JzdoMLdQj23SewfsUlgV5nXOBfNjsVnmi1afeekFa gZZPpyCZ8llasp4wXlAAHiedkcLkpIm5tyyx8qId2jSfa2PUFRAKpZ5TDEbjMo6m/x6Z ZOng== X-Gm-Message-State: ABy/qLZp5nc0kLb8iJpTRAgTyuubtwvTAOgn+bpfGTgQyeiAEJ66oDu8 6WMxRDC+nBx4ChdQUB9UvjM= X-Google-Smtp-Source: APBJJlEmRDAaNbUbGu+715wQqFZ5dKRqIcltjSCu2fXA2qxaZ95NgEXF/WDSkCezaXPpX6NltRejHA== X-Received: by 2002:a17:902:c951:b0:1ac:5717:fd5 with SMTP id i17-20020a170902c95100b001ac57170fd5mr3491465pla.60.1690396546132; Wed, 26 Jul 2023 11:35:46 -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 , Pavel Dovgalyuk , Paolo Bonzini , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Pavel Dovgalyuk Subject: [PATCH 1/7] target/ppc: Fix CPU reservation migration for record-replay Date: Thu, 27 Jul 2023 04:35:26 +1000 Message-Id: <20230726183532.434380-2-npiggin@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230726183532.434380-1-npiggin@gmail.com> References: <20230726183532.434380-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::62b; envelope-from=npiggin@gmail.com; helo=mail-pl1-x62b.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, 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 @gmail.com) X-ZM-MESSAGEID: 1690399262206100003 Content-Type: text/plain; charset="utf-8" ppc only migrates reserve_addr, so the destination machine can get a valid reservation with an incorrect reservation value of 0. Prior to commit 392d328abe753 ("target/ppc: Ensure stcx size matches larx"), this could permit a stcx. to incorrectly succeed. That commit inadvertently fixed that bug because the target machine starts with an impossible reservation size of 0, so any stcx. will fail. This behaviour is permitted by the ISA because reservation loss may have implementation-dependent cause. What's more, with KVM machines it is impossible save or reasonably restore reservation state. However if the vmstate is being used for record-replay, the reservation must be saved and restored exactly in order for execution from snapshot to match the record. This patch deprecates the existing incomplete reserve_addr vmstate, and adds a new vmstate subsection with complete reservation state. The new vmstate is needed only when record-replay mode is active. Acked-by: Pavel Dovgalyuk Signed-off-by: Nicholas Piggin --- target/ppc/cpu.h | 2 ++ target/ppc/machine.c | 26 ++++++++++++++++++++++++-- target/ppc/translate.c | 4 ++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 25fac9577a..27532d8f81 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1121,7 +1121,9 @@ struct CPUArchState { target_ulong reserve_addr; /* Reservation address */ target_ulong reserve_length; /* Reservation larx op size (bytes) */ target_ulong reserve_val; /* Reservation value */ +#if defined(TARGET_PPC64) target_ulong reserve_val2; +#endif =20 /* These are used in supervisor mode only */ target_ulong msr; /* machine state register */ diff --git a/target/ppc/machine.c b/target/ppc/machine.c index ebb37e07d0..9f956b972c 100644 --- a/target/ppc/machine.c +++ b/target/ppc/machine.c @@ -10,6 +10,7 @@ #include "qemu/main-loop.h" #include "kvm_ppc.h" #include "power8-pmu.h" +#include "sysemu/replay.h" =20 static void post_load_update_msr(CPUPPCState *env) { @@ -685,6 +686,27 @@ static const VMStateDescription vmstate_compat =3D { } }; =20 +static bool reservation_needed(void *opaque) +{ + return (replay_mode !=3D REPLAY_MODE_NONE); +} + +static const VMStateDescription vmstate_reservation =3D { + .name =3D "cpu/reservation", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D reservation_needed, + .fields =3D (VMStateField[]) { + VMSTATE_UINTTL(env.reserve_addr, PowerPCCPU), + VMSTATE_UINTTL(env.reserve_length, PowerPCCPU), + VMSTATE_UINTTL(env.reserve_val, PowerPCCPU), +#if defined(TARGET_PPC64) + VMSTATE_UINTTL(env.reserve_val2, PowerPCCPU), +#endif + VMSTATE_END_OF_LIST() + } +}; + const VMStateDescription vmstate_ppc_cpu =3D { .name =3D "cpu", .version_id =3D 5, @@ -706,8 +728,7 @@ const VMStateDescription vmstate_ppc_cpu =3D { VMSTATE_UINTTL_ARRAY(env.spr, PowerPCCPU, 1024), VMSTATE_UINT64(env.spe_acc, PowerPCCPU), =20 - /* Reservation */ - VMSTATE_UINTTL(env.reserve_addr, PowerPCCPU), + VMSTATE_UNUSED(sizeof(target_ulong)), /* was env.reserve_addr */ =20 /* Supervisor mode architected state */ VMSTATE_UINTTL(env.msr, PowerPCCPU), @@ -736,6 +757,7 @@ const VMStateDescription vmstate_ppc_cpu =3D { &vmstate_tlbemb, &vmstate_tlbmas, &vmstate_compat, + &vmstate_reservation, NULL } }; diff --git a/target/ppc/translate.c b/target/ppc/translate.c index e6a0709066..b88c00b4b0 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -77,7 +77,9 @@ static TCGv cpu_xer, cpu_so, cpu_ov, cpu_ca, cpu_ov32, cp= u_ca32; static TCGv cpu_reserve; static TCGv cpu_reserve_length; static TCGv cpu_reserve_val; +#if defined(TARGET_PPC64) static TCGv cpu_reserve_val2; +#endif static TCGv cpu_fpscr; static TCGv_i32 cpu_access_type; =20 @@ -151,9 +153,11 @@ void ppc_translate_init(void) cpu_reserve_val =3D tcg_global_mem_new(cpu_env, offsetof(CPUPPCState, reserve_val= ), "reserve_val"); +#if defined(TARGET_PPC64) cpu_reserve_val2 =3D tcg_global_mem_new(cpu_env, offsetof(CPUPPCState, reserve_va= l2), "reserve_val2"); +#endif =20 cpu_fpscr =3D tcg_global_mem_new(cpu_env, offsetof(CPUPPCState, fpscr), "fpscr"); --=20 2.40.1 From nobody Sun May 19 17:42:46 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=1690399246; cv=none; d=zohomail.com; s=zohoarc; b=d5BWRI49h9G1nLG/I7oEndPhWDlZRSxoDhkS6XI5ss3oMHIs+fuUyM+1Ojfi2/tcTp1T+qYvZynSfm889mNhtCOD6M9YadcDLGW/ys52xwIz8ZF9eljy9IKJ1rXz1bC6A57n0vJLgPm3LcidNIB+IJyWouaIOhDNXsbyfh904vc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690399246; 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=x2fe/M8UI9J0UcMXCBdChCqDBtJH1IsuZYF7E+KEStA=; b=jiWKcH/2MHVIzYClIP5cbu7aPV6s7qAQY5hPG4DZadCUw6BxEeffCy+SeR2C7tJBVE4f85I55gHJch+5XlU9mP0/mULByT5BadbinTeuPNKBtC63uwgT7KO7ZwxathNMjOR5NECqz9NkOAZ87zOKUxH1Qix9Jt460z/si2JvtNI= 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 1690399246052150.28907990751463; Wed, 26 Jul 2023 12:20:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOjMa-0000Fw-6E; Wed, 26 Jul 2023 14:35: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 1qOjMY-0000DB-3z; Wed, 26 Jul 2023 14:35:54 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qOjMW-0008Fv-L7; Wed, 26 Jul 2023 14:35:53 -0400 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1bbc2e1c6b2so567045ad.3; Wed, 26 Jul 2023 11:35:52 -0700 (PDT) Received: from wheely.local0.net ([118.102.104.45]) by smtp.gmail.com with ESMTPSA id e13-20020a17090301cd00b001b83dc8649dsm13485670plh.250.2023.07.26.11.35.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 11:35:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690396551; x=1691001351; 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=x2fe/M8UI9J0UcMXCBdChCqDBtJH1IsuZYF7E+KEStA=; b=CapyTk+GGU7M8EZ/+kdpYqfR0uX0CFgNeBDocHB2GevUicOgP4wUT10Ho3bZu1LObd ayIv8yXpedV87MIyyy5zNBLjHAz6zGjYWOgKrNKHg8qr1VWUgAFCvcp16oLOEyeciLvn kudcm+OhFP8u1dKeP6p4iWDebcwW1sTLvfrXUZS/5bFzV5ne/JHnc46zgJSrMtfWjiFY f9EnCYxbTiMMTj1onASCO0K6MeJVQVmGaIalkPuRaPlnXyzYb70kX86EW+6bcBF7Pj5E tG5TtpyOisUSHacAimFBTJnJOZbTlk/cXwiPTGA7J5lsbEfOqBkJBqyAnEWbDlyHNLer yNLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690396551; x=1691001351; 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=x2fe/M8UI9J0UcMXCBdChCqDBtJH1IsuZYF7E+KEStA=; b=GuC1S52wmYYkVNTmczGQpaWhsUm6XFCUw7PtrgRml2X61FraXGHVRC8Zu65Ml/zsid FT8f4w+qpux7DxKmIsEgmiQcpHqNiOtjWMOVz/vRX9ei+/46QxTYoomTvhIY91KzIKnW uDLqSRxmCiAe3kOkIT/Ek/zMQfDA3tIvmtWn2tigOg4qzQuIEOOuR1CWdZdDHm0MMKXP zxnfXeLZvvx/s72YqX0T9r53nOBctVPIdQDfgkKiV6IJvXK/eVdkh6teX6qZtzMq2E+z Kfvq5360qlw39/MUGq3yWtkBO2keciOQmaytT3LVEmDORRaZMFAx0sHCJW5zPpPzEe/y SkqA== X-Gm-Message-State: ABy/qLaRKetU/la3IoaSsxpBAHXPs+t46CGF/C+2EQhOTatkrDZs+LiO +nxus7M89qto8snmUO35NYg= X-Google-Smtp-Source: APBJJlEAhp8lfIZGVqUE9LFsWU2NOn6VDckmOH1sGJcYUeh87CALsgdX+I5ypXCXsyFDYLOUFaGn1g== X-Received: by 2002:a17:903:481:b0:1bb:7996:b267 with SMTP id jj1-20020a170903048100b001bb7996b267mr2045075plb.17.1690396551045; Wed, 26 Jul 2023 11:35: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 , Pavel Dovgalyuk , Paolo Bonzini , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Pavel Dovgalyuk Subject: [PATCH 2/7] target/ppc: Fix timebase reset with record-replay Date: Thu, 27 Jul 2023 04:35:27 +1000 Message-Id: <20230726183532.434380-3-npiggin@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230726183532.434380-1-npiggin@gmail.com> References: <20230726183532.434380-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::630; envelope-from=npiggin@gmail.com; helo=mail-pl1-x630.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, 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 @gmail.com) X-ZM-MESSAGEID: 1690399248287100003 Content-Type: text/plain; charset="utf-8" Timebase save uses a random number for a legacy vmstate field, which makes rr snapshot loading unbalanced. The easiest way to deal with this is just to skip the rng if record-replay is active. Reviewed-by: Pavel Dovgalyuk Signed-off-by: Nicholas Piggin --- hw/ppc/ppc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index cd1993e9c1..2476c4c4d3 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc.c @@ -32,6 +32,7 @@ #include "qemu/main-loop.h" #include "qemu/error-report.h" #include "sysemu/kvm.h" +#include "sysemu/replay.h" #include "sysemu/runstate.h" #include "kvm_ppc.h" #include "migration/vmstate.h" @@ -937,8 +938,14 @@ static void timebase_save(PPCTimebase *tb) return; } =20 - /* not used anymore, we keep it for compatibility */ - tb->time_of_the_day_ns =3D qemu_clock_get_ns(QEMU_CLOCK_HOST); + if (replay_mode =3D=3D REPLAY_MODE_NONE) { + /* not used anymore, we keep it for compatibility */ + tb->time_of_the_day_ns =3D qemu_clock_get_ns(QEMU_CLOCK_HOST); + } else { + /* simpler for record-replay to avoid this event, compat not neede= d */ + tb->time_of_the_day_ns =3D 0; + } + /* * tb_offset is only expected to be changed by QEMU so * there is no need to update it from KVM here --=20 2.40.1 From nobody Sun May 19 17:42:46 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=1690397960; cv=none; d=zohomail.com; s=zohoarc; b=Jr+S5JH4m/1CtqDYhkDsUdNm0NejC4HjLsPF8MGdwTSzW6Ygo6DG3q2gY23x6QFJGog209zvMRCHgwMCJWIduDwebf+nG+81cpUxw+7Cufziy2kTmSP79tnQrqXeBxWO+G1QJQUc/XvrQmAAgQZiUCEK+Fp1HqdmeGOQdGn23vg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690397960; 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=77fSGNGo6S4pQfx5yDcXmMMJ9f/I3cVQmostFkDgDU4=; b=lyNJRDF+Hu0s6AzlNABCT27OYkWeyk3fyR6jeYtbZRagz7K3tfEVbw/cqhw3+FCdbMDCgTlTkeDv6JCcm4tmNg5pYblLPTMpfhzaYmrGo3lJ/FxjI6OAqaqoiDBvxMMkVf4TPtXCZGvy5eEh9nJyNJovOhKGMoObP+1b/BfGrRU= 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 1690397960192239.57782842229608; Wed, 26 Jul 2023 11:59:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOjMh-0000Yi-AK; Wed, 26 Jul 2023 14:36:03 -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 1qOjMd-0000Mb-Oh; Wed, 26 Jul 2023 14:35:59 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qOjMb-0008HR-Hc; Wed, 26 Jul 2023 14:35:59 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1b9cdef8619so677755ad.0; Wed, 26 Jul 2023 11:35:56 -0700 (PDT) Received: from wheely.local0.net ([118.102.104.45]) by smtp.gmail.com with ESMTPSA id e13-20020a17090301cd00b001b83dc8649dsm13485670plh.250.2023.07.26.11.35.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 11:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690396556; x=1691001356; 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=77fSGNGo6S4pQfx5yDcXmMMJ9f/I3cVQmostFkDgDU4=; b=grM163GTsmG603K2ykbGuZSHmUOdG+54jAnaESRpZSN0UfGSwpn1aGKEyS46IjFm35 b501Pv8i4m/sxVDLG0rjhHEeHFMpmKrlIPnh+0kKRR8geIxhGPnZcjb4erz1Cf4Wk2Ae +HzPBcL4fqkRPqEKKoIbRcDOVK0xwzi7HsAeAJG6SlOVqoXmFp3lYEyE8f5Ct7XW8LCa 1FdcbTqDdep8hobXcTepVQ51GEZ68cmozE6BbRTJWzIWgAtyqwsXlUIHsA13BwRsmSm1 WljC4aXUQPtQl6XiJVJF7yHx9TRrUH5RHoVemGX4RXgDBuQSUzp+hcJ7FkT3kV5CHUml 6N2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690396556; x=1691001356; 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=77fSGNGo6S4pQfx5yDcXmMMJ9f/I3cVQmostFkDgDU4=; b=VzkFcryVDO/OIUwq986kuJWuwkHHMcDKMrqdrgT9t7biqEsk+ozST19or/BhasKgbC ztxICO4moZknTSvifRfYrW+067UcGVNmFvun/iQfubB8007UCwq4YJADk185OBM0a+0p Uacvi+a32MycfBljWxRVrvwVds9MLHbg/wTzghIPEwfWeYA7UXblJIuXH5Q32XR/ZoOn 3fb4uvYrccYpvbF6XthJm9J1FPKW5/NNHqPhKw1QLU4Oj+rwLVE4DF1B9m2fVtC5bN8M WJ86wD2ZIsYXRNy9kCOUHv/dGBy+t/xC+qcYIdFp5iKyl8V/CVMHOObdNaKNkQUtPQ3D DYSw== X-Gm-Message-State: ABy/qLb7ehCBl55lDwUYtsZbiC4PKgT4ZBbD2iIVEd5+r0pn33Roa2Tv 7TWcEemLzxqTJmrFMA8ydiEF02TJ2JM= X-Google-Smtp-Source: APBJJlE3EZO1XKyi2cYl/qOcR8FU4p9OxaMCn2oouRlFZ6kvsNi2+URktYO6dGzLHrnZIyE3+hzTcQ== X-Received: by 2002:a17:903:11d1:b0:1b7:c166:f197 with SMTP id q17-20020a17090311d100b001b7c166f197mr2909508plh.29.1690396555970; Wed, 26 Jul 2023 11:35:55 -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 , Pavel Dovgalyuk , Paolo Bonzini , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Pavel Dovgalyuk Subject: [PATCH 3/7] spapr: Fix machine reset deadlock from replay-record Date: Thu, 27 Jul 2023 04:35:28 +1000 Message-Id: <20230726183532.434380-4-npiggin@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230726183532.434380-1-npiggin@gmail.com> References: <20230726183532.434380-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::633; envelope-from=npiggin@gmail.com; helo=mail-pl1-x633.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, 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 @gmail.com) X-ZM-MESSAGEID: 1690397961741100002 Content-Type: text/plain; charset="utf-8" When the machine is reset to load a new snapshot while being debugged with replay-record, it is done from another thread, so the CPU does not run the register setting operations. Set CPU registers directly in machine reset. Cc: Pavel Dovgalyuk Signed-off-by: Nicholas Piggin --- hw/ppc/spapr.c | 20 ++++++++++++++++++-- include/hw/ppc/spapr.h | 1 + target/ppc/compat.c | 19 +++++++++++++++++++ target/ppc/cpu.h | 1 + 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 1c8b8d57a7..7d84244f03 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1322,6 +1322,22 @@ void spapr_set_all_lpcrs(target_ulong value, target_= ulong mask) } } =20 +/* May be used when the machine is not running */ +void spapr_init_all_lpcrs(target_ulong value, target_ulong mask) +{ + CPUState *cs; + CPU_FOREACH(cs) { + PowerPCCPU *cpu =3D POWERPC_CPU(cs); + CPUPPCState *env =3D &cpu->env; + target_ulong lpcr; + + lpcr =3D env->spr[SPR_LPCR]; + lpcr &=3D ~(LPCR_HR | LPCR_UPRT); + ppc_store_lpcr(cpu, lpcr); + } +} + + static bool spapr_get_pate(PPCVirtualHypervisor *vhyp, PowerPCCPU *cpu, target_ulong lpid, ppc_v3_pate_t *entry) { @@ -1583,7 +1599,7 @@ int spapr_reallocate_hpt(SpaprMachineState *spapr, in= t shift, Error **errp) } /* We're setting up a hash table, so that means we're not radix */ spapr->patb_entry =3D 0; - spapr_set_all_lpcrs(0, LPCR_HR | LPCR_UPRT); + spapr_init_all_lpcrs(0, LPCR_HR | LPCR_UPRT); return 0; } =20 @@ -1661,7 +1677,7 @@ static void spapr_machine_reset(MachineState *machine= , ShutdownCause reason) spapr_ovec_cleanup(spapr->ov5_cas); spapr->ov5_cas =3D spapr_ovec_new(); =20 - ppc_set_compat_all(spapr->max_compat_pvr, &error_fatal); + ppc_init_compat_all(spapr->max_compat_pvr, &error_fatal); =20 /* * This is fixing some of the default configuration of the XIVE diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 538b2dfb89..f47e8419a5 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -1012,6 +1012,7 @@ bool spapr_check_pagesize(SpaprMachineState *spapr, h= waddr pagesize, #define SPAPR_OV5_XIVE_BOTH 0x80 /* Only to advertise on the platform = */ =20 void spapr_set_all_lpcrs(target_ulong value, target_ulong mask); +void spapr_init_all_lpcrs(target_ulong value, target_ulong mask); hwaddr spapr_get_rtas_addr(void); bool spapr_memory_hot_unplug_supported(SpaprMachineState *spapr); =20 diff --git a/target/ppc/compat.c b/target/ppc/compat.c index 7949a24f5a..ebef2cccec 100644 --- a/target/ppc/compat.c +++ b/target/ppc/compat.c @@ -229,6 +229,25 @@ int ppc_set_compat_all(uint32_t compat_pvr, Error **er= rp) return 0; } =20 +/* To be used when the machine is not running */ +int ppc_init_compat_all(uint32_t compat_pvr, Error **errp) +{ + CPUState *cs; + + CPU_FOREACH(cs) { + PowerPCCPU *cpu =3D POWERPC_CPU(cs); + int ret; + + ret =3D ppc_set_compat(cpu, compat_pvr, errp); + + if (ret < 0) { + return ret; + } + } + + return 0; +} + int ppc_compat_max_vthreads(PowerPCCPU *cpu) { const CompatInfo *compat =3D compat_by_pvr(cpu->compat_pvr); diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 27532d8f81..40be0c362a 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1497,6 +1497,7 @@ int ppc_set_compat(PowerPCCPU *cpu, uint32_t compat_p= vr, Error **errp); =20 #if !defined(CONFIG_USER_ONLY) int ppc_set_compat_all(uint32_t compat_pvr, Error **errp); +int ppc_init_compat_all(uint32_t compat_pvr, Error **errp); #endif int ppc_compat_max_vthreads(PowerPCCPU *cpu); void ppc_compat_add_property(Object *obj, const char *name, --=20 2.40.1 From nobody Sun May 19 17:42:46 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=1690398098; cv=none; d=zohomail.com; s=zohoarc; b=WvyKfYq/L40Cx+sBGapWIYBLUUi020EA4WNKEad+CEdF856jr6CkIUz2gsUzXfR6mZ609oepLEP1vdKGiQJ1r9LSb6qb+Fgte61mtKo1/9REI5hTh6WmWFkQ4ZbkSBuQ+px/tMZc/jff5zyXQUuRQxInkWUTczHhHeIqFyJl7kw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690398098; 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=Lhgb5AXx1P4s219Mrw/Q8V+vpVdydwuZ2XT+9le2vYo=; b=Wbi9hHEN5ntCieYdiaapMDpk7O4iPLJB3vfoKazMvtNKpXPGPGumE0CdK1HFI3yzCMWdGhVuY3RvGRH85oznEGDOmAZNlp1U1lISTYAkdxjnPL3vWrKo1LecNEJAxo2usexuQ3KZL2xvdLcbsUoIkCXr/gpZoodqMnpYNG/LkSU= 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 1690398098782550.2213887307153; Wed, 26 Jul 2023 12:01:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOjMl-0000ih-9t; Wed, 26 Jul 2023 14:36:08 -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 1qOjMi-0000g9-LY; Wed, 26 Jul 2023 14:36:04 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qOjMg-0008Im-FX; Wed, 26 Jul 2023 14:36:04 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1bb7b8390e8so507845ad.2; Wed, 26 Jul 2023 11:36:01 -0700 (PDT) Received: from wheely.local0.net ([118.102.104.45]) by smtp.gmail.com with ESMTPSA id e13-20020a17090301cd00b001b83dc8649dsm13485670plh.250.2023.07.26.11.35.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 11:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690396561; x=1691001361; 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=Lhgb5AXx1P4s219Mrw/Q8V+vpVdydwuZ2XT+9le2vYo=; b=KwzKR2aWXz/BoNZH0Sv8zfVDQ94QjFg0d+Z/O6/xnwxr9josQBnpaFt8nTCnIrlmdc JXaM2gC2SZp87CYhTe30sF87dS0Vr9Jw2ljSaCHV0vQxtKALbYfVxDQw3p5y0jzzN20Y KktQ1Jzr6Nnoj0LyBNJpnj+F3Q0Q999/N4PtrLABfugMdkxmKzEw4PUxPTnHqP829LiA vEkkFXcBNlyD9s/OtnRImzBuYVNDNaAr55EofvqBpZDjhQjOCySv7mS6Ia9mmcysMQVp TO6i+wZ28jyxl7ltXCgkVhuWvuCRZbew/Fl+Xn2x0b1/AfLb1UyOI06yi5qTFt3cDP/Q qaSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690396561; x=1691001361; 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=Lhgb5AXx1P4s219Mrw/Q8V+vpVdydwuZ2XT+9le2vYo=; b=dKUOWppAF8RGC1Hs7Nun9u4WY7DJ403y0eBqgu8wztr8lh/oZX+OmQ1V5x8qlqW642 IMyE8UNMIdfOQv6VQ85MOa7By7Iw2n4dmkvZx8LPIq9jykkRgln+iZmu1jtMlkYRbP36 6f7mWFNQnzyV/ymoF16ZLHspgqvcuWgPdoeqooLSIeht0yhKCGjA35zHhtD7QxGcHwPo GGLp6wYKxICTCMB2kUCeEBfkz7QkA1V/sGlqJQ2eTPa0SLGkeEgwcMcJ6hOuv9wwqqpL UmU3OwwxxxGE6yYz+prgrnwEZxq0vCU3DI3/RmiY1EhA3CYy4phY6viABPQNsM2hzrJ1 tQTw== X-Gm-Message-State: ABy/qLavkWv4LbdJbtECbnwYTrlYTzGhg1E9EvjEEMyD34wVjjGkYdGu BxBD6/oF3ZyWhRC8mwkjXso= X-Google-Smtp-Source: APBJJlGc7HuiA+LZvUMMk956MQm8xWy8PAs8hjQCLgNYWvrXm9SIf2kdaytv6NWYgtsck0qhitmI+Q== X-Received: by 2002:a17:903:284:b0:1bb:876a:abe with SMTP id j4-20020a170903028400b001bb876a0abemr2566618plr.0.1690396560887; Wed, 26 Jul 2023 11:36:00 -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 , Pavel Dovgalyuk , Paolo Bonzini , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Pavel Dovgalyuk Subject: [PATCH 4/7] spapr: Fix record-replay machine reset consuming too many events Date: Thu, 27 Jul 2023 04:35:29 +1000 Message-Id: <20230726183532.434380-5-npiggin@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230726183532.434380-1-npiggin@gmail.com> References: <20230726183532.434380-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::634; envelope-from=npiggin@gmail.com; helo=mail-pl1-x634.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, 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 @gmail.com) X-ZM-MESSAGEID: 1690398101130100003 Content-Type: text/plain; charset="utf-8" spapr_machine_reset gets a random number to populate the device-tree rng seed with. When loading a snapshot for record-replay, the machine is reset again, and that tries to consume the random event record again, crashing due to inconsistent record Fix this by saving the seed to populate the device tree with, and skipping the rng on snapshot load. Cc: Pavel Dovgalyuk Signed-off-by: Nicholas Piggin Acked-by: Pavel Dovgalyuk --- hw/ppc/spapr.c | 12 +++++++++--- include/hw/ppc/spapr.h | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 7d84244f03..ecfbdb0030 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1022,7 +1022,6 @@ static void spapr_dt_chosen(SpaprMachineState *spapr,= void *fdt, bool reset) { MachineState *machine =3D MACHINE(spapr); SpaprMachineClass *smc =3D SPAPR_MACHINE_GET_CLASS(machine); - uint8_t rng_seed[32]; int chosen; =20 _FDT(chosen =3D fdt_add_subnode(fdt, 0, "chosen")); @@ -1100,8 +1099,7 @@ static void spapr_dt_chosen(SpaprMachineState *spapr,= void *fdt, bool reset) spapr_dt_ov5_platform_support(spapr, fdt, chosen); } =20 - qemu_guest_getrandom_nofail(rng_seed, sizeof(rng_seed)); - _FDT(fdt_setprop(fdt, chosen, "rng-seed", rng_seed, sizeof(rng_seed))); + _FDT(fdt_setprop(fdt, chosen, "rng-seed", spapr->fdt_rng_seed, 32)); =20 _FDT(spapr_dt_ovec(fdt, chosen, spapr->ov5_cas, "ibm,architecture-vec-= 5")); } @@ -1654,6 +1652,14 @@ static void spapr_machine_reset(MachineState *machin= e, ShutdownCause reason) void *fdt; int rc; =20 + if (reason !=3D SHUTDOWN_CAUSE_SNAPSHOT_LOAD) { + /* + * Record-replay snapshot load must not consume random, this was + * already replayed from initial machine reset. + */ + qemu_guest_getrandom_nofail(spapr->fdt_rng_seed, 32); + } + pef_kvm_reset(machine->cgs, &error_fatal); spapr_caps_apply(spapr); =20 diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index f47e8419a5..f4bd204d86 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -204,6 +204,7 @@ struct SpaprMachineState { uint32_t fdt_size; uint32_t fdt_initial_size; void *fdt_blob; + uint8_t fdt_rng_seed[32]; long kernel_size; bool kernel_le; uint64_t kernel_addr; --=20 2.40.1 From nobody Sun May 19 17:42:46 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=1690399429; cv=none; d=zohomail.com; s=zohoarc; b=b/Q8UqgRD0Y5YSJ5qmn0T+eWi0G+FOAoN5ATZquwrIBkwpMC3Zyrs9zwYCsJSf7KEsOlrkmK9isnZ1pCI+KgqzEGHUmsSRAQjXI7uSTsO1P5uRrOBxfNCXv+y6fUxizSMtL54Iw9r64hjm0kK+9orCKfvp429noCuud5bPd+AZg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690399429; 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=OTYHHB7LsLK6VsyELQ8ySde/gWfncQJsmnmH13BQxoE=; b=SmCtgSPiyob8HBzTh34bQ3cX9d342LPUyN6M098hrKQSwSrcMIUsmbM5OCYgJ3n5/JjxvNDVix+DEYtMX6GpNzx3aCfSQB3A8fZllZ1o2S9+WF6muMpRYF6yrBB5xwYO2bMyB2bKKSATF6sRzUELVBUyIuWjvIVPjNOe0EVljvg= 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 1690399429713184.09462185620293; Wed, 26 Jul 2023 12:23:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOjMr-0000jy-0U; Wed, 26 Jul 2023 14:36:13 -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 1qOjMn-0000jD-3Q; Wed, 26 Jul 2023 14:36:09 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qOjMl-0008Jw-Cj; Wed, 26 Jul 2023 14:36:08 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1bba48b0bd2so533235ad.3; Wed, 26 Jul 2023 11:36:06 -0700 (PDT) Received: from wheely.local0.net ([118.102.104.45]) by smtp.gmail.com with ESMTPSA id e13-20020a17090301cd00b001b83dc8649dsm13485670plh.250.2023.07.26.11.36.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 11:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690396565; x=1691001365; 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=OTYHHB7LsLK6VsyELQ8ySde/gWfncQJsmnmH13BQxoE=; b=JswuT1or989InqtJZC2IJY6ASZ3yHoHYltOe/1hRvtwgYJIscyqY/mNreI8l+bqnLk pgSmmKVBJSEQtZGbx4Ajo2XH9sSVZiL23RMPlmzaZVkusxCjv1u5myGKxCG3jt60ajEY 3Trn3vgdP5+MeSygzW/EaspyKZwFkSsQHf/ZK1vB+5XJqeYbgSLnSwd/Y1/zP/RvRK7Z BtelwQjCBGfCvIxlmRh/Dkt0Tfm7fJCayBp2KQV3mL2Rr8R53a7kZtGbUtHKQ3rRFG2N hQHxAxPB0phrw2iMlzdswFf2K0qYQNjFdRVm43FVofq9zV4UUwXQKpfBl6ta4fkOKXY1 +qhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690396565; x=1691001365; 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=OTYHHB7LsLK6VsyELQ8ySde/gWfncQJsmnmH13BQxoE=; b=eZJGWVvACrqv6Ukyn5CpYyMSE8bi+aMhiy18BQMPB49YVODVtv+3FbxhRrjPLsBh6K e0P/QtB3WUFu/RJgQB7eVq8ZAbuXAvJA2WPv33igjIBmGRfBuaeMYLXHFhqx0tDXp3W9 2TcRC1kdkph/GC1c5BIWcxHOHcFpkP1VjZC4EWeuRuZToi5Ms9UvsfhZuXOHV74vAP/S vf8ikPwSczmN+icUOCRL+2WmE26hUImR5h28c26qWCb58eK5cl8n71/qib+VZmFDYEar c+1TkYMZ/aVrx4Oa7GT28ATYP2qbfnYrTGrAEMdNyrBWLU/+s1S3sS9LidgEKNWsW0u+ fzrw== X-Gm-Message-State: ABy/qLbTr4CQZnThE+gUMDAp/oYg1Xngt83lj6pBaPBuIdDZxDaFp0ou Q5zWIs/g11tzxnfOFPEyW9hLXj3i3Cw= X-Google-Smtp-Source: APBJJlEBrn4ZZyISfngkvT0N+sxKxSbsq558UZqm+/SV0DNRC/jcIk4kbg6/eTHTaBTCbyFPdcIgTg== X-Received: by 2002:a17:902:e5cb:b0:1b8:a328:c1e6 with SMTP id u11-20020a170902e5cb00b001b8a328c1e6mr2848995plf.63.1690396565636; Wed, 26 Jul 2023 11:36:05 -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 , Pavel Dovgalyuk , Paolo Bonzini , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Pavel Dovgalyuk Subject: [PATCH 5/7] tests/avocado: boot ppc64 pseries replay-record test to Linux VFS mount Date: Thu, 27 Jul 2023 04:35:30 +1000 Message-Id: <20230726183532.434380-6-npiggin@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230726183532.434380-1-npiggin@gmail.com> References: <20230726183532.434380-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::636; envelope-from=npiggin@gmail.com; helo=mail-pl1-x636.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, 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 @gmail.com) X-ZM-MESSAGEID: 1690399430536100001 Content-Type: text/plain; charset="utf-8" This the ppc64 record-replay test is able to replay the full kernel boot so try enabling it. Cc: Pavel Dovgalyuk Signed-off-by: Nicholas Piggin Acked-by: Pavel Dovgalyuk --- tests/avocado/replay_kernel.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/avocado/replay_kernel.py b/tests/avocado/replay_kernel.py index 79c607b0e7..a18610542e 100644 --- a/tests/avocado/replay_kernel.py +++ b/tests/avocado/replay_kernel.py @@ -255,8 +255,7 @@ def test_ppc64_pseries(self): kernel_path =3D self.fetch_asset(kernel_url, asset_hash=3Dkernel_h= ash) =20 kernel_command_line =3D self.KERNEL_COMMON_COMMAND_LINE + 'console= =3Dhvc0' - # icount is not good enough for PPC64 for complete boot yet - console_pattern =3D 'Kernel command line: %s' % kernel_command_line + console_pattern =3D 'VFS: Cannot open root device' self.run_rr(kernel_path, kernel_command_line, console_pattern) =20 def test_ppc64_powernv(self): --=20 2.40.1 From nobody Sun May 19 17:42:46 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=1690397195; cv=none; d=zohomail.com; s=zohoarc; b=J/M0G/9zSfbjHQ1DqlhhSdwZ05CPeWirKtXDIYbE+3omT8JUSKmzCXfPb7WWWAvOBnIWQsyx99ne7MbtyMBKFUqbSfNNlTkOx7uspR4TQFLcNJ2yZ+GPSaGEqpN0HmYQ7kJMYKRKPW15jMAfr1VP9D5toKwwG4j/YBW6HLe+uPE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690397195; 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=vfyXIMhke3pUYlVdSvBeKeV9PKI5Be14OsNtsHaMr9Q=; b=V4whuRTY6oSXUYuI0Fwr3oS/hO0Br44XsEBiNTiiwn+itpn5znLqWbXdFqx0emztYYYW7Yn384T0sVPw0czYwNrRuV39CCevuBaqShqauC2rqU6ye3A3veQ8o2oUqlAec1oavyRnNPJT3tbtfuYLpUGuWGdUnHA/Rz2jOhNdtow= 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 1690397195099519.9517738258423; Wed, 26 Jul 2023 11:46:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOjN0-0000nL-0Q; Wed, 26 Jul 2023 14:36:22 -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 1qOjMu-0000mB-IX; Wed, 26 Jul 2023 14:36:18 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qOjMr-0008LO-2l; Wed, 26 Jul 2023 14:36:16 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1bb81809ca8so652025ad.3; Wed, 26 Jul 2023 11:36:11 -0700 (PDT) Received: from wheely.local0.net ([118.102.104.45]) by smtp.gmail.com with ESMTPSA id e13-20020a17090301cd00b001b83dc8649dsm13485670plh.250.2023.07.26.11.36.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 11:36:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690396570; x=1691001370; 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=vfyXIMhke3pUYlVdSvBeKeV9PKI5Be14OsNtsHaMr9Q=; b=fsVibz+aKHEfU6mih+EcUqPOZ0gjuiVfGyztemTQ+p5CrnHsQkzwA9WgymKugHPdd1 7bi/uLj5GS6OeiFQATINQL4mQGqgMnpjKd4Oy/UAHqlL+CMjr/IeqN27nnbawke7HhWa k4XCDQYOj5gCTMDy1QKP0OxGqJCAUcah6UxGD1W5mYeYs/1NQuYjJrZkgjBTPonCUyZX TsIAVhlmUtIc8Xj8tbBbPL3fYsbNWnbqom9TIm2gErD3yNzWZ79Bqd4i4VYNVpPnKIJX 8Bn7fI/bxxjquBhCdyVi4i73z/THZhXX6ouhSEERM9biCfa5ceZuTGNBA65RDpuOnnY6 cF6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690396570; x=1691001370; 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=vfyXIMhke3pUYlVdSvBeKeV9PKI5Be14OsNtsHaMr9Q=; b=TsNMgKK6czCj5/FcIX5B6kF0BIS9ydm9hm1F7aOEiMH4iJZ5GR/ZGMEwWAoEIZnvAy pVkHLX1fysiQEjeT41GMVEi+7ICBHseukAbKtZvvfKI6W198L1zNtLQ+N7odksTgTlUj zM5UbUNEdXjE7pqIVt2dE74Xnvsc0XEGrlxdS4XilYTIEZAFB5iPyb9etZyQeyRRTqpa BRZYAgnJGA3saNTYSI9s6LZInXNkSuByQTXwvo+ajFQV5sR3jvvubJErsQj/t9SggZt1 SD2n5W7KE75sMkudmgoDaqtzykTi0CUsOOR9MiqVZYTb4rwrtFeh1R/LkFVZjMRGZyZl 9Pnw== X-Gm-Message-State: ABy/qLYezQUt+IXhSPcxAgBsZ2MTYiGc7lG4jfEI+gUp+Oo6MtnwgWPq a7T0e/M2pG2l0uAs8hJDsaQ= X-Google-Smtp-Source: APBJJlE9mhOBSplNZQD7aAqsYFFWCpeIURRCNNcdbZ4SX5zRJJozI/Qb1hzpwIWfNVTeLQWwTsmi4g== X-Received: by 2002:a17:902:f546:b0:1bb:ce4a:5893 with SMTP id h6-20020a170902f54600b001bbce4a5893mr2627072plf.30.1690396570611; Wed, 26 Jul 2023 11:36:10 -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 , Pavel Dovgalyuk , Paolo Bonzini , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Pavel Dovgalyuk Subject: [PATCH 6/7] tests/avocado: reverse-debugging cope with re-executing breakpoints Date: Thu, 27 Jul 2023 04:35:31 +1000 Message-Id: <20230726183532.434380-7-npiggin@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230726183532.434380-1-npiggin@gmail.com> References: <20230726183532.434380-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::632; envelope-from=npiggin@gmail.com; helo=mail-pl1-x632.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, 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 @gmail.com) X-ZM-MESSAGEID: 1690397196024100001 Content-Type: text/plain; charset="utf-8" The reverse-debugging test creates a trace, then replays it and: 1. Steps the first 10 instructions and records their addresses. 2. Steps backward and verifies their addresses match. 3. Runs to (near) the end of the trace. 4. Sets breakpoints on the first 10 instructions. 5. Continues backward and verifies execution stops at the last breakpoint. Step 5 breaks if any of the other 9 breakpoints are re-executed in the trace after the 10th instruction is run, because those will be unexpectedly hit when reverse continuing. This situation does arise with the ppc pseries machine, the SLOF bios branches to its own entry point. Permit this breakpoint re-execution by switching steps 4 and 5, so that the trace will be run to the end *or* the next breakpoint hit. Reversing from there to the 10th intsruction will not hit another breakpoint, by definition. Another step is added between steps 2 and 3, which steps forward over the first 10 instructions and verifies their addresses, to support this. Cc: Pavel Dovgalyuk Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- tests/avocado/reverse_debugging.py | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/tests/avocado/reverse_debugging.py b/tests/avocado/reverse_deb= ugging.py index 680c314cfc..7d1a478df1 100644 --- a/tests/avocado/reverse_debugging.py +++ b/tests/avocado/reverse_debugging.py @@ -150,16 +150,33 @@ def reverse_debugging(self, shift=3D7, args=3DNone): self.check_pc(g, addr) logger.info('found position %x' % addr) =20 - logger.info('seeking to the end (icount %s)' % (last_icount - 1)) - vm.qmp('replay-break', icount=3Dlast_icount - 1) - # continue - will return after pausing - g.cmd(b'c', b'T02thread:01;') + # visit the recorded instruction in forward order + logger.info('stepping forward') + for addr in steps: + self.check_pc(g, addr) + self.gdb_step(g) + logger.info('found position %x' % addr) =20 + # set breakpoints for the instructions just stepped over logger.info('setting breakpoints') for addr in steps: # hardware breakpoint at addr with len=3D1 g.cmd(b'Z1,%x,1' % addr, b'OK') =20 + # this may hit a breakpoint if first instructions are executed + # again + logger.info('continuing execution') + vm.qmp('replay-break', icount=3Dlast_icount - 1) + # continue - will return after pausing + # This could stop at the end and get a T02 return, or by + # re-executing one of the breakpoints and get a T05 return. + g.cmd(b'c') + if self.vm_get_icount(vm) =3D=3D last_icount - 1: + logger.info('reached the end (icount %s)' % (last_icount - 1)) + else: + logger.info('hit a breakpoint again at %x (icount %s)' % + (self.get_pc(g), self.vm_get_icount(vm))) + logger.info('running reverse continue to reach %x' % steps[-1]) # reverse continue - will return after stopping at the breakpoint g.cmd(b'bc', b'T05thread:01;') --=20 2.40.1 From nobody Sun May 19 17:42:46 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=1690396793; cv=none; d=zohomail.com; s=zohoarc; b=BRxyfQ/c96IsGjRbjuIlYPh61pNhSoZJhUh/1lcDr4A6CPZWZk9Av5LmFJTxXolyS0Zg294SOeU+ULlCeahkWAbKyf/F0ZLcV0Da0MvyvsKevroHhseYuknOjvBFqbIxzXrOEjDgcc9g6ijjXDXVNQ60u8AxxdbzLmeLLbrzkUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690396793; 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=kbEjOnkySITmLw82s9WCGkUqlGYptTamWi06s3l0n7s=; b=GLX+eLRw/+uCYNRcNEW79viirvAHtpdYKegFXPIMtxpG7dCCHuL1Ni8Lk0JibGJcBj2/l1Z6nXfL/cqPzPk7ugG7cW1N/i0Nz2XVZGvEfxHHiiqAinqK8BUe0OtpZ69rPH+3y6GP7Zd1iwWLqxSGsTYpgMu3frKQjM+lT0qpRfE= 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 1690396793379116.41858987072817; Wed, 26 Jul 2023 11:39:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOjN0-0000nN-OI; Wed, 26 Jul 2023 14:36:22 -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 1qOjMy-0000mq-TS; Wed, 26 Jul 2023 14:36:20 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qOjMx-0008O8-16; Wed, 26 Jul 2023 14:36:20 -0400 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1b8ad8383faso833695ad.0; Wed, 26 Jul 2023 11:36:16 -0700 (PDT) Received: from wheely.local0.net ([118.102.104.45]) by smtp.gmail.com with ESMTPSA id e13-20020a17090301cd00b001b83dc8649dsm13485670plh.250.2023.07.26.11.36.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 11:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690396575; x=1691001375; 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=kbEjOnkySITmLw82s9WCGkUqlGYptTamWi06s3l0n7s=; b=lrJYSj/CKxLoBVwnudwupTv1NE9+vgiguez8ZPCHLa7sFdG2gYaykTPeeJ6sLTRn2B uwo2ghNk/QtV1KM9xK+RR7W3QZAHD+WHs9R2UnMMcgc7AwxkmR13n2ItoEeuciEMjFUu e0WkRAmZQkAObtk4QQJQRlWpzE8OJuwKz46rg4LJgYBi2wQCsmxZPiZAzaelfKHqKTQ5 4UrlmTPPKaNpwGzhpkI2XGDA6b4c8R3QxNgqMLTvsDNOxLaAalXXLz/zgvu8I94rNXWc phU5A0a3RciiD1DonXDKwFlLM0udwzGXUjZtfytZ50QOC28duU6hpjgScFC6oH3MUnP2 IioA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690396575; x=1691001375; 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=kbEjOnkySITmLw82s9WCGkUqlGYptTamWi06s3l0n7s=; b=QvnVUSSrxH5WZh0ZAj3hd76IRSUuJ901H+NqXLI/h22kIFfoUNmDIC+Ny/Gtd1HVQK PvWUXw1gJ9xeMJHaE9CEaZudju9+ax56nFI08M2QRc0KpJd+6MdMunlt9rv3cmJkIr+f hE03229H5gjxbactu3a/SI3sQ8YdkbzaT44vSeUH4bR7dH/uhppRJN+DC15i6ahXPzz+ SssaQpf7p/Kki3KHbrxDj9rUCKMAAFgTE0JrJjpauoSZUuq8pPzk8MUwK/7PenpO6OSL 9Y6dblykE8FmEeSCE4MR8oUG4gd2TnFS4D55bvC890OF42VgeLs+iN8rGM7RPX8qvR/d sXXQ== X-Gm-Message-State: ABy/qLa1Y0OfkVDNhp7u8hfYJOai63993RyWTemVJJOvx8kKZKVw3E3I DequTTU26QSk7txvabVC8QY= X-Google-Smtp-Source: APBJJlF5/fDOPSw+Q1LCBloGJicZ0hEasezVw9N/HnVZQl1W2EG9jOIxWwa1HeHzc6WwR4FZMG8oPQ== X-Received: by 2002:a17:903:489:b0:1bb:961e:dfbc with SMTP id jj9-20020a170903048900b001bb961edfbcmr2503911plb.20.1690396575474; Wed, 26 Jul 2023 11:36:15 -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 , Pavel Dovgalyuk , Paolo Bonzini , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Pavel Dovgalyuk Subject: [PATCH 7/7] tests/avocado: ppc64 reverse debugging tests for pseries and powernv Date: Thu, 27 Jul 2023 04:35:32 +1000 Message-Id: <20230726183532.434380-8-npiggin@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230726183532.434380-1-npiggin@gmail.com> References: <20230726183532.434380-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::630; envelope-from=npiggin@gmail.com; helo=mail-pl1-x630.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, 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 @gmail.com) X-ZM-MESSAGEID: 1690396795725100003 Content-Type: text/plain; charset="utf-8" These machines run reverse-debugging well enough to pass basic tests. Wire them up. Cc: Pavel Dovgalyuk Signed-off-by: Nicholas Piggin Reviewed-by: Pavel Dovgalyuk --- tests/avocado/reverse_debugging.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/avocado/reverse_debugging.py b/tests/avocado/reverse_deb= ugging.py index 7d1a478df1..fc47874eda 100644 --- a/tests/avocado/reverse_debugging.py +++ b/tests/avocado/reverse_debugging.py @@ -233,3 +233,32 @@ def test_aarch64_virt(self): =20 self.reverse_debugging( args=3D('-kernel', kernel_path)) + +class ReverseDebugging_ppc64(ReverseDebugging): + """ + :avocado: tags=3Daccel:tcg + """ + + REG_PC =3D 0x40 + + # unidentified gitlab timeout problem + @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab') + def test_ppc64_pseries(self): + """ + :avocado: tags=3Darch:ppc64 + :avocado: tags=3Dmachine:pseries + """ + # SLOF branches back to its entry point, which causes this test + # to take the 'hit a breakpoint again' path. That's not a problem, + # just slightly different than the other machines. + self.endian_is_le =3D False + self.reverse_debugging() + + @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab') + def test_ppc64_powernv(self): + """ + :avocado: tags=3Darch:ppc64 + :avocado: tags=3Dmachine:powernv + """ + self.endian_is_le =3D False + self.reverse_debugging() --=20 2.40.1