From patchwork Tue Sep 19 14:30:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hao Peng X-Patchwork-Id: 142068 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3635701vqi; Tue, 19 Sep 2023 12:38:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGRA402E4Fayq2kqyl4oGzcRHmcNIIXmyBtTGbYRaSELy+UjtlOTlfpJgbSd39F29Oz/x01 X-Received: by 2002:a05:6a20:144d:b0:14e:3daf:fdb9 with SMTP id a13-20020a056a20144d00b0014e3daffdb9mr539361pzi.22.1695152308514; Tue, 19 Sep 2023 12:38:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695152308; cv=none; d=google.com; s=arc-20160816; b=PgB7XL4xrsYaoa8UqX4KGaq3SMbuJuoJBO+B1amOpZ+brnmSpFBoW8W0ANacINOL0B 8SpjcZ9EJNYVfjlNbJxfIP21r19YXn+9nRwgOCA+pZBmGzxV42zfCQlyqhzxXW4sISCN 9usYJPmIimYH16Juqi6MnqRpahbYphnKVFkRJyU2XJrmMfmp2wJjXDAZ65J2dGeYqWjv aKxn7mGsBUcfmgmGqZAIexwj2guJmbjg//GDL28eYX+Zn/UetG3w/GpvGzKCZSWgOnmA Ne9XRe5oBZxqQjy2/HXA9ibT7UuBim5UFGzXvPkg290JxHoVkR5kGkE+JYq0lY8cocMu zToA== 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:mime-version :dkim-signature; bh=8Rt9ZRjuh0TBv20Cp+ldIRytJvrsd1UIlNU96DDB3sw=; fh=hwNM3A9Sza/63zO/jN1B8B47yTcbzVX5IohTecLQawI=; b=yZhwIc6DlwEMMvFUCpohLdhmhdABf538piMcvgZRJOOG0ts2bsKdKyU6pHoanuyZKG I6t0//Tyxz+svkMCIqo/LfQrgWAqW9OaUFzh2z09dmpz8y06LOxFP288HgzsJ5deLEXv bzrdHSDpQqt1P6cReS5LzlNus6xDbx4dy1MMxPb1mPoA0DGNuypm7JMc4jzcO0GFQC8m 9PGDuPzCL6SFgJr8g6HfLHtDBIWzC7iQ2RC1e+k87yvxWZMWcv0uCSqOyr1yo8pKzL/0 AKgLRVCNOKpItSBm8U0DqAFOm5wFkN9wc1Wy8D2pM6bgC0hA6OUT8WTfjUKc2xjagBlM IG0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=faeZ7rUN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id i3-20020a6551c3000000b0057851fc2b4asi5871170pgq.55.2023.09.19.12.38.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 12:38:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=faeZ7rUN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 837848029238; Tue, 19 Sep 2023 07:31:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232788AbjISObT (ORCPT + 26 others); Tue, 19 Sep 2023 10:31:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232004AbjISObS (ORCPT ); Tue, 19 Sep 2023 10:31:18 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5516583; Tue, 19 Sep 2023 07:31:12 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-403004a96a4so63625325e9.3; Tue, 19 Sep 2023 07:31:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695133871; x=1695738671; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=8Rt9ZRjuh0TBv20Cp+ldIRytJvrsd1UIlNU96DDB3sw=; b=faeZ7rUNRmE2gnqEigSreVhO83202izahqxSsaXtdTqt5nz3l028siJJyYZ/werKf+ D0VVtD9FcRvaYdryTHy8KfHlReyl+J1b1oTs77FiZHybrFEhwqoj5uIda52T2P0y4jcf 2rmYl0Su5M6t42FQ4fDQ2VIdWdWj2qHLNIzdK4LVisf64N/hXHkuTPiQgmyC81mTo+72 jctKxbUQhRFxCawPvf8yLt0k/tZE6ouD1XyYE7EvbECNMfGy3LMSe7PwhSnb1Ykjlu/X P+cgNZNbhuJ7lni58jjwytcBI0yhbDgiJeqP8f0cYK3xKCsYE0ht98bvGyx4D3+w/bY9 E9Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695133871; x=1695738671; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=8Rt9ZRjuh0TBv20Cp+ldIRytJvrsd1UIlNU96DDB3sw=; b=QCb2gK38B1yMKKn15Nxck2ReVeX6dHPg2VDRuCqpZuLhgBVByM8JA293WR0Gs43yiv czQBIju6GdOge8pSAuXc+OsYYjebv4XXWnAFXO7lcLFoIgOn57sFoMGz4vM20KkrrYLo Ize3mjN3DqRzLRui1kcR3f2L9CvWPidS9oWuRhGITNCwnfWc8de+neV93PeddKZvzIiX 6rEQe0610WvgtBmzzpfVZ3fzATiiyDJ87PHm1/3E7gch+YsCye4dgTNka3GPyWgCOjM1 czkyKBpDH/vYeLZFs8scdt4esgBriVAOiQXXmQC4t6+61qcBD8/Wx3YG+lyzwnFEKH61 dSuA== X-Gm-Message-State: AOJu0Yxt7hdrGWhtx/j1XWVXvhU+JF7fr3abW5EYin21IUiTbqHAJcba iqrBzLt0U9TlxIUECUw7EBiuSuRSnMa1G2HQX68= X-Received: by 2002:adf:d20a:0:b0:320:896:5ea8 with SMTP id j10-20020adfd20a000000b0032008965ea8mr6730564wrh.19.1695133870443; Tue, 19 Sep 2023 07:31:10 -0700 (PDT) MIME-Version: 1.0 From: Hao Peng Date: Tue, 19 Sep 2023 22:30:59 +0800 Message-ID: Subject: [PATCH] KVM: X86: Use octal for file permission To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, Sean Christopherson , linux-kernel@vger.kernel.org X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 19 Sep 2023 07:31:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777494498993441539 X-GMAIL-MSGID: 1777496026982636780 From: Peng Hao Improve code readability and checkpatch warnings: WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. Signed-off-by: Peng Hao --- arch/x86/kvm/x86.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) module_param(force_emulation_prefix, int, 0644); int __read_mostly pi_inject_timer = -1; -module_param(pi_inject_timer, bint, S_IRUGO | S_IWUSR); +module_param(pi_inject_timer, bint, 0644); /* Enable/disable PMU virtualization */ bool __read_mostly enable_pmu = true; -- 2.31.1 diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index e3412091505d..8c1190a5d09b 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -145,21 +145,21 @@ EXPORT_STATIC_CALL_GPL(kvm_x86_get_cs_db_l_bits); EXPORT_STATIC_CALL_GPL(kvm_x86_cache_reg); static bool __read_mostly ignore_msrs = 0; -module_param(ignore_msrs, bool, S_IRUGO | S_IWUSR); +module_param(ignore_msrs, bool, 0644); bool __read_mostly report_ignored_msrs = true; -module_param(report_ignored_msrs, bool, S_IRUGO | S_IWUSR); +module_param(report_ignored_msrs, bool, 0644); EXPORT_SYMBOL_GPL(report_ignored_msrs); unsigned int min_timer_period_us = 200; -module_param(min_timer_period_us, uint, S_IRUGO | S_IWUSR); +module_param(min_timer_period_us, uint, 0644); static bool __read_mostly kvmclock_periodic_sync = true; -module_param(kvmclock_periodic_sync, bool, S_IRUGO); +module_param(kvmclock_periodic_sync, bool, 0444); /* tsc tolerance in parts per million - default to 1/2 of the NTP threshold */ static u32 __read_mostly tsc_tolerance_ppm = 250; -module_param(tsc_tolerance_ppm, uint, S_IRUGO | S_IWUSR); +module_param(tsc_tolerance_ppm, uint, 0644); /* * lapic timer advance (tscdeadline mode only) in nanoseconds. '-1' enables @@ -168,13 +168,13 @@ module_param(tsc_tolerance_ppm, uint, S_IRUGO | S_IWUSR); * tuning, i.e. allows privileged userspace to set an exact advancement time. */ static int __read_mostly lapic_timer_advance_ns = -1; -module_param(lapic_timer_advance_ns, int, S_IRUGO | S_IWUSR); +module_param(lapic_timer_advance_ns, int, 0644); static bool __read_mostly vector_hashing = true; -module_param(vector_hashing, bool, S_IRUGO); +module_param(vector_hashing, bool, 0444); bool __read_mostly enable_vmware_backdoor = false; -module_param(enable_vmware_backdoor, bool, S_IRUGO); +module_param(enable_vmware_backdoor, bool, 0444); EXPORT_SYMBOL_GPL(enable_vmware_backdoor); /* @@ -186,7 +186,7 @@ static int __read_mostly force_emulation_prefix;