From mboxrd@z Thu Jan 1 00:00:00 1970 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 124F5C32772 for ; Thu, 18 Aug 2022 17:49:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345121AbiHRRtu (ORCPT ); Thu, 18 Aug 2022 13:49:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241671AbiHRRts (ORCPT ); Thu, 18 Aug 2022 13:49:48 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98E64C00CF for ; Thu, 18 Aug 2022 10:49:46 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id jm11so2094250plb.13 for ; Thu, 18 Aug 2022 10:49:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=9DsDwT22PvIrk8KHMwJ4ojUKw5VmQXY3VeVmmTdugFY=; b=dWVWBD0NtA2732x4FF3h3VXV9QrF8WCyK9Xq3/5pIPDN5c86oYi6pd3E9Tqzmih61D XnsOe6zN2dBFud6HcHR2TkmRnpUN4cbSmB6/ezyBroFT1kk1jpFkmivR4jYnNugQ8FCC BPR07fC/5T+Bhdaj7/2hzP3SiucmLnoMKltgU0WQYGyMOMiTax5IVuAaE0BhlUR80QW2 0z+vUjonVlwZtRBhiS8KckiRKkzQp0Dvl97cyMHVh9HwpFXUc5/ZzSTltF/N2xqtr1vV iurbgm6EKrbjvJUwUSpZP1hN02Xu1jzOe4/p7363eNgCDdKQuhlWoxy6WYYvyO4G0tDR W1eQ== 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; bh=9DsDwT22PvIrk8KHMwJ4ojUKw5VmQXY3VeVmmTdugFY=; b=IqjF9GXMsUowrQlACS6NAhbpEORkylScXj+yTZAET5S0ODyrLfhJ79sL9rZYwEpMPv 5wG6rCD8rLVD/0ADD5f6ddd5l95KI/l6aIONI+Zhi8NXBTvahtcsz9LZnboM/kXsHNFK cNm012J8m67vSy3vwrJGYwC6gBMV9pVi5YTGWb++43loC1UPpsgWnVXTXzERnldUd+8g 8F/ktx5+PyiNEh1Oa/albfhjZpxF2rVUg36Ld7gadg4MuylmGv+dk25qJIyysnVbjjqL ImeK64/nV9N0XATZ5tQZ7DJ4kAc6p5Q76BnmetnzWqWWAbg9eCR29XLZIEBmnO8JfFxq cL/w== X-Gm-Message-State: ACgBeo3dkhgKRW4WJshzmvzGl4of1BlV1T+o8f7s3lb05VgYBAphgXzZ GUHOMlHlrsTK1wCkVkVZg6OX9A== X-Google-Smtp-Source: AA6agR4xdRGg/7F/tdy10J4KT9KsESLpZLsqDBIGuLR0y4Zg077lgqYhN6Lj/jXTbwiQ/RkkA+Tc8Q== X-Received: by 2002:a17:90b:4f42:b0:1f5:6976:7021 with SMTP id pj2-20020a17090b4f4200b001f569767021mr4302756pjb.30.1660844985933; Thu, 18 Aug 2022 10:49:45 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id 186-20020a6219c3000000b00535f293bac6sm736695pfz.14.2022.08.18.10.49.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 10:49:45 -0700 (PDT) Date: Thu, 18 Aug 2022 17:49:42 +0000 From: Sean Christopherson To: Vitaly Kuznetsov Cc: kvm@vger.kernel.org, Paolo Bonzini , Anirudh Rayabharam , Wanpeng Li , Jim Mattson , Maxim Levitsky , Nathan Chancellor , Michael Kelley , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 22/26] KVM: VMX: Move LOAD_IA32_PERF_GLOBAL_CTRL errata handling out of setup_vmcs_config() Message-ID: References: <20220802160756.339464-1-vkuznets@redhat.com> <20220802160756.339464-23-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220802160756.339464-23-vkuznets@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 02, 2022, Vitaly Kuznetsov wrote: > While it seems reasonable to not expose LOAD_IA32_PERF_GLOBAL_CTRL controls > to L1 hypervisor on buggy CPUs, such change would inevitably break live > migration from older KVMs where the controls are exposed. Keep the status quo > for now, L1 hypervisor itself is supposed to take care of the errata. As noted before, this statement is wrong as it requires guest FMS == host FMS, but it's irrelevant because KVM can emulate the control unconditionally. I'll test and fold in my suggested patch[*] (assuming it works) and reword this part of the changelog. Ah, and I'll also need to fold in a patch to actually emulate the controls without hardware support. [*] https://lore.kernel.org/all/YtnZmCutdd5tpUmz@google.com > Reviewed-by: Maxim Levitsky > Signed-off-by: Vitaly Kuznetsov > --- > arch/x86/kvm/vmx/vmx.c | 59 +++++++++++++++++++++++++----------------- > 1 file changed, 35 insertions(+), 24 deletions(-) > ... > @@ -8192,6 +8199,10 @@ static __init int hardware_setup(void) > if (setup_vmcs_config(&vmcs_config, &vmx_capability) < 0) > return -EIO; > > + if (cpu_has_perf_global_ctrl_bug()) > + pr_warn_once("kvm: VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL " > + "does not work properly. Using workaround\n"); Any objections to opportunistically tweaking this? pr_warn_once("kvm: CPU has VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL erratum," "using MSR load/store lists for PERF_GLOBAL_CTRL\n"); > + > if (boot_cpu_has(X86_FEATURE_NX)) > kvm_enable_efer_bits(EFER_NX); > > -- > 2.35.3 >