Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp396267imw; Fri, 15 Jul 2022 05:33:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1urVZiRkWO5upIYQrV/ouM3swpO4UokpJkuIAeOjl1eq3MZHHIDOThhsfSWxc0gpM8baj2V X-Received: by 2002:a63:f91e:0:b0:419:e9dd:6d97 with SMTP id h30-20020a63f91e000000b00419e9dd6d97mr1325908pgi.116.1657888424645; Fri, 15 Jul 2022 05:33:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657888424; cv=none; d=google.com; s=arc-20160816; b=YViB2Ya2FL7CVZ2oSJKVGSZNKgBXAfRJFfRFs3NiP4SyN0ZECKynXdr8Wk+BGamTBI N0Eh7FBrV1bymKBD3lkQes73P5MU+nhP8cEBqdxZjkHqdO4p9QY76A/obXL0EjoHt31E PkMBHdH03BA9vtJC+42qUTg2prI3MVBDsuquIXfKABZNG2Bg1/5auZkF6ZX7AKA+7VI7 OYFxizBav5PLJXwb8BTlVS+zja4As9R7+yKl39VKhdGrkRfe3dd7TYZhnEF9M6eks/YO E9/h+QIu0fVatUw5kc2bZYlHlNIwcUHkIHT9FveKCZDE/we97d5Yv+K4ltB8w8uggZpy zChQ== 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; bh=OCMjV0taoc33PH+jeeSgTNHGXOaouK3RWjIM0hKiT4s=; b=hYkZ3AYq23pZcB8yp5BPj624xXzBAzD8+QBQhGUu74/fBlgjENgQU51Y4LWvwSFyx7 WvpEN8Ko7NoqME9d7rRJQTocVGwBec6/gMUEBlaLFtjLgPSqgJaghuFWV1lw1Gx5c/D/ 2nplmhRHeIMvfy/1I9pgOxth1o0AVimCY2Kq4VqbR3XbLs6ZFQVX3zQrrQqlRGyIcRe2 2S2qOUF6L+tBxZ5w05+vPZN8Om5IhlYYfCX0GifrAFRymPTZN46fQ4p4xB2Ub9t8CHoI clccUMBDaPtWJd9JFhDDC6Y1Zd8X/B7yWr/JGMxZLeln9np6Hpg/pwjEh1X/+rv0ytiQ NRpQ== 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 f7-20020a056a00238700b0052b36d3eaecsi2875651pfc.240.2022.07.15.05.33.29; Fri, 15 Jul 2022 05:33:44 -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; 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 S234091AbiGOMZ6 (ORCPT + 99 others); Fri, 15 Jul 2022 08:25:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbiGOMZy (ORCPT ); Fri, 15 Jul 2022 08:25:54 -0400 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 539EC814B2; Fri, 15 Jul 2022 05:25:53 -0700 (PDT) Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1oCKOG-00082w-00; Fri, 15 Jul 2022 14:25:52 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id BAF77C0499; Fri, 15 Jul 2022 14:24:36 +0200 (CEST) Date: Fri, 15 Jul 2022 14:24:36 +0200 From: Thomas Bogendoerfer To: Florian Fainelli Cc: linux-mips@vger.kernel.org, fancer.lancer@gmail.com, gerg@kernel.org, open list Subject: Re: [PATCH v2] MIPS: Fixed __debug_virt_addr_valid() Message-ID: <20220715122436.GA2705@alpha.franken.de> References: <20220714222514.1570617-1-f.fainelli@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220714222514.1570617-1-f.fainelli@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE 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 Thu, Jul 14, 2022 at 03:25:12PM -0700, Florian Fainelli wrote: > It is permissible for kernel code to call virt_to_phys() against virtual > addresses that are in KSEG0 or KSEG1 and we need to be dealing with both > types. Rewrite the test condition to ensure that the kernel virtual > addresses are above PAGE_OFFSET which they must be, and below KSEG2 > where the non-linear mapping starts. > > For EVA, there is not much that we can do given the linear address range > that is offered, so just return any virtual address as being valid. > > Finally, when HIGHMEM is not enabled, all virtual addresses are assumed > to be valid as well. > > Fixes: dfad83cb7193 ("MIPS: Add support for CONFIG_DEBUG_VIRTUAL") > Signed-off-by: Florian Fainelli > --- > Changes in v2: > > - handle lack of HIGHMEM and EVA > > arch/mips/mm/physaddr.c | 14 ++++---------- > 1 file changed, 4 insertions(+), 10 deletions(-) applied to mips-next. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]