Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B9A1C433F5 for ; Wed, 1 Dec 2021 01:08:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346067AbhLABLo (ORCPT ); Tue, 30 Nov 2021 20:11:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241106AbhLABLU (ORCPT ); Tue, 30 Nov 2021 20:11:20 -0500 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6109C061574 for ; Tue, 30 Nov 2021 17:08:00 -0800 (PST) Received: by mail-pg1-x52f.google.com with SMTP id r138so21689199pgr.13 for ; Tue, 30 Nov 2021 17:08:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=vbRT8aXA3F1xt3PU8F3O8agTqIaZlbDpUx5b8CZCQKY=; b=fT5iWAGZX+tpuhGkx/az1x5XGClubCRCkpS/kkCJTV1/53Yx3PUbOe9L1df2WtXSt+ AKZKjPqXgpiF2ya71hO4+ewV37JU7xx461fYNP5jIyMNyADtvVLswuURNf5mFl+xUagL CN0eMhGMZo9pv7hYyCr/dOc8QKCASC00WIXlKcr0bW0ET7iatUb7Ohd7QylxEPJHtjLq TbQZiZndthKKq7i+qvfI0urd1fUyR6xgl0YDaybr0kL7I7LCuE1jnIGOOj5+IADI5hy1 v2D0EnTLgVmNjW1SkQczO1tTXivxHClJnpgKUHiPqwN+0SWyEGRjNJWP0btYog4LBEUN KZxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vbRT8aXA3F1xt3PU8F3O8agTqIaZlbDpUx5b8CZCQKY=; b=eyio/fNYhmOfYfOp0qPe2IhbWF67cpUdJZ3DCQoB+2VZp8jU1MGldhc9ilDW4clB4t Jla0zKeQpOo6mjjfWn886lkOOMTEfQihsjxPfGO0+OQ+hciMxqOpcogILQDTcJTYFXvc gNkY8Y2vrCINK2nOQohyR+j/21XN0vQRA1l7vDG1SPioRasQ+svlq1ehmlum0uRqsCCg JrwDaaN5ZgprbcnGChfQAx8LX/2CBzb36iJZz74x5tLAG6LYN/J/N7bgS76oOVj/9UXK Et/zYP4gYIpa1EsuCYuUo0LxtcPCcMlg6Ymgudn8Qqu6rhmElQgS1Pm7UaF1kbrLqTTB 5HSw== X-Gm-Message-State: AOAM532zMdWgQi74cdBILxer/xArVVtf8zQ8C1BhDkahqcU4Px47pNEx rw+99eEMIuTGi2ZUMdvVZDSNQw== X-Google-Smtp-Source: ABdhPJzC1qeyr70CZme3ye39kJgvSth76594RljQ4Bv+NT1siBBapSHrb4rL7Ge5ghX0RunE32HUpw== X-Received: by 2002:a05:6a00:2349:b0:4a8:d87:e8ad with SMTP id j9-20020a056a00234900b004a80d87e8admr2962268pfj.15.1638320880128; Tue, 30 Nov 2021 17:08:00 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id m24sm15869121pgk.39.2021.11.30.17.07.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 17:07:59 -0800 (PST) Date: Wed, 1 Dec 2021 01:07:56 +0000 From: Sean Christopherson To: "Maciej S. Szmigiero" Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Igor Mammedov , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Christian Borntraeger , Janosch Frank , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandru Elisei , Atish Patra , Ben Gardon , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 03/29] KVM: Resync only arch fields when slots_arch_lock gets reacquired Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 30, 2021, Maciej S. Szmigiero wrote: > From: "Maciej S. Szmigiero" > > There is no need to copy the whole memslot data after releasing > slots_arch_lock for a moment to install temporary memslots copy in > kvm_set_memslot() since this lock only protects the arch field of each > memslot. > > Just resync this particular field after reacquiring slots_arch_lock. > > Note, this also eliminates the need to manually clear the INVALID flag > when restoring memslots; the "setting" of the INVALID flag was an > unwanted side effect of copying the entire memslots. > > Since kvm_copy_memslots() has just one caller remaining now > open-code it instead. > > Signed-off-by: Maciej S. Szmigiero > [sean: tweak shortlog, note INVALID flag in changelog, revert comment] > Signed-off-by: Sean Christopherson Heh, I think you can drop my SoB? This is new territory for me, I don't know the rules for this particular situation. Reviewed-by: Sean Christopherson