From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a17:906:cf90:b0:9bd:85f7:2662 with SMTP id um16csp1113377ejb; Fri, 20 Oct 2023 03:22:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdCJvKzUMkVnDrdHWbfnDpdgm6cbSq1EVQXEKFfJsXDpUaPiHFFUa4IOWiWAp6yEOCa4cI X-Received: by 2002:a67:ae45:0:b0:452:5de9:d303 with SMTP id u5-20020a67ae45000000b004525de9d303mr1478986vsh.30.1697797328501; Fri, 20 Oct 2023 03:22:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697797328; cv=none; d=google.com; s=arc-20160816; b=anzOE+bX6OHK2Cdor/3V26onQY9AN+oNJwjMnCsJ9zXyQhZ2jmiTv6HcZQzsXnAHh1 nEKVeWf8h7YQoPbpKTo1IT5NjWdjmJ/ZUogIANuCYlq1IgbVJrHJAdXMXAR4TDGH9QLT sU3vKIwDCRt0rv+JWnXvbVgs3EN2mmkZQQHAtias6GnfPTG4Q9FwW0opVvMIYN4z2Rm/ 21ENPDJUujlUNRLo5V13lbW5fhtWxNV7zg7yKRhKOeo2L+4xkAKh8aJiSWXRclL1WT4x y4HGUtv3Do3xguf80sNBs8Tlpi33NOQTX6Bzv9UP1jnKQjSq8gVWztscruomL3KAva61 6d9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:in-reply-to:references:to:from :subject:cc:message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=E6XpQDkV+ddExaFmcy6q/Y1PX3uCxd2m4rImMmrU/Ww=; fh=7kKgjPXrQl0sSqTS8MWYb20Ru3Y8dZHapb2ohL03cts=; b=Ij8N2J+EpFRIcvmMfgrZ/WECL1l7MkUv7g062nyCkFx6ESPu5tfEHAIiSxP/Mqg5QL /rcpva/n4uLNsIPvBEoUG/uKlzOMxp9yBnnCXzx7PKcGOkm6il2bExYJjnW3cUlP/1ye u860fKST9bk06bEWWg14ClAhsw5FvecsH0fRHUhDisD3ZUUOjzUESbDmS4n7t9rCKZnE K5KyjjIV2OQkJrluCgDmXkulpGZpMS9bEAFWhjR2fcjCniIMdCGFeBnFuInY1cv8zhH4 FF/UNVxiq9Seuq1trr39Tg5+SKfMGKo15iI9w+WbVMuQtdplMSUKWhCdoGG+S1TyluCX Lcyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Q1n7gncz; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d12-20020ac85acc000000b00418194af9ecsi1081512qtd.51.2023.10.20.03.22.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 03:22:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Q1n7gncz; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtmdT-0002O1-0Z; Fri, 20 Oct 2023 06:21:43 -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 1qtmdN-0002HX-EO; Fri, 20 Oct 2023 06:21:37 -0400 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtmdL-0003Us-I1; Fri, 20 Oct 2023 06:21:37 -0400 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-6ce2cf67be2so418789a34.2; Fri, 20 Oct 2023 03:21:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697797292; x=1698402092; darn=nongnu.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=E6XpQDkV+ddExaFmcy6q/Y1PX3uCxd2m4rImMmrU/Ww=; b=Q1n7gnczH6qm9bkWBR6735l389o/Gf3/9n3szJGPa92HMqF9xpGWk7PTIA2VUmzJ20 yn3s5h8j2B4XAoSr/Sc8+gJv7fwel0sQ97WDvT8oqkySfTMqaCcVSzrp+2Q2Ry0jxeGp xaS6X/7DW9ZyC7LOzw9XeorrWfiVpF4jLdVl2riQnW3c2xlVwNaKIy3yZyMJkSaagrkp jkeaQhBjuP7Ex1M3pDcqZuENfAiduV4SXtklAsIYw72IWQRAJUEtd4HAZxkr5yeXD+p2 msghrVlaAYqJEMdNyYeYFavcL4eOnnGI74z2hpXeo4J407xSxjbkmHUIaSiIlLuOzFH5 V/mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697797292; x=1698402092; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=E6XpQDkV+ddExaFmcy6q/Y1PX3uCxd2m4rImMmrU/Ww=; b=p0GAjy8SueHF5eyTzpqxi+fzz5GI8kZTC8XvcmJY+2FXZuf+HtoGmihAb0HjBhzD1w MgGSEY9BYaA2Yc6x5oEG5S9BGrEcOS1fwmO3/mXSg+XhwM2Hk+5FeN92KI6wjgftBlJn 1KoiUny8qrxieiDrDQgTN+r7b3ifPwgoA7tbKjVd9REDFhDkLsfayMFtcK8rbPrUxJhO k0zGAHvS/+U3v9yh0TAvaoPdu1lp3XUTlxt+6/0BktqyXus0D5ezW3qkAeUZ8qMSkDLI dNAQ70O0clerBeg2CocROueY4jwrd98hvNwUWoyN88uFlZO3gk0plCTXFZOKjVZho4Gc xidQ== X-Gm-Message-State: AOJu0YwB8orNvSWcpeMdbHezge+zqrKTR0WrhE7QlJMc7bRtkybiJhU4 fcEfjglBCqzRb0xrGntDcXc= X-Received: by 2002:a05:6830:16c9:b0:6c4:8441:f90 with SMTP id l9-20020a05683016c900b006c484410f90mr1387547otr.24.1697797292661; Fri, 20 Oct 2023 03:21:32 -0700 (PDT) Received: from localhost (61-68-209-245.tpgi.com.au. [61.68.209.245]) by smtp.gmail.com with ESMTPSA id y21-20020aa79af5000000b0068be348e35fsm1190429pfp.166.2023.10.20.03.21.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Oct 2023 03:21:32 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 20 Oct 2023 20:21:19 +1000 Message-Id: Cc: "Juan Quintela" , , "Stefan Berger" , "Marcel Apfelbaum" , , , "Gerd Hoffmann" , "Corey Minyard" , "Samuel Thibault" , "Richard Henderson" , "David Hildenbrand" , "Ilya Leoshkevich" , "Fabiano Rosas" , "Eric Farman" , "Peter Xu" , "Harsh Prateek Bora" , "John Snow" , , "Mark Cave-Ayland" , "Christian Borntraeger" , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Stefan Weil" , , "Jason Wang" , "Corey Minyard" , "Leonardo Bras" , "Thomas Huth" , "Peter Maydell" , "Michael S. Tsirkin" , =?utf-8?q?C=C3=A9dric_Le_Goater?= , "David Gibson" , "Halil Pasic" , "Daniel Henrique Barboza" Subject: Re: [PATCH 07/13] RFC migration: icp/server is a mess From: "Nicholas Piggin" To: "Greg Kurz" X-Mailer: aerc 0.15.2 References: <20231019190831.20363-1-quintela@redhat.com> <20231019190831.20363-8-quintela@redhat.com> <20231019233958.17abb488@bahia> <20231020103344.34baea63@bahia> In-Reply-To: <20231020103344.34baea63@bahia> Received-SPF: pass client-ip=2607:f8b0:4864:20::336; envelope-from=npiggin@gmail.com; helo=mail-ot1-x336.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-arm@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-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: SgJm7YYSg15H On Fri Oct 20, 2023 at 6:33 PM AEST, Greg Kurz wrote: > On Fri, 20 Oct 2023 17:49:38 +1000 > "Nicholas Piggin" wrote: > > > On Fri Oct 20, 2023 at 7:39 AM AEST, Greg Kurz wrote: > > > On Thu, 19 Oct 2023 21:08:25 +0200 > > > Juan Quintela wrote: > > > > > > > Current code does: > > > > - register pre_2_10_vmstate_dummy_icp with "icp/server" and instanc= e > > > > dependinfg on cpu number > > > > - for newer machines, it register vmstate_icp with "icp/server" nam= e > > > > and instance 0 > > > > - now it unregisters "icp/server" for the 1st instance. > > > >=20 > > > > This is wrong at many levels: > > > > - we shouldn't have two VMSTATEDescriptions with the same name > > > > - In case this is the only solution that we can came with, it needs= to > > > > be: > > > > * register pre_2_10_vmstate_dummy_icp > > > > * unregister pre_2_10_vmstate_dummy_icp > > > > * register real vmstate_icp > > > >=20 > > > > As the initialization of this machine is already complex enough, I > > > > need help from PPC maintainers to fix this. > > > >=20 > > > > Volunteers? > > > >=20 > > > > CC: Cedric Le Goater > > > > CC: Daniel Henrique Barboza > > > > CC: David Gibson > > > > CC: Greg Kurz > > > >=20 > > > > Signed-off-by: Juan Quintela > > > > --- > > > > hw/ppc/spapr.c | 7 ++++++- > > > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > >=20 > > > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > > > > index cb840676d3..8531d13492 100644 > > > > --- a/hw/ppc/spapr.c > > > > +++ b/hw/ppc/spapr.c > > > > @@ -143,7 +143,12 @@ static bool pre_2_10_vmstate_dummy_icp_needed(= void *opaque) > > > > } > > > > =20 > > > > static const VMStateDescription pre_2_10_vmstate_dummy_icp =3D { > > > > - .name =3D "icp/server", > > > > + /* > > > > + * Hack ahead. We can't have two devices with the same name a= nd > > > > + * instance id. So I rename this to pass make check. > > > > + * Real help from people who knows the hardware is needed. > > > > + */ > > > > + .name =3D "pre-2.10-icp/server", > > > > .version_id =3D 1, > > > > .minimum_version_id =3D 1, > > > > .needed =3D pre_2_10_vmstate_dummy_icp_needed, > > > > > > I guess this fix is acceptable as well and a lot simpler than > > > reverting the hack actually. Outcome is the same : drop > > > compat with pseries-2.9 and older. > > > > > > Reviewed-by: Greg Kurz > >=20 > > So the reason we can't have duplicate names registered, aside from it > > surely going bad if we actually send or receive a stream at the point > > they are registered, is the duplcate check introduced in patch 9? But > > before that, this hack does seem to actually work because the duplicate > > is unregistered right away. > >=20 > > Correct. > > > If I understand the workaround, there is an asymmetry in the migration > > sequence in that receiving an unexpected object would cause a failure, > > but going from newer to older would just skip some "expected" objects > > and that didn't cause a problem. So you only have to deal with ignoring > > the unexpected ones going form older to newer. > >=20 > > Correct. > > > Side question, is it possible to flag the problem of *not* receiving > > an object that you did expect? That might be a source of bugs too. > >=20 > > AFAICR we try to only migrate state that differs from reset : the > destination cannot really assume it will receive anything for a > given device. That's true, I guess you could always add some flag yourself if you certainly need something. > > > Anyway, I wonder if we could fix this spapr problem by adding a special > > case wild card instance matcher to ignore it? It's still a bit hacky > > but maybe a bit nicer. I don't mind deprecating the machine soon if > > you want to clear the wildcard hack away soon, but it would be nice to > > separate the deprecation and removal from the fix, if possible. > >=20 > > This patch is not tested but hopefully helps illustrate the idea. > >=20 > > I'm not sure this will fly with older QEMUs that don't know about > VMSTATE_INSTANCE_ID_WILD... but I'll let Juan comment on that. You could be right about that. He gave a simpler solution now anyway. Thanks, Nick