Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp4009494pxy; Tue, 4 May 2021 15:29:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwb8jj2B17lyn6sdWH2C24Iy1u/uNALOWKpNZn+jQTERwV7Q8jAj8N5+B4KW0vfDZhw/hgW X-Received: by 2002:aa7:d3c2:: with SMTP id o2mr28188116edr.111.1620167374005; Tue, 04 May 2021 15:29:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620167373; cv=none; d=google.com; s=arc-20160816; b=TQ08j8jldkHdk2LUlBBUPY6Kf8B/uVryxkqFwrfRWWn3SDWMvkP+I+xtjpNvgnXjGw 5+dPG4UY9gTNBT9ucue/Z+WFQNxSJaXG6JwHAwzEJsCzJgTSrU3M/apV+QIKUxDoTcAv LP2cPkmCEUpIZJGASjHrSasN17czlK9d//jaEcixCNqT6JrJnrgIGHFK0BURHYyn0DBo BbjTVsaqW3XiATg9E/ZsT8bvG8tzh89j3vxSFJJctaADj5Hd/3S9Cu5m+XbxzzRQg8Yu AoS19lD5dQWmApZGlKiobGyvgkBMJhjvsmsTmqT6RwG+opzH55BYWES+gQOsdGejTFqx 2xfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=dkzqzuqzIzyGMXhkNhZPDVIt0dLOFYeZCI/9RFkmSpw=; b=P0vBUqqMlr0FdNQtsLaEQaLaBoyf/LRyShAXNqunONbJobOPRiPMdsfGhM6hSN113Z 1QRsM8WgGhsVyWJ+TBS9+k2gIVf4HW9xKFHl8ycinXjHyKgYII4TkZKQb1sp8KJ8RuNF LfIM3Q787Ow6iJY/8ANQRXXnVnFmnZAx/S+nxEjM0U40Z4nq1B7RVWahsk9ZeWFG2Rb7 lCyrdezRD8pyKaesvg7SNGyWznQb+UxqpX+MXP4b3ocquy7z3sIPENsqA4eYMUxI1Ll0 AVQGpT9OpGNsUZ7sT+gFAjonU+ERz6aZmDWVgtLxgQM2QjlHNvSe/LfvVwnWYaFkTvEA ztEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=A6aH728o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n24si11874536eds.571.2021.05.04.15.29.10; Tue, 04 May 2021 15:29:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=A6aH728o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231542AbhEDV7v (ORCPT + 99 others); Tue, 4 May 2021 17:59:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231384AbhEDV7u (ORCPT ); Tue, 4 May 2021 17:59:50 -0400 Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20384C061574 for ; Tue, 4 May 2021 14:58:54 -0700 (PDT) Received: by mail-oi1-x22d.google.com with SMTP id t8so365459oij.0 for ; Tue, 04 May 2021 14:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dkzqzuqzIzyGMXhkNhZPDVIt0dLOFYeZCI/9RFkmSpw=; b=A6aH728ocHdU2NrXsY8xPLDqJ7siBrQdSFqWFsUTPhsTODpJ+hC/taJAGFixgeCRBB vMKpX+AKBQwztDRW+0GskmoASe9dHtX/eGp40ezB/OdWGva0wCEYxb+06LAwCcyBSQpf xEbjjQsfvzyVcBQIhy8IA3WALH20I2O2XtNlQYIAEpDbW9ObOE6/ViRgFIXthqxHx/ZY c27J7S7GYyHrzNXnEL4F3jq+272FZT6AojDU3c+4W+xM2QitbHthPEFPqhRr0Fs4iRlQ 72LxfQ0PIsyaK+uX/lG+IzyxYOwnBTkIaUTCISm/AGZwRZFbzxoUYfjpAYYxSvzvPWL/ dlxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dkzqzuqzIzyGMXhkNhZPDVIt0dLOFYeZCI/9RFkmSpw=; b=T6pUnEkw4phPLlIgNzyTYfGTn+2hTicSxMxWLHjxx132AaA6El/k/NOqB7JeAoOuQb hOkTsJ8DMIwLNiNl+0spcNFQ5iKmUqfl8JcikHSOdT9FXFEwQlf3CtcD9uiDhIxZQp4I hOco/xc8gaMvJlfmmIiG9PpkBIhfI7+nX+QA9GXKpUBYU76KYtvDeJcfzg7XXkuwTWM9 snF4+o8VZqcp6cPB1F6JXP55w8w+3e712Yob2NB4I4qwtNdfeKikF1h1kgjGxTFKCuPN eTvlnyP/NpZfmSV847GgKbFplkL8Sv9L7sO73btI6u1XpX1oyvXwVaxeKLIsq0LNV/3h lfOQ== X-Gm-Message-State: AOAM532JJZwHVRvKsNPGK4i13H6Idxl/H9H6fTlyMOvp3HpM+Tkohezz Ucjz0aLaGUi8lvUoSElk90QEF5To1jzn451BwPnSYQ== X-Received: by 2002:aca:408b:: with SMTP id n133mr4711322oia.13.1620165533296; Tue, 04 May 2021 14:58:53 -0700 (PDT) MIME-Version: 1.0 References: <20210504171734.1434054-1-seanjc@google.com> <20210504171734.1434054-4-seanjc@google.com> <1b50b090-2d6d-e13d-9532-e7195ebffe14@redhat.com> In-Reply-To: <1b50b090-2d6d-e13d-9532-e7195ebffe14@redhat.com> From: Jim Mattson Date: Tue, 4 May 2021 14:58:42 -0700 Message-ID: Subject: Re: [PATCH 03/15] KVM: SVM: Inject #UD on RDTSCP when it should be disabled in the guest To: Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm list , LKML , Xiaoyao Li , Reiji Watanabe Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 4, 2021 at 2:57 PM Paolo Bonzini wrote: > > On 04/05/21 23:53, Sean Christopherson wrote: > >> Does the right thing happen here if the vCPU is in guest mode when > >> userspace decides to toggle the CPUID.80000001H:EDX.RDTSCP bit on or > >> off? > > I hate our terminology. By "guest mode", do you mean running the vCPU, or do > > you specifically mean running in L2? > > > > Guest mode should mean L2. > > (I wonder if we should have a capability that says "KVM_SET_CPUID2 can > only be called prior to KVM_RUN"). It would certainly make it easier to reason about potential security issues.