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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_NONE,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 F343AC433B4 for ; Mon, 17 May 2021 10:36:28 +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 B806561076 for ; Mon, 17 May 2021 10:36:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B806561076 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=3nNH0Q/+9FjVwEkFfepB0wJ1h0pOT5QNXc12zMdoy+Y=; b=d+YjKsVRqbzqw/QDKFJEUh7ulC ikbXyp+XoCILIB1yRf19fpe28HTIaO5VX0wksE7X87YybOPlBN3SR8xJn/HEHlMZ1Y90wLNAevze9 l3264OBMVGd8VOmquejIsXNFgEzJ16wuQrilR1pzPsq5hIxAnwT1IC3Py3wOUlLawNfvtCJnWeMIJ Wmc0tJTwz7ex3762lZ0y5jZsAR863djJCqV3Q2uEhAhSjPEzXA64J9c5UVJMyo0Et6YUpONRHP/KK bFQr45B/cDHBdWMcQ/pLXCffQzpeBdr2JVsYMx2AGoTfIhG+gP04RBQSwbJrQ49nk4p2Gfekd07T7 JPkP5UIQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liaa1-00EbZO-KU; Mon, 17 May 2021 10:34:33 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liaZy-00EbYq-2g for linux-arm-kernel@desiato.infradead.org; Mon, 17 May 2021 10:34:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=Mwy1vv0iyfUpJPiSHI/Zjiyg7djoryxzWPZAhU/Uak4=; b=X/vDxf4I6r7eLfBePa0h8+pHWS z1pU7wiOxFdP1VlEzJw4x9e5A2H6o4kzkXuK5rH1qKpCgYT4jmJ8qpEiAVfkg9lstPDy4FdorHzbN reeatVqiI2Xh5obuBvmKcv22faAKFXr2m3kXbgvVLBSib2FBapo52XuCvIpRSCqSdO0jwg1EmLGwj XyK0fzSpXDZntNr6/UbSE4+T9kqaFytnY7wowB0vTMCtMxy1hiOLYt6Nrx3m57pYcDO9KTDUPA7Po EjcIvZO9+paCJwd39AkrVCgkHZ+n8LE7t+W7bhZtccUryKOUNHg30j1LpuXNvwWEs0OOq5AEse9sH GH5Wy1Jg==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liaZs-00DgNO-2l for linux-arm-kernel@lists.infradead.org; Mon, 17 May 2021 10:34:28 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 28D47106F; Mon, 17 May 2021 03:34:20 -0700 (PDT) Received: from eglon.cambridge.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 536B73F719; Mon, 17 May 2021 03:34:19 -0700 (PDT) From: James Morse To: linux-arm-kernel@lists.infradead.org Cc: Catalin Marinas , Will Deacon , James Morse Subject: [RFC PATCH] Documentation/arm64: describe the kernel's expectations of 'memory' Date: Mon, 17 May 2021 11:33:19 +0100 Message-Id: <20210517103319.5356-1-james.morse@arm.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_033424_213899_46873423 X-CRM114-Status: GOOD ( 16.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Standards such as CXL allow memory on PCIe devices to be made available to the operating system for use as regular memory. Document linux's expectations around the behaviour of memory as the implementations of these new standards may need special treatment in the OS, firmware or bootloader. Signed-off-by: James Morse --- Documentation/arm64/memory.rst | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Documentation/arm64/memory.rst b/Documentation/arm64/memory.rst index 901cd094f4ec..951802aee55f 100644 --- a/Documentation/arm64/memory.rst +++ b/Documentation/arm64/memory.rst @@ -167,3 +167,34 @@ from a 52-bit space by enabling the following kernel config options: Note that this option is only intended for debugging applications and should not be used in production. + +On device memory used as regular memory +--------------------------------------- +Standards such as CXL allow memory on PCIe device to be made +available to the operating system for use as regular memory. + +If memory is added to the UEFI memory map or DT, or discovered via ACPI's SRAT, +linux expects it to function in the same way as the bulk DRAM. This section +terms this 'regular memory'. + +The kernel may use any attributes to map this memory, e.g. Device-nGnRnE or +Normal Writeback-Cacheable. The kernel may not be in control of the attributes +used, e.g. if the memory is used by a KVM guest. +The kernel will perform cache maintenance to resolve mismatched attributes, +e.g. invalidating clean stale lines after writing new data when the MMU is +disabled. + +The memory may be used by any instruction supported by the CPUs. +e.g. Even when the v8.1 LSE atomic instructions are supported, the v8.0 +exclusives are still used for the futex code, and conditional waits, and still +used by existing user-space binaries. When the CPUs support features such as +MTE, all regular memory must support MTE tags. + +On device memory that does not function in the same way as regular memory must +not be added to the UEFI memory map or DT, or be discovered via ACPI's SRAT. + +On arm64, the kernel does not rewrite the UEFI memory map when memory is added +or removed. On device memory that is present at boot, but must be removed later +should be discovered via ACPI's SRAT to ensure it is not used for non-movable +structures. +e.g. the kernel text, page tables or the GIC ITS Pending Table. -- 2.30.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel