Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4323605rwb; Sat, 21 Jan 2023 09:34:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXsD6tRRxPRTp4DX62cmgDJt15OFHTdkYhWNpuxTbSPnHa3uR4P9zGSV/jQLqd6Eh2m1BIpM X-Received: by 2002:a17:903:428b:b0:192:feeb:b06d with SMTP id ju11-20020a170903428b00b00192feebb06dmr39435860plb.62.1674322449723; Sat, 21 Jan 2023 09:34:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674322449; cv=none; d=google.com; s=arc-20160816; b=Ofh670Iw2BjTdEDrQNQd5vsBKb0jJQsefSbRdNsMSyjnl+vuW3zjJVpdsBoHX+fjix kQRTtAfCxecIpNw/SJ6q+tBDAUOGRpIMrv7w2aMq+G4Hr8ztA7PNg5zimshL8zLk1AZo 1SpcuLJVZ78WX0jQEm7wMXXPj+xv8wR0zLI1baC89CimXWvB9wcBO0jF70F4XiovofxM k7dGM8apJR/B4LN8XB0ZX5Ymom0ySfeRcXPKQBQyotkFiFJm7UlDBdAlroE8unhVn+id tziEIehj4Ke2MHedhRf3SowtJMNVGPKxEaexNfLbgUZKjXSxIn/5cJb195dEhuHfpc5x g6xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=MvhZcSSbNWIJ7zZ8dMpb7xNicBT0OHoupTlfuTOZTq4=; b=wLO/xopG2sg1D3ZZhpfrM0jrptOrNIiJ/01fZgdm7Gc0UXSJm2OyDOYJaGgpSc2bbf kt2fYolIl7zr1E41eT96MEAzf6DQMkik+XBslAYF/xk+nd1a2idMxlnw4ZV/Ftx2QdXQ PwnKgsZSORyCDvg2L3xqg++zVPpZrwV0n1ngoEag0DOv4RhTmlK13f54CPeEimnnrTOD /I0/u2yQdxxWc7ExUvGVhl09Lmzd+J8RpQwb+miRAe+fdMdaLhovcpC+60Eeg9YYYV4Z WMz8qYFpQNYeXyHa/W//wlBWmcDhnmzL62IiM5605EiVUFksd+mYbfNQ0e+7e8d3uLW0 DPmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MuOROfp1; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p2-20020a1709028a8200b00194c45049d3si9526154plo.538.2023.01.21.09.34.03; Sat, 21 Jan 2023 09:34:09 -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=@intel.com header.s=Intel header.b=MuOROfp1; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229807AbjAUQrC (ORCPT + 50 others); Sat, 21 Jan 2023 11:47:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbjAUQrA (ORCPT ); Sat, 21 Jan 2023 11:47:00 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C81D1113F1 for ; Sat, 21 Jan 2023 08:46:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674319619; x=1705855619; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=Fo08ZcIrtTPKlL29c86Ws9ZwUgBRmQsU5QgIWyncqZQ=; b=MuOROfp1cJ29C5lVhJgq53WtYn3Rziy8J7176A3mqa0TucIIYgfLLubD 9pFonUK9kPQrKG6frMaUyr0j+WrpSSMEHIGj3Lo05FTIwMySHx9w+NExt RkdFDbqpTlOy6YOsTq62rEqRe9AjOrr5dHTQXApFziGoSWG0kaL0JOZ83 Vp91IM2saj2HYib03YPG3dYJk+i88BoW68j+2kO3aJfKxXs4oQtTlewCP Cmkf0MQoLT8cLHLm7aLEuz3pGIT3nlFoGgA9N+PG748SJDS5seUVB8PVI Yag818QHedC33KX61oM/sk6uwE5+QT4sNudNBD9nwohnhDXpYkGxKP4wz g==; X-IronPort-AV: E=McAfee;i="6500,9779,10597"; a="313693275" X-IronPort-AV: E=Sophos;i="5.97,235,1669104000"; d="scan'208";a="313693275" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2023 08:46:59 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10597"; a="693187852" X-IronPort-AV: E=Sophos;i="5.97,235,1669104000"; d="scan'208";a="693187852" Received: from aureliaw-mobl.amr.corp.intel.com (HELO [10.255.230.48]) ([10.255.230.48]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2023 08:46:59 -0800 Message-ID: <5703e698-a92a-2026-e5d4-3c6340578918@intel.com> Date: Sat, 21 Jan 2023 08:46:58 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: the x86 sysret_rip test fails on the Intel FRED architecture Content-Language: en-US To: "H. Peter Anvin" , "Li, Xin3" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "peterz@infradead.org" , "dave.hansen@linux.intel.com" Cc: "x86@kernel.org" , "linux-kernel@vger.kernel.org" References: <5d4ad3e3-034f-c7da-d141-9c001c2343af@intel.com> <18B5DB6D-AEBD-4A67-A7B3-CE64940819B7@zytor.com> From: Dave Hansen In-Reply-To: <18B5DB6D-AEBD-4A67-A7B3-CE64940819B7@zytor.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,URIBL_BLOCKED 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 On 1/20/23 20:59, H. Peter Anvin wrote: >> If not intentional, it might be something that can still be fixed. >> If it is intentional and is going to be with us for a while we have >> a few options. If userspace is _really_ depending on this >> behavior, we could just clobber r11 ourselves in the FRED entry >> path. If not, we can remove the assertion in the selftest. > We can't clobber it in the FRED entry path, since it is common for > all events, but we could do it in the syscall dispatch. > > However, it doesn't seem to make sense to do so to me. The current > behavior is much more of an artifact than desired behavior. I guess the SDM statements really are for the kernel's benefit and not for userspace. Userspace _should_ be treating SYSCALL like a CALL and r11 like any old register that can be clobbered. Right now, the kernel just happens to clobber it with RFLAGS. I do the the odds of anyone relying on this behavior are pretty small. Let's just zap the check from the selftest, document what we did in the FRED docs and changelog and move on. If someone screams later, we can fix in some SYSCALL-specific piece of the FRED code.