Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2378447pxj; Mon, 10 May 2021 01:11:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmkJxncJgieXIhxPtgPPaaQEDL4TPs0xIImPG20nHWv0NLX2yMnkIVJ+LPc7flNR2LdDi8 X-Received: by 2002:a5e:dd47:: with SMTP id u7mr12410917iop.62.1620634284014; Mon, 10 May 2021 01:11:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620634284; cv=none; d=google.com; s=arc-20160816; b=gnLWJReT9gaZyX262qESCrlDfXdKmJovCPcpZ+0YJuW/njvwWEIDCHuO4bDsmDhbj3 ZVNmfDwCvrekde5j/RS88CgmQOdEqErFv55JXR8Lio9fcujy/YYbmZnq9icclo39EZJn fQECvLAkVPr9vPRyYJ58d2bzV8ewJESGDeyjbYjREEHqk21j+Ze+MtDKnkFi3fZePN7R DY60/EwO+6QzJWmWWWksVJYCsBWkUzW+0MCbya63aa1KmCj9XUnCtgWWj7BEdJo0O++E lHkcp58UPPt6rQqzC14eEljWW0Nr7w66bBXWQdwSEelJaELYQTVH0xRJ8dLnwhSi1KrM AILg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=tWO5o+mnEQWJee4xIdn8XNFfma6hcdcmtBS3JbLPDEk=; b=fteFL7DFz2rGFGI5g5YJoZYNyPIwqC9YdH4UJqo3q+W4XlmKygkiGQzBWzNCBV8LvL uxgnUBHnyO6esHOu/ATvQVPNJSG0gtkZpZ8s5udV9M3qg4peuGBHKt26ZnC9kEuh+a/Q X17EKip3IVhUBie0W9/h4uOCoi3m52dQKWoJXLaLNvGM7VdLLYvR6tx+aWdCKUDGBRJw hnG02FnJsx9ksFBZOmbzHbrvA33yKtPkH60eoxxhhD7+O3TfD0FpconGQO3pOQ8IGBGB fYKqcRxG2nG+IRNtIWw9oYOIUAeU9+V+9C8I9se9/q0BWktNcGWp1BAZVE/xwnVa9C3g HOBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SCszalFI; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q3si729309ilu.88.2021.05.10.01.11.11; Mon, 10 May 2021 01:11:24 -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=@redhat.com header.s=mimecast20190719 header.b=SCszalFI; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230197AbhEJIJr (ORCPT + 99 others); Mon, 10 May 2021 04:09:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:23950 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230093AbhEJIJq (ORCPT ); Mon, 10 May 2021 04:09:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620634122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tWO5o+mnEQWJee4xIdn8XNFfma6hcdcmtBS3JbLPDEk=; b=SCszalFIhWnVTOlquuscYvrtsTT2S7mv8x6c7/x1iO/85TztdXuFfoj7l9bKer/vUl3Pqi jZs3vXv1iK6B7R6cmIc0spat10r5XkWLiZkDglIG2maRrvlmZ2wrC6YxaWvj2+8ELfzRCj /sBEQaboSYwVtWKiiHNMgAZ0S7ztXhI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-544-smI0prXuOfmf0isDLk6MRg-1; Mon, 10 May 2021 04:08:40 -0400 X-MC-Unique: smI0prXuOfmf0isDLk6MRg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2DB06107ACC7; Mon, 10 May 2021 08:08:39 +0000 (UTC) Received: from starship (unknown [10.40.194.86]) by smtp.corp.redhat.com (Postfix) with ESMTP id 483255D9F2; Mon, 10 May 2021 08:08:36 +0000 (UTC) Message-ID: <4a4b9fea4937da7b0b42e6f3179566d73bf022e2.camel@redhat.com> Subject: Re: [PATCH 03/15] KVM: SVM: Inject #UD on RDTSCP when it should be disabled in the guest From: Maxim Levitsky To: Jim Mattson , Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm list , LKML , Xiaoyao Li , Reiji Watanabe Date: Mon, 10 May 2021 11:08:34 +0300 In-Reply-To: References: <20210504171734.1434054-1-seanjc@google.com> <20210504171734.1434054-4-seanjc@google.com> <1b50b090-2d6d-e13d-9532-e7195ebffe14@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2021-05-04 at 14:58 -0700, Jim Mattson wrote: > 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. > I vote too for this. Best regards, Maxim Levitsky