Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp148348pxy; Tue, 4 May 2021 21:33:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5Cy+SoOxAPAErxU1tjo7EgjxsI/Co1L1q0sRhkO0iNJQiGl1KBMMX3koLJPG+W9BCnsZH X-Received: by 2002:a17:907:1b1e:: with SMTP id mp30mr25662849ejc.532.1620189202600; Tue, 04 May 2021 21:33:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620189202; cv=none; d=google.com; s=arc-20160816; b=mDaea3Ls4qZEbigut/tK59PjJwzEPaAJQVKCx4v3cNtFQlmhjUYGHfLFWsls+MWcus UUy6WYVkYlA6wpAmE64Xfk5QnsW3qPXsjCh14QIfWhvg/J/6Uq3gg+4yVGxbbkKD3Vjm Rqp/XaMJBty4/lPB85rJGY28t1MjG9HVD+5WDk8Z+9i6oweBNDWWPdEP0XbSzmBgRngW Qrw0LVMnX+xTcn3T5AcV+kzsiDTPeqfhkB5VqUFs8rYRONpzvDRRrlQUiiKUL7X2I3kR DzO5WiMD1f2XNxBbyLX2qlG8PRChB3c0174PIwwGEYaW0at06IAg30rC7MjeVfv3EFTh HmEg== 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=AkdJ7jdjHyuclShdANsqX7WPCnDkiVjMoelEcVTWBS0=; b=ETmPiR2GKkgcEum1pckUEBhmBHNxRigJMwV/ai9oz7Xj9q2pgkqIoS2xmvUcrfBLYw eoV0IjKQ3R7rKYIcTl1NmuVYpVNLxmp/G16UqJPEpu/tAPNie4OSaYKeaKzN5r/r5n4v 2Ih9vv72v7BlR+Mhdt4rl4yzuM3JJYnhAZZuALMwx/dw76Ty9qbSNyT2Z9a0dqFAf0Os vqoUqKmhxb3QTQuAolCV+arC9gL4QNubZUjF/LkyvH6zD1MEaBxxp1iseQAR//TvxR+w +vZ9iZItWojWxWP89VtQUQyaEvvd6O4Tsh04sP+k7E1sOLQjEX0WvBXmV4HjP2yP8aYY mCeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gR3Lsznu; 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 p1si4069097ejd.588.2021.05.04.21.32.59; Tue, 04 May 2021 21:33:22 -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=gR3Lsznu; 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 S231548AbhEEE2m (ORCPT + 99 others); Wed, 5 May 2021 00:28:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231326AbhEEE2a (ORCPT ); Wed, 5 May 2021 00:28:30 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FA62C0613ED for ; Tue, 4 May 2021 21:27:10 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id q2so1058518pfh.13 for ; Tue, 04 May 2021 21:27:10 -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=AkdJ7jdjHyuclShdANsqX7WPCnDkiVjMoelEcVTWBS0=; b=gR3LsznuyMIGgTZilvyx0JbzPUtgRaDl77q4aHnJG9jj2xRpGmUuKNGJmmDri8x6AB 1rx+OC3k+00tTkLIB0hsHQr2xUbgzHtK1opdiINI1vQ1MRP1Zt9ppArBgVelELnXR2UT VKjYZuOFWLL10Q6ZgngjkAfpOQaYSId/h3eJ3UOTMxiLVycyZrQ6uzZYv1QWVdwp2X1Y UVgku59UHziHV0a/0Ukn9h8lWrJ0tMc/u8iqfVnV/a7jsZxhto9jRLq+A0GlU7ib+oGP 9oX5E8rMCfiMYzBJe1ttxKAvMxK3fdGoIZDfmPLXdNqYp3wl7+HQtoofT7PoZrGXv65c mIDQ== 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=AkdJ7jdjHyuclShdANsqX7WPCnDkiVjMoelEcVTWBS0=; b=oum5PFzbtMw5FXyVqzw9RfYMF42wjYd9y/xKt4fm3zY9HZiyNl/lTYV6pCT/GxCwqh 6KqEiQ8+xnU8+nj2iOEAOjt1BGgExAVOB476cVVt/9SyApEc9FhHEWZAdPOlmmO+jJlJ cHn3FTfdPW8uUZH01xdaKA2dJjzcyrXbVEA/evsWrtX3wUsfwo/VqNoWkufS1BAzwrkj 3+UMC7EGGiY8gNdP+14UDnh5PVdyrrwRvBAfqQYpzrO7CS3LMr6ROZP08IGbS+C5nexP uCjP4k57gkkzJsJU5sSgPMJDM//Vq+M7cTQQLSFfXQ6ijStMusxeMy80uxCHiEzrDuO6 BDrw== X-Gm-Message-State: AOAM532x0OPcE8/R5U0MSVCcj3f9QQBI4/IMdt/wli5lFR8Czm7RVdAU ZLdkKrhEwPcyPZZE3Rj6EMJ+j9H2seYBI4mGDR9sng== X-Received: by 2002:a63:4f50:: with SMTP id p16mr26300372pgl.40.1620188829494; Tue, 04 May 2021 21:27:09 -0700 (PDT) MIME-Version: 1.0 References: <20210504171734.1434054-1-seanjc@google.com> <20210504171734.1434054-4-seanjc@google.com> In-Reply-To: <20210504171734.1434054-4-seanjc@google.com> From: Reiji Watanabe Date: Tue, 4 May 2021 21:26:53 -0700 Message-ID: Subject: Re: [PATCH 03/15] KVM: SVM: Inject #UD on RDTSCP when it should be disabled in the guest To: Sean Christopherson Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Xiaoyao Li 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: > > Intercept RDTSCP to inject #UD if RDTSC is disabled in the guest. > > Note, SVM does not support intercepting RDPID. Unlike VMX's > ENABLE_RDTSCP control, RDTSCP interception does not apply to RDPID. This > is a benign virtualization hole as the host kernel (incorrectly) sets > MSR_TSC_AUX if RDTSCP is supported, and KVM loads the guest's MSR_TSC_AUX > into hardware if RDTSCP is supported in the host, i.e. KVM will not leak > the host's MSR_TSC_AUX to the guest. > > But, when the kernel bug is fixed, KVM will start leaking the host's > MSR_TSC_AUX if RDPID is supported in hardware, but RDTSCP isn't available > for whatever reason. This leak will be remedied in a future commit. > > Fixes: 46896c73c1a4 ("KVM: svm: add support for RDTSCP") > Cc: stable@vger.kernel.org > Signed-off-by: Sean Christopherson Reviewed-by: Reiji Watanabe