From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A872BC433E0 for ; Wed, 10 Mar 2021 19:25:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 00CA164FCC for ; Wed, 10 Mar 2021 19:25:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 00CA164FCC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 613F28D0204; Wed, 10 Mar 2021 14:25:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C4EE8D01ED; Wed, 10 Mar 2021 14:25:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 417988D0204; Wed, 10 Mar 2021 14:25:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0006.hostedemail.com [216.40.44.6]) by kanga.kvack.org (Postfix) with ESMTP id 26F2F8D01ED for ; Wed, 10 Mar 2021 14:25:26 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E0A34181AF5D0 for ; Wed, 10 Mar 2021 19:25:25 +0000 (UTC) X-FDA: 77904943410.16.990FB8F Received: from labrats.qualcomm.com (labrats.qualcomm.com [199.106.110.90]) by imf13.hostedemail.com (Postfix) with ESMTP id B4E57E000109 for ; Wed, 10 Mar 2021 19:25:22 +0000 (UTC) IronPort-SDR: rrY9iLUqVQgskxHdY0uOyrU/J2t3Sg5dYz2MMmA5t0ARCdXpGOuXWBrw3ZsKZcdv74CFJIv11l U+Qut+Wjw9oE7yHHQjzAd7ROOEyW0gaQ/j3wsgvO30tRVvg8T3wQo0xUigDa8HFiLTjibBQuNL gP+KqfzjpRt6CpvmanQu1j26GEkwMpKdUsnqfVBxJWlczQx+3dyiGXysvKuk6T6L3F/J9jUu/L eh7i3QeWp+cJWqFozGSZ1FuTB/OJTkINRbDkqekItZ6dBSUp2guXMpc19NKe6uWCUygKPJ1RJZ f3k= X-IronPort-AV: E=Sophos;i="5.81,238,1610438400"; d="scan'208";a="47808929" Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by labrats.qualcomm.com with ESMTP; 10 Mar 2021 11:25:23 -0800 X-QCInternal: smtphost Received: from linux-kernel-memory-lab-01.qualcomm.com ([10.63.172.21]) by ironmsg04-sd.qualcomm.com with ESMTP; 10 Mar 2021 11:25:22 -0800 Received: by linux-kernel-memory-lab-01.qualcomm.com (Postfix, from userid 98314) id C7DB921C33; Wed, 10 Mar 2021 11:25:22 -0800 (PST) From: Patrick Daly To: catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org Cc: akpm@linux-foundation.org, anshuman.khandual@arm.com, david@redhat.com, linux-mm@kvack.org, pdaly@codeaurora.org, vincenzo.frascino@arm.com, will@kernel.org Subject: [PATCH] arm64: mte: Map hotplugged memory as Normal Tagged Date: Wed, 10 Mar 2021 11:24:35 -0800 Message-ID: <20210309122601.5543-1-catalin.marinas@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <20210309122601.5543-1-catalin.marinas@arm.com> References: <20210309122601.5543-1-catalin.marinas@arm.com> Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3599CC433DB for ; Tue, 9 Mar 2021 12:27:45 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BCBFE6526E for ; Tue, 9 Mar 2021 12:27:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BCBFE6526E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=KsW2t2BqP4kHpmIkduN2EcZVCNcBaJGUnoI6GEoGzkQ=; b=iAy9OOYQY/XMmP1riD6CvP5KpL 1PzcgcgGNW0jUKt7vQY5u2K4u/I+3TpVKm4MDLV9N5a9jbdqJgGVKqsqJHCZsYft8jLoO4SHvpk5z LykyP5BEBRFwDvrFhTHjG7EFL7b4oGnAu0Z0scRK3fI/NsS+8OLrRRr0RL5nW0seS400fW5u/Kjr1 m8ztaKlDuGwTkc3gHjdRGprg1KKqSSnckk5m7jy/Q0eVVQEB/FkOh8zwgFxsWGF8CzKeUAZtuzNns 8Gm0hVekMPVqnDB0otKZXGgIUeO6JtfLrFSsOxjuHpLduq824JoBhbi73gsI8EhkoFo0jIO95qQLN YBjgw/lQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJbRG-004SRD-6D; Tue, 09 Mar 2021 12:26:14 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJbRA-004SQX-Fa for linux-arm-kernel@lists.infradead.org; Tue, 09 Mar 2021 12:26:10 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9D7AE64F67; Tue, 9 Mar 2021 12:26:03 +0000 (UTC) X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Archived-At: List-Archive: Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: B4E57E000109 X-Stat-Signature: 1jzjfu5qd8ujwc5d8gt3jh6n58k9bfdd Received-SPF: none (qualcomm.com>: No applicable sender policy available) receiver=imf13; identity=mailfrom; envelope-from=""; helo=labrats.qualcomm.com; client-ip=199.106.110.90 X-HE-DKIM-Result: fail/fail (message has been altered) X-HE-Tag: 1615404322-885859 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Message-ID: <20210310192435.j_Tw_9MQwSEX-wDpdBNQN8SyfGNCQT-yYZwIqjYAD6U@z> From: Catalin Marinas > In a system supporting MTE, the linear map must allow reading/writing > allocation tags by setting the memory type as Normal Tagged. Currently, > this is only handled for memory present at boot. Hotplugged memory uses > Normal non-Tagged memory. > > Introduce pgprot_mhp() for hotplugged memory and use it in > add_memory_resource(). The arm64 code maps pgprot_mhp() to > pgprot_tagged(). > > Note that ZONE_DEVICE memory should not be mapped as Tagged and > therefore setting the memory type in arch_add_memory() is not feasible. > > Signed-off-by: Catalin Marinas > Fixes: 0178dc761368 ("arm64: mte: Use Normal Tagged attributes for the linear map") > Reported-by: Patrick Daly > Link: https://lore.kernel.org/r/1614745263-27827-1-git-send-email-pdaly@codeaurora.org > Cc: # 5.10.x > Cc: Will Deacon > Cc: Andrew Morton > Cc: Vincenzo Frascino > Cc: David Hildenbrand > --- > > Patrick, could you please give this patch a try on your platform? Thanks. It works for me. Sry for the double reply.