Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp650620pxb; Tue, 1 Feb 2022 07:42:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxk6YPSdz1T4PsI0tFS7I+FfTzItiiPISkzyB209HuEi7Er2l4oCIw59MufttAOI/xdSiae X-Received: by 2002:a05:6402:3511:: with SMTP id b17mr26020355edd.244.1643730127991; Tue, 01 Feb 2022 07:42:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643730127; cv=none; d=google.com; s=arc-20160816; b=kslDQpGZjQR0okYs0gNJlEvtDW4Zl86yAapi3kR5tRhV0BpcZWtRjmk02pjt+jzWEU GJmlW+ITp5T1kXyCuU3FtpZPMZOijLD7HoneivW74U1n9UCG+Wjh3Czg1TYeoZzer3om NjW3am8zTQTIRuISDOrFx1TGBGF4acYNG3pQoaVCs89jLohdpAIZIK1PcR5qY2oaX4pH q5VBIMZmqXKnseq1RQ8pMuwIxxZOdFyM90eMkdwTom8GMajAME2hnatpwShTNOwgkqPo SzJLXaJAHczcT8FQJHpSGqK49i5QEpVj5tUvO7mXnDeIitgDvUoSH7E+VuJTzMFczQR4 F39w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=DUls+NSqCzLwdMvu9DMfYrIm8aID0KapGH5s3ZOvbmM=; b=dvG0kMWMmstF7h8If9LO4/NVcx4g7JtszsejtlSzHm2zu/IqQUwotCG2HOYu4cg0+o Dqfc1FxMkEGM6mxt4yVHZsLm1Gsfhedle/JQ6AYLNVBnqyd681JnovcbRXUXgj/ZbDwv Kf15pwsJNpoYTIM7VRyhf7LLlkzT9n5xgj0SFA8vF3uAFktT56bRWUV7l6Ry3ZmQSO/u eQhq6RO3JgKexS3H2aDr6br4EX+BTrrR7ty34ySv7EAdOKb3q9udBTdkfheaMvzB4Q7J rejp3N/TMkSqDwt93B2QNrStK6aZUItzZihO4HF+SSiPorliYlxEoHrWOytJt9thIuT9 w1ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (no key) header.i=@lespinasse.org header.b="HO/JA3Fz"; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-53-rsa header.b=aLVrOmah; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lespinasse.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l9si8356001eds.288.2022.02.01.07.41.42; Tue, 01 Feb 2022 07:42:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=neutral (no key) header.i=@lespinasse.org header.b="HO/JA3Fz"; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-53-rsa header.b=aLVrOmah; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lespinasse.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243420AbiAaIHf (ORCPT + 99 others); Mon, 31 Jan 2022 03:07:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242353AbiAaIHc (ORCPT ); Mon, 31 Jan 2022 03:07:32 -0500 Received: from server.lespinasse.org (server.lespinasse.org [IPv6:2001:470:82ab::100:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 408BCC061714 for ; Mon, 31 Jan 2022 00:07:32 -0800 (PST) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-53-ed; t=1643616449; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=DUls+NSqCzLwdMvu9DMfYrIm8aID0KapGH5s3ZOvbmM=; b=HO/JA3FzstU7ddJ40KAF/Lb2XFouhcOhmEQwjCTTi0nYal7+D3kVQjpqaRVJ+9Frc1C9N C4GY0hPtgTCiIAQCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-53-rsa; t=1643616449; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=DUls+NSqCzLwdMvu9DMfYrIm8aID0KapGH5s3ZOvbmM=; b=aLVrOmahxQg+ZOd/LoQHUx/7vByrwGN7Xd0dgQQNhU1I5GVOkMKA7nwyXIK5UP7XG5MKH RDvCQZtIxBc7eLbNoXfJZzLQIOiTrWV+KMpLiNPvpV/Uu3zd3xLayV5lggbB7m8AjzCH2J8 uLAn8QWVKes4qJdhfJfW3+v0RkWs4zhSLpxoXf/bLQwO08xqJKgYm8L30aAP/42vOrD7AEm vh3D9K+S5i6eVVk+jTE5EDJ57vc+QvmGKFV6bue6mI0pzBINsv57zAY6cUWPhLsGmVXzNfO fHyzKWELMEidcbPxbnLI9yA4e378PpkDyia5zYcDBWtUKkAEMb2jkch9sY8w== Received: by server.lespinasse.org (Postfix, from userid 1000) id D1A82160968; Mon, 31 Jan 2022 00:07:29 -0800 (PST) Date: Mon, 31 Jan 2022 00:07:29 -0800 From: Michel Lespinasse To: Mike Rapoport Cc: Michel Lespinasse , Linux-MM , linux-kernel@vger.kernel.org, Andrew Morton , kernel-team@fb.com, Laurent Dufour , Jerome Glisse , Peter Zijlstra , Michal Hocko , Vlastimil Babka , Davidlohr Bueso , Matthew Wilcox , Liam Howlett , Rik van Riel , Paul McKenney , Song Liu , Suren Baghdasaryan , Minchan Kim , Joel Fernandes , David Rientjes , Axel Rasmussen , Andy Lutomirski Subject: Re: [PATCH v2 33/35] arm64/mm: attempt speculative mm faults first Message-ID: <20220131080729.GA785@lespinasse.org> References: <20220128131006.67712-1-michel@lespinasse.org> <20220128131006.67712-34-michel@lespinasse.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 30, 2022 at 11:13:26AM +0200, Mike Rapoport wrote: > The speculative page fault implementation here (and for PowerPC as well) > looks very similar to x86. Can we factor it our rather than copy 3 (or > more) times? In each arch, the speculative code was written along the lines of the existing non-speculative code, so that behavior would be unchanged when speculation succeeds. Now each arch's existing, non-speculative code paths are quite similar, but they do have small differences as to how they implement various permission checks, protection keys and the like. The same small differences end up being reflected in the new speculative code paths. I agree it would be nice if this code could be unified between archs, but IMO this should start with the existing non-speculative code - I don't think it would make sense to try unifying the new speculative code while trying to follow the behavior of the non-unified old non-speculative code paths...