Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1483757pxp; Thu, 10 Mar 2022 06:23:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJyO9nwAeOIoGhS0VzqdO0NMkWroyt/UmsepqgOom0YeHjoILvfTLKYMxftewPNosJmdRes0 X-Received: by 2002:a17:906:3412:b0:6db:6ad:381c with SMTP id c18-20020a170906341200b006db06ad381cmr4541185ejb.302.1646922193415; Thu, 10 Mar 2022 06:23:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646922193; cv=none; d=google.com; s=arc-20160816; b=BF35rqUTpgIg8/SYac6nNulFHw497yPDkaA+EclfchwAj9WhrNcvveIOoOaRGhcpX4 Gnb2MYbMyceQXbWQMnEeLdPvSzTMepPreLGy/qvHIX0iSVkpdyoam9Kpq0XiIIxCyQ5X gUuf3KgQ3fTX2/Y/rucJr23cR/ZVgChX5tVOmT3ZUOcEfCARqxu+Ms1+IMTfT1jxl9ru TagDpqACWlzq9iNmbSd6S/SxYLW/Gq60UPR2Wzle3SIg3EZ+/KBP6HJ232a35VUKyL7b 6loryAnhIB8Y/nqhmLFo60jr2cBTmAcR+3acwmwvetsfDk8pGE9lhv4WkxummEbgse92 +PVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=IxtXQxh5RamskdoY4DXLCqA3pufxMyiLeszQ4CymfxM=; b=DzSnuDsr4B/768Mgn6Z/1v753nZjZrf4P7hq2CUQfwaEm7p3dPWgJL4r+qUC9YRqgG d/3oIpHM3+0bs28jO57RTpuTzB3d9fxgI/wdD9wOxTDa7o1NYToR4dpdZQjj1qjWoK3F REIjDvpTZb03y4svrrcsUpgncVEewoR+5n/5CDsGRh7ts8aSZ0U8uUfQDex/sy6b89JN NHJTDj3tQSiv28FO9Aa7j2pSi/I+ZUyUdqTidgOWAhQQnK1+5siVzfceQJcmI7qdz0uD EIUKh+1wKaWe2fimZFEQY+hbdOFv8D/JZHCphoDyJGV5Lcn4BXB7EMtBUZf00GbQILhK 5WOA== ARC-Authentication-Results: i=1; mx.google.com; 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 dr13-20020a170907720d00b006db014d91c8si3188170ejc.127.2022.03.10.06.22.50; Thu, 10 Mar 2022 06:23:13 -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; 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 S241349AbiCJKrO (ORCPT + 99 others); Thu, 10 Mar 2022 05:47:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbiCJKrK (ORCPT ); Thu, 10 Mar 2022 05:47:10 -0500 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D19F213DE3C; Thu, 10 Mar 2022 02:46:09 -0800 (PST) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 06AE892009C; Thu, 10 Mar 2022 11:46:08 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id F3D0292009B; Thu, 10 Mar 2022 10:46:08 +0000 (GMT) Date: Thu, 10 Mar 2022 10:46:08 +0000 (GMT) From: "Maciej W. Rozycki" To: Thomas Bogendoerfer cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, arnd@kernel.org Subject: Re: [PATCH] MIPS: Handle address errors for accesses above CPU max virtual user address In-Reply-To: <20220222155345.138861-1-tsbogend@alpha.franken.de> Message-ID: References: <20220222155345.138861-1-tsbogend@alpha.franken.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,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 On Tue, 22 Feb 2022, Thomas Bogendoerfer wrote: > Address errors have always been treated as unaliged accesses and handled > as such. But address errors are also issued for illegal accesses like > user to kernel space or accesses outside of implemented spaces. This > change implements Linux exception handling for accesses to the illegal > space above the CPU implemented maximum virtual user address and the > MIPS 64bit architecture maximum. With this we can now use a fixed value > for the maximum task size on every MIPS CPU and get a more optimized > access_ok(). Decades ago I had a patch to handle this with CPU-specific limits, which in the end I have not submitted for one reason or another. I guess we didn't have what is `cpu_vmbits' nowadays. I'll see if I can dig it out and check if there's anything interesting there we might also require. Overall good work, and I'm rather embarassed we have gone so far without it. Thanks! Maciej