From patchwork Thu Sep 22 18:20:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 12985648 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 29CF5C6FA8B for ; Thu, 22 Sep 2022 18:21:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232027AbiIVSVe (ORCPT ); Thu, 22 Sep 2022 14:21:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230094AbiIVSVY (ORCPT ); Thu, 22 Sep 2022 14:21:24 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A092A10AB0E; Thu, 22 Sep 2022 11:21:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663870883; x=1695406883; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xXzjDD2RfWE2U6k2WEiDMxRTTvA39oD3cMMwgQ6GMXc=; b=Qcb3NpWRyQhVgVDcss/itiY2oDFtFWNy+TL2azb/hpTbET0/xln/K1PU mXhPSjOfqugQ7/+0d14jiEFZKdY18k2YD2V7OBlWTOTx9r1yh3MqJ4Ngm tgkvSJZWOMmqCyQt2EB14E/SMx7DK57OQmkmwCeNDkYDhTUQA5wcNmXIE lhmUgc2B7Bu9V4NjapUuS5n2YlykKbB5bXzYrOe2JlSs2OPgwoUtAMrOV WDb/3iFRteWHrsGtQx8pDC1wVxPFpKBQbsSwN3QqnEhKFmYzyg9DQ3fqE oxFwqHVheZNx2REGGKEft3JaO/00Ly1yKzjx9r8FFvFg7BlNFBWTugxtY Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10478"; a="386675950" X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="386675950" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2022 11:21:15 -0700 X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="653086658" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2022 11:21:15 -0700 From: isaku.yamahata@intel.com To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Sean Christopherson , Thomas Gleixner , Marc Zyngier , Will Deacon Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com, Kai Huang , Chao Gao , Atish Patra , Shaokun Zhang , Daniel Lezcano , Huang Ying , Huacai Chen , Dave Hansen , Borislav Petkov Subject: [PATCH v5 05/30] KVM: Provide more information in kernel log if hardware enabling fails Date: Thu, 22 Sep 2022 11:20:34 -0700 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Isaku Yamahata Provide the name of the calling function to hardware_enable_nolock() and include it in the error message to provide additional information on exactly what path failed. Opportunistically bump the pr_info() to pr_warn(), failure to enable virtualization support is warn-worthy as _something_ is wrong with the system. Suggested-by: Chao Gao Signed-off-by: Isaku Yamahata --- virt/kvm/kvm_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 4243a9541543..4f19c47aab1c 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -5006,7 +5006,8 @@ static void hardware_enable_nolock(void *junk) if (r) { cpumask_clear_cpu(cpu, cpus_hardware_enabled); atomic_inc(&hardware_enable_failed); - pr_info("kvm: enabling virtualization on CPU%d failed\n", cpu); + pr_warn("kvm: enabling virtualization on CPU%d failed during %pSb\n", + cpu, __builtin_return_address(0)); } }