From patchwork Fri Feb 22 10:48:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tianyu Lan X-Patchwork-Id: 10825665 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 2E9521390 for ; Fri, 22 Feb 2019 10:49:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B2FD3059C for ; Fri, 22 Feb 2019 10:49:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C746305A2; Fri, 22 Feb 2019 10:49:10 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,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 AEF233059C for ; Fri, 22 Feb 2019 10:49:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726269AbfBVKs7 (ORCPT ); Fri, 22 Feb 2019 05:48:59 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:40128 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725944AbfBVKs7 (ORCPT ); Fri, 22 Feb 2019 05:48:59 -0500 Received: by mail-pl1-f196.google.com with SMTP id bj4so937471plb.7; Fri, 22 Feb 2019 02:48:58 -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; bh=fAdmP+5W2W/Twor/fTlS5H793IUgC5hKNOYFaD43O34=; b=FqATnabAuhdjzOFmA7muuqFvjvMujtxYxRjpDFEAxLf11ADpWVnIZj3iVGNrpVkQBx RytuZrK9JgZqSTPsAwCeWohP3xkqhk+RNLPJ1b9VKX2VhgJRYmMtyxdaGlX8MsR/l6DF CvKXofCbGDPSXM5EtCtrsZiMaS1QQyT+K7PxFwgTE3QOkAnPCRMlDwFwQMuVUkoRTQan k10yCDtu5ThjFk+Aeutpv5bY8WZIx0MIJpZttJOv3c5lZBHHKYgpqdREZVXvmxXO7yYc u7E9XBAKpGtBDWREuWjgv6/LMJg977Xq5miaMoz9WHpbLHajNXqDDbFwY8pIrLTwNY5v GIdQ== 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; bh=fAdmP+5W2W/Twor/fTlS5H793IUgC5hKNOYFaD43O34=; b=kL6X3tcYwKKAv/DqdjuEGbG5oKDYL+/LPoIQysa+/knmS4KqrM1HezPQeQI1RW5U4K UVui9m2lqSaXkzTqNfv8pyGFGuxcI9OiWG+eebyW5TNecjRloQWbZdokmswRfHTFSR8y JAnsQv9N7bnP7BHFV9y7U8wVmg+2BBjvTHr88kVu07i5LVSKuBRAP6M7IRiR0xn07rC/ nY8H8BcZ1+tDxxHqrKBenpPPJr7TGIxaTSvRZXigXSKVocopi93mHAblIBUc4NsSO3u/ CYbs4GRQMz6A/Kd/slsSw81lja4fMoBli6tYXqwvfgxIGIUTit1YxhZi3xkQe8s0INXz zKsQ== X-Gm-Message-State: AHQUAuYgN81azBHTKdAoYj4Y2ntvWpgXnM2OpXGoSNe4S480IFAxOLQ7 fcMUP9BjlCc6guuJbylQpfM= X-Google-Smtp-Source: AHgI3IaWjASUkU76oUdbWtkNzBsHKRTATh6auh3QEUS7vFmP2A0HufUijwD4ASth6YBG5heidDYPPw== X-Received: by 2002:a17:902:f24:: with SMTP id 33mr3570610ply.65.1550832538475; Fri, 22 Feb 2019 02:48:58 -0800 (PST) Received: from localhost.corp.microsoft.com ([167.220.255.67]) by smtp.googlemail.com with ESMTPSA id t71sm1537822pgd.15.2019.02.22.02.48.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Feb 2019 02:48:57 -0800 (PST) From: lantianyu1986@gmail.com X-Google-Original-From: Tianyu.Lan@microsoft.com Cc: Lan Tianyu , 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, devel@linuxdriverproject.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, michael.h.kelley@microsoft.com, vkuznets@redhat.com, stable@vger.kernel.org Subject: [PATCH] x86/Hyper-V: Fix definition HV_MAX_FLUSH_REP_COUNT Date: Fri, 22 Feb 2019 18:48:44 +0800 Message-Id: <20190222104844.1847-1-Tianyu.Lan@microsoft.com> X-Mailer: git-send-email 2.14.4 To: unlisted-recipients:; (no To-header on input) 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 The max flush rep count of HvFlushGuestPhysicalAddressList hypercall is equal with how many entries of union hv_gpa_page_range can be populated into the input parameter page. The origin code lacks parenthesis around PAGE_SIZE - 2 * sizeof(u64). This patch is to fix it. Cc: Fixs: cc4edae4b9(x86/hyper-v: Add HvFlushGuestAddressList hypercall support) Signed-off-by: Lan Tianyu --- arch/x86/include/asm/hyperv-tlfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h index 705dafc2d11a..2bdbbbcfa393 100644 --- a/arch/x86/include/asm/hyperv-tlfs.h +++ b/arch/x86/include/asm/hyperv-tlfs.h @@ -841,7 +841,7 @@ union hv_gpa_page_range { * count is equal with how many entries of union hv_gpa_page_range can * be populated into the input parameter page. */ -#define HV_MAX_FLUSH_REP_COUNT (PAGE_SIZE - 2 * sizeof(u64) / \ +#define HV_MAX_FLUSH_REP_COUNT ((PAGE_SIZE - 2 * sizeof(u64)) / \ sizeof(union hv_gpa_page_range)) struct hv_guest_mapping_flush_list {