Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp873693pxb; Wed, 1 Sep 2021 11:49:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgupQvbn/ceOE5KjBji0NpUXDPHXNWtc2zCu3nJiA4dZ89WgFBX11lg+STR9GA8wkcmzdw X-Received: by 2002:a02:ad17:: with SMTP id s23mr862913jan.135.1630522165630; Wed, 01 Sep 2021 11:49:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630522165; cv=none; d=google.com; s=arc-20160816; b=rveaRL3mjgYOemEQbCz0NcZZK32GQkGJkt0QCSI3tT1Ldg2p4LYVuYYrVehMVXkFrP Wh9F6zabRbPlLA1DOiAlwiXp5G8lJRDdf0FzlChZo3hlx2F7wmgDJuG67FwcfGxBWktr ORaIPM0T7nagDaLR2IQ8ALqhYORFGmzaIVAHcPWLzLU0+pW3Rph0xGmBa2hkYCQQJC7Z lZvjUVUY7coUrV6Mn0uoBkLl5gqgh5MD53lXjlTqNr8Vvy3gVOoFJF59gYZ/5u0yAX5p bpDRDbnLF6GqZoZLOhB/7aTpL/AG3vv+LxpUl+kH4LhNyQ2S0fCyfmpwjcIPurQAwEmq QcFw== 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=b0wiLdV/sTJcclFf0mgjAxzhXW/epoX+CHp2TKm2RDM=; b=l+IpJNkLd/riHucLbVUVrJp2+G4UVQIsZ3Vh/o7dT58AChY8zLJoYbE+UySHAteqLM 2660b+9i0FL9tvRG8G6zdCjmuCyQp/Forjia+xPXNYUmBIt2JfyL2Rh8Yq/7pI4SAyFZ M9SVkP0vp6/y/PkUs8lr7uWx5/wA0PZKdfGPC1SOF7n0t4ZOJfxI4/m8byLIjq/dNKqp 3lLvPElQoOc/wKODQ5lPk4H9y8q6gWYWSY/omu6EUUC0ySpYMuhSJlb3gBbovzIQzsx/ xlXArKlCPmmR1WbCAW6raFl9SeXrfJeYTpAqprjuM9JwnR3n14J0blZQJzkdDbIK5d3v P0Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=cOVczLGH; 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=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q15si320886ilc.138.2021.09.01.11.49.14; Wed, 01 Sep 2021 11:49:25 -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=@alien8.de header.s=dkim header.b=cOVczLGH; 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=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242706AbhIAHmZ (ORCPT + 99 others); Wed, 1 Sep 2021 03:42:25 -0400 Received: from mail.skyhub.de ([5.9.137.197]:40054 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242660AbhIAHmY (ORCPT ); Wed, 1 Sep 2021 03:42:24 -0400 Received: from zn.tnic (p200300ec2f0f3000ff66408ba4c79392.dip0.t-ipconnect.de [IPv6:2003:ec:2f0f:3000:ff66:408b:a4c7:9392]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id DF5B31EC051E; Wed, 1 Sep 2021 09:41:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1630482083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=b0wiLdV/sTJcclFf0mgjAxzhXW/epoX+CHp2TKm2RDM=; b=cOVczLGHd4PSquOG6P9RC+m3pH5VcA0R8z72qAqhOuUZlrB5LnNeuM/ag7b81+oPr7Ps6q +eHJW/2C+LUVF0f5YgK4+CtCcG6Lnoi0qtbWbfSZK/UvsiVBWdHj5Kl4+W6VEgn3rLA5fF IOIN7BzTjybnMOGo9Vw7Bb2nUFvD+PQ= Date: Wed, 1 Sep 2021 09:42:03 +0200 From: Borislav Petkov To: "Kuppuswamy, Sathyanarayanan" Cc: Sean Christopherson , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Andy Lutomirski , Peter H Anvin , Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Kuppuswamy Sathyanarayanan , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 08/12] x86/tdx: Add HLT support for TDX guest Message-ID: References: <20210804181329.2899708-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210804181329.2899708-9-sathyanarayanan.kuppuswamy@linux.intel.com> <0d2421ac-c501-d33f-d3fc-be9dac7e221c@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <0d2421ac-c501-d33f-d3fc-be9dac7e221c@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 31, 2021 at 01:49:54PM -0700, Kuppuswamy, Sathyanarayanan wrote: > Regarding details about _tdx_hypercall() wrapper usage, do you want me > to document the ABI details? > > For example for MSR read, > > static u64 tdx_read_msr_safe(unsigned int msr, int *err) > { > struct tdx_hypercall_output out = {0}; > u64 ret; > > WARN_ON_ONCE(tdx_is_context_switched_msr(msr)); > > /* > * TDX MSR READ Hypercall ABI: > * > * Input Registers: > * > * R11(EXIT_REASON_MSR_READ) - hypercall sub function id > * R12(msr) - MSR index > * > * Output Registers: > * > * R10(out.r10) - Hypercall return error code > * R11(out.r11) - MSR read value > * RAX(ret) - TDCALL error code > */ > ret = _tdx_hypercall(EXIT_REASON_MSR_READ, msr, 0, 0, 0, &out); > > Let me know if you agree with above format? Yes, that's nice, thanks. Alternatively, you could simply point at the relevant place in the TDX documentation so that people can go look at it and find out how, for example, a MSR read is done, ABI-wise. With all those confidential computing solutions and the amount of specs out there, one can get lost pretty easily so having doc references should be very helpful. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette