Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp290325ybe; Wed, 18 Sep 2019 17:25:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdJKOB4VtZF4PYs8ZD9aBql9BbzvvxpzDMYzuaFyBlNuEUKZZ0IJn9eyldAgrIBvzx+2YF X-Received: by 2002:aa7:db43:: with SMTP id n3mr12978687edt.136.1568852747589; Wed, 18 Sep 2019 17:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568852747; cv=none; d=google.com; s=arc-20160816; b=jgpAo3d9NJndlBdC1ecxhainBCyRzuFBvt86Ifyevtfjjs15B8tclDIutEx99PegdI fHGX3KPPfR8ONd7WjcBsU39zXO9nr6tPNdo2BQAf5LXXThlW6OhXJCkqLkRWdFK9UAWh qAcp+vkxGbNsOUQMPY4VUVWyGMBKoCVSpBQBsMakNL9WetIv8v2ZH8rmtY3/3VFuELsf tR+mI0xgS/Cg0KW396YBEcSZ7HexMj5zbVjPSMmePe/2Zxy5Bsr2B2UsbDYIcXT02a/3 Mbm138s8sAFK5sCCUeEEnLmg39XC5Mmu93BUymvjg4+HH2Gqjxts5tcCYrc0nfpaScmV Z2nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=yuWRiwMPkmai8ORYZuQLgM5VySGSpAfwh5rTjrm3mgg=; b=yMV/B1Ryr2oMkYKZY1ADguEZOOo4TdsLJBxEVtz9ywpGcpSdd/it7kmk+GDQNWZHPf 9TX7beYUoJ5lgjYKktOtPrkwenFEGPYrsrnbgo8pKz6PEERHd/YvR5FVq6s3Gf46V8/J HVdl+t/LHk+IsOTKypRnuoQ7romeWG3W+rqP6qYptYu459erZJKw3lPJWe13XFdMq8sy pRg7tWsC/SIl45LFAAiU8kld+QiVKcfZm1CzBAwbYsSRq8UFevAn9s8ipIqXncJV/95A 6Dh9Pi0+u0TfVKqCGtjOEypsyUx0vPyiK8qGNLSedaCjvLDyg2IhfvD3rQ5Q70ViYMCV XtnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ozlabs.org header.s=201707 header.b=Nt4NYXLQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ozlabs.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y64si4365322edy.434.2019.09.18.17.25.23; Wed, 18 Sep 2019 17:25:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ozlabs.org header.s=201707 header.b=Nt4NYXLQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ozlabs.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730716AbfISAXf (ORCPT + 99 others); Wed, 18 Sep 2019 20:23:35 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:59765 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728516AbfISAXf (ORCPT ); Wed, 18 Sep 2019 20:23:35 -0400 Received: by ozlabs.org (Postfix, from userid 1003) id 46YcyX5cBKz9sNf; Thu, 19 Sep 2019 10:23:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1568852612; bh=cu6MqzQ+Jjg6jBgAMHqPfsdtuEEEpXwelfg4ezvXdsY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Nt4NYXLQPNaOq5EaXwA6J6CUQqtE4sYHQnvkHZSOhCjqqWJ01CdAB4tfDaD7elmpm n8+n+jy0vrYBX7bhjUejT61fggDfeR0cgCIUnTuqNkpIC0IXNlLj5BQyxdJITIPcBR mnSFYsZrVTQqPYzswqowK1En17cvpVKAST5slijgNdV7bpZykh7hDKsvP4WJVNLb/9 Ol1XIqjO/OL2LCmIx/vGzkgBlQMKHpTE8RacF1q2tw33WNlisVf3Zmdf+cisE74bOX ghUTBd1CuYuzqzcB8Zaw4KJe2JcyTf9IC7kOu6x2wrhVjXAyrW69MyKAvq+7wse73h GRj1zPawfFkIQ== Date: Thu, 19 Sep 2019 10:22:42 +1000 From: Paul Mackerras To: Sean Christopherson Cc: James Hogan , Christian Borntraeger , Janosch Frank , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Marc Zyngier , David Hildenbrand , Cornelia Huck , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , James Morse , Julien Thierry , Suzuki K Pouloze , linux-mips@vger.kernel.org, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Subject: Re: [PATCH 10/13] KVM: Provide common implementation for generic dirty log functions Message-ID: <20190919002242.GA19503@blackberry> References: <20190911185038.24341-1-sean.j.christopherson@intel.com> <20190911185038.24341-11-sean.j.christopherson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190911185038.24341-11-sean.j.christopherson@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 11, 2019 at 11:50:35AM -0700, Sean Christopherson wrote: > Move the implementations of KVM_GET_DIRTY_LOG and KVM_CLEAR_DIRTY_LOG > for CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT into common KVM code. > The arch specific implemenations are extremely similar, differing > only in whether the dirty log needs to be sync'd from hardware (x86) > and how the TLBs are flushed. Add new arch hooks to handle sync > and TLB flush; the sync will also be used for non-generic dirty log > support in a future patch (s390). > > The ulterior motive for providing a common implementation is to > eliminate the dependency between arch and common code with respect to > the memslot referenced by the dirty log, i.e. to make it obvious in the > code that the validity of the memslot is guaranteed, as a future patch > will rework memslot handling such that id_to_memslot() can return NULL. I notice you add empty definitions of kvm_arch_sync_dirty_log() for PPC, both Book E and Book 3S. Given that PPC doesn't select CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT, why is this necessary? Paul.