From patchwork Fri Mar 16 20:37:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 10290247 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 62EEA60291 for ; Fri, 16 Mar 2018 20:43:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5494F29089 for ; Fri, 16 Mar 2018 20:43:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4952129093; Fri, 16 Mar 2018 20:43:17 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable 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 9C31229089 for ; Fri, 16 Mar 2018 20:43:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753658AbeCPUjS (ORCPT ); Fri, 16 Mar 2018 16:39:18 -0400 Received: from mail-by2nam03on0059.outbound.protection.outlook.com ([104.47.42.59]:55584 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752514AbeCPUhy (ORCPT ); Fri, 16 Mar 2018 16:37:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=yYG3SG4QKkgt61qzAFHHB8mVDjHoRkKGfos/7bYFe+w=; b=Ja/fpg2BhI1Xg40Ebk3+uIf/eSP0iGHnjtf1pnrrBYPi9ddxAyh5PhAVigAEGJpAEaZsueni9tzj//VNX0rftbep4P8ai1bBkA1Svj4OVwtCp7ac0TBAvtpCCLnLca1Vpi+P8RGiVUzmRZOahMTdyU8XUzTQ8phjfjm9T9OxOpA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; Received: from linux-pyp0.amd.com (165.204.77.1) by MWHPR12MB1776.namprd12.prod.outlook.com (2603:10b6:300:113::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.14; Fri, 16 Mar 2018 20:37:50 +0000 From: Babu Moger To: joro@8bytes.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, pbonzini@redhat.com, rkrcmar@redhat.com Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, babu.moger@amd.com Subject: [PATCH v2 1/5] KVM: VMX: Fix the module parameters for vmx Date: Fri, 16 Mar 2018 16:37:22 -0400 Message-Id: <1521232646-79580-2-git-send-email-babu.moger@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1521232646-79580-1-git-send-email-babu.moger@amd.com> References: <1521232646-79580-1-git-send-email-babu.moger@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BN6PR17CA0018.namprd17.prod.outlook.com (2603:10b6:404:65::28) To MWHPR12MB1776.namprd12.prod.outlook.com (2603:10b6:300:113::7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 15ee58ec-bbce-4cf6-3882-08d58b7dca51 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:MWHPR12MB1776; X-Microsoft-Exchange-Diag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y4jGzQgnyYQ3wZfiz/c/7LoKqyEW0OLBtBSKtSzWqb15kxvmKNMl62C26fcrW1zxitfM/eUMpOHdyN4Yoa7wQ6g3L4X6jgFxmzM1IEXVLMcO+DjL7l9ziIZqGHKx1D7YJqJf62vXDXA4ADDr6B87xOUzoRbKmZYio+0LWYr1iC2wZVx35fMzEaEtza1RBT5BcR9Mu/m9CSGVtFo59rr0fzeWWZMp16gg7PUS6QeQXIefaYDiHP741KZ3MaFRIuj5Q7JtBsrhkL6iSxa7HK4ZvBtRaXV+DPC9eVixWrhdIuowj/hNOvrCdKbjqVtewByrzExsWVSb4zUyZ90eI/PSqvmVnGrOO+qLNjGKHPetwY7hAg2AtxfwM; 4:3fbSOqN/73eciENpMYvWjujiURKqP91CBIvbnSj4MUo1cQvqi8hDbirCS8PrstB1RuVm1Sk66TFDlYlHMrhFg3F3WiTMOAxB1I7zMNYAn+8oLf3B4tdWZU9+8pUFDWrJPMGJ8FLoRLbHCiWazjh6vjwgOfpvq3JanxkmMbNgbMM8Ojf2idyTEgKXC69QFxddP/1QAIE17rNIRCvTlk1uhnx2JXoQeCBIEjU9coBezTWiAdY0+NcI+onQjS+9volx+h401wvPhU6sK3sNm5ayTPak1H31bHd/UHVnn3VPQDd5Mgj/+NKScRdBEDdpi25e X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501244)(52105095)(3002001)(10201501046)(6055026)(6041310)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:MWHPR12MB1776; BCL:0; PCL:0; RULEID:; SRVR:MWHPR12MB1776; X-Forefront-PRVS: 0613912E23 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(366004)(39860400002)(346002)(39380400002)(189003)(199004)(81166006)(8676002)(81156014)(50226002)(6116002)(7736002)(186003)(16526019)(3846002)(26005)(305945005)(106356001)(2950100002)(16586007)(478600001)(4720700003)(386003)(6666003)(25786009)(316002)(59450400001)(66066001)(97736004)(8936002)(4326008)(50466002)(48376002)(52116002)(51416003)(7696005)(68736007)(53936002)(76176011)(72206003)(36756003)(105586002)(53416004)(2906002)(6486002)(47776003)(5660300001)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1776; H:linux-pyp0.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1776; 23:TEOD/WcK0YBCknSBoRebCNaD6FQkgjSgHd0xWfL0X?= =?us-ascii?Q?brVqjwNc7PceDv7ox9b/oQhz2tdcz/Ms8BuI0DEcrPijJJbI89BTvUVlduWS?= =?us-ascii?Q?EA7gIq9JKyv1Kb9BRVDhmrDWup7kU+jIPYaoiVMRTV4+e0l9y9JMdR+0HNax?= =?us-ascii?Q?3P2JD1i+irDV9RVH442VObdV8zuIL0l4QadXKuAHS6Tbt2tpdBmfR+4wrUqw?= =?us-ascii?Q?LrSh9E6ZOWHu9jy6wOhyUxlD/AKfxY+n1zyp61DnY372upX2hSQc34XEc/oy?= =?us-ascii?Q?/dZ++4qpQojv/FoANNOSCYJbKZP8QiXFscIDZLfctTQrXzyUHRe/suEkLZ7c?= =?us-ascii?Q?aG+9bLdTrl1p9cwQeia8L8ZhWtw9aA+WXDCWzWWgo9vXfyeA1U7DaXaFqCve?= =?us-ascii?Q?KNt9KDEI1f9x0sCu2mIIIEHnYs9Rg/2vZsMKHUToGHcN8xD6osYlCc12PWa4?= =?us-ascii?Q?9ZLIxveSVfiSRbdqYSNpVYCT+Bx4oSkK+ZQzhJYD5niboMzWvUE+JSazAQ+X?= =?us-ascii?Q?TijRFXP7Sv4QV4B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dGrZW4TrmsnN30IHj45w9acHRDbtRPJE4WWQFi5U2pYWoln3RqfU/hZfXmO+Sh10akEvus7dRtwRqTfmCbj/ITc1vecEhtmATrsQHewXh4+AKq4JHl9XzD6+4stzhfttgVVc4H X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Mar 2018 20:37:50.9599 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15ee58ec-bbce-4cf6-3882-08d58b7dca51 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1776 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The vmx module parameters are supposed to be unsigned variants. Also fixed the checkpatch errors like the one below. WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. +module_param(ple_gap, uint, S_IRUGO); Signed-off-by: Babu Moger --- arch/x86/kvm/vmx.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index c829d89..c9a9080 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -163,24 +163,24 @@ #define KVM_VMX_DEFAULT_PLE_WINDOW_MAX \ INT_MAX / KVM_VMX_DEFAULT_PLE_WINDOW_GROW -static int ple_gap = KVM_VMX_DEFAULT_PLE_GAP; -module_param(ple_gap, int, S_IRUGO); +static uint ple_gap = KVM_VMX_DEFAULT_PLE_GAP; +module_param(ple_gap, uint, 0444); -static int ple_window = KVM_VMX_DEFAULT_PLE_WINDOW; -module_param(ple_window, int, S_IRUGO); +static uint ple_window = KVM_VMX_DEFAULT_PLE_WINDOW; +module_param(ple_window, uint, 0444); /* Default doubles per-vcpu window every exit. */ -static int ple_window_grow = KVM_VMX_DEFAULT_PLE_WINDOW_GROW; -module_param(ple_window_grow, int, S_IRUGO); +static uint ple_window_grow = KVM_VMX_DEFAULT_PLE_WINDOW_GROW; +module_param(ple_window_grow, uint, 0444); /* Default resets per-vcpu window every exit to ple_window. */ -static int ple_window_shrink = KVM_VMX_DEFAULT_PLE_WINDOW_SHRINK; -module_param(ple_window_shrink, int, S_IRUGO); +static uint ple_window_shrink = KVM_VMX_DEFAULT_PLE_WINDOW_SHRINK; +module_param(ple_window_shrink, uint, 0444); /* Default is to compute the maximum so we can never overflow. */ -static int ple_window_actual_max = KVM_VMX_DEFAULT_PLE_WINDOW_MAX; -static int ple_window_max = KVM_VMX_DEFAULT_PLE_WINDOW_MAX; -module_param(ple_window_max, int, S_IRUGO); +static uint ple_window_actual_max = KVM_VMX_DEFAULT_PLE_WINDOW_MAX; +static uint ple_window_max = KVM_VMX_DEFAULT_PLE_WINDOW_MAX; +module_param(ple_window_max, uint, 0444); extern const ulong vmx_return; @@ -6640,7 +6640,7 @@ static int handle_invalid_guest_state(struct kvm_vcpu *vcpu) return ret; } -static int __grow_ple_window(int val) +static uint __grow_ple_window(uint val) { if (ple_window_grow < 1) return ple_window; @@ -6655,7 +6655,7 @@ static int __grow_ple_window(int val) return val; } -static int __shrink_ple_window(int val, int modifier, int minimum) +static uint __shrink_ple_window(uint val, uint modifier, uint minimum) { if (modifier < 1) return ple_window;