Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57D1AC54EED for ; Tue, 24 Jan 2023 21:02:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233949AbjAXVCp (ORCPT ); Tue, 24 Jan 2023 16:02:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbjAXVCm (ORCPT ); Tue, 24 Jan 2023 16:02:42 -0500 Received: from mail.zytor.com (unknown [IPv6:2607:7c80:54:3::138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A672141B6B; Tue, 24 Jan 2023 13:02:39 -0800 (PST) Received: from [IPV6:2601:646:8600:40c0:425:cd56:6750:e1bf] ([IPv6:2601:646:8600:40c0:425:cd56:6750:e1bf]) (authenticated bits=0) by mail.zytor.com (8.17.1/8.17.1) with ESMTPSA id 30OKxS182864905 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Tue, 24 Jan 2023 12:59:28 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 30OKxS182864905 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2023010601; t=1674593970; bh=9DoeK4pzKCZ3oaVq5FOrw6uKFJ44twkQ98xAmRhBhKE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ePbJFTc0iGeSoXi2dUxZBxD7tYcuZnLph7f5toU8zeVvCxLnEiVMWPmNyqUs6qpxc gc93d23/ifog6fq+BYPcZQs6I1dJtP6i5dNpW1zrmKyDpFRtkg+8xNh1mUzQdrUJN7 /YLxM3sPU+WF3dcfnQVTvWNxtRsR8coafLnRNuPgjz4ze8dbDf/9oNUjfRDNNO0r39 BJd5aosDQPCp+CEMjtN7QsvUGOQP/ae+TqW3XDD6EtymLb3Xp6OPNw/9cpDwMwa131 tOYpFtzEYvmwKNEA6TG1XyymYaQzYfng+1voObl+lAbOWIvg10IIzkz4Jw+URsxSIW Aj0SkIlbRuZpw== Message-ID: <48072ce2-e28d-9267-1f8e-3c76682fb782@zytor.com> Date: Tue, 24 Jan 2023 12:59:23 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [RFC PATCH v3 2/2] selftests/x86: sysret_rip: Add more syscall tests with respect to `%rcx` and `%r11` Content-Language: en-US To: Ammar Faizi , x86 Mailing List Cc: Dave Hansen , Dave Hansen , Xin Li , Thomas Gleixner , Andrew Cooper , Brian Gerst , Ingo Molnar , Borislav Petkov , Peter Zijlstra , Shuah Khan , Ingo Molnar , Andy Lutomirski , "Kirill A. Shutemov" , Linux Kselftest Mailing List , Linux Kernel Mailing List References: <25b96960-a07e-a952-5c23-786b55054126@zytor.com> <6cd0db14-c9e2-3598-fd10-4b473d78c373@citrix.com> <5ecc383c-621b-57d9-7f6d-d63496fca3b3@zytor.com> <20230124022729.596997-1-ammarfaizi2@gnuweeb.org> <20230124022729.596997-3-ammarfaizi2@gnuweeb.org> <20230124100926.637335-1-ammarfaizi2@gnuweeb.org> <20230124100926.637335-3-ammarfaizi2@gnuweeb.org> From: "H. Peter Anvin" In-Reply-To: <20230124100926.637335-3-ammarfaizi2@gnuweeb.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/24/23 02:09, Ammar Faizi wrote: > From: Ammar Faizi > > Test that: > > - "syscall" in a FRED system doesn't clobber %rcx and %r11. > - "syscall" in a non-FRED system sets %rcx=%rip and %r11=%rflags. > > Test them out with a trivial system call like __NR_getppid and friends > which are extremely likely to return with SYSRET on an IDT system. > > Link: https://lore.kernel.org/lkml/25b96960-a07e-a952-5c23-786b55054126@zytor.com > Co-developed-by: H. Peter Anvin (Intel) > Signed-off-by: H. Peter Anvin (Intel) > Acked-by: H. Peter Anvin (Intel) > Signed-off-by: Ammar Faizi Add to the description that the purpose of this is to ensure that various system calls are *consistent*, as per the comment immediately below your code. -hpa