Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp3409974rwn; Sat, 10 Sep 2022 11:04:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Vsc1rdfSNEGv785hz0TyrIYDYLgPL6VykBdR1mJVkb2XV/UweI2jlxZ5JMb1L0gbQcf1G X-Received: by 2002:a05:6402:44c:b0:445:f2f1:4add with SMTP id p12-20020a056402044c00b00445f2f14addmr16262088edw.257.1662833079190; Sat, 10 Sep 2022 11:04:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662833079; cv=none; d=google.com; s=arc-20160816; b=cR9xw/7ghVA4Hx1Qf+0HRFiIXk9mFl6wpJrQPeaYzWJUz9XEh+4IZ6Z/ilmf1lqsv9 Y9YfQ+nttlRjNkG7dbcdXT4n9ESVdqAlAQ40+M16ZXhgkTAa7d8GYszWG3e0VIXL0AYm M2NtfqdY60+K0VIfaFdZcoWTHctuCRIDApPeaed2aNUQYiNmCqYWhr2jfK43dzp9tEAS 86QCzq5NVLX95R3UbRKSMoA+0Dt+XdhsSdumH8gYFmZTPCPluErAR+Epd5TkNySSa27n HgCcp9iQWZGJVieGyz9h4COHPB9KNa5tOhrpIqcYwkANg3IDFBV6yn9dkRBXZ2IZaKRU wmJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9LVUrGmgg5NlXwKIeiUGY0pBFtC3Dd7Xv1rjO/T4Xds=; b=lW7/eU8GWEkdnjqAD01Kub6QNjrE2ftjOWnM1FtVwWTd2A+YtNp0qdxUAhy9XP+ARK wqXfEVxXf7u76rajUPBkhmFqaI3vHw7BauWSfKIkAbcJzNHw4U9Nsa9Tow8fDlTeDEEV LdfxBdw14v9tWzfzUHia4eBBsLMiWCVyiCgeM/Uy9YmamRmj7vNt+BP1DKPs6k/fBe5x ecabO3M0E5wuBFg+ytq+C4jPa74uNAm1BOnBLqkdxmgrA/YZLm4odAss5dAj96hyStti Hg6rFSR4+VfFVH2ShTf/ReasKWLpHhvALOyBV5iOw4k8JqTbENN+O4wBH+V/6MIYs/iu NI2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nnsbvU4x; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q6-20020a056402518600b004505bf285a9si3748958edd.321.2022.09.10.11.03.57; Sat, 10 Sep 2022 11:04:39 -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=@gmail.com header.s=20210112 header.b=nnsbvU4x; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229517AbiIJR7Z (ORCPT + 99 others); Sat, 10 Sep 2022 13:59:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbiIJR7W (ORCPT ); Sat, 10 Sep 2022 13:59:22 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12C554199A; Sat, 10 Sep 2022 10:59:22 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id go6so121827pjb.2; Sat, 10 Sep 2022 10:59:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=9LVUrGmgg5NlXwKIeiUGY0pBFtC3Dd7Xv1rjO/T4Xds=; b=nnsbvU4xT1jL/likGEbVZ8DRFDzCbfse76m0FvZSSTskw6aq70/qtBkDwC8poGl/0W 04kWcA5DnWQN2RC+CqYP9h09n0DCCGElrI/Tp+Sd8sHXPUF50geQOzNHXDVGT41gmLmr nQjSP4GQyYQnifQT2HL6seGBx2ab5K36CjBwGh8FHN0/TiPgIN+/Jx8z/RTV5tT1buL0 5PUXVJ0PRaY+UbR0CVbViITfXmEmn+Hxs1ZoP0biUOyAQrKQ+tWV1XKHeiZtEHL/ia3T u7znD9H5y/dcC+bcl26vM8DMUJCWgGGXKsR4Z83e5oF3KjQ8vh9GbVEfsJ40rGFBwoLu 0Taw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=9LVUrGmgg5NlXwKIeiUGY0pBFtC3Dd7Xv1rjO/T4Xds=; b=WLKbIOnKRHtAlP4dSYDEFVi/0iz2osVcqbrzRzztV0H5sddMikyLSqkprmKVeZkNmX YsRqwkGLZCNJ6dZov0sNpULCFEPIkuXDw+UUHtPqkZESeL7Kxm/KieF+aaKGZTucxlbS ndm4+s+JhIuUHN6FVUZYYJRjrPGo6U0l5JNg0kfs2GZ+r5cvafUnNQI72g3tZWQSmbF8 duxFcrKKpT5t/U5dGOS8g3j7V9BaBu+KLrUKlLzponzAioOLmvVxIRWclu6HADOCI5Ay NvNWtMB59F7ssINoAc4Qk+xlQ5W+rh5WT3Fx3WnGONjHyTmvfMohZ2Zuwt1wYdMGtavh Z8ZQ== X-Gm-Message-State: ACgBeo0zQe6c1Ir/bAKkQG9WtjgnIvgRAWteS8f0pWU0uTJHVobKdIBw 5OBmtKhH0ORW1aTP4Qr7qVs= X-Received: by 2002:a17:90a:d343:b0:1fd:b437:7ae9 with SMTP id i3-20020a17090ad34300b001fdb4377ae9mr16285600pjx.73.1662832761350; Sat, 10 Sep 2022 10:59:21 -0700 (PDT) Received: from localhost ([192.55.55.56]) by smtp.gmail.com with ESMTPSA id z12-20020a170903018c00b00176d4b093e1sm2635869plg.16.2022.09.10.10.59.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Sep 2022 10:59:20 -0700 (PDT) Date: Sat, 10 Sep 2022 10:59:19 -0700 From: Isaku Yamahata To: Chao Gao Cc: isaku.yamahata@intel.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Sean Christopherson , Marc Zyngier , Will Deacon , Yuan Yao , isaku.yamahata@gmail.com, Kai Huang , Atish Patra , Shaokun Zhang , Qi Liu , John Garry , Daniel Lezcano , Huang Ying , Huacai Chen Subject: Re: [PATCH v4 09/26] KVM: Do processor compatibility check on resume Message-ID: <20220910175919.GB699006@ls.amr.corp.intel.com> References: <1c302387e21e689f103bf954f355cf49f73d1e82.1662679124.git.isaku.yamahata@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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,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 Fri, Sep 09, 2022 at 10:15:16AM +0800, Chao Gao wrote: > On Thu, Sep 08, 2022 at 04:25:25PM -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 is called for resuming from S3/S4. CPUs can be > >replaced or the kernel can resume from S4 on a different machine. So > > Are they valid cases handled by other kernel components? Trying to > handle them in KVM only doesn't help as kernel is likely to fail > somewhere else. I guess no. Actually without the compatibility check, kvm_resume() tries to enable it by calling hardware_enable_nolock(). The real effect on error case of this patch is to print out (potentially) more helpful message gracefully by check_processor_compatibility instead of error message of haredware_enable. -- Isaku Yamahata