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=-17.7 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 72062C4338F for ; Fri, 6 Aug 2021 08:47:50 +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 D2A9B60EE8 for ; Fri, 6 Aug 2021 08:47:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D2A9B60EE8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:34752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBvW8-0006dq-H4 for qemu-devel@archiver.kernel.org; Fri, 06 Aug 2021 04:47:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBvVZ-0005wW-5v for qemu-devel@nongnu.org; Fri, 06 Aug 2021 04:47:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:30870) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBvVW-00052C-NL for qemu-devel@nongnu.org; Fri, 06 Aug 2021 04:47:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628239628; 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=uoTvZnmA9yGBaGohl/jSAUwj3OwZR0GOKUwnuOxtI5U=; b=ROZYS63DPlQXVViP7ZTzdcbTibhKM6nFw9QKj4KhgzmDRzRX1aSaxh6zVpgEjd2y89ELjC IbSuOGDabxiBwSf75bTG9L92Pysbz53w9Gnr11IYJ/0X/A9vtJDOWbftJdT9mLdIMTlMYR 6ZJ9IvlLp6pHTDjnaG1+4MshBo7y7Dc= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-155-_SB_U7-cNwOAgDxxA2kmxQ-1; Fri, 06 Aug 2021 04:47:07 -0400 X-MC-Unique: _SB_U7-cNwOAgDxxA2kmxQ-1 Received: by mail-wm1-f71.google.com with SMTP id a18-20020a05600c2252b02902531dcdc68fso3620359wmm.6 for ; Fri, 06 Aug 2021 01:47:07 -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=uoTvZnmA9yGBaGohl/jSAUwj3OwZR0GOKUwnuOxtI5U=; b=mpUhTI9tYQtCafSRANpdOEoq49uhgi/Hd/8PTWFC6l0eH7QrxhqvpvyXwuGiOeVPos Ko6Q/epA9aZSQcaekFby+sZkQpdqSpuYL4TE9eT/DjMzaaY1anzmKMrlxJxWe4yOeryl koffY/Oji8E+F6r2ey/45EUxdu38a0t1FJ/TLbbb6h5uDzxysscjsJRUb1xCw/NijjjK JMAzXOA2NRx8OPyMXOhrixqnWlYkdxRKiUsoBIxJ/OKs1vjx2liSDdUG6G+Ow/fPVVQZ 0DDtEAthEMPxxgal1aSdkzgT26hsccYNr+NOFkWo8meyivSfxZu6JmO83rFOckflAFom d56w== X-Gm-Message-State: AOAM5332oq4EgnrFzhkFtduPQuAnplqE2Q4w2oRz7nQTv0Y81qFZltBh V939QgUxR2Egq5J64aFdcwNXN1LUrMsJ8wk/Z74E9XMUHnTzXTU7tyXiw90NxQkuaQXL58uHk// eTzCF0UNusRvaROc= X-Received: by 2002:a5d:53ca:: with SMTP id a10mr9381046wrw.197.1628239626629; Fri, 06 Aug 2021 01:47:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmR/1MukFXuDSce3xe803K7nHGHumfXmbn6ACrelUeWFDwiVUI4/WGdMku7JMssfrJbV+Sag== X-Received: by 2002:a5d:53ca:: with SMTP id a10mr9381021wrw.197.1628239626427; Fri, 06 Aug 2021 01:47:06 -0700 (PDT) Received: from thuth.remote.csb (dynamic-046-114-147-107.46.114.pool.telefonica.de. [46.114.147.107]) by smtp.gmail.com with ESMTPSA id f3sm9073592wro.30.2021.08.06.01.47.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Aug 2021 01:47:05 -0700 (PDT) Subject: Re: [PATCH v1 09/12] hw/s390x/s390-skeys: use memory mapping to detect which storage keys to migrate To: David Hildenbrand , qemu-devel@nongnu.org References: <20210805152804.100333-1-david@redhat.com> <20210805152804.100333-10-david@redhat.com> From: Thomas Huth Message-ID: <9f614da7-e1c6-b2c9-04f1-ee8ad8c60b5e@redhat.com> Date: Fri, 6 Aug 2021 10:47:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210805152804.100333-10-david@redhat.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=216.205.24.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.699, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.132, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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: "Jason J . Herne" , Janosch Frank , Cornelia Huck , Richard Henderson , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, Claudio Imbrenda Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 05/08/2021 17.28, David Hildenbrand wrote: > Let's use the guest_phys_blocks API to get physical memory regions > that are well defined inside our physical address space and migrate the > storage keys of these. > > This is a prepearation for having memory besides initial ram defined in s/prepearation/preparation/ > the guest physical address space, for example, via memory devices. We > get rid of the ms->ram_size dependency. > > Please note that we will usually have very little (--> 1) physical > ranges. With virtio-mem might have significantly more ranges in the > future. If that turns out to be a problem (e.g., total memory > footprint of the list), we could look into a memory mapping > API that avoids creation of a list and instead triggers a callback for > each range. > > Signed-off-by: David Hildenbrand > --- > hw/s390x/s390-skeys.c | 70 ++++++++++++++++++++++++++----------------- > 1 file changed, 43 insertions(+), 27 deletions(-) Reviewed-by: Thomas Huth