Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp2861980rwb; Mon, 5 Sep 2022 02:45:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR6owbNEhr1jliajm9Xzj0a0DeIX30d8PVYwHoLiO8tGjBYoY8GR0CfRFXEQ2FfmyrrmgDbC X-Received: by 2002:a17:903:32d0:b0:174:ce51:223f with SMTP id i16-20020a17090332d000b00174ce51223fmr37770988plr.117.1662371104039; Mon, 05 Sep 2022 02:45:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662371104; cv=none; d=google.com; s=arc-20160816; b=m+yE/xXqjH1uhcGxzZ1eo56E6a0MJDLJ8Hv02mK+JzEWlYLQKIB7Ty1Tnv3xUdir/O GSXEpEfdGQPJnXCc2xbsz580htf39rPMwiPHGD5s1lHVlLKWPN+cKBpTxFWGi8nJt5Gq cAG0JczluzzWeob2iaUeZs7vBSUoGZnaNFb4tA4ZxJKMd0TNazk5b0c4scHIHu1LN/uE q5zHgPxt0aOjOxbUYdaiGeesIe/W0v/UFY192hIsT2raGCK3zq9gnRpHoStQUStQ6QvU ZxLBueQMQR2A0t/NPAGKXYJXIObX0//K2V8mfyugD4arn8pxhrYuZbOXFzvUd2FoNUVE DSSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=PoDHkBULwBxV11qfHr3wqPhVvN2iCE2iEbTKMXi3FXk=; b=eljcSG2KFFyPMCYfRzH1Lm94Hj6T2U1rJeECBClzPhvM/QEMjHu3aMgLVNvFWo1Ogo VS61+fk1o8RUK0T9MjPlktQIQm3pr1WEctOuSgOqtKtD4BeU++3meTSbEZW6Hqlb896d caytxCdDzlrBrYgoS6jne0kf4S2hzX4yxNGnq+EIefr5d5ql3YIitS9VQkCmvgp5kQgM j84hgThjPUc6libUNtG+axTFc1BhbBi8Xhn5XDAkQpwtdUepzZ7ZeCloqxZFn3N4wBBk DZn8ZpYmkdb3WGbRn/M95gKnmZS1mqRrnJ81Y7JfcD0mrCI6sSvk2RS+tlKJaPpcI1rQ jYtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ndpMLtLV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y5-20020a63e245000000b004344757e1c6si3574110pgj.177.2022.09.05.02.44.53; Mon, 05 Sep 2022 02:45:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ndpMLtLV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237468AbiIEIlT (ORCPT + 99 others); Mon, 5 Sep 2022 04:41:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238169AbiIEIk6 (ORCPT ); Mon, 5 Sep 2022 04:40:58 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C9B52654; Mon, 5 Sep 2022 01:40:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662367221; x=1693903221; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=btdeNSlwm5b5+Fc8dEtnw3mA1Hti4hAjCaqKbQB4+Sc=; b=ndpMLtLVJcnx5jeL235pCMi0g1rPKydsAtKhoKIqVGTeN2g17IIVy41/ 0BrfknKM+nPjXCLlFNC8h6H5m9b4ihxX1BPpAdHorYvNZu57F+vcpOYcj T0R8Gvqn5aox4Opd0tuV+gpU0T2hQj6FBcqsxAS6nUgC2B8lh/PX9xInU 0MH2pdZZnKr3OYIb7vOWCNSVpB3tvvwSgLrCyl3pA7yWUuj/ozHCYzUVE 2n0Hu8MBRXw4w60aDPE9zAuV4crtPqpwSz7xi3B7y9sxxCrriypZl8kvv ZJqy3khR6JQtNA4u/BrCOd52tXTv3CfT9weF/PFQuTBQvdd5M61VD2qpR g==; X-IronPort-AV: E=McAfee;i="6500,9779,10460"; a="322508352" X-IronPort-AV: E=Sophos;i="5.93,290,1654585200"; d="scan'208";a="322508352" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2022 01:40:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,290,1654585200"; d="scan'208";a="858885905" Received: from yy-desk-7060.sh.intel.com (HELO localhost) ([10.239.159.76]) by fmsmga006.fm.intel.com with ESMTP; 05 Sep 2022 01:40:15 -0700 Date: Mon, 5 Sep 2022 16:40:14 +0800 From: Yuan Yao To: isaku.yamahata@intel.com Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Sean Christopherson , Thomas Gleixner , Marc Zyngier , Will Deacon , isaku.yamahata@gmail.com, Kai Huang , Chao Gao , Atish Patra , Shaokun Zhang , Qi Liu , John Garry , Daniel Lezcano , Huang Ying , Huacai Chen , Dave Hansen , Borislav Petkov Subject: Re: [PATCH v3 09/22] KVM: Do processor compatibility check on resume Message-ID: <20220905084014.uanoazei77i3xjjo@yy-desk-7060> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 On Thu, Sep 01, 2022 at 07:17:44PM -0700, isaku.yamahata@intel.com wrote: > From: Isaku Yamahata > > So far the processor compatibility check is not done on resume. It should > be done. The resume happens for resuming from S3/S4, so the compatibility checking is used to detecte CPU replacement, or resume from S4 on an different machine ? > > Signed-off-by: Isaku Yamahata > --- > virt/kvm/kvm_main.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 0ac00c711384..fc55447c4dba 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -5715,6 +5715,13 @@ static int kvm_suspend(void) > > static void kvm_resume(void) > { > + if (kvm_arch_check_processor_compat()) > + /* > + * No warning here because kvm_arch_check_processor_compat() > + * would have warned with more information. > + */ > + return; /* FIXME: disable KVM */ > + > if (kvm_usage_count) { > lockdep_assert_not_held(&kvm_count_lock); > hardware_enable_nolock((void *)__func__); > -- > 2.25.1 >