Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp22476718rwd; Fri, 30 Jun 2023 08:27:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5h60+FAIC5lqeYFjp1jzSB8HD9D3m6Oraqw00Zh4nAEuBuEdQOnc25v7LqIA90QNBFRFDl X-Received: by 2002:a05:6808:18c:b0:3a1:e85f:33c3 with SMTP id w12-20020a056808018c00b003a1e85f33c3mr3021754oic.50.1688138865787; Fri, 30 Jun 2023 08:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688138865; cv=none; d=google.com; s=arc-20160816; b=ePpeJRWB0jNuBe99zwfN8gQQ5PPfBJ9Nic83rOyT5stWv7X6BzwmBEkKLaXTAy5SdK tCoHRCyfxkxV7Z9+y581L6KoOW5hpu3OljD8h5Va4uCLkuFLo0IcRl8gjRO/lpkZomZk wSMD4KaESdHHBH+jcG1RR0LNRU86S6VAuX2fAMrOMwBzgIXbDz+Jk2YIeVSd+3qdcbYJ CesgvZwafDeqKWff2fROop4hQhjc1RnVUOr47v68DT9XJWMeXgf4lxMXRfAYBDAzeD1y I9xTWv8hxaobsTtuDHRAxIZpy0Br6lrOsHHS2huG81DDYWJjqocvjSqcDe2elRJSERaH yH6w== 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=Z7oJzLLPGW/Cx9f/CDqtoSXPOSWREn06ZdPTZhJC3Go=; fh=vsEd8BLoKDp3Ci+jZF/1KgWlfWFwIrzoKJhcKF5+yCk=; b=ciUAX56McrgXwRKQXQGYGRy4eos7HSaLyopZwSjbc4RgdiFprhxOIh5MS7nUHaTD6W 0gP4EBgTGdTw1njr+LCyPpyEDoF+dE4ixk8MHTdVMSfw/ICRwDK6x9mUT6+G/muhaXu8 DopS605QZ4XtotOvcoA4W14Xq8VmZvjR6pTkv1cFYSwvc4rDIsrEnqxFxoILzlTLkilM W4xwkTs4IAjzS3qQPIYNiFn2ZrvH++QNGX6Ee85B/Jr3pD08V9WhxABWQUylzCggyxJl PTUDU8B0j6kMz3qS+A5+ehGpbJm8S9hIpdAJF79NPz7Kk3F77n8/YSzb+H4L3LUNCE3b T+Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=AfsXkZXl; 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 33-20020a630a21000000b0054fd06a3585si12286458pgk.158.2023.06.30.08.27.32; Fri, 30 Jun 2023 08:27:45 -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=AfsXkZXl; 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 S232234AbjF3PQ2 (ORCPT + 99 others); Fri, 30 Jun 2023 11:16:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232539AbjF3PQG (ORCPT ); Fri, 30 Jun 2023 11:16:06 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B27D54690 for ; Fri, 30 Jun 2023 08:15:26 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-56cf9a86277so18219527b3.3 for ; Fri, 30 Jun 2023 08:15:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1688138126; x=1690730126; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Z7oJzLLPGW/Cx9f/CDqtoSXPOSWREn06ZdPTZhJC3Go=; b=AfsXkZXlZJPvva1bmvipN9xiFdW0LWN5Ibj64QQvTBdzXdIrAXkFx0kUhmllcfNyjr pAlOJ7sJPNzfIfdXxHCn+R1qQiqSw5cQGKtoSE6I6+1q8qU/HMbjfixp7a/mjyvMyoSN b02kSEaYdL50YI1V7wz8SUtGgKFRBMVHxhqhbre0ua4nYdt2U9kAYDTJdJqzJlwBBfYb Wkx8i9WsPC9wi3bibCZvTbX2brPCZKCZVckU/uqISG3uTscgkQcXTeIN9YeVJyoaCl7A zKj67sA93xoBdrCn5C5jXdJufo2VXCIJY2kHP7iLx/xm7YwAjcj3Z6QR/wXS39Pna9ie b2fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688138126; x=1690730126; 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=Z7oJzLLPGW/Cx9f/CDqtoSXPOSWREn06ZdPTZhJC3Go=; b=D5LMMfZtdZUtP9iwEAhMLndpxnP5dG0ppO75/WtWEGAXxPRj2V57XqfLd1VerLCLXR 3cgE1v5X69akDS+PtlQluUgKTpFBnHWZax9RLVNqqvCEMlWfrsVOqUemTnXKiuiOdbL7 g0ZQ2c4CDD8owZAMiVAh4FWtHmIvpPnbnJ/Xh2oTXprOSx0pIXtOI4kbOa7vh4CQzBrd XzQvHKZrwP7+YY6YQtIXlyKIGxuzH0PqxXQr+CV/mwPihz3NCKBZOp9+RsSoSOzaYxjm V/CD3p7YB9VXUjDVF5GHuSFH0KQRu4fqwXjGX6tKqGYH3i/Vn4JdyfV6o5GB/BhKbEbb x8KQ== X-Gm-Message-State: ABy/qLZubI9JHqEDmgRVa1dg8tfzzflxRI3g4vIGEvoFKEDo3Vnce6VV G/66hq5kHoe0ky3yZ1KmDiNOcZw1NCo= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a25:ac0b:0:b0:c3f:b53e:b2c2 with SMTP id w11-20020a25ac0b000000b00c3fb53eb2c2mr22548ybi.0.1688138125852; Fri, 30 Jun 2023 08:15:25 -0700 (PDT) Date: Fri, 30 Jun 2023 08:15:24 -0700 In-Reply-To: Mime-Version: 1.0 References: <20230511040857.6094-11-weijiang.yang@intel.com> <21568052-eb0f-a8d6-5225-3b422e9470e9@intel.com> <0a98683f-3e60-1f1b-55df-f2a781929fdf@intel.com> <8dec8b09-2568-a664-e51d-e6ff9f49e7de@intel.com> Message-ID: Subject: Re: [PATCH v3 10/21] KVM:x86: Add #CP support in guest exception classification From: Sean Christopherson To: Gil Neiger Cc: Weijiang Yang , Chao Gao , "pbonzini@redhat.com" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "peterz@infradead.org" , "rppt@kernel.org" , "binbin.wu@linux.intel.com" , Rick P Edgecombe , "john.allen@amd.com" 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=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 On Fri, Jun 30, 2023, Gil Neiger wrote: > Intel will not produce any CPU with CET that does not enumerate IA32_VMX_BASIC[56] as 1. > > One can check that bit before injecting a #CP with error code, but it should > not be necessary if CET is enumerated. > > Of course, if the KVM may run as a guest of another VMM/hypervisor, it may be > that the virtual CPU in which KVM operates may enumerate CET but clear the > bit in IA32_VMX_BASIC. Yeah, I think KVM should be paranoid and expose CET to the guest if and only if IA32_VMX_BASIC[56] is 1. That'll also help validate nested support, e.g. will make it more obvious if userspace+KVM provides a "bad" model to L1.