Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp1585952lkv; Wed, 19 May 2021 13:25:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGS6PNXNdkH/jVjzk7ayComJGKB3AnX61DAXX+GyIefSyUZaHqB6QMQBrTdQXI24O7CAvW X-Received: by 2002:a05:6638:37a9:: with SMTP id w41mr1192802jal.12.1621455903615; Wed, 19 May 2021 13:25:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621455903; cv=none; d=google.com; s=arc-20160816; b=Xm+p1J43X7PCzuquNDR6uWCv2tiIlVaNLE7RjgaZsm5yvb/+CY6rRnH6/18bFvbeZj N8tbW0JkzQCWcGXBA7V6ogPMeO4vfhA6mVOTWY7RjxAM3n/UU2y2h0FtYRSSy0+aJXgE NVp+o7bEGvu14KQQ2MEiyYnGzR2yr1EqgEWWkyZxjdax0xvfnRlmClOPw1qQdE2cZCwB w/fgjoE6XpC2BMDn7Kz/2LfKz+adKv8F9sE0zVDyMcMwYFW8GfH4YPfPzUi/04/Pghal foCyd8X3eyx+As1fymc5UkHvagdscKQmfNyBQTKmPqxDkwbrMzdh2KKolVtkf41zcTDo cZIA== 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:dkim-signature; bh=SdBCXg0gqh5qnS8uVaYaL/GELEQlApKoiEiviwsxCNE=; b=TBda9l25mfzxDRgt6ZTxWtGrD00U7V/TZv403S2YeNV4GeSAQOWGfKlBE8Z+CbYlAl AeQbf5XIr3JP2LGLYYUTDPhLBXTh85HAhvgImKC55Unzw3x9IjC/Vr7maVvk/Mq9RurX 5Aq4GxbA8fJ91FPvLEZVUK7aWwZ7/wBoBC2kwxF2EHOrtO/aQXZvHKNZ7YTOyWyahcM8 holrxKAGJN2VELKIKD3HrsrydmSYAAHbVmMUr9SzQZg2U7ZYSr7XSmLZwTPuU5/Jsz4z 5zQyCIm76CPRZLEphRefRmLa3HG9CCV0yC1Sf1Xup0Af0legM80tV7Mf6z1BAfDqfBoC X/cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ShUap1zV; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w8si386695jaw.8.2021.05.19.13.24.50; Wed, 19 May 2021 13:25:03 -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=@google.com header.s=20161025 header.b=ShUap1zV; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232890AbhESULR (ORCPT + 99 others); Wed, 19 May 2021 16:11:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232884AbhESULO (ORCPT ); Wed, 19 May 2021 16:11:14 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 107A1C06175F for ; Wed, 19 May 2021 13:09:54 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id j6-20020a17090adc86b02900cbfe6f2c96so4023768pjv.1 for ; Wed, 19 May 2021 13:09:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=SdBCXg0gqh5qnS8uVaYaL/GELEQlApKoiEiviwsxCNE=; b=ShUap1zVSjEf5c9tIcb8T3dxQtq7M5Bf5oSNZC70CMZkV8qiu6KLwlh8zkYnbIdlbQ 3VVxpXSmlTvPSS0MA1yYxv4e/bUwretCF7OcceYfg8wDgMQG9akv8wKhqry2IPz3LhiG 5xdRxgMacXaYyaBNXh7uLCPDi6m/Q4OvLmYBMYBrSYbYILDPdMMokt7QcwIedJzkAsXC n1vrdyaCPOz54iZSqlfIkvvFiDmRrc1IyW7R3bPTyXODiSijpX5h7WhINw0c2jsqbTHt MY+Xepc/OYTPE3ePBcGYftHF89DfPCfCZmSgTlpaAbr1mEjSuK0r7zTI++WtkE35lxnq peDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=SdBCXg0gqh5qnS8uVaYaL/GELEQlApKoiEiviwsxCNE=; b=nYawKG6kPKv1Hn4xJ96JgDOyTVATTMoTA5JyHtwbuAAyydup69C41NoTU4uRKsA2kq AhrwS0KLxTtQjF9eAzIM4f2U+yaH4qDh158a4Q6ec2P+sUBGr3L/s3ihGoY+51fkveXG p9QkQ6ET1v7HxZuZD+HmCsW3/7JkashAv/HAw1AydVPAU0+xuzQxIU/rqnKYR9nZOWy6 RMR0/bwXX4ev6cbJK+S53VwNbNHKhJcHZiQLAWNL9CEuLaAsn5v+SaF9LJ/HrCtkfhGq TeadTupLgU/Q7K0Nuc6LXUzV2xwt3tqrzgmTY/CXb4lYqirug+MaSC25T1iGWpVf+N9O AR9A== X-Gm-Message-State: AOAM5313DXpCjxyweqzhhfQRbj3VVWDmsIPzWGB/x6JTKvhLprnDYu0p wT0Vt3tuyXwfuk6hgw9GGMpwEQ== X-Received: by 2002:a17:902:854b:b029:f0:b966:1ee6 with SMTP id d11-20020a170902854bb02900f0b9661ee6mr1496588plo.50.1621454993416; Wed, 19 May 2021 13:09:53 -0700 (PDT) Received: from google.com (240.111.247.35.bc.googleusercontent.com. [35.247.111.240]) by smtp.gmail.com with ESMTPSA id w123sm183702pfw.151.2021.05.19.13.09.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 13:09:52 -0700 (PDT) Date: Wed, 19 May 2021 20:09:49 +0000 From: Sean Christopherson To: "Kuppuswamy, Sathyanarayanan" Cc: Dave Hansen , Peter Zijlstra , Andy Lutomirski , Tony Luck , Andi Kleen , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Dan Williams , Raj Ashok , linux-kernel@vger.kernel.org Subject: Re: [RFC v2-fix-v1 1/1] x86/tdx: Add __tdx_module_call() and __tdx_hypercall() helper functions Message-ID: References: <3a7c0bba-cc43-e4ba-f7fe-43c8627c2fc2@intel.com> <20210519055842.2048957-1-sathyanarayanan.kuppuswamy@linux.intel.com> <568d2929-f366-e3be-96f9-0bfa91991ef2@intel.com> <02e7b229-4b6f-c1c7-bb63-48e5e9eca5db@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <02e7b229-4b6f-c1c7-bb63-48e5e9eca5db@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 19, 2021, Kuppuswamy, Sathyanarayanan wrote: > > On 5/19/21 8:31 AM, Dave Hansen wrote: > > Was this "older compiler" argument really the reason? > > It is a speculation. I haven't tried to reproduce it with old compiler. So > I have removed that point. It's not "older" compilers. gcc does not support R8-R15 as input/output constraints, which means inline asm needs to do register shenanigans, and those are horribly fragile because the compiler does not ensure register variables are preserved outside of asm blobs. E.g. adding a print like so can corrupt r10, which makes it an absolute nightmare to debug/trace flows that pass r8-r15 to asm blobs since looking at the code the wrong way can break things. register unsigned long r10 asm("r10") = __r10; pr_info("TDCALL: RAX = %lx, R10 = %lx\n", rax, __r10); asm volatile("tdcall" : "=a"(rax) : : "a"(rax), "r"(r10));