Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp155209pxv; Thu, 8 Jul 2021 17:40:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyP0oqFJ6faVf6ZudDDCcnjJ4mAJDa/JzeAjTQbSZUC2hlJAYduwlYSvjcKHzkey8CAxFoU X-Received: by 2002:a17:907:7243:: with SMTP id ds3mr21734187ejc.150.1625791209601; Thu, 08 Jul 2021 17:40:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625791209; cv=none; d=google.com; s=arc-20160816; b=JodntKrvcpo/u1UKrJTbWdK6fUQ1PkHSBJvvYoYIWOQqFXrmqYzZv+S+6LAgun4Q2L MhCj21uT1UHUcijks/t2Z6aSTM/YJ9fsMy2G/p26ZGpGqCRJYuJEvMfKctkExW3DaDAJ /m7CCgM2mflnl1/hJrzDf97nZsN7mvfVjgbsEPjfo08Vj1J5pnSAIbSvCrI2ZyCQ6qPs ygZI2QkHAOczEujQlYD059hrz7wtIyGPJmstDA5SRCVvHRA32cp4LSGpJQXdAMBdnDvV 7A+jXq6kGAPCvuU62tnFm2PCteVvfWU+hZLPsZtE5XS9zS/75xuJzq8JtvWFL/xiuoCr XpSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=t0dEReZjvTZC8iKx06Ai7cUtftg5EDFHfoBQvlJdM+k=; b=PrrnCVBGr1J1pI7WU4fC7vu0ocO0Idu1m0s/SxVZuQP/hxKevmnDdk3jhsfocN86s/ 95PnNX6jSB3xW70tsnWtzkiXQTEawNvr4mf8sp+k17ycZnLSk06bRFO93MGO+XkfU/4e VugG9pygKEeMwwyCmeiGWkIsKmcKcx4VdI/vXQQ2OIttps3SCBSrAnPKKxDYNu20uEuM +IAfY1apyEJM0JpHbWUxNeB6Xd4SwEWO+ozm7DvAeFaDeO/lSpdaPRC5uoJpBBVQx45C Qh6altatbZ5bsEX0+4dP1o+pplrJHrJ66CMeN8lLUVYeARQNv7N4v7Mzq/MEWMOgmmhG MZCg== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds17si5716782ejc.467.2021.07.08.17.39.45; Thu, 08 Jul 2021 17:40:09 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230004AbhGIAl0 (ORCPT + 99 others); Thu, 8 Jul 2021 20:41:26 -0400 Received: from mga06.intel.com ([134.134.136.31]:16188 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbhGIAl0 (ORCPT ); Thu, 8 Jul 2021 20:41:26 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10039"; a="270737872" X-IronPort-AV: E=Sophos;i="5.84,225,1620716400"; d="scan'208";a="270737872" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2021 17:38:42 -0700 X-IronPort-AV: E=Sophos;i="5.84,225,1620716400"; d="scan'208";a="458088979" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.212.178.170]) ([10.212.178.170]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2021 17:38:41 -0700 Subject: Re: [PATCH v2 5/6] platform/x86: intel_tdx_attest: Add TDX Guest attestation interface driver To: Dave Hansen , Andy Lutomirski , Kuppuswamy Sathyanarayanan , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Peter Zijlstra , Hans de Goede , Mark Gross , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: Peter H Anvin , Tony Luck , Dan Williams , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , x86@kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org References: <20210707204249.3046665-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210707204249.3046665-6-sathyanarayanan.kuppuswamy@linux.intel.com> <06c85c19-e16c-3121-ed47-075cfa779b67@kernel.org> <169451ef-e8f6-5a07-f47a-61eaa085b4ef@intel.com> From: Andi Kleen Message-ID: Date: Thu, 8 Jul 2021 17:38:41 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <169451ef-e8f6-5a07-f47a-61eaa085b4ef@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Expensive and permanently fractures the direct map. > > I'm struggling to figure out why the direct map is even touched here. I think Sathya did it this way because the TD interface requires a physical address. > Why not just use a vmalloc area mapping? You really just need *a* > decrypted mapping to the page. You don't need to make *every* mapping > to the page decrypted. Yes it would be possible to use vmap() on the page and only set the vmap encrypted by passing the right flags directly. That would avoid breaking up the direct mapping. -Andi