Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp834755rwl; Thu, 10 Aug 2023 02:16:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEMqFlJEMHY12bbScvDLNQ/A5RuVlcnRMl2Ckoz6szNzEl+S3dq/LSia6Wrw/tAfwnoOIib X-Received: by 2002:a05:6a00:138c:b0:673:8dfb:af32 with SMTP id t12-20020a056a00138c00b006738dfbaf32mr2096315pfg.26.1691658982843; Thu, 10 Aug 2023 02:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691658982; cv=none; d=google.com; s=arc-20160816; b=Kysla1OUCna24ZyBSrWhanAE9oQJI+IFahYZe+3w1U7jPZHIlUacNMCbibXNQ+NOC/ YcID8yXJLSnRzvC6w7DMCMfzFSR6ExAdbVQDcLAN7vKPNJgQOMfWbR/sToK2fvI0pmm0 LJ8aMiPpuFohg6t/PoR1KUEbkU5onxGB7dtoI7cZds9vNKFGFJX6V6wtwc6tImFZTe9o 8QtLCjgEPgVa4FFXTxvZ2oOFqtJS9Cqn14ihxgKK//9G6MRLaCLQBOemZBZEziZacO9j VQuQ0O90LSBRNdp2xZbHX9pHi+OCT3019GsgM5pC1GWpKVGoUDvqvsFpjg5348ob7xpy Ka8g== 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=cfauMD8eBoVBO4qe286JXop9yP4fl+wk73WA7VU1aX4=; fh=LcQ78wCWFdGHurJvIArrL+kR2SNLFSLxNCuQM/WSFG8=; b=ivdMQMaRej2mlPw8q+sxCyVgM+2TwhicaqauM37lLxpaQjEbbmt3Xl64Ww4oiSl4ZR +LA3ji0XZqW1Ys40/O473XYvMTaQVbcf4aL3ERNn7Os48fnGYj42YRtN0UMLRbiX0sHP 58+FjsyLbrK6ugZ8HML1MJDdUvjrJ1nvIoavPdu7/mTNn7ngalyAsxoZjGRX9NNRWOMJ t4YVajdZ2Sr5dM0kxtj7dLZD517NmpFMXYnlPaAdpp+uwZLy1DAQCU0Xkqq7gKUmD2D+ 24MTmY9XF4HGNwaGgHy/rWqm4c+F+rpCcNOlubeuKeCL6LiCsLREABpwxkHp52ZcbkvR CrxQ== 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 t20-20020a656094000000b0056382a0bc99si1251741pgu.580.2023.08.10.02.16.09; Thu, 10 Aug 2023 02:16:22 -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 S234202AbjHJIoA (ORCPT + 99 others); Thu, 10 Aug 2023 04:44:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232087AbjHJIn7 (ORCPT ); Thu, 10 Aug 2023 04:43:59 -0400 Received: from Atcsqr.andestech.com (60-248-80-70.hinet-ip.hinet.net [60.248.80.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B50A5211D for ; Thu, 10 Aug 2023 01:43:57 -0700 (PDT) Received: from mail.andestech.com (ATCPCS16.andestech.com [10.0.1.222]) by Atcsqr.andestech.com with ESMTP id 37A8hXq5021431; Thu, 10 Aug 2023 16:43:33 +0800 (+08) (envelope-from dylan@andestech.com) Received: from atctrx.andestech.com (10.0.15.173) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.498.0; Thu, 10 Aug 2023 16:43:29 +0800 Date: Thu, 10 Aug 2023 16:43:29 +0800 From: Dylan Jhong To: Alexandre Ghiti CC: Andrew Morton , Uladzislau Rezki , Christoph Hellwig , Lorenzo Stoakes , , Subject: Re: [PATCH -fixes] mm: Add a call to flush_cache_vmap() in vmap_pfn() Message-ID: References: <20230809164633.1556126-1-alexghiti@rivosinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230809164633.1556126-1-alexghiti@rivosinc.com> User-Agent: Mutt/2.1.4 (2021-12-11) X-Originating-IP: [10.0.15.173] X-DNSRBL: X-SPAM-SOURCE-CHECK: pass X-MAIL: Atcsqr.andestech.com 37A8hXq5021431 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,PDS_RDNS_DYNAMIC_FP, RCVD_IN_DNSWL_BLOCKED,RDNS_DYNAMIC,SPF_HELO_NONE,SPF_PASS autolearn=no 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 Wed, Aug 09, 2023 at 06:46:33PM +0200, Alexandre Ghiti wrote: > flush_cache_vmap() must be called after new vmalloc mappings are > installed in the page table in order to allow architectures to make sure > the new mapping is visible. > > Fixes: 3e9a9e256b1e ("mm: add a vmap_pfn function") > Reported-by: Dylan Jhong > Closes: https://lore.kernel.org/linux-riscv/ZMytNY2J8iyjbPPy@atctrx.andestech.com/ > Signed-off-by: Alexandre Ghiti > --- > mm/vmalloc.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c > index 93cf99aba335..228a4a5312f2 100644 > --- a/mm/vmalloc.c > +++ b/mm/vmalloc.c > @@ -2979,6 +2979,10 @@ void *vmap_pfn(unsigned long *pfns, unsigned int count, pgprot_t prot) > free_vm_area(area); > return NULL; > } > + > + flush_cache_vmap((unsigned long)area->addr, > + (unsigned long)area->addr + count * PAGE_SIZE); > + > return area->addr; > } > EXPORT_SYMBOL_GPL(vmap_pfn); > -- > 2.39.2 > Hi Alex, Looks good to me. Thanks. Reviewed-by: Dylan Jhong Best regards, Dylan Jhong