Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1116863ybz; Sat, 25 Apr 2020 11:19:52 -0700 (PDT) X-Google-Smtp-Source: APiQypJTWAcDf1GrliBkQVPeCPOQawSC7eOEdetZYtMRTH68bS7e2h8qhj5MFISUs8cRJYbL788e X-Received: by 2002:a50:da49:: with SMTP id a9mr12037367edk.388.1587838792165; Sat, 25 Apr 2020 11:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587838792; cv=none; d=google.com; s=arc-20160816; b=TIRfL/4UTxW2t0bG39aQScphE01gcPXMu7DDCbrRu60w7Z54KY+ih0qext3ajAdKY5 7eF2PD2wGGrODs6WWt6EmwrCsxQjXPFDgflu2k3ruLBiQLns1GfMJwgdyQY8ARd80NKo x6xohFCAYLn+33xHHaAF3rdgrdfl4jigb4yk7hIVG02Ul99duFpO0sRTGKWukk0sXdHB YQEJ+VxofrLMWKPTf/iUnCdr3qAMNoSZ/kMG8yhbbaayrzRCz1svtJtBOzXJl4zLaIyg 4gWaqt44oFcjXJ61T/BgHllkf0fy46U80wFnSB91mVC65dOE/zttDewyGKoJiSDwT+fb T1LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=i6/8QKM6yqyksti+48GZmHJzD/daFi3KdQq/PCEYuoA=; b=tCNcZW0C6arPmZ3wO0299WoIMC7ktZ7EBpkGTGczDFIgtcn9+6U1rwB6457Xsq6vx9 Voeuca7iKNpbbLVBMvE/BQ7pWfBdgXXOI1+cTmTdggHKKShp00sl2oM4Il831fxe5ebV ko7yzv3MHoW8uXaRmD1yimBUmgJQBIgIwC9UQ/c768EWYbvY5Bc6V3/HyBAZnicpLyMo HTdj4XaFdqKbKg9j8qEO+qnpNAJ70DlHFL8Oe2lC1y6NFz6IITJS9AL18R3lp/1S7Ct7 Miu5pGF/DbbqXeNId/gH3zs3WKHiEnJf1ouOTWegU7sYULTJn637g32qechxja5ucR8d TRug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Td1w4w4h; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lw23si5432418ejb.423.2020.04.25.11.19.28; Sat, 25 Apr 2020 11:19:52 -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=@kernel.org header.s=default header.b=Td1w4w4h; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726157AbgDYSPu (ORCPT + 99 others); Sat, 25 Apr 2020 14:15:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:50438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726145AbgDYSPu (ORCPT ); Sat, 25 Apr 2020 14:15:50 -0400 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 49AD421744 for ; Sat, 25 Apr 2020 18:15:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587838549; bh=cVK0toJnn9vOB9E2SmO9CBJWGgOYMugNbByNAh8ilkI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Td1w4w4h9ChWYz5sxGi7UkXFmK/KIcZI+NzSE/qXy5EHXewGWv3PHpGP8/taXuTC8 uWk+vEI7eTXTaXz696KMMjIcufWpDhgIKKqdFCb7AYkGEgWEYvLqqKw19we/BmxCNY FwvAGN5IfcSyhd4VsaVVYwDtAW54CWFlJnBsZaMo= Received: by mail-wr1-f54.google.com with SMTP id t14so15496767wrw.12 for ; Sat, 25 Apr 2020 11:15:49 -0700 (PDT) X-Gm-Message-State: AGi0PuaRXSzcKD3PaWwfbu+qj94jwaH93yM6LTVhX3urwwYhcTYpIl6h 35z4NlELhAT7Hu47hBNUGz3esnZ9IlE7CI20Nj6Viw== X-Received: by 2002:adf:f648:: with SMTP id x8mr17727377wrp.257.1587838547579; Sat, 25 Apr 2020 11:15:47 -0700 (PDT) MIME-Version: 1.0 References: <20200319091407.1481-56-joro@8bytes.org> <20200424210316.848878-1-mstunes@vmware.com> <2c49061d-eb84-032e-8dcb-dd36a891ce90@intel.com> <4d2ac222-a896-a60e-9b3c-b35aa7e81a97@intel.com> <20200425124909.GO30814@suse.de> In-Reply-To: <20200425124909.GO30814@suse.de> From: Andy Lutomirski Date: Sat, 25 Apr 2020 11:15:35 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] Allow RDTSC and RDTSCP from userspace To: Joerg Roedel Cc: Dave Hansen , Tom Lendacky , Mike Stunes , Joerg Roedel , Dan Williams , Dave Hansen , "H. Peter Anvin" , Juergen Gross , Jiri Slaby , Kees Cook , kvm list , LKML , Andrew Lutomirski , Peter Zijlstra , Thomas Hellstrom , Linux Virtualization , X86 ML , Sean Christopherson Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 25, 2020 at 5:49 AM Joerg Roedel wrote: > > Hi Dave, > > On Fri, Apr 24, 2020 at 03:53:09PM -0700, Dave Hansen wrote: > > Ahh, so any instruction that can have an instruction intercept set > > potentially needs to be able to tolerate a #VC? Those instruction > > intercepts are under the control of the (untrusted relative to the > > guest) hypervisor, right? > > > > >From the main sev-es series: > > > > +#ifdef CONFIG_AMD_MEM_ENCRYPT > > +idtentry vmm_communication do_vmm_communication has_error_code=1 > > +#endif > > The next version of the patch-set (which I will hopefully have ready > next week) will have this changed. The #VC exception handler uses an IST > stack and is set to paranoid=1 and shift_ist. The IST stacks for the #VC > handler are only allocated when SEV-ES is active. shift_ist is gross. What's it for? If it's not needed, I'd rather not use it, and I eventually want to get rid of it for #DB as well. --Andy