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 AD56CC54EAA for ; Wed, 25 Jan 2023 03:44:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230510AbjAYDoz (ORCPT ); Tue, 24 Jan 2023 22:44:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230252AbjAYDor (ORCPT ); Tue, 24 Jan 2023 22:44:47 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 656695BA4; Tue, 24 Jan 2023 19:44:44 -0800 (PST) Received: from biznet-home.integral.gnuweeb.org (unknown [182.253.88.152]) by gnuweeb.org (Postfix) with ESMTPSA id 0C3B082EFF; Wed, 25 Jan 2023 03:44:37 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1674618284; bh=mpRUDUZIZZzLmygxuJtFY1U1CWw+tvFmbmQsHCSH3Lc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nq9VTXrfMqII4bevpBsOxzUkptwiZb0uvJAWU6IoeGmZLpOXVLNXRtv92gtmN3QqM Zj81eWOyb/e1+DxVqVcZIzSshrDhSbYyFF8u5zJxL42q3bmZqk381jxjcrsCNw0AF8 rWMRv5uCnfOyGHuRt4XBSfrErT8hyoZpGGtiFFabGlSMgDe8+/IgFW19YPXPnrvnbg RUzqP6iAJ8mXKbIfwfl60VReNqXzhjsILkB45EOl53F1WXE7gQshJcC2dDnFcuyaun qvThntBiobmTv0xsYA8zCo3rXYnlrFX2fAgBFixQ4A9XWJQoDVELRY3ceeEaLf1PbV BhjUmIkhRKYBg== Date: Wed, 25 Jan 2023 10:44:34 +0700 From: Ammar Faizi To: "H. Peter Anvin" , Xin Li Cc: Dave Hansen , Dave Hansen , Thomas Gleixner , Andrew Cooper , Brian Gerst , Ingo Molnar , Borislav Petkov , Peter Zijlstra , Shuah Khan , Ingo Molnar , Andy Lutomirski , x86 Mailing List , "Kirill A. Shutemov" , Linux Kselftest Mailing List , Linux Kernel Mailing List Subject: Re: [RFC PATCH v4 1/2] selftests/x86: sysret_rip: Handle syscall in a FRED system Message-ID: References: <5ecc383c-621b-57d9-7f6d-d63496fca3b3@zytor.com> <20230124022729.596997-1-ammarfaizi2@gnuweeb.org> <20230124022729.596997-3-ammarfaizi2@gnuweeb.org> <20230125032240.728463-1-ammarfaizi2@gnuweeb.org> <20230125032240.728463-2-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 25, 2023 at 10:37:17AM +0700, Ammar Faizi wrote: > On Wed, Jan 25, 2023 at 10:22:39AM +0700, Ammar Faizi wrote: > > + /* > > + * Test that we don't get a mix of REGS_SAVED and REGS_SYSRET. > > + * It needs at least calling do_syscall() twice to assert. > > + */ > > + if (regs_ok_state == REGS_UNDEFINED) { > > + /* > > + * First time calling do_syscall(). > > + */ > > + regs_ok_state = ret; > > + return ret; > > + } else { > > Oops, this should not be returning ret here. Ignore this version. > I'll send v5. Side note: This mistake doesn't affect the test correctness because we currenly don't use the return value of do_syscall(). But still worth fixing... -- Ammar Faizi