From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC7C7C63797 for ; Thu, 22 Jul 2021 17:52:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BDA7A61409 for ; Thu, 22 Jul 2021 17:52:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229951AbhGVRMM (ORCPT ); Thu, 22 Jul 2021 13:12:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60145 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbhGVRML (ORCPT ); Thu, 22 Jul 2021 13:12:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626976366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=raFWkEmfEsnXA+zlkTsH/h7na1SeJw58CnlfHE/P3Ws=; b=gnVvuK8fqaIZG7AlrSswYZfYKicFKpztwpCe6yBY46ppedYykjBdcohQp96pQZtseHxNox 63t8nJqQ8sH9DEMO5HUZEaPAk3UzIB4Ssle4fHMqetWqm0lkoIFCpnavEgzJxJkXMKzY0N c7aJRzTX5cD+5VINxuHbeGRgtXuXTuM= Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-248-feiMbvB4O-6AnHM-qh13_A-1; Thu, 22 Jul 2021 13:52:45 -0400 X-MC-Unique: feiMbvB4O-6AnHM-qh13_A-1 Received: by mail-oi1-f198.google.com with SMTP id t11-20020a0568080b2bb029025af6d05d99so4469219oij.10 for ; Thu, 22 Jul 2021 10:52:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=raFWkEmfEsnXA+zlkTsH/h7na1SeJw58CnlfHE/P3Ws=; b=s/LkNjtNrVjtw0awWaWggtUC75WADiBfP3+/P7IJIP2UfPP8OPvPt1yqLPEpM1cXNl 1aA4POdxrJpOa7dFj2f7yah3ubcASk0lBpxrcon3W/oAE+owRfbPuI7XQnfh6MHlCurg BSOt/YAgjH+JC9A7SbSi4tWZZtV9PLb0AeMLsGgxcsUNZ2C50Y2cR2wNQrZSfdHQAJLr ShnX6hYZd1+m2UOq495x1JfUCGlahMEozciJZTnFZrFLspmrO2Xr7ix83BkDLBvwU1sJ uoOjPUNGGQXODMimuhfIoyGCNTH5Gc4LFwJe1boqhIsgmdKtrykjrPrzvqjSivDoHx+O Up5Q== X-Gm-Message-State: AOAM53220M1fmAChttk/Q+BtUok+gqqec1NnZ9acjNhg4g56irLIknBS QZT6MXQRnMWyheokufEam+A8Hpalq7MQ/JMO5FArcEF3dRgKTT0PEywwJ28nNcr5ORiTgKlPGAW qEHFJ7n4EmqjKj4+uyq7MbAI6LmuT/rZFPjiZo2eh3KkLPG9KwTs2H+B/ZgDxcg== X-Received: by 2002:a05:6830:438b:: with SMTP id s11mr636074otv.133.1626976364333; Thu, 22 Jul 2021 10:52:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYxdgdIkzUJlEvp1X0rIRGzY1SrQ7Xzkw/4Mpg1l/IcSoHndZi3iNwTfJV7xrpAXc4vqTTRA== X-Received: by 2002:a05:6830:438b:: with SMTP id s11mr636051otv.133.1626976364091; Thu, 22 Jul 2021 10:52:44 -0700 (PDT) Received: from [192.168.0.173] (ip68-102-25-176.ks.ok.cox.net. [68.102.25.176]) by smtp.gmail.com with ESMTPSA id b2sm2175904otf.40.2021.07.22.10.52.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Jul 2021 10:52:43 -0700 (PDT) From: Connor Kuehl Subject: Re: [RFC PATCH v2 04/44] vl: Introduce machine_init_done_late notifier To: isaku.yamahata@gmail.com, qemu-devel@nongnu.org, pbonzini@redhat.com, alistair@alistair23.me, ehabkost@redhat.com, marcel.apfelbaum@gmail.com, mst@redhat.com, cohuck@redhat.com, mtosatti@redhat.com, xiaoyao.li@intel.com, seanjc@google.com, erdemaktas@google.com Cc: isaku.yamahata@intel.com, kvm@vger.kernel.org References: <80ac3e382a248bac13662d4052d17c41f1c21e3a.1625704980.git.isaku.yamahata@intel.com> Message-ID: Date: Thu, 22 Jul 2021 12:52:42 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <80ac3e382a248bac13662d4052d17c41f1c21e3a.1625704980.git.isaku.yamahata@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 7/7/21 7:54 PM, isaku.yamahata@gmail.com wrote: > From: Isaku Yamahata > > Introduce a new notifier, machine_init_done_late, that is notified after > machine_init_done. This will be used by TDX to generate the HOB for its > virtual firmware, which needs to be done after all guest memory has been > added, i.e. after machine_init_done notifiers have run. Some code > registers memory by machine_init_done(). > > Signed-off-by: Isaku Yamahata > --- > hw/core/machine.c | 26 ++++++++++++++++++++++++++ > include/sysemu/sysemu.h | 2 ++ > 2 files changed, 28 insertions(+) > > diff --git a/hw/core/machine.c b/hw/core/machine.c > index ffc076ae84..66c39cf72a 100644 > --- a/hw/core/machine.c > +++ b/hw/core/machine.c > @@ -1278,6 +1278,31 @@ void qemu_remove_machine_init_done_notifier(Notifier *notify) > notifier_remove(notify); > } > > +static NotifierList machine_init_done_late_notifiers = > + NOTIFIER_LIST_INITIALIZER(machine_init_done_late_notifiers); I think a comment here describing the difference between machine_init_done and machine_init_done_late would go a long way for other developers so they don't have to hunt through the git log. Connor