Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3213005imw; Mon, 11 Jul 2022 04:26:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sH4cPb5UcW2+sgyALPi2Ow4TrLXM4rUnXBWdQK+syayKarFPPIYs7DOn6zp61IT8F6ooRh X-Received: by 2002:a63:d315:0:b0:411:bbff:efbc with SMTP id b21-20020a63d315000000b00411bbffefbcmr15216610pgg.342.1657538783991; Mon, 11 Jul 2022 04:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657538783; cv=none; d=google.com; s=arc-20160816; b=G7VLMurdUR2UxRc1wpeBNHMVsoXuA8JidFy6/2bMSY4kJu8zGcAaWAKMbVIFFM2nM4 XYVisq+zlZuHt0xYcN/wj/RusXSBYPvA5UH/Fv99l8P0QDXQn0A+EJ6J164bG0MEwgZW 2Dt2xX52QF1YWhVyYtFPI1gI9A4Oux9o2APjwwlGvk9gmmt/eWWARKyPh+8/97/TanBn 2Z4wClJ2/lzrh4sFf2gcmwUCebyzAefqA9+sVEL668CIzTWGg0sIepy+MbpAN/Se94QJ ccQBIuIZ2opE8bF9BaUbuqCAx9s9ploPUB9vdurJmL8dSmyONULUJbMcDKjdpGyM+yLq +FBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tKUP88tFfL4ob57kLuQtLQDMBfz35DAQY6r3VlU1mf0=; b=ZnCAX4GyozZSMSeV0Nt3iv/joyzIsB2famMCBO/zAvbJn6pIqgI48CgP3ccIFdfU70 EPRpIBY1funWARcZf5Dvg1DjtkUSjtj8gI29VQN+gm2M/txw3NxIDC2Wfo0cILFcsre4 h/PvJZGJ/kP4+Q94w7Vv5votnhvdFst4mP/79XuH9fvDe1AxmL6z+vNU6oGvm1F6Gude XT/iljxs7M/8Noy/RrFkltlJQ8kcKGDosikl7b5y+qYstQHS4hDT6EuUZyFaFtu+uvMf 8I0sWvRmyDPGW2D7EDL0W+yOhyvEgFWgbCLeC2eLrIjwzZoVqBbN9yMKjyrh2f5Y5sdf iS3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=a9PmZb1x; 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 w12-20020a170902e88c00b0016c0474d5cesi11625612plg.532.2022.07.11.04.26.11; Mon, 11 Jul 2022 04:26:23 -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=@gmail.com header.s=20210112 header.b=a9PmZb1x; 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 S230225AbiGKLSt (ORCPT + 99 others); Mon, 11 Jul 2022 07:18:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230405AbiGKLSW (ORCPT ); Mon, 11 Jul 2022 07:18:22 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 995EF273B; Mon, 11 Jul 2022 03:40:56 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id bf9so7946610lfb.13; Mon, 11 Jul 2022 03:40:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=tKUP88tFfL4ob57kLuQtLQDMBfz35DAQY6r3VlU1mf0=; b=a9PmZb1xGozPn2iBGEJ+GaeXt02e0hsZkWJj7XS4kv2H1XgVVprv2HeDALTTfu+Z6r umWMgZnd8unLH1HrkEgbSIvx7bvu2gl6DDtu9TQrlQIiwsMXvmbzAbSrhBSUD9yUgnl/ iY/nhDDf5ZpsBjxfRhsOl7P/N1k2vyVUfJAQjkJ/eWnffLuaDeuJ6K6ELIj9fvDtQLaN jflsV5WgBROyRRc6wYdOev/rHUsDtr75eGW/tWjkuliyLgstVsDPei1c8ZCGqeOf2SpY lJL4EDfOxknhQpv0U2XpwS+6FmeHcnXh1xZLTQKfIegNMnJL0dJb3Y6EVMiyaeE65Fk6 XUhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=tKUP88tFfL4ob57kLuQtLQDMBfz35DAQY6r3VlU1mf0=; b=PywIo/h/e8AKLuXMAPuFq5O2Wzo7E8UXFpl8976460TAdlqdTdUqD18d+ePEsIs9t7 jprgXFpdmdAehCONn3ihahbb/tSqRIxI20R1YribyKn5rSQIaNkeQmhciuTsVJsBoUCG xWEwiWT/3YALVPDkvtNlgx9ik7inmdxlIY8csJYzhZgrmSzR0VMoYfOwVi3unpvoJFxl Z/77xJdEqPtBiKy0OEbyDz36KlpNgELd3oMRFyKujDiBYE5itF8wr2zzPLCtwltdV4dc M435HBxZUbfpdXzui4/DFLekM1P0ht9vfhA3H0rIl3sXFvhXP/wqQYhigNVqlo0U1Edz Cwcw== X-Gm-Message-State: AJIora9GJw1pUCmwwjq+utKD9vUjGslQRUIN8BAcFufrnimfczcD8mQF wr95PvF33OIpnWHSV3963W4= X-Received: by 2002:a05:6512:1698:b0:47f:b5a6:6870 with SMTP id bu24-20020a056512169800b0047fb5a66870mr11063346lfb.578.1657536054874; Mon, 11 Jul 2022 03:40:54 -0700 (PDT) Received: from mobilestation ([95.79.140.178]) by smtp.gmail.com with ESMTPSA id m5-20020a2ea885000000b0025a7338317esm1625353ljq.64.2022.07.11.03.40.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 03:40:54 -0700 (PDT) Date: Mon, 11 Jul 2022 13:40:52 +0300 From: Serge Semin To: Thomas Bogendoerfer Cc: Florian Fainelli , linux-mips@vger.kernel.org, gerg@kernel.org, open list Subject: Re: [PATCH] MIPS: Fixed __debug_virt_addr_valid() Message-ID: <20220711104052.ddefbgd34xbbjykg@mobilestation> References: <20220707215237.1730283-1-f.fainelli@gmail.com> <20220711083848.GE6084@alpha.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220711083848.GE6084@alpha.franken.de> 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,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 Mon, Jul 11, 2022 at 10:38:48AM +0200, Thomas Bogendoerfer wrote: > On Thu, Jul 07, 2022 at 02:52:36PM -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. Add a final condition that ensures that the virtual address is > > below KSEG2. > > > > Fixes: dfad83cb7193 ("MIPS: Add support for CONFIG_DEBUG_VIRTUAL") > > Signed-off-by: Florian Fainelli > > --- > > arch/mips/mm/physaddr.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/arch/mips/mm/physaddr.c b/arch/mips/mm/physaddr.c > > index a1ced5e44951..a82f8f57a652 100644 > > --- a/arch/mips/mm/physaddr.c > > +++ b/arch/mips/mm/physaddr.c > > @@ -5,6 +5,7 @@ > > #include > > #include > > > > +#include > > #include > > #include > > #include > > @@ -30,7 +31,7 @@ static inline bool __debug_virt_addr_valid(unsigned long x) > > if (x == MAX_DMA_ADDRESS) > > return true; > > > > - return false; > > + return KSEGX(x) < KSEG2; > > } > > > > phys_addr_t __virt_to_phys(volatile const void *x) > > -- > > 2.25.1 > > applied to mips-next. Are you sure it was ready to be applied? Link: https://lore.kernel.org/linux-mips/20220708115851.ejsooiilxcopkoei@mobilestation/ -Sergey > > Thomas. > > -- > Crap can work. Given enough thrust pigs will fly, but it's not necessarily a > good idea. [ RFC1925, 2.3 ]