Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4835844pxb; Tue, 28 Sep 2021 05:19:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfN6INMyqLd03z+ZsJTxvi9ZZSTgdZ9n1HAsQ/vbkKcSC/RESU/XoeMk5A0/FGHHAdu0ys X-Received: by 2002:aa7:c690:: with SMTP id n16mr4710788edq.304.1632831562112; Tue, 28 Sep 2021 05:19:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632831562; cv=none; d=google.com; s=arc-20160816; b=ymxphCZD2rLziXCZ0CNqKSP2jfAksVrMK7K+WzNFJZXzGmddwoiBE4svbLwYq8md/7 tOUZETdgY3ZocWeAhkudXITRTQXYE3Y1c4VVBBsRbZBYEnZwBRNw0vsRORhvO+RXuQ1R MfET/NxMXKf9QgMOLxbGsV9FergjaRvWNOArjLp2k68lStqeMs6HlMw+KIrdI6AYRLbk nM+uUKHxuJhuNnv6QAG2V3QOo4PHaU2LdrYYQ8Y87O2o+vt3/iC92LfpTeQ5cg6h1ynC 8xVj/PrnzBUoEQwtnmOYOv+EdFpc6wqKaf3sFcPBNZvPUQxXchO5Wj9WjTpMg/dHA2Do /T4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=rqyIBcunnd1rBGlkRPmoYR+bJfPQ/NZiWWxmokdPHiY=; b=GQ4dLqQl07TJogm7LXiv/Q/sntqLmia04XFw/3tHtY5fDC9JXZ6H6FpvmDt29tMArm 8qfxM+o+ezn0dOtmyoMJel6FMtIwuLJfC97olGj795sVApqfsKeTyzT2WRTs05vC+z4a v3Rq8zwBJ27shT4ZiFG8KG4TCjmHBlsUOlmN+U66AY5kVgMCUoDFCNKL0FVY2Cz72P1/ ibE/SN975jXu3Y7FMYWQc+DS1yv072lnUbYR2h2GXQGAYDpxfFYcFUo6wlyv81ZDMPnr lb1iuApd1jHhIbKIHZZMOaYn8d6SBj7gP/uGREs2HnnJTVzdRqioB3nmoDnMEpfz2JaJ cdPg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d11si20833847edm.533.2021.09.28.05.18.57; Tue, 28 Sep 2021 05:19: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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240622AbhI1MSW (ORCPT + 99 others); Tue, 28 Sep 2021 08:18:22 -0400 Received: from 8bytes.org ([81.169.241.247]:39992 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240544AbhI1MSN (ORCPT ); Tue, 28 Sep 2021 08:18:13 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id E1DE5208; Tue, 28 Sep 2021 14:16:31 +0200 (CEST) Date: Tue, 28 Sep 2021 14:16:26 +0200 From: Joerg Roedel To: Kuppuswamy Sathyanarayanan Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Paolo Bonzini , Juergen Gross , Deep Shah , VMware Inc , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Peter H Anvin , Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 06/11] x86/traps: Add #VE support for TDX guest Message-ID: References: <20210903172812.1097643-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210903172812.1097643-7-sathyanarayanan.kuppuswamy@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210903172812.1097643-7-sathyanarayanan.kuppuswamy@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 03, 2021 at 10:28:07AM -0700, Kuppuswamy Sathyanarayanan wrote: > In the settings that Linux will run in, virtual exceptions are never > generated on accesses to normal, TD-private memory that has been > accepted. Does this also hold true when the Hypervisor does unexpected things that cause previously accepted pages to become unaccepted again? This means pages like the entry code pages or other memory that is touched before the syscall entry path switched stacks. Can you sched some light on what happens in such a situation? > +DEFINE_IDTENTRY(exc_virtualization_exception) > +{ > + struct ve_info ve; > + int ret; > + > + RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU"); > + > + /* > + * NMIs/Machine-checks/Interrupts will be in a disabled state > + * till TDGETVEINFO TDCALL is executed. This prevents #VE > + * nesting issue. > + */ > + ret = tdx_get_ve_info(&ve); > + > + cond_local_irq_enable(regs); Potentially enabling IRQs here means that TDX does not have a shared per-cpu data structure (like the GHCB on AMD). Is that right?