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=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,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 9C69EC433B4 for ; Thu, 29 Apr 2021 13:16:19 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 08DC3610A2 for ; Thu, 29 Apr 2021 13:16:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 08DC3610A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:52438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lc6Wf-00033v-On for qemu-devel@archiver.kernel.org; Thu, 29 Apr 2021 09:16:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lc6UZ-00024t-Eo for qemu-devel@nongnu.org; Thu, 29 Apr 2021 09:14:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39647) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lc6UX-0003zS-RE for qemu-devel@nongnu.org; Thu, 29 Apr 2021 09:14:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619702045; 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=YNDady5+JJ7NjQfJHFsCxgGF67pbM8RxFRhCvS8bGZ4=; b=OtIpU6xYhdrkqxG4zpKekBZefIreIhsIlWZz/wX/W6an3ndrsmvJfRRoavxOWUVjCGQomy qtGKc5McXJkFnOZShRhaGVWEy731kymbq+dFPUVUCMoUKrnor0/LYXY6DMKNw62WW06Ind 2lcKYrHkZr7ScIZYScB2JXGN0ZoycWE= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-149-2N2A34jxN6C6NrTXURjS3w-1; Thu, 29 Apr 2021 09:14:03 -0400 X-MC-Unique: 2N2A34jxN6C6NrTXURjS3w-1 Received: by mail-wr1-f70.google.com with SMTP id x10-20020adfc18a0000b029010d83c83f2aso1807847wre.8 for ; Thu, 29 Apr 2021 06:14:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=YNDady5+JJ7NjQfJHFsCxgGF67pbM8RxFRhCvS8bGZ4=; b=tXkP36bxWGtj4660u8VwbCZjbe0NFq4IAZpJXFv2PW7YSaq5ZSKLnbCwNv04a2oz+K gGLkeaidn3YTIt4bCKpSC9Iw3q4XUfn4g5Z6VtzfpcXR9hou/4VZZT8AsSrQqP2RWw68 Nb3O3GdaY5fGmGbmM109nic1mysly7aFEyoLwbRM7wvvCIgvpVAAByB7Rm6odkpoGDay TpNi99/XDwL7DQhpKl6obFtBV8dWSAnFlzw4mootSzdS0BauaXNt+fMLHylFmEybmY6W 3j5lRz/43aA+DYcQBpcSlFKgFZSzBEO+gS5hGJWcav8UdQY4Eh+djJjp+N2aK1iqTcZe 1Fag== X-Gm-Message-State: AOAM530eXiYt7CUC8TpahWEh5gNNMvVArx2V/kriA9lKze2z7oYuL/H9 YUEl0u3yg7agNISiRhIhhXSWfFzO4HJTBygd6NB/uJLj5Hqdt8w+XmQM3bYI8GFI1wx15zetZd5 7IvG/JlD0xfpfntI= X-Received: by 2002:adf:f190:: with SMTP id h16mr29294883wro.393.1619702041911; Thu, 29 Apr 2021 06:14:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1MExN3KVuUhtUgWImKz77t75UyYwDhPUjrJApTUptIX3AZsoxK2xwfeiIPQfP789NnUL3xQ== X-Received: by 2002:adf:f190:: with SMTP id h16mr29294854wro.393.1619702041708; Thu, 29 Apr 2021 06:14:01 -0700 (PDT) Received: from [192.168.1.19] (anancy-651-1-208-144.w109-217.abo.wanadoo.fr. [109.217.237.144]) by smtp.gmail.com with ESMTPSA id o17sm1174972wrs.48.2021.04.29.06.14.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Apr 2021 06:14:01 -0700 (PDT) Subject: Re: [PATCH v5 01/10] util: vfio-helpers: Factor out and fix processing of existing ram blocks To: David Hildenbrand , qemu-devel@nongnu.org References: <20210429112708.12291-1-david@redhat.com> <20210429112708.12291-2-david@redhat.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: Date: Thu, 29 Apr 2021 15:13:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210429112708.12291-2-david@redhat.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.22, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Juan Quintela , "Michael S. Tsirkin" , Richard Henderson , "Dr. David Alan Gilbert" , Peter Xu , Alex Williamson , Paolo Bonzini Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 4/29/21 1:26 PM, David Hildenbrand wrote: > Factor it out into common code when a new notifier is registered, just > as done with the memory region notifier. This keeps logic about how to > process existing ram blocks at a central place. > > Just like when adding a new ram block, we have to register the max_length. > Ram blocks are only "fake resized". All memory (max_length) is mapped. > > Print the warning from inside qemu_vfio_ram_block_added(). > > Reviewed-by: Peter Xu > Signed-off-by: David Hildenbrand > --- > hw/core/numa.c | 14 ++++++++++++++ > include/exec/cpu-common.h | 1 + > softmmu/physmem.c | 5 +++++ > util/vfio-helpers.c | 29 ++++++++--------------------- > 4 files changed, 28 insertions(+), 21 deletions(-) Reviewed-by: Philippe Mathieu-Daudé