From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 621C9C2B9F7 for ; Tue, 25 May 2021 02:26:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4807C6141D for ; Tue, 25 May 2021 02:26:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230206AbhEYC1l (ORCPT ); Mon, 24 May 2021 22:27:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230195AbhEYC1j (ORCPT ); Mon, 24 May 2021 22:27:39 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E885C061574 for ; Mon, 24 May 2021 19:26:10 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id y15so11012265pfn.13 for ; Mon, 24 May 2021 19:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Bd/aixUu9hpwumclvDAK4EJj/hPrV/y2+Drdwtrgvlw=; b=nmqPnBbBmXh2PPfkSEwFth4fcOArZSWczOiD2FWtb0auBxrRC/UaZ4g4EmZQgWB12P wYpI/oIeYwR4sP13sJtWUyw8Cd7n+dlb8RkPuheVGG7EV57zETc/lMhfSt+i0+rI4ol0 TFUlFuLEz+9P+UuCPhVqhnVoknAQJ933ambfER3UKIbccyHNeAhKVEq0zHUQyaL31KGk WBFwGysdEq82Td2VISlpyLlrl2aXO0fb1SwPf9iTz2E5TdrelvOWg6oiiMC9f+Cn4Ll8 tKvypSB956iNHUsO/l3iuB2B/v9kUogeB8z6HF/qP3QXMJ1ZTDOZYmrv4lLF3Kl6JmIS bKyg== 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:content-transfer-encoding; bh=Bd/aixUu9hpwumclvDAK4EJj/hPrV/y2+Drdwtrgvlw=; b=HSMD/JmewmrfthzFF5Q2qZF9Of0VyaO6/d6vJdfqsxGlA04ii1y11/Q7CCu7GGm0Vg KqxjvoVQsh8T8UBvB492qYrXF6Kz2kP9KVfsKfrnBLfgZoyCnGuo9oO+0MerDxCmi3W8 LapJyeQY5RTM1ff4MYrLCv1Ea8RJLwNUhI+z7XMuXtQ5gN4f2F4FPNFnnClAk9ugqaym We1jSBTiQDuyNzBic/BnE7WFQXkirSGbNvTkN93AFhEOXDwUXdk3xnKvrZDXzSDJGgTW X7I9xDl70+TiGR+KluyR41ZgIkr6QWHoo+OO/ifYnRaAHvBhgdzpa5x8e+aTnu0DjLop zLaA== X-Gm-Message-State: AOAM533AUl3gPzNNWOoqVaKbtIkz7kIvDlz/q6arxLKgQDgCQvjT7cm4 egSoZAZGozj1Bkc1CpJF3TR5tUCZcJwdtYDfOJ4e9A== X-Google-Smtp-Source: ABdhPJzBT+DE3d5Jlni87pcVERVwS36cMzAE0W1tSoMWIX00HvpRLW75roMZiLbMTXAKC5iMndOQWmn3BIwfl2W21PQ= X-Received: by 2002:a63:1e1a:: with SMTP id e26mr16321299pge.240.1621909569971; Mon, 24 May 2021 19:26:09 -0700 (PDT) MIME-Version: 1.0 References: <37ad50ca-f568-4c62-56e2-9e9b1f34084c@linux.intel.com> <20210524233211.802033-1-sathyanarayanan.kuppuswamy@linux.intel.com> In-Reply-To: <20210524233211.802033-1-sathyanarayanan.kuppuswamy@linux.intel.com> From: Dan Williams Date: Mon, 24 May 2021 19:26:03 -0700 Message-ID: Subject: Re: [RFC v2-fix-v2 1/2] x86/tdx: Handle MWAIT and MONITOR To: Kuppuswamy Sathyanarayanan Cc: Peter Zijlstra , Andy Lutomirski , Dave Hansen , Tony Luck , Andi Kleen , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Raj Ashok , Sean Christopherson , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 24, 2021 at 4:32 PM Kuppuswamy Sathyanarayanan wrote: > > When running as a TDX guest, there are a number of existing, > privileged instructions that do not work. If the guest kernel > uses these instructions, the hardware generates a #VE. > > You can find the list of unsupported instructions in Intel > Trust Domain Extensions (Intel=C2=AE TDX) Module specification, > sec 9.2.2 and in Guest-Host Communication Interface (GHCI) > Specification for Intel TDX, sec 2.4.1. > > To prevent TD guests from using MWAIT/MONITOR instructions, > the CPUID flags for these instructions are already disabled > by the TDX module. > > After the above mentioned preventive measures, if TD guests > still execute these instructions, add appropriate warning > message (WARN_ONCE()) in #VE handler. This handling behavior > is same as KVM (which also treats MWAIT/MONITOR as nops with > warning once in unsupported platforms). > > Signed-off-by: Kuppuswamy Sathyanarayanan > Reviewed-by: Andi Kleen > --- > > Changes since RFC v2: > * Moved WBINVD related changes to a new patch. > * Fixed commit log as per review comments. Looks good. Reviewed-by: Dan Williams