Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5381252rwl; Tue, 21 Mar 2023 18:18:03 -0700 (PDT) X-Google-Smtp-Source: AK7set+V3AAoe1+vtI3Rug/IkQgdNj4TT2T3DFfOr6HI0Ykws4l9zTnDH82rLgg3MV/ML1oOEiHC X-Received: by 2002:a05:6402:27c7:b0:500:3fd0:25b5 with SMTP id c7-20020a05640227c700b005003fd025b5mr6148977ede.2.1679447882873; Tue, 21 Mar 2023 18:18:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679447882; cv=none; d=google.com; s=arc-20160816; b=ID/NYolq7JwERXAF3vMUHBxfop+ePQCYbz4zVDLWg90gRJY3KzMwYjaXOTF+rvEt0r GK6Uumm0ceavqW+hbtBQ2g/6+ik3uvc6ypoum7FbUJJin5cgmPlAW0Ib5ydA6uVmeaBb T0M7w+0d9B3VmocrPl6z+lOpP9BcOjXeXKz95eG2aR5fQiKSwhMo4jhP1gC88CVUIXZp wt7rIj+Mf7tgm/oLaFR0hxIbk1cRnsL2rFr0ddI/53D2xFzJrggXsRrXbsS4yxT/woUj /KVtGlQFPG/UCaSUsQQDIl1uBvgPGE8p1uRnM2KrbIx4m3F5cfbbIn+ptWJmYpPo/gCH WYeA== 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:mime-version:date :reply-to:dkim-signature; bh=SydnB1+QRF9IlXppuAgZ+ky6nRrQbHVxvC/XmUdsdiY=; b=T3CKEZoPmTzJ41BZPg1DS3fv+5/Nxusi9fOgirqITSYPvcAec5eWTYR7P5o9/lwEnJ YfWyZiDeDFMoOCt1eghvcyMcYvjHNGSsHFtyjIa99QCD/gwvf729clUOVX9/iMPvvapW FIhLNnYZnwNXttlqtiIui/Ur6vmJeUPvqxV2+67t/kd4V47Wj8LSmfEUd/BsvK0XHuv1 vunkPf2tnneNqeeGpGQkiLQSCk3SemdA0k67Lpmzh1qbgm6YmDR5zOj5wpU8IC/+zJ/u ptdyz6CrAdhZjhiUkC2Nse/kq/X3nC3Zon2FVTaVp4dLTrDXOUF6NotSVJBhHBd328oP 0Nbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=jbFmzeJW; 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 w4-20020aa7da44000000b004c49811f79fsi14557944eds.557.2023.03.21.18.17.38; Tue, 21 Mar 2023 18:18:02 -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=20210112 header.b=jbFmzeJW; 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 S230027AbjCVBPt (ORCPT + 99 others); Tue, 21 Mar 2023 21:15:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230093AbjCVBPe (ORCPT ); Tue, 21 Mar 2023 21:15:34 -0400 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B066C5941D for ; Tue, 21 Mar 2023 18:15:16 -0700 (PDT) Received: by mail-pf1-x449.google.com with SMTP id a6-20020aa795a6000000b006262c174d64so6201662pfk.7 for ; Tue, 21 Mar 2023 18:15:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679447715; h=cc:to:from:subject:message-id:mime-version:date:reply-to:from:to:cc :subject:date:message-id:reply-to; bh=SydnB1+QRF9IlXppuAgZ+ky6nRrQbHVxvC/XmUdsdiY=; b=jbFmzeJWI4oKy/KdMtcNefGi/r6vZHAew2gWJPwPFQBeCLaM3x7BHXo3wkMdz7HuP4 /AicEu9/SuwbhW7Def92WFSyg3tAk65lZhGnogbcTY/70fU4vDq1nVz1+hdMH2Iq91Ze RqGGqsQjKBwq5/dcJ/RgXyln4HndGZEZeu5aMOY9k+Hoapsv4gRGdakqDVE0ZoxTGPWs l50YENqy68/Dj5pBxSODe4lxXrjmk1gOndViZ3m7COxLpbpalrVexiM0+up5A5LR2Irh 8hvesS0Ijk3Jdjvw2d575es68SifE54lmcLabytFMQ4D14nyKMnyk/jTWtRlym6i3q0Z 8eLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679447715; h=cc:to:from:subject:message-id:mime-version:date:reply-to :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SydnB1+QRF9IlXppuAgZ+ky6nRrQbHVxvC/XmUdsdiY=; b=Wpn3IK6gttwWawk/umsMjoyxOWihNOvLSUzBebt7q+QNtexB1tTtHCeTNsutAnFyOm 3ccH7cQoj75lbC5ON3cSN/E7stG2if+ToytoEDIxuMHCeyt0aQfURZ1f+x1/fAdWGp9s 6J0k/P+gW+0kAdXCwdtcj8FLic5Ju5iOYeXJCzIeEJcbDOhcVF52vLTu4DhaCuZsWnMt oXlokdd8d6iWzr2eqJwWmhYIr8i6dRxxpTqhhSqDnXnv9qRRLTvr1aDsL0EWmCFrth87 KEIwQZTj8svUYKkQqTpa/4rrhfs+kJx8rHHoVVjxfTstxcJeIzR/y/v5bhQMfVS4rjyp cUPw== X-Gm-Message-State: AO0yUKWqEV+93FvpTV665e392e5y8sqFof+UPH7/TZCb1szhdVu3tuvS S/Ku3vFV/xyDoET5pDOjSmyZuhgyZkc= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:768c:b0:19f:6f30:a3f6 with SMTP id m12-20020a170902768c00b0019f6f30a3f6mr427886pll.1.1679447715345; Tue, 21 Mar 2023 18:15:15 -0700 (PDT) Reply-To: Sean Christopherson Date: Tue, 21 Mar 2023 18:14:34 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.40.0.rc2.332.ga46443480c-goog Message-ID: <20230322011440.2195485-1-seanjc@google.com> Subject: [PATCH 0/6] KVM: x86: Unhost the *_CMD MSR mess From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor , Emanuele Giuseppe Esposito , Pawan Gupta , Jim Mattson Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 Revert the FLUSH_L1D enabling, which has multiple fatal bugs, clean up the existing PRED_CMD handling, and reintroduce FLUSH_L1D virtualization without inheriting the mistakes made by PRED_CMD. The last patch hardens SVM against one of the bugs introduced in the FLUSH_L1D enabling. I'll post KUT patches tomorrow. I have the tests written (and they found bugs in my code, :shocked-pikachu:), just need to write the changelogs. Wanted to get this out sooner than later as I'm guessing I'm not the only one whose VMs won't boot on Intel CPUs... Sean Christopherson (6): KVM: x86: Revert MSR_IA32_FLUSH_CMD.FLUSH_L1D enabling KVM: VMX: Passthrough MSR_IA32_PRED_CMD based purely on host+guest CPUID KVM: SVM: Passthrough MSR_IA32_PRED_CMD based purely on host+guest CPUID KVM: x86: Move MSR_IA32_PRED_CMD WRMSR emulation to common code KVM: x86: Virtualize FLUSH_L1D and passthrough MSR_IA32_FLUSH_CMD KVM: SVM: Return the local "r" variable from svm_set_msr() arch/x86/kvm/svm/svm.c | 51 +++++++++++----------------------------- arch/x86/kvm/vmx/vmx.c | 53 +++++++----------------------------------- arch/x86/kvm/vmx/vmx.h | 2 +- arch/x86/kvm/x86.c | 23 ++++++++++++++++++ 4 files changed, 46 insertions(+), 83 deletions(-) base-commit: d8708b80fa0e6e21bc0c9e7276ad0bccef73b6e7 -- 2.40.0.rc2.332.ga46443480c-goog