Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp562419rwb; Tue, 27 Sep 2022 01:08:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4JfO8NIhfqmRxQbvaRyvkfhEvX5db7oeeMCcnYrSOCU/VvExQOiXo+/zVhH/xk8zm02AJU X-Received: by 2002:a05:6402:4148:b0:440:cb9f:d10f with SMTP id x8-20020a056402414800b00440cb9fd10fmr26502177eda.77.1664266106539; Tue, 27 Sep 2022 01:08:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664266106; cv=none; d=google.com; s=arc-20160816; b=NU8GHoMU71JHH6JcDcketegI4Wi3oOYZgieN/NsUr1WgeTNbJMbpscs8tIs9KB2ypI WDCak2DhY/mDKUtlIRTXaHIPW9uv9bmPsvNOoDqs7s19L9GGXTZwnzDTQZoXlHY+uroC 5rmx0ddt0tVS0x1kaHBOlXwMjOCp4136h+zIla3r56h7amJnpYD9pTrm02hP4ViX7Aze c0/GbOx63NsFFkvmYVx2GRb9fRmc8rbYYbT9Gb0wUB9nNRnApF4vOGvmimScaY19mvKm Q7PqP/zHtoyi35mC2oVuVRJytRs1G/Vh1vG7J6NHsTH9T8EKHT8XpB90Oj57P0YKmm+Q 90PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=RtXJbKHZYC18WG/J6u7uWLr7/k/wdJ+NHytl4cI7JSI=; b=BbsVUmGSjmrclbrfbwn+gTYzugJGRG1GGmRE3D/r3Per/FkBsMWmh1PfbPMOWb/He9 bz7QaQZykK/qYPKabyAg7vAXAVJFpP97g5xhvaVr77dQyzeCkRzvsAvy6MScPEfuoNaV bNrTsoc3a2025gNNZvaOrQwGMGz5Bh5wyGfA1qmIAQqR6ndUvVUUT2BIP0kG82/A5UFV 8hoCo97Sd8F6QhE4lZU0wh+MyUA5Bd8VKHSXsr+ewhoMg8ZXOlDdYXF4ReWf8+IZCRi4 0nYhg9AiGSLyv3ZhASrFmB6+5NuEigqw9YCS03OZgqmKrWWpiOrTkP+5GKMWESVf5h9A QY2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LGZJPQlK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l17-20020a056402255100b00451a9bc10casi1336559edb.196.2022.09.27.01.07.59; Tue, 27 Sep 2022 01:08:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LGZJPQlK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230480AbiI0HqW (ORCPT + 99 others); Tue, 27 Sep 2022 03:46:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230469AbiI0HqS (ORCPT ); Tue, 27 Sep 2022 03:46:18 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 288F05C9DC for ; Tue, 27 Sep 2022 00:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664264774; 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=RtXJbKHZYC18WG/J6u7uWLr7/k/wdJ+NHytl4cI7JSI=; b=LGZJPQlKMm8PLVW1tkHX7HSkDJgFLX/6DXqbRqnXXeJoLrza4cc7a0CBiyt5+K//9FzieT C1WK93elw7C5VKvet+RbPAoPKrxIl7dPZGNwG4nmBYcXOGSXTq1MDSuQFmmdgWA7ipQLLd rw2Frc+bfhWyeaJZhVVBO9PO6CUZkCI= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-584-lCj0akHfPwm2CoLPVr-TYQ-1; Tue, 27 Sep 2022 03:46:10 -0400 X-MC-Unique: lCj0akHfPwm2CoLPVr-TYQ-1 Received: by mail-wr1-f71.google.com with SMTP id a13-20020adfbc4d000000b00228631ddfafso1863884wrh.9 for ; Tue, 27 Sep 2022 00:46:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=RtXJbKHZYC18WG/J6u7uWLr7/k/wdJ+NHytl4cI7JSI=; b=FYoAMqaCCgIDd4ZOiDqejvh94oPT9H4h0QFGfCHpEb5GrDkDt9w6UsXel6g25U5hij C7ZP7/Xewgfh74VeEUfI/JdI8BVSwhtFpYhuX8rjcxfDGCsiKzkdk6sdo94t8VzWxpck 76ruzjQtdLexJx/y3nl+P88QtlJpkM6A4zJrVP8j+GY5yaw5HzFE+US9vqit3DXsXjaJ eHWYzDjBFi9Jw1q7w4md+YIPhVeNw/qcBK7dhxh+TNZYHQSj0zQDYaVvPTWtQpwvIDEP ZBqYsl9ecsN5ud38h26Upv9S7j0xHm78hvbz0yDYvmAbY5gUQ2sYIKsBWToUGq5XoPT3 kJFw== X-Gm-Message-State: ACrzQf09cux+fSmybp8zkmcQJZGPv8EjplwcEG5SW0JBbnOBSBpTbJ5t KYZXM9gKYzQau8caVXwuc5KHZpDj3VxGlQge62yRY+1BJhwm3byrO8ZlYCJw0WkcL6q/fK6Agy3 2WygkpFDGX7kQ3b6sfxB5+rjn X-Received: by 2002:adf:d1c6:0:b0:228:dff6:77b8 with SMTP id b6-20020adfd1c6000000b00228dff677b8mr16340439wrd.115.1664264769540; Tue, 27 Sep 2022 00:46:09 -0700 (PDT) X-Received: by 2002:adf:d1c6:0:b0:228:dff6:77b8 with SMTP id b6-20020adfd1c6000000b00228dff677b8mr16340419wrd.115.1664264769304; Tue, 27 Sep 2022 00:46:09 -0700 (PDT) Received: from ?IPV6:2003:cb:c705:ff00:9ec2:6ff6:11a1:3e80? (p200300cbc705ff009ec26ff611a13e80.dip0.t-ipconnect.de. [2003:cb:c705:ff00:9ec2:6ff6:11a1:3e80]) by smtp.gmail.com with ESMTPSA id bg42-20020a05600c3caa00b003a5f4fccd4asm14115656wmb.35.2022.09.27.00.46.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Sep 2022 00:46:08 -0700 (PDT) Message-ID: Date: Tue, 27 Sep 2022 09:46:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [RFC PATCH 9/9] kvm_main.c: handle atomic memslot update Content-Language: en-US To: Emanuele Giuseppe Esposito , kvm@vger.kernel.org Cc: Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Maxim Levitsky , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org References: <20220909104506.738478-1-eesposit@redhat.com> <20220909104506.738478-10-eesposit@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220909104506.738478-10-eesposit@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09.09.22 12:45, Emanuele Giuseppe Esposito wrote: > When kvm_vm_ioctl_set_memory_region_list() is invoked, we need > to make sure that all memslots are updated in the inactive list > and then swap (preferreably only once) the lists, so that all > changes are visible immediately. > > The only issue is that DELETE and MOVE need to perform 2 swaps: > firstly replace old memslot with invalid, and then remove invalid. > I'm curious, how would a resize (grow/shrink) or a split be handled? -- Thanks, David / dhildenb