Received: by 2002:a17:906:dac7:b0:886:babc:7eeb with SMTP id xi7csp3691089ejb; Sun, 12 Feb 2023 07:18:55 -0800 (PST) X-Google-Smtp-Source: AK7set+4mLu8CFeDB7BjU0k0/+L3wAvJd9VnrpKWEWzVpph5+KYABThXMzDKS6evCyfvCofDZfLU X-Received: by 2002:a05:622a:1828:b0:3ba:2b4:7b39 with SMTP id t40-20020a05622a182800b003ba02b47b39mr40822537qtc.46.1676215134851; Sun, 12 Feb 2023 07:18:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676215134; cv=none; d=google.com; s=arc-20160816; b=LqTEVUuSBxQuDPglSJVMRS0/9lXuT39F7T2wZ4voMRVbnHwKgSUkosB9zsSE2CRxTF SMxCC1a2HBEmfgEXcv9upHcIIE3pqgvFQW/eQ/ABy2lcciFjm0JvZDfIkqBpJMujVF8Y UGgDF405TdPuVT12MJwsIcxDBuMnwzjBS4xNsiewkee/88OVe7z1GkXQkS8ALgqwzpJl iKyV21/3WJLp8unI9i2JfEXz0BDCzsFXHQYjouudT/qyHv9DO9tCNmzO8fUHLqzbrnwg SbZPzwEb/kqkiu7Byi/ew19G7AeAEGckqRSTC/ryaLjM2H6n42Ix5wYNbruOG/K4CDzb DyMA== 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:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=mQr+ntmI4/lwq9bLSqAKH0XQE2Ljg2VTPyjKdUOb6wI=; b=vkjm954rXtuNRna51SSAP+AHATNNgYXKQikMi6VcgV8PxKv5I7xKMNfpqF+w4QBKKq hCaYRVc4NC9f4opqKtixWDiAXupKFTPdHFGryD+ECEqybDtvFrenCeFzb9nVwAV/x8xn YIxgX7TVVfscILkEcX8sQoBBenjmNlMT+cPHKoMa0VH5bJR0IzU6gpjctVRFuEHqS9nk IJb5hsXijPpGvBYN6e44oE3Xss4Go1kMCkfRtKxM8VOrm1fyjcaWyJ3kqdby/P4mNkfS 1Dkb7AUrvgsgGfFTzA2jw3TygSB7KZLQUeKDxAJy8j3kbfa4NcvISSwIZu8n0afX5oHz xQsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=URtxRHSK; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j13-20020a05622a038d00b003b635a1f190si8117104qtx.251.2023.02.12.07.18.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Feb 2023 07:18:54 -0800 (PST) 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=@linaro.org header.s=google header.b=URtxRHSK; 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=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRE7q-0002sr-GD; Sun, 12 Feb 2023 10:18:46 -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 1pRE7m-0002sW-HV for qemu-arm@nongnu.org; Sun, 12 Feb 2023 10:18:43 -0500 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRE7k-0007YI-Tm for qemu-arm@nongnu.org; Sun, 12 Feb 2023 10:18:42 -0500 Received: by mail-pf1-x434.google.com with SMTP id g9so6408631pfo.5 for ; Sun, 12 Feb 2023 07:18:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=mQr+ntmI4/lwq9bLSqAKH0XQE2Ljg2VTPyjKdUOb6wI=; b=URtxRHSKiixIMIZ9OfDeAWt/RZ0MEjlAOGrZKd6DFq4AhPrYx0uyz26g1cIM7E9zaK gnuVujcLhkKzo5OjhEsDNFKxbcawu3xKd0UwnjRIHQ1dkjlmwDq6eDxX9qGD6behwC+7 NFXDqiDxGRs5G2xGJE5s4OsylxpJ262itjeZ5Wb1AYlf3AKIvFqYFbArfVWFUoougvW5 t1SwyUTB/bUouHBLpUr1x80iV8KbXkh0DLrD2bPxfTYtnR+hX/iP5nfnCv+NuJDPPgE+ tRcLp1PoOrdpE6KNADZg9XXWrvlO5ZB8FtXDSUnEXEXXM6wGxcPB7dCws68Z7c87+xD9 3Tyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mQr+ntmI4/lwq9bLSqAKH0XQE2Ljg2VTPyjKdUOb6wI=; b=ufyzE4H9Yk11bpMRsP0iSonL65S/zLedCGQMVlTfFcorBe4l6VQ8D4X0G4loldIFlB mbjan7VdkAcYdFS1H4ec2da62pn/BFZjnSfbZcpMKOH4N9zTF2W+wy8kH0/P6BU8YBHU OX65KB1h+zpBXj2o1GAXJoYF8PxF/L7Z4QUv8g4JkBV3/5YOhFhZBCMdI7Ke+Ob4tLxe xEu+KYaYzIl1zQdTJlPzZws5BWFJ/KPPFskD+BVehFAOvqz89th3hiBoBpcwJmqmzfqC EwV1Et6KmTrfskLDaPz3juNtP3+7SzIxlgjXjntoGg1KB0EImQRYHPPN2RfmMqYmzCts XFuA== X-Gm-Message-State: AO0yUKXQgDLtf6XwrJ+TC1MQI8IFkn4dxEl3bgRmZiIGFteYbDxBjPiC VWtTKjBzjyIlisX3bQ7QBeliFw== X-Received: by 2002:a62:7b4b:0:b0:5a8:ab7c:981c with SMTP id w72-20020a627b4b000000b005a8ab7c981cmr1942477pfc.29.1676215119222; Sun, 12 Feb 2023 07:18:39 -0800 (PST) Received: from [192.168.101.227] (rrcs-74-87-59-234.west.biz.rr.com. [74.87.59.234]) by smtp.gmail.com with ESMTPSA id a9-20020aa78649000000b005a817ff3903sm917252pfo.3.2023.02.12.07.18.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Feb 2023 07:18:38 -0800 (PST) Message-ID: Date: Sun, 12 Feb 2023 05:18:33 -1000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v4] hw/arm/smmuv3: Add GBPA register Content-Language: en-US To: Mostafa Saleh Cc: qemu-devel@nongnu.org, jean-philippe@linaro.org, eric.auger@redhat.com, peter.maydell@linaro.org, qemu-arm@nongnu.org References: <20230210221951.1298668-1-smostafa@google.com> <9619db1f-5595-b95b-7643-ae345759a59c@linaro.org> From: Richard Henderson In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.google.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 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, NICE_REPLY_A=-0.348, 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: xljXQ6/2okXW On 2/12/23 03:23, Mostafa Saleh wrote: > On Sat, Feb 11, 2023 at 01:48:57PM -1000, Richard Henderson wrote: > >> Just "return s->gbpa != SMMU_GBPA_RESET_VAL;". > > I will update it. > >>> @@ -1512,6 +1553,10 @@ static const VMStateDescription vmstate_smmuv3 = { >>> VMSTATE_END_OF_LIST(), >>> }, >>> + .subsections = (const VMStateDescription * []) { >>> + &vmstate_gbpa, >>> + NULL >>> + } >> >> Actually, I suspect that you need a pre_load hook that resets gbpa, which >> will then be overwritten if and only if the saved value != reset value. >> > > Please correct me if I am wrong. From what I see, the initial for value > GBPA will be set from smmu_reset_hold which is called from context of > qemu_system_reset from qemu_init context. > And migration will start after that in migration_incoming_process from > qemu_main_loop context. > > I validated that also by printing the value of GBPA from vmstate_smmuv3 > pre_load at migration without GPBA, and it is the same as > SMMU_GBPA_RESET_VAL. Is that from -loadvm on the command-line, or the loadvm command from the monitor? It's the latter that I suspect requires the pre_load. r~