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=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 55EE3C4332D for ; Thu, 19 Mar 2020 15:44:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 246992080C for ; Thu, 19 Mar 2020 15:44:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584632659; bh=FVF/u9TSzlMdhf4kpAsywZwLbl/sGhd8ENC//u14qkk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=YSthexWCD7uAE5HoOFXXj1+CMvU1XDUY2AuFyneSSFHpVmd+wuxorMYoKccOBmFkk aM+qWUhTA8+2J0Prav6sYOQS+jhaBatb8cNthhCnU4r9Ag/OWflUwNzsPR61PCG/5n H756J9oYlGJnnQdH21DqmNbDPmdbkwfaiPxb/xw0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728044AbgCSPoS (ORCPT ); Thu, 19 Mar 2020 11:44:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:55472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727212AbgCSPoR (ORCPT ); Thu, 19 Mar 2020 11:44:17 -0400 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 821AF20836 for ; Thu, 19 Mar 2020 15:44:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584632656; bh=FVF/u9TSzlMdhf4kpAsywZwLbl/sGhd8ENC//u14qkk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=I0y8sUtct/Bh3UhCYALlKYXq+6n0HLrW6vax7RdHHsEFi5n3GSL+JQMq0m0DjnndW Xnlr5ugUwiw8Ty8NfSG7okzMxvecohY1DohE1VEjUTEVJLbVTbJhrexGrjUrcjgFHl WDAK45zaZZs97psWeLFp4eLJq6uLqm/BJjrLdIjE= Received: by mail-wr1-f53.google.com with SMTP id i9so3593773wrx.12 for ; Thu, 19 Mar 2020 08:44:16 -0700 (PDT) X-Gm-Message-State: ANhLgQ0O6nehPNln4RMHjDLezthcSj2iu4CGYSR/JwPT4cgFG5weJWK5 IXp/tW9vbue6pBv1Ep7tyy2xweYIBozC/Zopf89qbg== X-Google-Smtp-Source: ADFU+vu9xO32MybzBmacdPgCqlG7WVDPKTtdn223Fbu4PAIymbvyrGwQMSSWxAV7RNpXhGgQhHa1JuyvGJ5sDsUdXMI= X-Received: by 2002:adf:a30b:: with SMTP id c11mr4940938wrb.257.1584632654996; Thu, 19 Mar 2020 08:44:14 -0700 (PDT) MIME-Version: 1.0 References: <20200319091407.1481-1-joro@8bytes.org> <20200319091407.1481-42-joro@8bytes.org> In-Reply-To: <20200319091407.1481-42-joro@8bytes.org> From: Andy Lutomirski Date: Thu, 19 Mar 2020 08:44:03 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 41/70] x86/sev-es: Add Runtime #VC Exception Handler To: Joerg Roedel Cc: X86 ML , "H. Peter Anvin" , Andy Lutomirski , Dave Hansen , Peter Zijlstra , Thomas Hellstrom , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , LKML , kvm list , Linux Virtualization , Joerg Roedel 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 Thu, Mar 19, 2020 at 2:14 AM Joerg Roedel wrote: > > From: Tom Lendacky > > Add the handler for #VC exceptions invoked at runtime. If I read this correctly, this does not use IST. If that's true, I don't see how this can possibly work. There at least two nasty cases that come to mind: 1. SYSCALL followed by NMI. The NMI IRET hack gets to #VC and we explode. This is fixable by getting rid of the NMI EFLAGS.TF hack. 2. tools/testing/selftests/x86/mov_ss_trap_64. User code does MOV (addr), SS; SYSCALL, where addr has a data breakpoint. We get #DB promoted to #VC with no stack.