From patchwork Mon Feb 27 08:45:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hoo X-Patchwork-Id: 13153101 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD1CCC64ED6 for ; Mon, 27 Feb 2023 08:56:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231285AbjB0I4V (ORCPT ); Mon, 27 Feb 2023 03:56:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231320AbjB0Izx (ORCPT ); Mon, 27 Feb 2023 03:55:53 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6797B1713 for ; Mon, 27 Feb 2023 00:47:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677487671; x=1709023671; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KDJQsv8v8pA0Pa5ghjuA3PzGLpKYZKTlr2UU2oYWW58=; b=CsDN2bTG3vw3jPnLhGCrFFYf5rJv3JPB1qAiM2V3H2qC8JuEJgRBEAMx gmZDhQWVjYIKEoum+G4rXIvYPatGkv5dnmYJIrK2KiXMyBtyp2wUexRQ2 SPXIiWtF7kLv9t6h6gJ1ttQo8dvMH+bD4lSLwLU7wLVX+FpcVBluEg9zb ob2sWshvpgmmYReNH+vt1zgWB+opMf2elfMgzkzgUGeYHWJFoJ9B4H9Lo gQrIDrn7OEhycKYlFZN99udKAepQDoQ0rvIbPrxl7nWwe2+ORTsJb+HNO h43qzLVLrA+AUZkORbnFrGBsqNlsvBthv6VrRM7ZtkFojMRIssEuMQUql Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10633"; a="322057690" X-IronPort-AV: E=Sophos;i="5.97,331,1669104000"; d="scan'208";a="322057690" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2023 00:46:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10633"; a="651127080" X-IronPort-AV: E=Sophos;i="5.97,331,1669104000"; d="scan'208";a="651127080" Received: from sqa-gate.sh.intel.com (HELO robert-clx2.tsp.org) ([10.239.48.212]) by orsmga006.jf.intel.com with ESMTP; 27 Feb 2023 00:46:13 -0800 From: Robert Hoo To: seanjc@google.com, pbonzini@redhat.com, chao.gao@intel.com, binbin.wu@linux.intel.com Cc: kvm@vger.kernel.org, Robert Hoo Subject: [PATCH v5 2/5] [Trivial]KVM: x86: Explicitly cast ulong to bool in kvm_set_cr3() Date: Mon, 27 Feb 2023 16:45:44 +0800 Message-Id: <20230227084547.404871-3-robert.hu@linux.intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230227084547.404871-1-robert.hu@linux.intel.com> References: <20230227084547.404871-1-robert.hu@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org kvm_read_cr4_bits() returns ulong, explicitly cast it bool when assign to a bool variable. Signed-off-by: Robert Hoo --- arch/x86/kvm/x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 312aea1854ae..b9611690561d 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1236,7 +1236,7 @@ int kvm_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3) bool skip_tlb_flush = false; unsigned long pcid = 0; #ifdef CONFIG_X86_64 - bool pcid_enabled = kvm_read_cr4_bits(vcpu, X86_CR4_PCIDE); + bool pcid_enabled = !!kvm_read_cr4_bits(vcpu, X86_CR4_PCIDE); if (pcid_enabled) { skip_tlb_flush = cr3 & X86_CR3_PCID_NOFLUSH;