Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4586906rwb; Sat, 21 Jan 2023 15:21:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXvrXrEEy2PHUTbPThQQuR8/iWQubRk5GI9cwGTfbNNopSDtgKUGcHVk0u8JpX5Uvn8AAGCQ X-Received: by 2002:a17:907:1248:b0:84d:45db:b203 with SMTP id wc8-20020a170907124800b0084d45dbb203mr17192148ejb.12.1674343304397; Sat, 21 Jan 2023 15:21:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674343304; cv=none; d=google.com; s=arc-20160816; b=cIedMZ7FhC3Bhh1F2eXb2Zx6TPmXNp/aS4M+tg+Tjr2azOt2B6BqNecgJSv7AiY3xF s3IYoEQHeXwP/T5jGhj3ahQHKW37IYkxqlxSNVPzD0MXheMS385YymcvN1W9GY589afX SvCTHVLl91gaftK1zM36ARRfz/U6/ugWw58D4at7yvJ/xjMhqPpixSqHsXnBnxqMzJm7 EJRAPKY+1INOHuLHa4AkYyM0FLK030DrrQy3Md62+LrNOi2jm1qDhvMYphLBN2lRRKAx PZiM0iOlIhdizPYSTUhIIUTWozM13FN9yBJ0CM8QpHqjboFj3KUufz1LLx8yO3QB2Ewf zCNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=IItOU+p55SK2QjQ3YzQRVeif5DdV8TaENAjnN4IuI2s=; b=r5387ybgr7eUPeSGsN+mOK56AHNkZjDuM5125pSoKYJ5QF+FCIEXo6EDaXVrhdKiBE Guvo9P2AgB3UJpVr8ZrhVOf6+EGvOsztlM+biasgIAcyEVONJLyw4wfAtB66yqsPUCz/ MYyXh5BMlvHEPYFDO6vJsAnnZufakOQITjCRjRA/HyxWMcx+C/jTcV7TfDhXQZHIwU2q sZsat0uz1ndPdqNnRlNdqOlErzlyYIcgZt/NLESuaKQ54aHk4j05QLuX/EJWzzPTT4kA FWO4eoDAt53rAL2Nnx0D+hApxaGXpzflMyLKy+X8MTlTfvB54Nf76L1cK53zFwZ6AnrN sMNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ox9Tv51s; 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=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg4-20020a1709072cc400b0086ee02edc68si3626893ejc.197.2023.01.21.15.21.32; Sat, 21 Jan 2023 15:21:44 -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=@gmail.com header.s=20210112 header.b=Ox9Tv51s; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229645AbjAUVr7 (ORCPT + 50 others); Sat, 21 Jan 2023 16:47:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229587AbjAUVr4 (ORCPT ); Sat, 21 Jan 2023 16:47:56 -0500 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 747891A480 for ; Sat, 21 Jan 2023 13:47:55 -0800 (PST) Received: by mail-qt1-x832.google.com with SMTP id a25so6929109qto.10 for ; Sat, 21 Jan 2023 13:47:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=IItOU+p55SK2QjQ3YzQRVeif5DdV8TaENAjnN4IuI2s=; b=Ox9Tv51sqK/MFsroZpFTPtuz1PEtLzo6HMMf9MTMMDYKZxqMPkKrbsC2+rK3NFMu8l rLsc6QbPb99oqg371qE3BP0A1XDzk/VFHO0Ut94/Hd0l10/coXjsPGMkcCJp8Y5Yl0ew PHLhgrxiK4cpCLx03dyKeDId1gGXBpVl/CqBCQH/UziFktXZkw1TTfrzoOSzO0xkGMEe RWOdbtI18O9RJni4b3VzmFhRkVbz32UPyQkU7bYn66Wl7zs7Y2URhEu1UMi+uGdPi0ph P9dB2pAEwBVTrPpz9qtAN6JP5x7yOe4sYGypV8lbsKwvGkbIDSFX+ZQ8RndHSDNHVUK1 j2yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IItOU+p55SK2QjQ3YzQRVeif5DdV8TaENAjnN4IuI2s=; b=uvVQ36NKqy81X4belEwnrt/UfOXVWCR5/Xbgi168p0eU+rv6Uz0S0B54BLzxdNnaYl 3QjuXqVvTSX/D026J4A4QrxcuXiqPlWrxIRUvGAmMqH5Rog8G+7RzvVYvoaY6+Yd+mWN SvcsDagLD9IjEVjvxPFIbKtE2ZGaeX/Zf0xeaVIG8cAvyTNmqrrysPwAdC2mdmGOu8oP 1FXxEw/R5vEhAkSGozSdpnOVj6uKw66M/ajvC3tHEluxxD5nfqw5veIEsf1pps5Ik9yU 8bhlzGdcdSjitZCvbHtBP5RMOb9VMI8DwDuQarHYkEetF6NDOZ9PKXJ9xGC4A/sw8oxT Qyzw== X-Gm-Message-State: AFqh2kpZxf9C0CIbpSMO0IjQ47IjRqZMjRJ/a97qk6DXN0hYqcjnzA92 u5nckGJSC7zHOWA24LboiT9qphg89GF6N29ztw== X-Received: by 2002:ac8:70cb:0:b0:3a9:82a1:fb0f with SMTP id g11-20020ac870cb000000b003a982a1fb0fmr961787qtp.22.1674337674581; Sat, 21 Jan 2023 13:47:54 -0800 (PST) MIME-Version: 1.0 References: <5d4ad3e3-034f-c7da-d141-9c001c2343af@intel.com> <18B5DB6D-AEBD-4A67-A7B3-CE64940819B7@zytor.com> <5703e698-a92a-2026-e5d4-3c6340578918@intel.com> In-Reply-To: <5703e698-a92a-2026-e5d4-3c6340578918@intel.com> From: Brian Gerst Date: Sat, 21 Jan 2023 16:47:48 -0500 Message-ID: Subject: Re: the x86 sysret_rip test fails on the Intel FRED architecture To: Dave Hansen Cc: "H. Peter Anvin" , "Li, Xin3" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "peterz@infradead.org" , "dave.hansen@linux.intel.com" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 On Sat, Jan 21, 2023 at 12:34 PM Dave Hansen wrote: > > 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. Keep the selftest check, but also accept preserved RCX/R11. What really matters is that the kernel isn't leaking data. -- Brian Gerst