Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp209031pxy; Tue, 20 Apr 2021 16:55:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeqydH/m4BSw0i8cKkw3Ww7vmPF+I+OJ2tkP+XQiM9fHQehRAcYXvCtgayv5TntvBJyRmT X-Received: by 2002:a17:906:b191:: with SMTP id w17mr30347705ejy.200.1618962917441; Tue, 20 Apr 2021 16:55:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618962917; cv=none; d=google.com; s=arc-20160816; b=YL3jTG8yzG+HUzvZkoMuKeqicdhahpc6pCeVrUIG6b+fHXNnTe3hfVUbO32r+B61++ 5HJSccSHwxNgtydQNmq2T+7guPqRp9tOzWAf+U2jmAIcEiM4pemsHGqBttwaAU2rRrit ZWVZtve5ta238N15VLAw8k2mdBuxGedTpSd/S9hjQ9hu2ui4eh/vADe4dCAzPSfnrYro J0aX06aiVl0dwzSzj9KiFbn283nvKG+DY/Gpz+YpKh2Pm0cSSeKkmoCnCsv+unTpcW7a 5vSNJwktpyyGMHkDowsU1ezujlLlKm5SolUsYPcyZy0NIyjDq5YLcw0rR/uCqvOOo30w Hh8g== 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=F1HVqw2u+ZEVP3LLHwLN3iHI1fOIOC87ihGMFz6AjvQ=; b=vcGuOULRNOhaaHKh/cEqtR1t9Qgcc2wQBMvqitMiDoP+v5ZVRkY3YjHDBykk/oxQ6O BAHUeP0tEzjM27uepZ2xYjD33IeXHxanETUTC+lkc50y7zDBXsUnih29Dv/dUKEVueqh sadM2Cv57Pe3i/3Sz+HoOFEA4fIzWeoAUjRsZss5VnJCCys/D9qssI+SZ2/9dLvZT0RG aTOKfM3v9Gnzj9K57SS82GIsf/riVDEWX9cXdiO17TxiL/lbKcAznx9tVO6KaywmgBSd nCKG2+DpdAlA0Jj9eL5w/EBf9qa8k2V3pL+Wm0fF+izWHhSsF/xMyEoJHKo9ohNkUtez aI2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=b1J20iHm; 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 z3si489714edd.61.2021.04.20.16.54.53; Tue, 20 Apr 2021 16:55:17 -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=b1J20iHm; 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 S234380AbhDTXya (ORCPT + 99 others); Tue, 20 Apr 2021 19:54:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233992AbhDTXy3 (ORCPT ); Tue, 20 Apr 2021 19:54:29 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A61A9C06174A for ; Tue, 20 Apr 2021 16:53:57 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id u17so60865984ejk.2 for ; Tue, 20 Apr 2021 16:53:57 -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=F1HVqw2u+ZEVP3LLHwLN3iHI1fOIOC87ihGMFz6AjvQ=; b=b1J20iHm9woqr0rW5wfn/QNVzNKS/tbNwU/8AHh1VWxJYJjPKn7fyCzGkkLajwpoEQ Q68quh7pNoBXlSWxJTq+kC4PxdR7SyMdBk2cXUfROUdNWSfNRV68IY9Xu3a9515AWa0A OfIxQooTfPELmkSEShUytc9HSqM+7JVpKS0J7J9IPJBhKTd0kZ3SM4PaIExchFWkLJMq SDdMqMl0GWDuNbIVmPpy6HB9RC9Oseo099u46R3ddDpo0BvxQSmuqiwPa07LiXcq6ifF X2G5yxAOHhv6+SNHF/Xc77dIPxGSBrri5xNklqftApMVughkKRtDZJJHTsD4bfc9fnNw GQQA== 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=F1HVqw2u+ZEVP3LLHwLN3iHI1fOIOC87ihGMFz6AjvQ=; b=OqL+ua8KrNSYVsAF+obDjOputYZw4WOIr02yl7burmPCOEa7DsGq5tEtIMpNsFUvjC qdGEoAGHgTOhISOUa9oY3qffx023LoUlIYEKHJvk99A3Box3CNiYV++9k4Uf4Cfa2Ynh TFTvVrxbYBgTBlgp4yPzHv4PSw4K6IHLy+8Q/DUPYhviW1np3V5ziA0nbhq2Iq9i+KNX 8LR6mp8skA9Negag4Kjra4yKJBbecnvnJZRcXFMtpVkv9nWuMFVwGAImNIj20lCDbHnx zF3GZy9PrtlF6g0QEu4tzOHyx0CcmxKHVYCtyH2hL8MEekEVzhGcLrKs+FjCiW71cF6p Nmuw== X-Gm-Message-State: AOAM530LOEtrLYQsThW1mbmDbPQE3jwx6/eHmiOZP+6GFDygIKqOUXzP vj7YJn+aIVTqBtY68dfMkOXvcjJGqNGf4iw2N+UUvQ== X-Received: by 2002:a17:906:18e1:: with SMTP id e1mr13565044ejf.341.1618962836302; Tue, 20 Apr 2021 16:53:56 -0700 (PDT) MIME-Version: 1.0 References: <8723950c-e07c-9a03-503a-ab232701d1e9@linux.intel.com> <77a13ae9-0220-030e-7ae4-fd26edd7b110@intel.com> <2a3f6b3d-cd80-0734-ce83-c067666c8326@linux.intel.com> <14332abf-c78c-3bc2-9a7c-ceacfa7a0661@intel.com> <596175e3-9d1e-6c9c-fadb-ad02c396e3ad@linux.intel.com> In-Reply-To: <596175e3-9d1e-6c9c-fadb-ad02c396e3ad@linux.intel.com> From: Dan Williams Date: Tue, 20 Apr 2021 16:53:48 -0700 Message-ID: Subject: Re: [PATCH v2 1/1] x86/tdx: Add __tdcall() and __tdvmcall() helper functions To: "Kuppuswamy, Sathyanarayanan" Cc: Dave Hansen , Peter Zijlstra , Andy Lutomirski , 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, Apr 20, 2021 at 4:12 PM Kuppuswamy, Sathyanarayanan wrote: [..] > >>> Also, do you *REALLY* need to do this from assembly? Can't it be done > >>> in the C wrapper? > >> Its common for all use cases of TDVMCALL (vendor specific, in/out, etc). > >> so added > >> it here. > > Can I ask a favor? Please put a line break between quoted lines and your reply. > > That's not a good reason. You could just as easily have a C wrapper > > which all uses of TDVMCALL go through. ...because this runs together when reading otherwise. > Any reason for not preferring it in assembly code? > Also, using wrapper will add more complication for in/out instruction > substitution use case. please check the use case in following patch. > https://github.com/intel/tdx/commit/1b73f60aa5bb93554f3b15cd786a9b10b53c1543 This commit still has open coded assembly for the TDVMCALL? I thought we talked about it being unified with the common definition, or has this patch not been reworked with that feedback yet? I expect there is no performance reason why in/out need to get their own custom coded TDVMCALL implementation. It should also be the case the failure should behave the same as native in/out failure i.e. all ones on read failure, and silent drops on write failure.