From patchwork Fri Jan 27 18:26:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 49591 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp981298wrn; Fri, 27 Jan 2023 10:30:21 -0800 (PST) X-Google-Smtp-Source: AK7set/G2m+2eYeXBav7vKc92J5JhALq9I0f5VJQZjxfjD+TdX84rD8tpnMfJ6kzgbj7OGGhEm/B X-Received: by 2002:a17:90a:1a15:b0:22c:912:b80d with SMTP id 21-20020a17090a1a1500b0022c0912b80dmr11434724pjk.33.1674844221311; Fri, 27 Jan 2023 10:30:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674844221; cv=none; d=google.com; s=arc-20160816; b=bKmqqhuTGs8dQlv+Q2d9m2DCAjGB3iG/qaXuB0Hfdu+n7RNSmy/hxSMOhJxRzsn576 zuHWxV/JiuRDhMhna2VBXNtsmaomSdSnanXH35M1Px6tw8Wqbi0Z4p6uJo4/O3YLn6IJ oAHKWGR9KbECTW67QNdYTPPYxbkldDn9oIFmFtz/imdwTuyQZY2Fs1tyOGuDkObQz6JC QSIHDJUQIxmfHueiwphEOk7s43MQPRIq6+CRyc8n25M0jZgxTtRuqQWVjJXiVvLgDBls 4fB8VJoJS1eI14M4W5UweUhK9r5huaGYk5LQU/JuFCj1jBzEguTt5FoqK8yQtGgRB2/I aOOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=7jgNMHq14Xe7rRTeyNKhv1BS2HLRk4TqMnnGO7FHEqM=; b=bUmHJ14ULN/Ff+Af6rL/bBsmJdXO+NJgjpaHDdQWVa5yTfxAELOGRGwURDfdO0MgiG a9lVwDN7AaTKrO2o1H07I/SvnsanXRxxPqlqkhlfouWuctLwF6DsyVeS/WpOjIRymPgs SjOZLsyWiO4wQ6Vldp/wJbFd9BwUor8SM7tMC0MIQie+NKlKG3UNFcEGJ0j8/4Rdumpo Wf8HSZoJUas7t82lxGIW688xSZQV4k3AgC17mSF4DDUfU5LWeYZaWwI3cHJwhClcdQgw FKAcysag+zzAo+U+nGjxSTaNUBQ/1R8bTV0NXYsQbMUGtK9jz2lpWzMVhuglYawkEV7D Hr7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=isTLEb4O; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s22-20020a17090ad49600b002190ba4112dsi4993669pju.94.2023.01.27.10.30.08; Fri, 27 Jan 2023 10:30:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=isTLEb4O; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233599AbjA0S3w (ORCPT + 99 others); Fri, 27 Jan 2023 13:29:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234687AbjA0S3d (ORCPT ); Fri, 27 Jan 2023 13:29:33 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1031E8661D; Fri, 27 Jan 2023 10:29:11 -0800 (PST) Date: Fri, 27 Jan 2023 18:26:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1674844017; h=from:from:sender:sender:reply-to: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:content-transfer-encoding; bh=7jgNMHq14Xe7rRTeyNKhv1BS2HLRk4TqMnnGO7FHEqM=; b=isTLEb4O/nivlakQQC4lZqa91cfKpYkr1V9Gqx3ToLsKhT4MVmDjvob2465CitPrL8O7Hs IWKwlYLtiKjLRgePCJHD4Bl0D0aG7qV6pu2Ia0dEkCgvcldRgiRYYFd1PH5//8TXuJfc5R +JFNg57xe7u2eOTVmWm4MdAnpMDoLNBq11NlUEbC6EmqfON0+BtE6tabuwoToBwMSBPDc3 mLgHo53B8J6snEQbgjwLoVaASNlBHRCSFolCHZ211Ku+1NCVXttc2oqXE+xqLnp+1GBQKu fd7gFk3rZfpKX690QfttyYLAk3Me30YAYn68f7MmnJaYZ3L379LSTSnKLr/tCA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1674844017; h=from:from:sender:sender:reply-to: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:content-transfer-encoding; bh=7jgNMHq14Xe7rRTeyNKhv1BS2HLRk4TqMnnGO7FHEqM=; b=KyRbaeFDrt8DUNJmbKUZm5cnr2OTMQbRdO/2yBPdae54MIGl+g09BP67FmUFholeHOJbMw YcsU4F8YOOtxPgBA== From: "tip-bot2 for Kirill A. Shutemov" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/tdx] x86/tdx: Add more registers to struct tdx_hypercall_args Cc: "Kirill A. Shutemov" , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <167484401713.4906.10547453863607764127.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756201453858596432?= X-GMAIL-MSGID: =?utf-8?q?1756201453858596432?= The following commit has been merged into the x86/tdx branch of tip: Commit-ID: 0da908c291070d89482f6211dbe81d4d43c3f7cb Gitweb: https://git.kernel.org/tip/0da908c291070d89482f6211dbe81d4d43c3f7cb Author: Kirill A. Shutemov AuthorDate: Fri, 27 Jan 2023 01:11:54 +03:00 Committer: Dave Hansen CommitterDate: Fri, 27 Jan 2023 09:42:09 -08:00 x86/tdx: Add more registers to struct tdx_hypercall_args struct tdx_hypercall_args is used to pass down hypercall arguments to __tdx_hypercall() assembly routine. Currently __tdx_hypercall() handles up to 6 arguments. In preparation to changes in __tdx_hypercall(), expand the structure to 6 more registers and generate asm offsets for them. Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Link: https://lore.kernel.org/all/20230126221159.8635-3-kirill.shutemov%40linux.intel.com --- arch/x86/include/asm/shared/tdx.h | 6 ++++++ arch/x86/kernel/asm-offsets.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/arch/x86/include/asm/shared/tdx.h b/arch/x86/include/asm/shared/tdx.h index e53f262..8068faa 100644 --- a/arch/x86/include/asm/shared/tdx.h +++ b/arch/x86/include/asm/shared/tdx.h @@ -22,12 +22,18 @@ * This is a software only structure and not part of the TDX module/VMM ABI. */ struct tdx_hypercall_args { + u64 r8; + u64 r9; u64 r10; u64 r11; u64 r12; u64 r13; u64 r14; u64 r15; + u64 rdi; + u64 rsi; + u64 rbx; + u64 rdx; }; /* Used to request services from the VMM */ diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c index 82c783d..8650f29 100644 --- a/arch/x86/kernel/asm-offsets.c +++ b/arch/x86/kernel/asm-offsets.c @@ -75,12 +75,18 @@ static void __used common(void) OFFSET(TDX_MODULE_r11, tdx_module_output, r11); BLANK(); + OFFSET(TDX_HYPERCALL_r8, tdx_hypercall_args, r8); + OFFSET(TDX_HYPERCALL_r9, tdx_hypercall_args, r9); OFFSET(TDX_HYPERCALL_r10, tdx_hypercall_args, r10); OFFSET(TDX_HYPERCALL_r11, tdx_hypercall_args, r11); OFFSET(TDX_HYPERCALL_r12, tdx_hypercall_args, r12); OFFSET(TDX_HYPERCALL_r13, tdx_hypercall_args, r13); OFFSET(TDX_HYPERCALL_r14, tdx_hypercall_args, r14); OFFSET(TDX_HYPERCALL_r15, tdx_hypercall_args, r15); + OFFSET(TDX_HYPERCALL_rdi, tdx_hypercall_args, rdi); + OFFSET(TDX_HYPERCALL_rsi, tdx_hypercall_args, rsi); + OFFSET(TDX_HYPERCALL_rbx, tdx_hypercall_args, rbx); + OFFSET(TDX_HYPERCALL_rdx, tdx_hypercall_args, rdx); BLANK(); OFFSET(BP_scratch, boot_params, scratch);