Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4101220rwe; Tue, 30 Aug 2022 04:49:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR52drSlOayt2+9beNY7wyD0tan5TvA0le7xnQAgRMDvYzIwxZMNlKzrikKjD8X3/vOHYiJ6 X-Received: by 2002:a17:902:8bc7:b0:172:c32f:7d30 with SMTP id r7-20020a1709028bc700b00172c32f7d30mr20158429plo.48.1661860189985; Tue, 30 Aug 2022 04:49:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1661860189; cv=pass; d=google.com; s=arc-20160816; b=fZ9q76O+YX3Y9eucp4RyGdsZbL/U3rchAHfC0AYSzU0wPR2n1CXS3H5CntVSPbJzrY 2PJkV/edyqMnCzjfrw8atkxOhfWwkzBDCfFE2C880bcO9cpupIyHXVM0jxu5hn5p4kI+ c68LpybcuWbKvaYCpOSocrMvOMNW/uxcG7fCmxMBR886Nrvq9leDPziRbczQIkk3FznY uPLUY+YUYLfL5+zjYbDZlkh9PbOQR6zuey8DBhWqvmjwMKRtD9rEFsRMjWYQQOfvqJbY dElyzKJ8MeXmmdiB4bK9JICUDsOfeLBHvzL+98AtTZuLYuzSyyPLmr/bMT0Dl/en0G7R th5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:reply-to:in-reply-to:references:mime-version :dkim-signature; bh=t8x29qDSobRrZnNTFzvK22EpsdeXafMwe0vNxp+CuHk=; b=rcmfOLZFGaPzuMvgzwtGv6pF1ra6OV+v37Uq4bnl14N5MfqEYkEUDtBM6TejMJdZ1n lvbUYDRnIUeThBNR4bX6iNsS54Q4AFL3lVMSdGA0JV0yy9cxmblNs3AhAovOsXSWaOP/ +DtToxVU+TC3t+jY98Sizp0DK0UiUUDMfpAJvlbNOg7sjRy3RVG+IIpSIlKxlGgnydHm 8QJAL4AK7ZF1fk4ZL5MDd+D145fuF61yIr7etqmfjnx7RcSC3oe6revQscMM03kgyql+ AHZJyV3tAdXUlqDvguXP1tBbUyneaGp7iSW0hRBPvNuqHZZG8/X0A4U1yvQgJAU5X4wu SQnA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@iki.fi header.s=lahtoruutu header.b=TpjoYoXR; arc=pass (i=1); 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y8-20020a17090ad70800b001fda01de650si174762pju.122.2022.08.30.04.49.38; Tue, 30 Aug 2022 04:49:49 -0700 (PDT) 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=@iki.fi header.s=lahtoruutu header.b=TpjoYoXR; arc=pass (i=1); 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231187AbiH3LoB (ORCPT + 99 others); Tue, 30 Aug 2022 07:44:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231253AbiH3Lnd (ORCPT ); Tue, 30 Aug 2022 07:43:33 -0400 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E677540BE7; Tue, 30 Aug 2022 04:42:22 -0700 (PDT) Received: from mail-vs1-f44.google.com (mail-vs1-f44.google.com [209.85.217.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: martin-eric.racine) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 43B051B00305; Tue, 30 Aug 2022 14:42:17 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1661859737; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=t8x29qDSobRrZnNTFzvK22EpsdeXafMwe0vNxp+CuHk=; b=TpjoYoXR3ax65V0VMTXfKc1LUxWSgPXGqeMIgKvk8Nrmg9aust0pYrnJd1nokl/zr8N9mr hDlOtGuwfgZLWimBIbJ/ebi8cFU0XcqfRxYp6HE3n6sj2AzuQCXPRySlFwDnP+YLsIm9QV UboZieUXF0n16JE9+e+DtHw5PVaL5WMGJZOcxeNyidO20sgKx3hi6h+8q4FL9gqV9Shw5Y fx8rVtZbOZBB4qqVp/lvZGkmAGV+a+0E4lMWYF1s+eCAGs8cWrGLzzJx4Yc5bYbmq+/zJ8 Png6P5NK9zNng3hOIvs4ZDw7lqi943JuzvsN0UuuoM1SRyruf4jGsEL+aasZUA== Received: by mail-vs1-f44.google.com with SMTP id m66so11168562vsm.12; Tue, 30 Aug 2022 04:42:17 -0700 (PDT) X-Gm-Message-State: ACgBeo0o2Gn8OXbntPhBYktV0G13sLyDSEBqe/XCzT6Zm0Hvryou45/d TMiIDBuZ/SMygjJK8OecPggHXsjX4oU2wXlH2Ek= X-Received: by 2002:a67:e9ce:0:b0:390:e35a:8b57 with SMTP id q14-20020a67e9ce000000b00390e35a8b57mr2616999vso.40.1661859736062; Tue, 30 Aug 2022 04:42:16 -0700 (PDT) MIME-Version: 1.0 References: <9395338630e3313c1bf0393ae507925d1f9af870.camel@decadent.org.uk> In-Reply-To: Reply-To: martin-eric.racine@iki.fi From: =?UTF-8?Q?Martin=2D=C3=89ric_Racine?= Date: Tue, 30 Aug 2022 14:42:04 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] x86/speculation: Avoid LFENCE in FILL_RETURN_BUFFER on CPUs that lack it To: Peter Zijlstra Cc: Ben Hutchings , x86@kernel.org, Linux Kernel Mailing List , 1017425@bugs.debian.org, stable@vger.kernel.org, regressions@lists.linux.dev, Daniel Sneddon , Pawan Gupta Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1661859737; a=rsa-sha256; cv=none; b=SWdWlxmty1Ltap/ZQIbrGerSZBSMK9dbHZuamMKLgS2qOBNrsWUXsqIFxUrMnoObzQJiV6 WsQt2cU9DZkaxtsfxIZ+rEpYYitX5yIhJ/KlmKgIRgepT47kwNUmYED6qykjixNJRBqQGU QvKwqizQSiMfI/O3cnb5r1gK99VijQgJ3uYfEcHhs+245kcLW4ctpZM85VFTJSfKcM7oZe W4OahdA/o7KbTRaNS1U2PhDCknptJ75x4sBEyC6td1qPcYx7IMSlFEZq1vlohGM5/9/uw6 0iYxGVwQ6U755QGZvv4KpF9PORoOdzWcFEUxPgusbT5BmCa7WLOYGrbA3F6G1w== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=martin-eric.racine smtp.mailfrom=martin-eric.racine@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1661859737; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=t8x29qDSobRrZnNTFzvK22EpsdeXafMwe0vNxp+CuHk=; b=jfk6QBlViFYzf3Bddy2YSS+ShIqNoV7ddB8HJfZCUKfpyGocxF06pXTr40PAFGeJc6mE15 SHrre3uLJ3pcryArecQtamufl3UvuzJ8/dFr1HYm/zghYAoGLCWNtoC/avWPEyaHIEF5gr CKXTFjwubc/mHI25+FAC4LPEN8irZgPqcxQGdUyDAA2K7pfBh6ZvYJlt3NkXjTnP/zU5jZ GJwmI6jIPiv4n3oT6Onip642q2hwAmPtYF3E59OBlmT8IgQa/9D6KQl1Capx72+lAvGz2E WAvC8j4lhvrROO8PK7juoOjGstGY4yh7ovIkEYRj0/PjTYbyMMmHgRgrkvJQww== X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Greetings, On Fri, Aug 19, 2022 at 3:15 PM Peter Zijlstra wrote= : > > On Fri, Aug 19, 2022 at 01:38:27PM +0200, Ben Hutchings wrote: > > > So that puts the whole __FILL_RETURN_BUFFER inside an alternative, and > > we can't have nested alternatives. That's unfortunate. > > Well, both alternatives end with the LFENCE instruction, so I could pull > it out and do two consequtive ALTs, but unrolling the loop for i386 is > a better solution in that the sequence, while larger, removes the need > for the LFENCE. Have we reached a definitive conclusion on to how to fix this? Martin-=C3=89ric