Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3643625pxj; Tue, 11 May 2021 08:47:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkX4CdcecaDcrUlKo78mpv5gyXNy+xAPFPGY08Kklu6FJjbXAwCKJ3uq9igBUNkCMxqCiZ X-Received: by 2002:aa7:d7cf:: with SMTP id e15mr36394009eds.109.1620748049211; Tue, 11 May 2021 08:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620748049; cv=none; d=google.com; s=arc-20160816; b=ZJ66dLkQpX0h1RoYQ37q1kxC6h/MVveD+SYyzeqfQbBo6d3oB+3puuzZ4IbecrsEgn kTSwf0d/29VOl6sXK6RUxdIrC6JFbYq6fnBF5uNJ1BycCF11kd9/yvSksJ5fL3oue7mw d57YaQP17jzy5csEZkYFfwOVe96UwIW08TmurHr7DgC7oShN8rUy3JdhGdInQP94sxkW 9+Dz3nZwQgpbtr4L9WmHWbb4hBS055AdvvQNP0kZLMVfGAm9s863jYuaRhe3C1EYuZwC bW7CqVdkGqIGeKL0ENe8UQaHBTey/U3nY1X4N+tDxBWgXiDgVS/9sY6pamGbT5PpjCpw TRFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=c+izgIxCefJB4G4VdFMpn06wW/mU/26rnT9TPpicrH4=; b=W5mIELOfnU0EdVIbSooQqA5EpjKQ3Yxvf2pwAVURLXr3d6TPd9Y233sTKYoVUlvkHN DfihxDk1jeV1plRtVSue7oa9pOJUo+N91L9QOYxjmkslx5KlGLUhlKPCinCaAKd3Oadl j98R9/sRSqaMXB5DGB7/29d3gE0/MLCaFe/TsQkv2oBvE/yBi6mivrxVFNO3yLJJXdRv 2tGbC2TfD4jMznkYfNufxNde3OYIGsnQfNx5Amjn2PMaGFRiUW9Fh+0y2ZUS6S3Q6a+K brMtgaOaER0ytq8a/CrKnix+p1KvpBIysJq/ayE+BM23AXW8U9fae/15wpHUZnhNLv4q ngxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b="WcK2Te/+"; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f17si15745238edx.76.2021.05.11.08.47.05; Tue, 11 May 2021 08:47:29 -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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b="WcK2Te/+"; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231828AbhEKPpS (ORCPT + 99 others); Tue, 11 May 2021 11:45:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231764AbhEKPpR (ORCPT ); Tue, 11 May 2021 11:45:17 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34CB1C061574 for ; Tue, 11 May 2021 08:44:11 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id f24so30466331ejc.6 for ; Tue, 11 May 2021 08:44:11 -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; bh=c+izgIxCefJB4G4VdFMpn06wW/mU/26rnT9TPpicrH4=; b=WcK2Te/+yNhv2y/wmAZmVq+IdBcJiYzMSnW3QybM5DPuWIau+5AAp72JfNVgsiVjxA oDrPIvSoQwNSgiJKA3Zv2UlumK9gEoDuINsWqd/vlbpOS4jD/HPVmsdWhI6MHBpK+MA8 sYEPMq1Xg5pk/eP/WeeLLu73ALNCxH2+gJGKvmqGb119yjz7SV7xlCyrou/WPaw15YIR hyMoYqRyW1isSjZJmTfQSasXeLfcwmOLJl/iD3+nbftnhdw4k7OGhNgHYoH+m2/ewbyF 2zUENTTaqovSAwfq6j2WG/uH12oFCPLD/pp1CBcpC0yT97xNOIe+gziCMqkFIco5jViU kEIw== 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; bh=c+izgIxCefJB4G4VdFMpn06wW/mU/26rnT9TPpicrH4=; b=OIwIfbB5FRXtMmyyA12U9JWmZRhYKNcC3QVCqhTtNmCxtpqzqHZLiiAV6ci+7Ruu01 KUknNXEKqA7/JjuWY4DJ0Mry1aUJY1rRUEdjRKgNDKZCgGqfP4MYutPbMKN2Yo0FaiRC QFO8291w7q1ei0gd5R5cHSndAl7HZ1FimWi1OBgYa30JnQAeT8RRszTCDVbqvrE3savj k9Cv21Z1tdth+4qd0etFgdH6OZvbOkRZBOSvX/2UfYr2q2v45OGwfIBrBH6Y1yujKCI6 9ORJj5lM2KbELwogOn4Q0gJ6LpN7FFHpbQ42n7DIfX7bSWCgUpOAPwHFuO3WBuN8w3Us 99pA== X-Gm-Message-State: AOAM532AwESjs/vd5+5F1ZnrHN4O7ixlBZ61HtCQeyihoGQsVpIM2YBB lkc6QVusveZDTx7F3s2K08c0FnwZNzV2Pypm1I07EA== X-Received: by 2002:a17:906:a20b:: with SMTP id r11mr32692130ejy.323.1620747849976; Tue, 11 May 2021 08:44:09 -0700 (PDT) MIME-Version: 1.0 References: <0e7e94d1ee4bae49dfd0dd441dc4f2ab6df76668.1619458733.git.sathyanarayanan.kuppuswamy@linux.intel.com> <6ea92e98-a243-ef7c-4263-bafb8946feef@intel.com> In-Reply-To: <6ea92e98-a243-ef7c-4263-bafb8946feef@intel.com> From: Dan Williams Date: Tue, 11 May 2021 08:43:59 -0700 Message-ID: Subject: Re: [RFC v2 14/32] x86/tdx: Handle port I/O To: Dave Hansen Cc: Kuppuswamy Sathyanarayanan , Peter Zijlstra , Andy Lutomirski , Tony Luck , Andi Kleen , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Raj Ashok , Sean Christopherson , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 11, 2021 at 8:36 AM Dave Hansen wrote: > > On 5/10/21 2:57 PM, Dan Williams wrote: > >> Decompression code uses port IO for earlyprintk. We must use > >> paravirt calls there too if we want to allow earlyprintk. > > What is the tradeoff between teaching the decompression code to handle > > #VE (the implied assumption) vs teaching it to avoid #VE with direct > > TDVMCALLs (the chosen direction)? > > To me, the tradeoff is not just "teaching" the code to handle a #VE, but > ensuring that the entire architecture works. > > Intentionally invoking a #VE is like making a function call that *MIGHT* > recurse on itself. Sure, you can try to come up with a story about > bounding the recursion. But, I don't see any semblance of that in this > series. > > Exception-based recursion is really nasty because it's implicit, not > explicit. That's why I'm advocating for a design where the kernel never > intentionally causes a #VE: it never intentionally recurses without bounds. Thanks Dave, this really helps.