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=-14.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 26D48C432BE for ; Wed, 25 Aug 2021 17:46:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 00F83610E8 for ; Wed, 25 Aug 2021 17:46:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233006AbhHYRrS (ORCPT ); Wed, 25 Aug 2021 13:47:18 -0400 Received: from mail-ot1-f44.google.com ([209.85.210.44]:34725 "EHLO mail-ot1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231602AbhHYRrR (ORCPT ); Wed, 25 Aug 2021 13:47:17 -0400 Received: by mail-ot1-f44.google.com with SMTP id k12-20020a056830150c00b0051abe7f680bso46287otp.1; Wed, 25 Aug 2021 10:46:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iCtlcERoYNnbif+Y8zhh0368pArdTRgkUQL9JCAr/bg=; b=aU3+zl9Ig2KOMEVT6lqGqif9khEA4zJjDPFqkDkV/bOKNPOPSjCGfedxHo7TrAlSEA /XXeJLOgSYjRgWcu7ukW152rmTwX1nJPjAW/eScUfoKocta0E0bfwDwKVYMVdcAHDqEN Bqh/p/JtcjV7a4hTHzjd3eZUrVlMQdp6O/sIMv3GVJaBYOW9mgGd8CpGBFwky9GCeWpz vWjxA9/dDW0lsOOx9c82ReuTA0eSrdRc2VwCHLKaUo3HLQStmCqWCfCZyzojie1yuMGF 3bNp9OPRztC5jpND0WWpahWJtSmZRbSJBdE9/3DNDwNF/iqwAUnMY1HXL4UWzna/gs+3 A8hA== X-Gm-Message-State: AOAM530lCMcyd7ry0zoUlUD5RnR/XbptUWTT2Da3V3rYrTazBDatiADI Cde/93OfWgocTmcsM5KNkZC7UTTdbGKTNRKXUuM= X-Google-Smtp-Source: ABdhPJwoeMOzINNBvR+IsBC8Rp3PRgkA7Hhn/rQT6zvv0kkQFzdSIQX5dqxRXMbB/GrayCzX5YJnbcfGv2nDsGqM6ko= X-Received: by 2002:a9d:a57:: with SMTP id 81mr24620521otg.260.1629913590155; Wed, 25 Aug 2021 10:46:30 -0700 (PDT) MIME-Version: 1.0 References: <20210802152359.12623-1-lorenzo.pieralisi@arm.com> <20210823104618.14552-1-lorenzo.pieralisi@arm.com> <20210823123052.GC8603@arm.com> In-Reply-To: <20210823123052.GC8603@arm.com> From: "Rafael J. Wysocki" Date: Wed, 25 Aug 2021 19:46:19 +0200 Message-ID: Subject: Re: [PATCH RESEND v3] ACPI: Add memory semantics to acpi_os_map_memory() To: Catalin Marinas , Lorenzo Pieralisi Cc: Linux Kernel Mailing List , Hanjun Guo , Ard Biesheuvel , Will Deacon , Sudeep Holla , "Rafael J. Wysocki" , ACPI Devel Maling List , Linux ARM , Veronika kabatova , Robin Murphy Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Mon, Aug 23, 2021 at 2:31 PM Catalin Marinas wrote: > > On Mon, Aug 23, 2021 at 11:46:18AM +0100, Lorenzo Pieralisi wrote: > > The memory attributes attached to memory regions depend on architecture > > specific mappings. > > > > For some memory regions, the attributes specified by firmware (eg > > uncached) are not sufficient to determine how a memory region should be > > mapped by an OS (for instance a region that is define as uncached in > > firmware can be mapped as Normal or Device memory on arm64) and > > therefore the OS must be given control on how to map the region to match > > the expected mapping behaviour (eg if a mapping is requested with memory > > semantics, it must allow unaligned accesses). > > > > Rework acpi_os_map_memory() and acpi_os_ioremap() back-end to split > > them into two separate code paths: > > > > acpi_os_memmap() -> memory semantics > > acpi_os_ioremap() -> MMIO semantics > > > > The split allows the architectural implementation back-ends to detect > > the default memory attributes required by the mapping in question > > (ie the mapping API defines the semantics memory vs MMIO) and map the > > memory accordingly. > > > > Link: https://lore.kernel.org/linux-arm-kernel/31ffe8fc-f5ee-2858-26c5-0fd8bdd68702@arm.com > > Tested-by: Hanjun Guo > > Signed-off-by: Lorenzo Pieralisi > > Acked-by: Ard Biesheuvel > > Cc: Ard Biesheuvel > > Cc: Will Deacon > > Cc: Hanjun Guo > > Cc: Sudeep Holla > > Cc: Catalin Marinas > > Cc: "Rafael J. Wysocki" > > --- > > Resending with all lists CC'ed. > > > > Patch series is a v3 of a previous version[2]: > > > > v2->v3: > > - Dropped first two-patches following LKML feedback[2] > > v1->v2 > > - Added patch 1 and 2 according to feedback received on[1] > > > > [1] https://lore.kernel.org/linux-acpi/20210726100026.12538-1-lorenzo.pieralisi@arm.com > > [2] https://lore.kernel.org/linux-acpi/20210802152359.12623-1-lorenzo.pieralisi@arm.com > > > > arch/arm64/include/asm/acpi.h | 3 +++ > > arch/arm64/kernel/acpi.c | 19 ++++++++++++++++--- > > drivers/acpi/osl.c | 23 ++++++++++++++++------- > > include/acpi/acpi_io.h | 8 ++++++++ > > 4 files changed, 43 insertions(+), 10 deletions(-) > > For arm64: > > Acked-by: Catalin Marinas > > I presume this patch would go in via the acpi tree. Applied as 5.15 material, thanks! 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=-14.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 10A64C432BE for ; Wed, 25 Aug 2021 17:48:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 C7BA960E90 for ; Wed, 25 Aug 2021 17:48:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C7BA960E90 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5SMTc5RW9h+npy2kuOAEzpilw0NhJkdUQkJpVBwIl4k=; b=O0HzlXQFVoYjIk r8LbGKZeRj6aa+qggm8hByj8tAzv4t7odx0WiP95iiZmh37Okz0X2kPa5G32eC7pDK30iED1Ue2EF caBbbfV1acokrTu462e5IXx5507kIRKa18k20vCH3ayEhIdcAbeLMl1EOxthuIwoXJlBxFwyvszgk UjJmfu4iicXsx6xkwYutXXESh9PsquJQsI1PRrnaXqbvEpRb6kds0EoaYuG1hfA0NaUfJFJjdE58g 5VZ3Lz+dFL9fZOVq/HlysYGDHECpJV4x0gT+/1CZgmzNDA0cMPiabCK4neCw6uh+ImliypvN9bnB/ VnhYeUUh72sHy33yUGNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mIwyz-0087c4-94; Wed, 25 Aug 2021 17:46:37 +0000 Received: from mail-ot1-f54.google.com ([209.85.210.54]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mIwyv-0087bH-Bh for linux-arm-kernel@lists.infradead.org; Wed, 25 Aug 2021 17:46:35 +0000 Received: by mail-ot1-f54.google.com with SMTP id c19-20020a9d6153000000b0051829acbfc7so55812646otk.9 for ; Wed, 25 Aug 2021 10:46:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iCtlcERoYNnbif+Y8zhh0368pArdTRgkUQL9JCAr/bg=; b=KY9EgVB9+BIwBSfPrBLORnDTya7ci71NiUGgK1ql1FyOie3rQ/gNVWNxZXvhYZoJF0 wtwl/3NcDUdVI40zBxXc0DM89yWpcz0re2QGtr5RihtPJleBZS+XmSfW/hNxu7jetn8K H88PbgtRAnR6ZYZff3l67F8FDugyITSX3mkZtpX/wZST6Ygg89bp1pKqvQshStJ6J8Il i6kr9ItAGV8Qmd3gSjlPabiiBuxQpO+LjtKgqFQdphAcNNMzv0CAm0BdX9F9nVyvDBJh cjKioKRw8hs4D1lnXd0krRmthykIZiPDzdAxu0dqL/HtYSQNCnIt6iPuVqpETAT3i64e w3+w== X-Gm-Message-State: AOAM530IejJPy1ffpDZnZOI0FZeBeuFBD8vRTJk1OSoyVY3OtOc2EJvP /AiC0x2tAEzLiSkBicJC2PgjuqEdqBt8x9Ouy5U= X-Google-Smtp-Source: ABdhPJwoeMOzINNBvR+IsBC8Rp3PRgkA7Hhn/rQT6zvv0kkQFzdSIQX5dqxRXMbB/GrayCzX5YJnbcfGv2nDsGqM6ko= X-Received: by 2002:a9d:a57:: with SMTP id 81mr24620521otg.260.1629913590155; Wed, 25 Aug 2021 10:46:30 -0700 (PDT) MIME-Version: 1.0 References: <20210802152359.12623-1-lorenzo.pieralisi@arm.com> <20210823104618.14552-1-lorenzo.pieralisi@arm.com> <20210823123052.GC8603@arm.com> In-Reply-To: <20210823123052.GC8603@arm.com> From: "Rafael J. Wysocki" Date: Wed, 25 Aug 2021 19:46:19 +0200 Message-ID: Subject: Re: [PATCH RESEND v3] ACPI: Add memory semantics to acpi_os_map_memory() To: Catalin Marinas , Lorenzo Pieralisi Cc: Linux Kernel Mailing List , Hanjun Guo , Ard Biesheuvel , Will Deacon , Sudeep Holla , "Rafael J. Wysocki" , ACPI Devel Maling List , Linux ARM , Veronika kabatova , Robin Murphy X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210825_104633_447955_E2EFF533 X-CRM114-Status: GOOD ( 26.32 ) 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 On Mon, Aug 23, 2021 at 2:31 PM Catalin Marinas wrote: > > On Mon, Aug 23, 2021 at 11:46:18AM +0100, Lorenzo Pieralisi wrote: > > The memory attributes attached to memory regions depend on architecture > > specific mappings. > > > > For some memory regions, the attributes specified by firmware (eg > > uncached) are not sufficient to determine how a memory region should be > > mapped by an OS (for instance a region that is define as uncached in > > firmware can be mapped as Normal or Device memory on arm64) and > > therefore the OS must be given control on how to map the region to match > > the expected mapping behaviour (eg if a mapping is requested with memory > > semantics, it must allow unaligned accesses). > > > > Rework acpi_os_map_memory() and acpi_os_ioremap() back-end to split > > them into two separate code paths: > > > > acpi_os_memmap() -> memory semantics > > acpi_os_ioremap() -> MMIO semantics > > > > The split allows the architectural implementation back-ends to detect > > the default memory attributes required by the mapping in question > > (ie the mapping API defines the semantics memory vs MMIO) and map the > > memory accordingly. > > > > Link: https://lore.kernel.org/linux-arm-kernel/31ffe8fc-f5ee-2858-26c5-0fd8bdd68702@arm.com > > Tested-by: Hanjun Guo > > Signed-off-by: Lorenzo Pieralisi > > Acked-by: Ard Biesheuvel > > Cc: Ard Biesheuvel > > Cc: Will Deacon > > Cc: Hanjun Guo > > Cc: Sudeep Holla > > Cc: Catalin Marinas > > Cc: "Rafael J. Wysocki" > > --- > > Resending with all lists CC'ed. > > > > Patch series is a v3 of a previous version[2]: > > > > v2->v3: > > - Dropped first two-patches following LKML feedback[2] > > v1->v2 > > - Added patch 1 and 2 according to feedback received on[1] > > > > [1] https://lore.kernel.org/linux-acpi/20210726100026.12538-1-lorenzo.pieralisi@arm.com > > [2] https://lore.kernel.org/linux-acpi/20210802152359.12623-1-lorenzo.pieralisi@arm.com > > > > arch/arm64/include/asm/acpi.h | 3 +++ > > arch/arm64/kernel/acpi.c | 19 ++++++++++++++++--- > > drivers/acpi/osl.c | 23 ++++++++++++++++------- > > include/acpi/acpi_io.h | 8 ++++++++ > > 4 files changed, 43 insertions(+), 10 deletions(-) > > For arm64: > > Acked-by: Catalin Marinas > > I presume this patch would go in via the acpi tree. Applied as 5.15 material, thanks! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel