Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp382902rdb; Thu, 22 Feb 2024 06:47:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUcMtfI5Z9wCu5coSkOIOIcRfeV7a/f+AOGJ242PgHXliU7YxHFEtBosB+FSeCp12EjeW12ZZ5BHV9gZXFJjSryQPVpgsGEuLudxOi0qg== X-Google-Smtp-Source: AGHT+IFOtA50MBnwp91G2vGlF7YOP+n+2bIVvxvhQR5YJXEcTBOxBSjEhN5xDP7WGjvKQ90Ct365 X-Received: by 2002:a17:906:78b:b0:a3e:7ad2:63ed with SMTP id l11-20020a170906078b00b00a3e7ad263edmr9554121ejc.64.1708613262891; Thu, 22 Feb 2024 06:47:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708613262; cv=pass; d=google.com; s=arc-20160816; b=xsF2nHNMSmAZLQxzQKxFAn7HMBFI4puQ+NXjbst6ksbu9kkErnrHdhk8SpxND6u8i8 wElYSQgrM7odrA+gnIqh42WUWezRjP5XJZ0o1thVvKJm5fpYkdP9sGfJOrDG7xAwevHS O8f9tRe1xuRP1MDh+xgiqiNTaVnEDwrOExC9qIR2morkRX8awkHV3JrYM1unBJfo0RC/ w9jFaem21WCvBd1hYjYIGm0H6FclQ2khBbvu5PO7xtR6mbtvRWifaTRdSu1YLNgVWzjb dOtOcfhJy7fRzPhIAp/N+3xDi6JHM55AriHBcZTemoyF9qXFpC/wicQoHBDpNYXvytsM JSUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=NVo2zogiOR8SZ38K8Y+66IemWP15Q95q22AYy5NBYz0=; fh=KTwOmOGIRTHkKUrOPCE8H2zTgpqZANsgCM8uDpQCH1g=; b=lIDLbjV1Gxwh9eltyyGNUjYhQ+ws+z+JKdDlB9rPEA+xykyvO6X5i40QI/0/tMjclB zi7cScZ0u6OEywianjIOZwMbrgY3iQPcWrlV9eSHklrZbiCQlZj4KUGzhsEjgc+7zwLS tvYbKqY+SOWcyZQ4DRoOLhTVSi3EDRFyWWTzEYLIEtH0MsRe8Adt0eU2olY3gv7Gxacr ELaaYHcKTmB59aTNSXSlXPPqGpdgob6QPc5Z7dSKyeQHwbke3gVTOytg75UvUsMhUlNL hPODSfIvDx6pwmrOl7bQIyL70hE1VEM9fOhBXvWs0YQgvrQHL8wb8Orh60umHDJxupn4 gDGw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-76721-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76721-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n18-20020a1709061d1200b00a3ea9a44b5csi3642523ejh.87.2024.02.22.06.47.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 06:47:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76721-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-76721-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76721-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A32BB1F24E30 for ; Thu, 22 Feb 2024 14:47:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE72B1482FB; Thu, 22 Feb 2024 14:47:36 +0000 (UTC) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1C85146900 for ; Thu, 22 Feb 2024 14:47:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708613256; cv=none; b=ZjTFVwj2b1C887lXfFScV7hKOGUPPt4fN+rPgaoBMCmIOlIYV4tQqzDY9EtLFCTzQtsc+TLryeiKP40390t79jHESBkZVbKhXqjvYUCHrduRjCW6JAP2EKf0TsRqJmdJyz/4x10D99CHfrMbIAcUwewVIpqignqD3j4Ff3AtAVg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708613256; c=relaxed/simple; bh=s08qFDFyauiHhIOYQ3iEIG+R2xyF6nr4Cusf4jErsCg=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=PqVZ7NMKvOakcZlYAzlOANjwfikLENIgGn/kMB/ayhxCJkxmoIOycY7Lg66mzVWf0gRTgB5P7J0FfhJjaGHlM6IkOob1/008eycLj7NWq89dm5SO0m2ZwyVXFLnIULwTzvWJpPwX2TsENCQ0YK/BXV6G/D0VF06no53Xr27Pm98= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4TgbXc0hsKz2Bcy6; Thu, 22 Feb 2024 22:45:20 +0800 (CST) Received: from dggpemm100001.china.huawei.com (unknown [7.185.36.93]) by mail.maildlp.com (Postfix) with ESMTPS id 04D321A0172; Thu, 22 Feb 2024 22:47:30 +0800 (CST) Received: from [10.174.177.243] (10.174.177.243) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 22 Feb 2024 22:47:28 +0800 Message-ID: Date: Thu, 22 Feb 2024 22:47:27 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] arm: flush: check if the folio is reserved for IMO addresses Content-Language: en-US To: "Russell King (Oracle)" CC: Yongqiang Liu , , , , , , , , , , References: <20240222140147.1880357-1-liuyongqiang13@huawei.com> From: Kefeng Wang In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm100001.china.huawei.com (7.185.36.93) On 2024/2/22 22:38, Russell King (Oracle) wrote: > On Thu, Feb 22, 2024 at 10:06:04PM +0800, Kefeng Wang wrote: >> >> >> On 2024/2/22 22:01, Yongqiang Liu wrote: >>> Since commit a4d5613c4dc6 ("arm: extend pfn_valid to take into account >>> freed memory map alignment") changes the semantics of pfn_valid() to check >>> presence of the memory map for a PFN. A valid page for an address which >>> is reserved but not mapped by the kernel[1].In Some uio case we will get >>> a crash on a system with the following memory layout: >>> >>> node 0: [mem 0x00000000c0a00000-0x00000000cc8fffff] >>> node 0: [mem 0x00000000d0000000-0x00000000da1fffff] >>> the uio layout is:0xc0900000, 0x100000 >>> >>> the crash backtrace like: >>> >>> Unable to handle kernel paging request at virtual address bff00000 >>> [...] >>> CPU: 1 PID: 465 Comm: startapp.bin Tainted: G O 5.10.0 #1 >>> Hardware name: Generic DT based system >>> PC is at b15_flush_kern_dcache_area+0x24/0x3c >>> LR is at __sync_icache_dcache+0x6c/0x98 >>> [...] >>> (b15_flush_kern_dcache_area) from (__sync_icache_dcache+0x6c/0x98) >>> (__sync_icache_dcache) from (set_pte_at+0x28/0x54) >>> (set_pte_at) from (remap_pfn_range+0x1a0/0x274) >>> (remap_pfn_range) from (uio_mmap+0x184/0x1b8 [uio]) >>> (uio_mmap [uio]) from (__mmap_region+0x264/0x5f4) >>> (__mmap_region) from (__do_mmap_mm+0x3ec/0x440) >>> (__do_mmap_mm) from (do_mmap+0x50/0x58) >>> (do_mmap) from (vm_mmap_pgoff+0xfc/0x188) >>> (vm_mmap_pgoff) from (ksys_mmap_pgoff+0xac/0xc4) >>> (ksys_mmap_pgoff) from (ret_fast_syscall+0x0/0x5c) >>> Code: e0801001 e2423001 e1c00003 f57ff04f (ee070f3e) >>> ---[ end trace 09cf0734c3805d52 ]--- >>> Kernel panic - not syncing: Fatal exception >>> >>> So check if PG_reserved was set to solve this issue. >>> >>> [1]: https://lore.kernel.org/lkml/Zbtdue57RO0QScJM@linux.ibm.com/ >>> >>> Fixes: a4d5613c4dc6 ("arm: extend pfn_valid to take into account freed memory map alignment") >>> Suggested-by: Mike Rapoport >>> Signed-off-by: Yongqiang Liu >>> --- >>> arch/arm/mm/flush.c | 4 ++++ >>> 1 file changed, 4 insertions(+) >>> >>> diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c >>> index d19d140a10c7..f2b99223a0ab 100644 >>> --- a/arch/arm/mm/flush.c >>> +++ b/arch/arm/mm/flush.c >>> @@ -15,6 +15,7 @@ >>> #include >>> #include >>> #include >>> +#include >> 这个删掉吧然后发出去 > > Speak English so that everyone knows what you are saying. You are > participating in an international community where English is the > language that we use to communicate between ourselves. > Sorry, I mistake for a internal mail To Yongqiang, please drop the unnecessary include and as Matthew said, please consider to use folio helper. > Thanks. >