Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4094665pxv; Mon, 26 Jul 2021 21:23:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUBtqnw8yfsyOrIFUEjjoVrb0lzZx5G2/2efYElF/6GrHmYw/KlcWfyx2D4UB7LrvucWPI X-Received: by 2002:a05:6402:1603:: with SMTP id f3mr4171388edv.274.1627359815563; Mon, 26 Jul 2021 21:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627359815; cv=none; d=google.com; s=arc-20160816; b=RCPyUHhdzElBHDu0vGJrvWdJIWJ+l7HnICNauN0XrV7PPAHtiJ4Z9rzesYq9ZRXo9A mL38pZ0uaRRvPDSEe2mOTCs9pSamRJHSx5H4G2eDUql5aTpK20nWa/ggPkhZe+it+swm 2+35Z8kz1EKq5DUPTngP6WTf95ObVLBv8QKKa4qJ5jOyn5tEHHeAzI1NgsOXdvzUL9mX BwA3m78SP8urGi2Y1qf1KKseFmLVczwsatmVrB6biySTp3Y6ZO6VWR7Vl/jzIB/sx8BL 5tzSA/urk/9NHtzwmPAxYzChyEL5Cbt2OQPoB4F3xR2qogozAKnCNb2akoJ5lWNsTjAc wP4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=vAIsx7L84JkcIQ8KRxi1/iG5xFwrlV8PPo4NGEyyNy4=; b=hZG0E+oC5zsljs3ocBQ1OGBZGMgh7LRLuHqOKVwsf0Lm70c21vcO9bEzw3c4qX3F/D hOyhyZwc4EEWcwuVCFMtUit5zZSXrNYiJb/GKn+d4X5rbwjBlrbT1KLnUVyzV6MgeNic NN9sf/thQbqj4zB3rss82ZPB5nz9f8kiBfAVytxiF8tZYo61Dx1k2cmpkMv5vU3I2tjr s31lsV7BC3eYao2KcMcPhzHVANXpOcfl5TxNcAHhcCljhU7ORkrUufNZwx0H7k6lB4mG ykfqATaKb+AQsQv5Ew5mROJ789TzH6ZBdNauObTWKs4OVgYAvZIN7k2uh7SW3y/0hxMK A9JQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sd11si1824033ejb.511.2021.07.26.21.23.12; Mon, 26 Jul 2021 21:23:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231842AbhG0EVu (ORCPT + 99 others); Tue, 27 Jul 2021 00:21:50 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:12266 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbhG0EVt (ORCPT ); Tue, 27 Jul 2021 00:21:49 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4GYk492wt2z1CPJS; Tue, 27 Jul 2021 12:15:53 +0800 (CST) Received: from dggpemm500002.china.huawei.com (7.185.36.229) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 27 Jul 2021 12:21:47 +0800 Received: from [10.174.178.247] (10.174.178.247) by dggpemm500002.china.huawei.com (7.185.36.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 27 Jul 2021 12:21:46 +0800 Subject: Re: [PATCH] ACPI: Add memory semantics to acpi_os_map_memory() To: Lorenzo Pieralisi , CC: Ard Biesheuvel , Will Deacon , "Sudeep Holla" , Catalin Marinas , "Rafael J. Wysocki" , , , Veronika kabatova , Robin Murphy References: <20210726100026.12538-1-lorenzo.pieralisi@arm.com> From: Hanjun Guo Message-ID: Date: Tue, 27 Jul 2021 12:21:46 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20210726100026.12538-1-lorenzo.pieralisi@arm.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.247] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/7/26 18:00, 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 > Signed-off-by: Lorenzo Pieralisi > Cc: Ard Biesheuvel > Cc: Will Deacon > Cc: Hanjun Guo > Cc: Sudeep Holla > Cc: Catalin Marinas > Cc: "Rafael J. Wysocki" > --- > arch/arm64/include/asm/acpi.h | 3 +++ > arch/arm64/kernel/acpi.c | 19 ++++++++++++++++--- > drivers/acpi/osl.c | 23 ++++++++++++++++------- > include/acpi/acpi_io.h | 8 ++++++++ Acked-by: Hanjun Guo I did the boot test on both x86 and ARM64 server machines, and no regressions, Tested-by: Hanjun Guo Thanks Hanjun