Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3667953rwo; Mon, 24 Jul 2023 14:55:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlGToGEMRpQN9+MHofg/uS/St3jvP1Y2XzVY9tIkhjfq20hpy4aeRMQFrfubU27133Oo6QBK X-Received: by 2002:a05:6a00:2e82:b0:668:6eed:7c12 with SMTP id fd2-20020a056a002e8200b006686eed7c12mr10647349pfb.22.1690235758847; Mon, 24 Jul 2023 14:55:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690235758; cv=none; d=google.com; s=arc-20160816; b=roC7PCiku/zUCdm0u/fV00lyJL901vofQr2R+u9ltaKVFnKSqvOyktyvpxuVvm4lgO tf930VI9lDL510qKacK+lSjVghGLtSpqZa6GTb1CyN6QuQRVCqJn/4jZOPwlQ2yQShz5 TPpZTim73IdVJyXM9oQcn3OCEpT0PsCkp5nkh39f9GKzEAGBIkV8t9+r+ScAHnp5oW1S DTbrjgA128OHYrv3gu1rpa2MmA9GWoqH8rc7io4pPchD+PqkoPpq3fvoC3GlIyYgAYUx sx8iicmks3mIyAe0MOF/DQj2U6//1Kj6J6U5YPbL2e0llrtWwcIeg9zg4zVd9JlemIN3 WoMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=8BXNvlgPl86R5u1hRBm87aT1u2p7UCsAkEmDEcFG3FM=; fh=iA9qT0EJTXI92gQ1ljocMFQRm+GzjAukVos0/kpf9So=; b=bh16zIVoT6x2QnPzZycAohBRlQ3ZuGAxvp4vsN2tw6fW4ie2jCkSGyG9OXEojeStSA t7ZbV0EaaUSNI6TqZUFnT6dZjlvQmElA8lSEdHb5j0kShnggltIx2vr9rx9RMY7sJPcO gwj4m7jFxrKP+SKTE5YTUX9QaHxQFPUhS5zE+oy7uypoFTkB5bM+byNb/6eB6DCA3Km7 yLCf25D+eSyF2GVAuAdXfalyAbeWIufgDFzKX2Oot9+gqnvyKY/axneyLUHvPr8xI83G Wr4GjzMY7p3acAS7ACtSu0t4luT1wcmiex9GiHjsBf8pUbT75b/Y7PoBTa2A4l36DvaY flMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=WQVwrhAC; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k72-20020a636f4b000000b00563a0c1bf06si4988408pgc.428.2023.07.24.14.55.46; Mon, 24 Jul 2023 14:55:58 -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=@google.com header.s=20221208 header.b=WQVwrhAC; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231267AbjGXVkK (ORCPT + 99 others); Mon, 24 Jul 2023 17:40:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229834AbjGXVkI (ORCPT ); Mon, 24 Jul 2023 17:40:08 -0400 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AC8810D9 for ; Mon, 24 Jul 2023 14:40:06 -0700 (PDT) Received: by mail-pl1-x64a.google.com with SMTP id d9443c01a7336-1bb83eb84e5so22995915ad.1 for ; Mon, 24 Jul 2023 14:40:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690234805; x=1690839605; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=8BXNvlgPl86R5u1hRBm87aT1u2p7UCsAkEmDEcFG3FM=; b=WQVwrhACND8PT5c7alEIYasKcI4Gp7ux8sDxSBc+Z2bJbXkeTQ5jBOUHXIeOX7mlDT IA9pzFYjQzEITJml3F0PjSrEsUo05ZsNqrb8ZwrdQPd0nMVfILzegzYolD0BGNic81Gz s/fdxjhr9ssohjwdFcYBZFpTEIY+Cqf0ZgzvRQr8pLNrIFSvHblY82xsimwQ5Hoxpxag ZEchK0cmfSc5EC0KjP2jeYQcYdm/+0G52yT8+C/fGHF0OSFhlgDympjozQGmHyuKGxkf fMrqX+sFQNcqhs5SEIEVfG4p8fZpQ9QGuGj6l2J8Jvr1lkwN+TT1rHadFW5PB+D/1gaQ ICdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690234805; x=1690839605; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8BXNvlgPl86R5u1hRBm87aT1u2p7UCsAkEmDEcFG3FM=; b=MZASTdlhsFhirLEjvad3v73hXYabIfBa5+U6uw3k7JQcm3c0hiTe1DZb/T4bkXg/zd +a8F3GN8xLf4naHdmYI8cgpluGhookkSXKOMg+s4X8+3JaHspmYtP4oDypAR+/gqpcyi Zxn6k3RssJpbirqyEsZy7p6r8sQIbR1bDCldsIGBpNVaC/aA03W9iwzivaNZtjuJWBSZ KKuP5x1B4wwdBEjQyxENPf4WDZ5Kqs4SS+SHS1rZGFDZs4JC1NjHDdsC29AEdVQL5P9Q oYvU0hoavWftdkrVajiKlUqg3ED2JYVqsYCFPh6aAjI8CspqZag/avs8yuvD3pFSvQ9w uyow== X-Gm-Message-State: ABy/qLbvRnyMmFGiVSwsF51Qi/o8n75TQkLN66+8pEVYBDB/iaBEakId p1Zr7YPdH38y7PGv8Eag0jlMTWSruU0= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:903:32c3:b0:1b9:e338:a90d with SMTP id i3-20020a17090332c300b001b9e338a90dmr44909plr.3.1690234805271; Mon, 24 Jul 2023 14:40:05 -0700 (PDT) Date: Mon, 24 Jul 2023 14:40:03 -0700 In-Reply-To: <20230724212150.GH3745454@hirez.programming.kicks-ass.net> Mime-Version: 1.0 References: <20230721201859.2307736-1-seanjc@google.com> <20230721201859.2307736-15-seanjc@google.com> <20230724212150.GH3745454@hirez.programming.kicks-ass.net> Message-ID: Subject: Re: [PATCH v4 14/19] KVM: SVM: Check that the current CPU supports SVM in kvm_is_svm_supported() From: Sean Christopherson To: Peter Zijlstra Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Paolo Bonzini , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Andrew Cooper , Kai Huang , Chao Gao Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL 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 Mon, Jul 24, 2023, Peter Zijlstra wrote: > On Fri, Jul 21, 2023 at 01:18:54PM -0700, Sean Christopherson wrote: > > Check "this" CPU instead of the boot CPU when querying SVM support so that > > the per-CPU checks done during hardware enabling actually function as > > intended, i.e. will detect issues where SVM isn't support on all CPUs. > > Is that a realistic concern? It's not a concern in the sense that it should never happen, but I know of at least one example where VMX on Intel completely disappeared[1]. The "compatibility" checks are really more about the entire VMX/SVM feature set, the base VMX/SVM support check is just an easy and obvious precursor to the full compatibility checks. Of course, SVM doesn't currently have compatibility checks on the full SVM feature set, but that's more due to lack of a forcing function than a desire to _not_ have them. Intel CPUs have a pesky habit of bugs, ucode updates, and/or in-field errors resulting in VMX features randomly appearing or disappearing. E.g. there's an ongoing buzilla (sorry) issue[2] where a user is only able to load KVM *after* a suspend+resume cycle, because TSC scaling only shows up on one socket immediately after boot, which is then somehow resolved by suspend+resume. [1] 009bce1df0bb ("x86/split_lock: Don't write MSR_TEST_CTRL on CPUs that aren't whitelisted") [2] https://bugzilla.kernel.org/show_bug.cgi?id=217574