Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1293415pxj; Fri, 18 Jun 2021 04:05:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKlTmZA59reD/dx8uErlantvDNLJxxEgDCQF3uQAlmRPalcVTB1JE2UYoNs+FXPeXsqEEs X-Received: by 2002:a17:906:7c10:: with SMTP id t16mr10116061ejo.204.1624014324836; Fri, 18 Jun 2021 04:05:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624014324; cv=none; d=google.com; s=arc-20160816; b=ECgiRO44/Qr4gKo6yy7bWrc3j1aUfPu/b6o5GSNgamRreSeX7xw8Zwi9ynnhhDkLf7 hgDODvJy0uPiVNjrgyjij3lxW7tgEfbcy6D4R5h9pr4ZYbUJFfAglflynrrPV6psAY9j 4hMieHKcJ2fAvMZ7EungJ2bJU/b+QlOl32SH3/wJYcaMxI1eY6OPDr0YgPkqx7IrTBSX ISy8g+PQBufEMctNHnLhmMlJx9ghjPu0ZEv2i7RvU/wedD34eG8ph+ArqtOpSI2tAefT I+lzXfpovuAi0IwbQwGEC3+hb6AIvVHV51z7Z0boVfUaCMgCUG1MzeIh5MHpkTuSmbQl qwpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kxWq/w4pUVc8HOlAC++EsNgPCdWz4WRSzn6eNlOcpd8=; b=InTjr6shxi/ePkeqebMI+dYVE7mA40eko7fwPaY/TfHm/RP28mnFtjsZcoUJNBUBY8 6ogWCi0g+A+OGbu/kPFr7bJBDpNa5xbYshZx0zIDGZ2wgCJ7ddFYU9tfNkKVp4bwPFDt VSqb4gdapYZkoNm9rVU5ajIKGTkzYDU+faxBwUbOS4bRYH3nOifAc2DRo4x7D1vlxN3t TylmHBjLUEq6jJBeBLXfA5VvoWZC/nSg+KgKYkbMINUcVf8SDUUGmHzv5JagZXeSoXm8 zqk8KgVlGf1ePBRcdDZcrwcPt8nt82arfu4dojAx+pazMLh287MhGPM4o28WeD+5k0cJ E5vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=bhaMQb0W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id og3si2283134ejc.48.2021.06.18.04.05.02; Fri, 18 Jun 2021 04:05:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=bhaMQb0W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232371AbhFRJB4 (ORCPT + 99 others); Fri, 18 Jun 2021 05:01:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230076AbhFRJBz (ORCPT ); Fri, 18 Jun 2021 05:01:55 -0400 Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA5FAC06175F for ; Fri, 18 Jun 2021 01:59:45 -0700 (PDT) Received: by mail-ot1-x32d.google.com with SMTP id k10-20020a056830168ab029044d922f6a45so641314otr.7 for ; Fri, 18 Jun 2021 01:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kxWq/w4pUVc8HOlAC++EsNgPCdWz4WRSzn6eNlOcpd8=; b=bhaMQb0WGrbDqa+aKHcQIksSIM+zTHdcqFfPBr5BV5rr/Wi8UST4PtBaFBBmWA70/c JeE4Hu4BbtwFqF0c80sjfACvvB1nesUeK9TieyU/oqhdgOex7UgfdkqRux0UxZ5/TcHT DLHvuKVExIhZtgV1fPhYLr/Md+zpFpFjNVpAPjGlXCP+m9MsUwKdcLN7akLZFoz7RcTk 238s+sJ/BuekxpTMYI4dcJE/HjWwxIUM3JYIJt/VdYH2Zb8cmBY3gzekVcESfoAgP54o bIIHlFX/dEToFLWW+5NXkS2fXPFEuRa4egZ9ULCaZiOK2z8px8znd93Nlh17ZN0KkdrP Dwpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kxWq/w4pUVc8HOlAC++EsNgPCdWz4WRSzn6eNlOcpd8=; b=D35BBlpfuihu30kDGLIIslTzw38n7mnMfYnbyfhwM5v9HZx3moiEvbBC4nLPiAH0iu lQMZqEc8Q6/1flHzNTkP8cEv4quhPEgvKiypeEjUbrb/gijzvRU77aUqhcUVSb/neti6 s6ZgPNYWb91gz0V6BmYtfX+2YjKTF8JAHBjcocL/X0TMJkSIYUIjspUqmjTZgUCrZrlL cMoYahTb5VOX3Zd+CGjbRcH9R4dhzMR6vcl7F4Wp8zV/gMqZ9gIeNQI69u1tJn6+9V8n QL2DtYV0Zt2UQnlvlulVrs+rws8ta81AwIFxbJcokVDEg3F6zCTzCc0VNYST44Gas8Y6 DneA== X-Gm-Message-State: AOAM531pI501Q0brx8b1X74FKfWa+/8aD/OkaawLLttGMwR4HOaPfQ3G 4Iljb8fLp9zg5i0cQGUvSxUacq3V3LVbo8GVVakP1A== X-Received: by 2002:a05:6830:1598:: with SMTP id i24mr8497546otr.52.1624006785056; Fri, 18 Jun 2021 01:59:45 -0700 (PDT) MIME-Version: 1.0 References: <20210617105824.31752-1-wangyanan55@huawei.com> <20210617105824.31752-2-wangyanan55@huawei.com> <20210617123837.GA24457@willie-the-truck> <87eed0d13p.wl-maz@kernel.org> <2c1b9376-3997-aa7b-d5f3-b04da985c260@huawei.com> In-Reply-To: <2c1b9376-3997-aa7b-d5f3-b04da985c260@huawei.com> From: Fuad Tabba Date: Fri, 18 Jun 2021 09:59:09 +0100 Message-ID: Subject: Re: [PATCH v7 1/4] KVM: arm64: Introduce two cache maintenance callbacks To: "wangyanan (Y)" Cc: Marc Zyngier , Will Deacon , kvm@vger.kernel.org, Catalin Marinas , linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, Jun 18, 2021 at 2:52 AM wangyanan (Y) wrote: > > > > On 2021/6/17 22:20, Marc Zyngier wrote: > > On Thu, 17 Jun 2021 13:38:37 +0100, > > Will Deacon wrote: > >> On Thu, Jun 17, 2021 at 06:58:21PM +0800, Yanan Wang wrote: > >>> To prepare for performing CMOs for guest stage-2 in the fault handlers > >>> in pgtable.c, here introduce two cache maintenance callbacks in struct > >>> kvm_pgtable_mm_ops. We also adjust the comment alignment for the > >>> existing part but make no real content change at all. > >>> > >>> Signed-off-by: Yanan Wang > >>> --- > >>> arch/arm64/include/asm/kvm_pgtable.h | 42 +++++++++++++++++----------- > >>> 1 file changed, 25 insertions(+), 17 deletions(-) > >>> > >>> diff --git a/arch/arm64/include/asm/kvm_pgtable.h b/arch/arm64/include/asm/kvm_pgtable.h > >>> index c3674c47d48c..b6ce34aa44bb 100644 > >>> --- a/arch/arm64/include/asm/kvm_pgtable.h > >>> +++ b/arch/arm64/include/asm/kvm_pgtable.h > >>> @@ -27,23 +27,29 @@ typedef u64 kvm_pte_t; > >>> > >>> /** > >>> * struct kvm_pgtable_mm_ops - Memory management callbacks. > >>> - * @zalloc_page: Allocate a single zeroed memory page. The @arg parameter > >>> - * can be used by the walker to pass a memcache. The > >>> - * initial refcount of the page is 1. > >>> - * @zalloc_pages_exact: Allocate an exact number of zeroed memory pages. The > >>> - * @size parameter is in bytes, and is rounded-up to the > >>> - * next page boundary. The resulting allocation is > >>> - * physically contiguous. > >>> - * @free_pages_exact: Free an exact number of memory pages previously > >>> - * allocated by zalloc_pages_exact. > >>> - * @get_page: Increment the refcount on a page. > >>> - * @put_page: Decrement the refcount on a page. When the refcount > >>> - * reaches 0 the page is automatically freed. > >>> - * @page_count: Return the refcount of a page. > >>> - * @phys_to_virt: Convert a physical address into a virtual address mapped > >>> - * in the current context. > >>> - * @virt_to_phys: Convert a virtual address mapped in the current context > >>> - * into a physical address. > >>> + * @zalloc_page: Allocate a single zeroed memory page. > >>> + * The @arg parameter can be used by the walker > >>> + * to pass a memcache. The initial refcount of > >>> + * the page is 1. > >>> + * @zalloc_pages_exact: Allocate an exact number of zeroed memory pages. > >>> + * The @size parameter is in bytes, and is rounded > >>> + * up to the next page boundary. The resulting > >>> + * allocation is physically contiguous. > >>> + * @free_pages_exact: Free an exact number of memory pages previously > >>> + * allocated by zalloc_pages_exact. > >>> + * @get_page: Increment the refcount on a page. > >>> + * @put_page: Decrement the refcount on a page. When the > >>> + * refcount reaches 0 the page is automatically > >>> + * freed. > >>> + * @page_count: Return the refcount of a page. > >>> + * @phys_to_virt: Convert a physical address into a virtual address > >>> + * mapped in the current context. > >>> + * @virt_to_phys: Convert a virtual address mapped in the current > >>> + * context into a physical address. > >>> + * @clean_invalidate_dcache: Clean and invalidate the data cache for the > >>> + * specified memory address range. > >> This should probably be explicit about whether this to the PoU/PoC/PoP. > > Indeed. I can fix that locally if there is nothing else that requires > > adjusting. > Will be grateful ! Sorry, I missed the v7 update. One comment here is that the naming used in the patch series I mentioned shortens invalidate to inval (if you want it to be less of a mouthful): https://lore.kernel.org/linux-arm-kernel/20210524083001.2586635-19-tabba@google.com/ Otherwise: Reviewed-by: Fuad Tabba Thanks! /fuad > > Thanks, > Yanan > . > > > > M. > > > > _______________________________________________ > kvmarm mailing list > kvmarm@lists.cs.columbia.edu > https://lists.cs.columbia.edu/mailman/listinfo/kvmarm