Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp760393rwl; Thu, 10 Aug 2023 00:46:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdAAFxmq91gGmJscu0YQfWv7Zxw/eIIoP5auq7Q7FWxV1vtymjBTkee9T5UI6DbtSKbbmy X-Received: by 2002:a05:620a:4414:b0:76c:d996:a56e with SMTP id v20-20020a05620a441400b0076cd996a56emr1726428qkp.60.1691653613490; Thu, 10 Aug 2023 00:46:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691653613; cv=none; d=google.com; s=arc-20160816; b=ftSKgAN8xIxjt7YG6xfxiFDdsSENFlWkHVTHuaWm38TBS5zTAmuT+dSyqQtHVjXVj5 TIsxkum7qzgKFtdPD6viFrQSLdk3nC8q7lK4nkVALcHsTQ1ZL7Il/0vBjDYAGqsauN1M KezivF2jF82Np+90JO7hJdN3UNwcv8ahz0uPN3YOxQrbfV72WGSq4RrqI8uFRiX4s+/B bmjH6EvPMPD8w8MlVrP3vVuQMDDo6lhtwUnkhaOKpZBv/Uk8JdCmilbA1FwqvBblW9K4 7pazNuy3exEtf2MB/1cSDpdWuIh17hWp4fzRBaA7tKKAq2ScTxzPhnkNnV0cNUhKLZTy X0DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=UR7Lvol0nL5qJqdk+EAflqogsBm2jlNb+rpEaQRXEuI=; fh=PWslRz5+EQg7MoFzMIi53Yk8l+ibrsq4LmZlqCqilFU=; b=z5s2b+OJ2P0mIIKOeYCCA4eFmvGA2g62cDLTscT8PzfVXqWsWi9p1Z+eeBOpZPSxTN lkrT8oLvKME2jHjisfSiBOqZRJm89KCcd/pf22tvs0l3COPdhauj62sYCC0pGDzXpAyN skiyLgf0mlAEjdA62m5dHwKyhGYdGsburLIT09DP9hbqicR0k+LFGfGqDgTXU55nJMB+ YDnALm8uJ0qs9oHuptybFR9MxqPIceWILyizB0591LjSFmDHpRwLWDyE0TyM07yDJ9Qm i7HxlSfRxxWC5WOzT7Ks2w14g5aagf5u7JdgCGodxVusYVhLZi/JblO+AKXrTM8EDwo0 4PLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=qJ4XRDLa; 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 h2-20020a635302000000b00553a50c5d85si1040017pgb.510.2023.08.10.00.46.39; Thu, 10 Aug 2023 00:46:53 -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=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=qJ4XRDLa; 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 S232216AbjHJHPV (ORCPT + 99 others); Thu, 10 Aug 2023 03:15:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229740AbjHJHPT (ORCPT ); Thu, 10 Aug 2023 03:15:19 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2F3912D for ; Thu, 10 Aug 2023 00:15:18 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-31427ddd3fbso582360f8f.0 for ; Thu, 10 Aug 2023 00:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1691651717; x=1692256517; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=UR7Lvol0nL5qJqdk+EAflqogsBm2jlNb+rpEaQRXEuI=; b=qJ4XRDLarXrFBClncAjIiyyvqREnotU+C8Z68t+4hq5DS6i05ymSbaQs22uvMBqJ7p C6cB1/oSgIAy5Ah39K7zPFUq4udynF8B2WIXVnhNCT0kgysVvWE3S3tlB1/DflAK3Ag6 0nhEFlXfJPU9vepMNTmR/7u76Cpzw9UUdqII867VSdH15SFm8bVyxe4KM0IoUyogDtsL g66nxzIpxbajTtvKj4g+IfNrcjaipuTGBG2sdV1KDZ0j0P1Wi8LyaLz5a+zo5T5rOoaL ihYJSgSEU8Eoaeubu2FaMFjDsqRMCz7T/wViXEoCz+lu3N2PD+wctdEs5QL+kN5NJ6kp nIAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691651717; x=1692256517; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UR7Lvol0nL5qJqdk+EAflqogsBm2jlNb+rpEaQRXEuI=; b=PR9dhWY8ZXWcvqwMCSseWdD0e1dLpuhFQpnP5Hieft6hdRgndlX2qDgzLqYWlRbaHY XyFv4Hd6Z/4xWPaXgNVMuv6w5OvcPFx1qpY+qVX1e9EH8lIuPS9eSU/DX/xGwLKZxjAR SzgpS4TZtkYDHUSKwDNSzBsNYT3AC64paCi7Y39lsLR2ei5PMMwJL6Clykh5ev083qJK LyCEstkDEh4yLlLyT9zFuoFtvPS9ii+bsVClOQLK1uNU5VwCShxHds9K1Uk+rN1WLM3R r/QAiVIOvYEENTzliSvRJLSGvIf9Om3Xg1TTwug9xBIGHAWcUn5CZwn1II+G9OZltAaN NZHw== X-Gm-Message-State: AOJu0YzgMyNuh4xyXniR72h5v+ZJ44HDMgCGS53dO+fr5liT4XL/7my/ 7VAXWJV18y6Dl2ki1ic3l+lut2EVSM0rYHW1AI/7ew== X-Received: by 2002:adf:e9cc:0:b0:318:7c3:12c8 with SMTP id l12-20020adfe9cc000000b0031807c312c8mr1414690wrn.21.1691651717439; Thu, 10 Aug 2023 00:15:17 -0700 (PDT) MIME-Version: 1.0 References: <20230809164633.1556126-1-alexghiti@rivosinc.com> <20230809114651.eb690e5bd4c60b075eb3111b@linux-foundation.org> In-Reply-To: <20230809114651.eb690e5bd4c60b075eb3111b@linux-foundation.org> From: Alexandre Ghiti Date: Thu, 10 Aug 2023 09:15:06 +0200 Message-ID: Subject: Re: [PATCH -fixes] mm: Add a call to flush_cache_vmap() in vmap_pfn() To: Andrew Morton Cc: Uladzislau Rezki , Christoph Hellwig , Lorenzo Stoakes , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dylan Jhong Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 Hi Andrew, On Wed, Aug 9, 2023 at 8:46=E2=80=AFPM Andrew Morton wrote: > > On Wed, 9 Aug 2023 18:46:33 +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 sur= e > > the new mapping is visible. > > Thanks. What are the user-visible effects of this bug? It could lead to a panic since on some architectures (like powerpc), the page table walker could see the wrong pte value and trigger a spurious page fault that can not be resolved (see commit f1cb8f9beba8 ("powerpc/64s/radix: avoid ptesync after set_pte and ptep_set_access_flags")). But actually the patch is aiming at riscv: the riscv specification allows the caching of invalid entries in the TLB, and since we recently removed the vmalloc page fault handling, we now need to emit a tlb shootdown whenever a new vmalloc mapping is emitted (https://lore.kernel.org/linux-riscv/20230725132246.817726-1-alexghiti@rivo= sinc.com/). That's a temporary solution, there are ways to avoid that :) Thanks, Alex