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=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 E01F8C4CEC4 for ; Thu, 19 Sep 2019 00:23:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B2ECC218AE for ; Thu, 19 Sep 2019 00:23:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ozlabs.org header.i=@ozlabs.org header.b="Nt4NYXLQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730791AbfISAXg (ORCPT ); Wed, 18 Sep 2019 20:23:36 -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.