From patchwork Fri Dec 8 18:12:55 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: 175984 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5631773vqy; Fri, 8 Dec 2023 10:13:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXO0p4iTIhIg/Vt9F0ljCMssofXm+wFB2f1AZ3J54wveJdvrxWIOWKkFeoTTHW3zM+AIwk X-Received: by 2002:a17:902:dacf:b0:1cf:c901:5451 with SMTP id q15-20020a170902dacf00b001cfc9015451mr500374plx.14.1702059185366; Fri, 08 Dec 2023 10:13:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702059185; cv=none; d=google.com; s=arc-20160816; b=hfErtVxTWZllDJVo8tiMIsY+sFk8FuL/i36vgHjitHduxNsG7zyZwrgOQ+HA2XysaT VKmIHzJMrjaBDGbWDkZltTXJNluvDqTXMbQrb2pZ7/Wfao5isP904AMNEaQMKCmYD0dr 2O37mi+rIN//LsvyJrRz4sZO7JxlhAYuBd9gc3mtamGiMJUqt5t+jyktrcOa8YAXf+Mp Dc0Ju8U4+dpgGFMa2LZpUFM9p5A7cU5H+qk+AhjfiWZz4QoIJDSUbQvBZng28zf7fDu+ PvpEwJsTJKw4ImMJhDbIhO6BaJqlfsQHzN2/ikLG2pA5aZAnARmkh8DPwa5E7tPJJZal uNcg== 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=VPq10NsC/rF3pTsW5VwJxHxpL7DlSSTW9H4lmsDaLFM=; fh=/n9XlXj1IKUyPlyHECKcBKWdQ7usrdaKCfKX5noQGgg=; b=E041Jy8Hdhq087vu2FlCQSE7GO0egAhxWuKo9Hty/LyusRRijFISjtOP/4Av3YOMGq oeDjee9UjG+lA7mrtjx/bNTpx8bifZkGtvBWo6WQzZKm2ieiyEoZvpw1d+Mk2ZG2KYY6 YKTqUBBVcbq7mIP/imda0MVpaQBGtX/ItEtNSQD2GecHRH62BKuZdowHuzCkSFLmWB6V Za77dnL3nZfa2wUYQ2aiv3uDqjtm0BEpIQ5jqcIXD06DT6trF/3jRGYFYRnvVBX0W9zf Q3Tk4f9tm0mg8PDhQ/gmBHV/Js1nbqbOw9QQMn9O1OmJmNcwT1mKw6P9EfJctBNlKYf5 vOHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Ow8pyzuL; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=SQ6OuEP8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id b3-20020a170902d30300b001d04d730685si1871541plc.543.2023.12.08.10.13.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 10:13:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Ow8pyzuL; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=SQ6OuEP8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 658BB819D20A; Fri, 8 Dec 2023 10:13:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233504AbjLHSMw (ORCPT + 99 others); Fri, 8 Dec 2023 13:12:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbjLHSMv (ORCPT ); Fri, 8 Dec 2023 13:12:51 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA02390; Fri, 8 Dec 2023 10:12:57 -0800 (PST) Date: Fri, 08 Dec 2023 18:12:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1702059176; 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=VPq10NsC/rF3pTsW5VwJxHxpL7DlSSTW9H4lmsDaLFM=; b=Ow8pyzuL1flnJc492kWFDsRoQhzA2qs52/Kd1Pt2ViOe3IdnAC8QHHKmmZDFiUEfX/xzht Ly9RugGP05HXyVeAWBXdyCt9a8zzI3YYl69WlHc62MTp+MWIDN9KroFUpfuHyV3VAyGsbW y+w/omIeB0MVcEoSULMsyLEKzNInfLwApT0e5jbXm8bkG9gT4pF8GV4A43ewuLBJtWbXsf KZFfG/TAuw9SyX0tndhBm5Q7ILQBwSpo7sHnUs3EGB/K9bxMaZ8MjRz57Vxf3RgecqOAI8 X5s2AzCXUTWTUQD6QueCS2QUx7T8KFhiDcbDT54FqGC4v8D9gcgzam/cPAmKMw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1702059176; 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=VPq10NsC/rF3pTsW5VwJxHxpL7DlSSTW9H4lmsDaLFM=; b=SQ6OuEP8WsP0VeRP58uaT93aL/b8C51hnIWUvRMS8ZhwSLNorh2pYXKXIqaXouc9L4ujK6 MqU5q9wyCqDVzoAg== From: "tip-bot2 for Jo Van Bulck" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/sgx] selftests/sgx: Remove incomplete ABI sanitization code in test enclave Cc: Jo Van Bulck , Dave Hansen , Jarkko Sakkinen , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <170205917549.398.11664796877429502969.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 08 Dec 2023 10:13:01 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784738412482606159 X-GMAIL-MSGID: 1784738412482606159 The following commit has been merged into the x86/sgx branch of tip: Commit-ID: 886c5be0b12e89b2905c26c4f24d50ae91f261da Gitweb: https://git.kernel.org/tip/886c5be0b12e89b2905c26c4f24d50ae91f261da Author: Jo Van Bulck AuthorDate: Thu, 05 Oct 2023 17:38:54 +02:00 Committer: Dave Hansen CommitterDate: Fri, 08 Dec 2023 10:05:28 -08:00 selftests/sgx: Remove incomplete ABI sanitization code in test enclave As the selftest enclave is *not* intended for production, simplify the code by not initializing CPU configuration registers as expected by the ABI on enclave entry or cleansing caller-save registers on enclave exit. Signed-off-by: Jo Van Bulck Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Link: https://lore.kernel.org/all/da0cfb1e-e347-f7f2-ac72-aec0ee0d867d@intel.com/ Link: https://lore.kernel.org/all/20231005153854.25566-14-jo.vanbulck%40cs.kuleuven.be --- tools/testing/selftests/sgx/test_encl_bootstrap.S | 16 ++------------ 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/tools/testing/selftests/sgx/test_encl_bootstrap.S b/tools/testing/selftests/sgx/test_encl_bootstrap.S index 28fe5d2..d8c4ac9 100644 --- a/tools/testing/selftests/sgx/test_encl_bootstrap.S +++ b/tools/testing/selftests/sgx/test_encl_bootstrap.S @@ -59,21 +59,11 @@ encl_entry_core: push %rcx # push the address after EENTER + # NOTE: as the selftest enclave is *not* intended for production, + # simplify the code by not initializing ABI registers on entry or + # cleansing caller-save registers on exit. call encl_body - /* Clear volatile GPRs, except RAX (EEXIT function). */ - xor %rcx, %rcx - xor %rdx, %rdx - xor %rdi, %rdi - xor %rsi, %rsi - xor %r8, %r8 - xor %r9, %r9 - xor %r10, %r10 - xor %r11, %r11 - - # Reset status flags. - add %rdx, %rdx # OF = SF = AF = CF = 0; ZF = PF = 1 - # Prepare EEXIT target by popping the address of the instruction after # EENTER to RBX. pop %rbx