From patchwork Tue Feb 26 14:09:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tianyu Lan X-Patchwork-Id: 10830305 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2192F1399 for ; Tue, 26 Feb 2019 14:09:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B7FB2B6B9 for ; Tue, 26 Feb 2019 14:09:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2FFE2BAF0; Tue, 26 Feb 2019 14:09:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C33B2BB38 for ; Tue, 26 Feb 2019 14:09:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726810AbfBZOJh (ORCPT ); Tue, 26 Feb 2019 09:09:37 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:33808 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbfBZOJh (ORCPT ); Tue, 26 Feb 2019 09:09:37 -0500 Received: by mail-pl1-f194.google.com with SMTP id d15so6315715plr.1; Tue, 26 Feb 2019 06:09:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uhliVxb4ys30IUASAOX1iohI7f1IEN6Ho0oCZTBoeuE=; b=o6RsOIS1ya7DtnttYYfCtj8BEMGgkAA/bW0z4DvTp7k2Ps2D9BUPxvPluBVbvTU7yA yJ9ad4Opx/7kXtaeES2ynO+1vhOXHMX0Zv7NUdTyHXBunZiOrohtVZQVxoDFAdZvwXsM XMmsq3iEIQ9OAOcX8UEfeMavv5xe0aqX48C0jtuxuuqSpE+Qt0rnMOt8+p6nKcVd0StJ kBl3cuKrAYwEfWHidI19Tpo0IX3vF+KmQwE+Qh8tIerDKHltNHOm5D1KLR/GJWCe6zqH Lv/KPpBb9ANKlbyEFqO9KELiRYaSrYQGMlK3anuUwBFd7sagc4zGl7zkIxtfnzjZQrFk SIEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uhliVxb4ys30IUASAOX1iohI7f1IEN6Ho0oCZTBoeuE=; b=WJ1c3OHxP4UT2do1Pr22oJY2LjQTySBKPtXQxWdYXa8GLeutiDbAGZU3DRdsvUPCLh 3SgBmmhkzmShnyM3UcIzYWifytV0Kf7YuZhQEQePVcyuNFyxcfOo1fUifb9WdYQr3JpQ yfgTlk8JFuANbRL4i8XGjyM+wt/hXrtRYNi0N9aENHDICbXssmmepLCuIRQIDPkCAS29 qnPw6gmfEV9wTx7emqhFwMroJfdHotEm6ztcOpTJKQcIFrnyWH1q/ryc7AVKjRRtjxpd OZvbAyoyBEUEzslxF0TBn8TeHD39FT+5gZYRI/hMpyzPBD39zbhRwoa5ADGRu7X4pKOY Fh4w== X-Gm-Message-State: AHQUAuYq2Z6S9JCltuCCujGakqtVezFrHDeI5JDfjBVEWf19gWUTVm8x lqI2sFaaLRxoyhR+Vn0PwvA= X-Google-Smtp-Source: AHgI3IaFWOIt2VMGD6s8omAMJOP4iMJqxdqAm1SpDNPUCTZP4gSETd4fRTr2KqsWntm1fLoEHy7pOw== X-Received: by 2002:a17:902:6b47:: with SMTP id g7mr26987198plt.100.1551190176895; Tue, 26 Feb 2019 06:09:36 -0800 (PST) Received: from localhost.corp.microsoft.com ([167.220.255.67]) by smtp.googlemail.com with ESMTPSA id k64sm41773182pfj.69.2019.02.26.06.09.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Feb 2019 06:09:36 -0800 (PST) From: lantianyu1986@gmail.com X-Google-Original-From: Tianyu.Lan@microsoft.com To: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, sashal@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, pbonzini@redhat.com, rkrcmar@redhat.com, michael.h.kelley@microsoft.com, vkuznets@redhat.com Cc: Lan Tianyu , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-hyperv@vger.kernel.org Subject: [Update PATCH V3 1/10] X86/Hyper-V: Add parameter offset for hyperv_fill_flush_guest_mapping_list() Date: Tue, 26 Feb 2019 22:09:16 +0800 Message-Id: <20190226140916.22369-1-Tianyu.Lan@microsoft.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20190222150637.2337-2-Tianyu.Lan@microsoft.com> References: <20190222150637.2337-2-Tianyu.Lan@microsoft.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Lan Tianyu Add parameter offset to specify start position to add flush ranges in guest address list of struct hv_guest_mapping_flush_list. Signed-off-by: Lan Tianyu --- Update "offset" parameter's type of hyperv_fill_flush_guest_mapping_list() arch/x86/hyperv/nested.c | 4 ++-- arch/x86/include/asm/mshyperv.h | 2 +- arch/x86/kvm/vmx/vmx.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/hyperv/nested.c b/arch/x86/hyperv/nested.c index dd0a843f766d..d54c2276c922 100644 --- a/arch/x86/hyperv/nested.c +++ b/arch/x86/hyperv/nested.c @@ -58,11 +58,11 @@ EXPORT_SYMBOL_GPL(hyperv_flush_guest_mapping); int hyperv_fill_flush_guest_mapping_list( struct hv_guest_mapping_flush_list *flush, - u64 start_gfn, u64 pages) + u32 offset, u64 start_gfn, u64 pages) { u64 cur = start_gfn; u64 additional_pages; - int gpa_n = 0; + int gpa_n = offset; do { /* diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h index cc60e617931c..8b63ed95780e 100644 --- a/arch/x86/include/asm/mshyperv.h +++ b/arch/x86/include/asm/mshyperv.h @@ -357,7 +357,7 @@ int hyperv_flush_guest_mapping_range(u64 as, hyperv_fill_flush_list_func fill_func, void *data); int hyperv_fill_flush_guest_mapping_list( struct hv_guest_mapping_flush_list *flush, - u64 start_gfn, u64 end_gfn); + u32 offset, u64 start_gfn, u64 end_gfn); #ifdef CONFIG_X86_64 void hv_apic_init(void); diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 4950bb20e06a..77b5379e3655 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -433,7 +433,7 @@ static int kvm_fill_hv_flush_list_func(struct hv_guest_mapping_flush_list *flush { struct kvm_tlb_range *range = data; - return hyperv_fill_flush_guest_mapping_list(flush, range->start_gfn, + return hyperv_fill_flush_guest_mapping_list(flush, 0, range->start_gfn, range->pages); }