Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3860782pxy; Tue, 4 May 2021 11:32:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyqTIibIUlZQasuOf3ZG09Ta/YwpofovR01lgRfWV/oId8HCleuBODaws5mTRtkBHSAvqd X-Received: by 2002:a17:906:dc8:: with SMTP id p8mr23119501eji.75.1620153126218; Tue, 04 May 2021 11:32:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620153126; cv=none; d=google.com; s=arc-20160816; b=gusTLQiNmEsyGfwz7Z0MSc36hLectSwMmGxpvdvl6DmdfcIFLGVyDxXlSSMxVltY7F 8nKSJsms8OY6Pyn5f2CRm89TZhkwN3ps1yQBUZzC7JJVczlGn6xWz4KVKNoWM0U/8LF+ rpPddUcWvw5zDdjvRnfomq4bvM2JFjbxOAwDNWdsFYzkBe084oUm+BqjxTgEjh6RMTTk 9uyxRPLIB9LKZ2wuofMqaKN0F5iI6zPhUygI3zf1HosW2PyUByfJqUp2FY3HSVr/NJYM GzxR1O0t0o+o+2uSldpe1f8bwUCLu7OQmFXuj8kjWU92RAsbjRODzMIP2IgtXHykHOzU AYmw== 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=DCkRHCN61kfizqWJXP1PWNpclqjzIE2ZjByqn8qit3M=; b=cAzdz+CxNDMnBbtl0d1Q6heF+9r/1jPvW3cZA9jmj/rZA/t/LOw1ZS8aIz6yLph70X OzE2kjKzwK84P2cqiOUJQXJ+FfMT5jKZVXhEKQBnSM2E0P4g+tIE5dLSfCiONwISvIOS EkqcAmitZqDfXsMY75LEFauLKF4hrnzbw3kzEliUxLhJfWhgJ3XsUj/Tjo+4lSSYFCEw ms1a7Qz7lfA4S629OtqcbbNJwKgN0pamciwHM0rbYhzOeukArPNZuilWHR+38DGqXS4c 548k9yyo77eoLcUSIw19V6P7O9o4e10iZONfZEu4+mQX1IKTjn4Bnm0Q5YnJXMfTyM3g 16ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=TJ5hcE62; 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 zg9si3851069ejb.436.2021.05.04.11.31.43; Tue, 04 May 2021 11:32:06 -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=TJ5hcE62; 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 S232089AbhEDRvS (ORCPT + 99 others); Tue, 4 May 2021 13:51:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231773AbhEDRvS (ORCPT ); Tue, 4 May 2021 13:51:18 -0400 Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07E25C061574 for ; Tue, 4 May 2021 10:50:22 -0700 (PDT) Received: by mail-oi1-x233.google.com with SMTP id e25so9588147oii.2 for ; Tue, 04 May 2021 10:50:22 -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=DCkRHCN61kfizqWJXP1PWNpclqjzIE2ZjByqn8qit3M=; b=TJ5hcE62aB70t3wRgov2kIHjvIshRaIKwKhsS6AKdPP57RDYO/z30LoU/rF67pU0XU IX8UJLBud9zuRfHTIlVO/nC7FH2uePijzicdHzldgmLPR59XrR5NnW8i/dr6td/UiKEe +2l5dD8yXCQ14uQwkasfUugjgt3fHHCqDtcmA4+c0Nx9+AsX+DWmpKYLE7ndkYCluTGP Ff/X1Cz7eEwgxJONcOl06k3gXPXPGY3nmZXgc4RpwISc5vPk4pewq0R4oddwgpc43Kxu igyvApR6auWvoSXDFL3RbIDTX4Q1sGlY/YD01BsPMY3+n+ohgtbTvxm91vcssZbXIWUP Fi5Q== 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=DCkRHCN61kfizqWJXP1PWNpclqjzIE2ZjByqn8qit3M=; b=qRwees55nkjM4iR/5urQmQSc5Rm6X/AVyQaBwkTBYkSurgPbfLnf7TFjjZ8i+ltGDN bvQXhYOYqmIqPWs3q6n24VYIveqSjdWyrTK1Ao+iR3Kra6g7u4oFkAY5QrsAESTHyilT /CdPo5GBWqpOwB0pf9XmiKNM5I9GSkLgpsBFSGDlSGLwQeAUq6ybuAKkaFTrVgRl7aF9 2846iKzMAae/DuqKdczvRmBnyDKcB6VtzWGXTKU2QosI3EvpL5KhORyA/bMLozAt2Fil eAFXbBXGhon1cMErpMCXLoZ6TYeU4oWAQpiG3MD0LKh87RuSt9hz2NuDb0/ttKvU1BrJ 9mLw== X-Gm-Message-State: AOAM5324CQJi8K8mkhKYOYUEmbM6F13TMYDEd/esuRW6nanWn0igedPF WxPo6jiaqr9rw4S/ltCAFzpIDhsSev3ABZ8JGX7ynQ== X-Received: by 2002:aca:3cd6:: with SMTP id j205mr18533711oia.28.1620150621183; Tue, 04 May 2021 10:50:21 -0700 (PDT) MIME-Version: 1.0 References: <20210504171734.1434054-1-seanjc@google.com> <20210504171734.1434054-3-seanjc@google.com> In-Reply-To: <20210504171734.1434054-3-seanjc@google.com> From: Jim Mattson Date: Tue, 4 May 2021 10:50:10 -0700 Message-ID: Subject: Re: [PATCH 02/15] KVM: x86: Emulate RDPID only if RDTSCP is supported To: Sean Christopherson Cc: Paolo Bonzini , 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 10:17 AM Sean Christopherson wrote: > > Do not advertise emulation support for RDPID if RDTSCP is unsupported. > RDPID emulation subtly relies on MSR_TSC_AUX to exist in hardware, as > both vmx_get_msr() and svm_get_msr() will return an error if the MSR is > unsupported, i.e. ctxt->ops->get_msr() will fail and the emulator will > inject a #UD. > > Note, RDPID emulation also relies on RDTSCP being enabled in the guest, > but this is a KVM bug and will eventually be fixed. > > Fixes: fb6d4d340e05 ("KVM: x86: emulate RDPID") > Cc: stable@vger.kernel.org > Signed-off-by: Sean Christopherson Reviewed by: Jim Mattson