Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp11513pxb; Tue, 31 Aug 2021 13:51:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxbZNAKwrmTigbC/9+DBy9XqEH2FhJ1McrJwMqGlFplqLyJTX0lPDa4YjhUufrFbBd/0/S X-Received: by 2002:a02:644:: with SMTP id 65mr4632573jav.84.1630443077168; Tue, 31 Aug 2021 13:51:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630443077; cv=none; d=google.com; s=arc-20160816; b=AX5YIpkePaTV3W40y9vkJv5xs+Per5GJIIMR9U0k+qIbJ5ObrmnnuRgZ6NMW4eBZs2 2D86deEhNEMx7ZU+LZ25p54EWMa+PJl9KHM/ifvKZrdKgcjxfW6KGzmZnz6dUpjnTG7B 0dXxL2Q+A9mH1kjLOUbp8bgmAI91dgDCx4Eal7Z9f4F9KQZi/vpkn3gxnXfM1qryx1vR IvSC73UzTtFdPc6pDpFAxlPBPBWIw9WvLt0FiE+uPyH3rFSzBDf2CilVVY/hpUmHnKwM fPZfLBuUuuLvtrqcCgFnMoQNHfWGSzAfN7odMdecNkPKTytU1OoaBOz40vc4i3GzA7sC VPdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=vLmSqYAOBZX3qnVuaRESXuwqtG3kTWLt1wFFKvd+Bs0=; b=ZKqWYZ/qdawm6cvTF9RWQp92ehac16ZaE00pHwv6mbbBgivJ+dkcYPUswAXS4MvgNT 92WKOCI5iDYyRiiQaSqllLfECYpCUPoV0vHA0THfCbANL2do1TTSfAv5CAB1KG+YOaZG 59FUN1VqMu6wpsj6sNjjqA+2c3ug6lxaO3CH19GGcEMecPsUyUyZbYvR+2NG2ivpon6J FvWhszAVpsUvlWe5yWvA7NojAh/UXci0wGbEIb69SlpPLDIRDd1Jbcfx/reKLIRd6Rcb V136V8rqypJIa+x3kZLCnouPsWK5hcsOnLEZeZeQY7yEllcrOGl0F2DA6hwp6QkMpEPH eEmw== 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 t11si20221231jal.119.2021.08.31.13.51.05; Tue, 31 Aug 2021 13:51: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; 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 S241217AbhHaUuy (ORCPT + 99 others); Tue, 31 Aug 2021 16:50:54 -0400 Received: from mga11.intel.com ([192.55.52.93]:51488 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229916AbhHaUux (ORCPT ); Tue, 31 Aug 2021 16:50:53 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10093"; a="215434694" X-IronPort-AV: E=Sophos;i="5.84,367,1620716400"; d="scan'208";a="215434694" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2021 13:49:57 -0700 X-IronPort-AV: E=Sophos;i="5.84,367,1620716400"; d="scan'208";a="460331329" Received: from krbo1-mobl1.amr.corp.intel.com (HELO skuppusw-mobl5.amr.corp.intel.com) ([10.212.32.188]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2021 13:49:57 -0700 Subject: Re: [PATCH v5 08/12] x86/tdx: Add HLT support for TDX guest To: Borislav Petkov , Sean Christopherson Cc: 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 References: <20210804181329.2899708-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210804181329.2899708-9-sathyanarayanan.kuppuswamy@linux.intel.com> From: "Kuppuswamy, Sathyanarayanan" Message-ID: <0d2421ac-c501-d33f-d3fc-be9dac7e221c@linux.intel.com> Date: Tue, 31 Aug 2021 13:49:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Boris, On 8/24/21 10:27 AM, Borislav Petkov wrote: > I think in the next version all those _tdx_hypercall() wrappers should > spell it out what the parameters they pass are used for. > > Hohumm. 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? -- Sathyanarayanan Kuppuswamy Linux Kernel Developer