Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp432251pxj; Thu, 17 Jun 2021 06:10:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwS8WaqWKM1vO6EIuJGPIdsH6ShV4aaRm1ZjHa570rYtuQO1/NJ/Dfiulkt9UPFX1T8316N X-Received: by 2002:a6b:d113:: with SMTP id l19mr3704319iob.207.1623935430438; Thu, 17 Jun 2021 06:10:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623935430; cv=none; d=google.com; s=arc-20160816; b=rvugUx9m+9hBeHB6HnL5GWhR86BT2rDmiz8LwdRPi09NLi/WohQbnNygBHgMaMgWrM 09MWkRIxCJ3Usjbh9HfYkWY+gf+AbWM7zQle6oyTB5ve8eYZu0GxaepMCdsYdJ2OJbbR BQaCQYD01w/vLYrCs8vuny/0gANtq4sTZzcDYv3BNx9DhmzZhGTPBnwy2bRS6TEHwDRf RJXsUNU91S9lM/J4MEUHf7e6XgCcNxCkowhzwBWO4Te/mAOwgxefyLoYQhsWJJ7pyTL1 DBQ805ufr9ovg7HB1OxtV+054exObIwkwiCEA5O3dIZD2/6GeQG1zFrjNFj0Eq+fCkXY dEXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=QnnBCVZQMEDuByr+6Szy/jY3Ks4s+5muwgBRtreRvgY=; b=q2rWIpcz17ymCKsrIe97boiHZsV3ybcG5GlGiXS2GnA1Az0aKYMRTN9uKv8IjPe5FF Hhg0nRkzmorcuuGevcaqqOHQN0na9+i+eoF+jI7bXldQxWVo5X4qxpzGaUZfXv42PwtI rVU45Cj/0pzraDZDtWZI9xh5ZhSeLP1+jmkhSrtfzn+Pc5J2tubvQyj59NzwxiKrT6On HqW3IE7oyC88jCsEun0Ig2IkEtr7/6gepioc7bkeW4xky61fGZsNYSSdz/my/SIkePuN xCN53aN2I5JiUTUV+Ec+7P8RkF0Bcx0txyh1bT4ly3xhzF0scw0UU+jDvurwVZpgmsYf F78g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t17si5511219jaj.108.2021.06.17.06.10.15; Thu, 17 Jun 2021 06:10:30 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232239AbhFQLAm (ORCPT + 99 others); Thu, 17 Jun 2021 07:00:42 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:4836 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232220AbhFQLAi (ORCPT ); Thu, 17 Jun 2021 07:00:38 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4G5JnL45XGzXgrg; Thu, 17 Jun 2021 18:53:26 +0800 (CST) Received: from dggpemm500023.china.huawei.com (7.185.36.83) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 17 Jun 2021 18:58:28 +0800 Received: from DESKTOP-TMVL5KK.china.huawei.com (10.174.187.128) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 17 Jun 2021 18:58:28 +0800 From: Yanan Wang To: Marc Zyngier , Will Deacon , "Quentin Perret" , Alexandru Elisei , , , , CC: Catalin Marinas , James Morse , Julien Thierry , "Suzuki K Poulose" , Gavin Shan , , , , Yanan Wang Subject: [PATCH v7 1/4] KVM: arm64: Introduce two cache maintenance callbacks Date: Thu, 17 Jun 2021 18:58:21 +0800 Message-ID: <20210617105824.31752-2-wangyanan55@huawei.com> X-Mailer: git-send-email 2.8.4.windows.1 In-Reply-To: <20210617105824.31752-1-wangyanan55@huawei.com> References: <20210617105824.31752-1-wangyanan55@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.187.128] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500023.china.huawei.com (7.185.36.83) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. + * @invalidate_icache: Invalidate the instruction cache for the + * specified memory address range. */ struct kvm_pgtable_mm_ops { void* (*zalloc_page)(void *arg); @@ -54,6 +60,8 @@ struct kvm_pgtable_mm_ops { int (*page_count)(void *addr); void* (*phys_to_virt)(phys_addr_t phys); phys_addr_t (*virt_to_phys)(void *addr); + void (*clean_invalidate_dcache)(void *addr, size_t size); + void (*invalidate_icache)(void *addr, size_t size); }; /** -- 2.23.0