Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp219044pxb; Mon, 16 Aug 2021 04:03:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznHhzDEwCLIRH2frubfWeLqZ+3S2OK39di1QPg7+59ICzd/sVEuAO4nMWK7/WPv3Ilo4Y0 X-Received: by 2002:a50:d4cf:: with SMTP id e15mr19296561edj.2.1629111806737; Mon, 16 Aug 2021 04:03:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629111806; cv=none; d=google.com; s=arc-20160816; b=nf8DUm3A6QqfL8768N5hLjjiqATYuiqV7TAosWEFaut4j3vFy+LiyjlbOgsyHiF4nY Dat1euSJHRqw9i034qpM0+bXi7G9oSe7k8+y/3PtSU7ccZVO1gr+Vbs/LeyM1ts452fh gFQGKEo7HpRjf3m30HhMX11GVR/ta1o3Nc/dW5OlJxhjFbsrdiIT406OdcjmMLDLpzQO kjvzG346GO/v7gP5o+sm+iAkFAhdmaWqzNRYAFhF2C9f9UcRruVXFErD5s3p1mWWqDxV qQDUEjtVGeZSFDosrbPmH+P5yzit6ztHAVs/R8c0bUEiBUGv5PUr8+ikVsg770QNDSWE aB0g== 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=5jCV6o2hrmdu8jLkc3OmFatJZTpYE0DOsO+lw9LEWgA=; b=JrEX/uDuzXOeWl2Wb2kGptP8fGpHKf0iS+0OG6WxLEviM3OqDo7kxiPfM8izPwl4co j1NHnS0lXe5pMlH1aO1kLT+5HogyBaSm/n5ZTkci9HMr/UgoE5bU5b9eNmg5oLi5ayJM GCc9SuPiYrank10yYjuElLmas+20BLhOfk380ietoIFgWPOooD8uuBDsoNVBLo63MJsr xBYGQi8U2OUzwpUA+BXoqdFHBMskRuO5pxwpqAHmkK5ZIDg7oJCVdGEAGlS44M9BL3BC 626orRTtqtYdWE0nUPdFej/21WGFEtOYSKOlwyAjQvJKjkHVGIwAF4zDZp1VGDO7VRo+ ZNqw== 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=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u20si10429751edv.439.2021.08.16.04.03.04; Mon, 16 Aug 2021 04:03:26 -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=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235858AbhHPLAD (ORCPT + 99 others); Mon, 16 Aug 2021 07:00:03 -0400 Received: from foss.arm.com ([217.140.110.172]:42872 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232390AbhHPLAC (ORCPT ); Mon, 16 Aug 2021 07:00:02 -0400 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 583B36D; Mon, 16 Aug 2021 03:59:31 -0700 (PDT) Received: from [10.57.36.146] (unknown [10.57.36.146]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 76F743F40C; Mon, 16 Aug 2021 03:59:29 -0700 (PDT) Subject: Re: [PATCH v2 1/3] ACPI: osl: Add __force attribute in acpi_os_map_iomem() cast To: Ard Biesheuvel , Lorenzo Pieralisi Cc: Christoph Hellwig , Linux Kernel Mailing List , "Rafael J. Wysocki" , ACPI Devel Maling List , Linux ARM , Veronika kabatova , Will Deacon , Hanjun Guo , Sudeep Holla , Catalin Marinas References: <20210726100026.12538-1-lorenzo.pieralisi@arm.com> <20210802152359.12623-2-lorenzo.pieralisi@arm.com> <20210811145508.GA3650@lpieralisi> <20210816095854.GA2599@lpieralisi> From: Robin Murphy Message-ID: <381418c8-5302-6991-b3aa-df6378dd1c64@arm.com> Date: Mon, 16 Aug 2021 11:59:24 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-08-16 11:21, Ard Biesheuvel wrote: > On Mon, 16 Aug 2021 at 11:59, Lorenzo Pieralisi > wrote: >> >> On Wed, Aug 11, 2021 at 03:55:08PM +0100, Lorenzo Pieralisi wrote: >>> On Wed, Aug 11, 2021 at 03:08:24PM +0100, Christoph Hellwig wrote: >>>> On Wed, Aug 11, 2021 at 12:40:28PM +0200, Ard Biesheuvel wrote: >>>>> The whole problem we are solving here is that ACPI, being based on >>>>> x86, conflates MMIO mappings with memory mappings, and has been using >>>>> the same underlying infrastructure for either. >>>> >>>> So let's fix that problem instead of papering over it. >>> >>> Patch (3) in this series is a fix - I would ask whether it makes >>> sense to merge patches (2-3) now and think about reworking the current >>> ACPI IO/MEM mapping API later, it can be an invasive change for a fix, >>> assuming we agree on how to rework the ACPI IO/MEM mapping API. >> >> What should we do then with this series ? >> > > It is not even clear that reworking the ACPI core is feasible to begin > with, OTOH, fixing a sparse warning is arguably not a critical bug fix > either, so I'd suggest we just drop that bit. Indeed, the only way to truly fix the issue is to fire up the time machine and rewrite the ACPI and EFI specs to not define that tables and data may or may not be required to be mapped as Device memory depending on the whims of the firmware. Otherwise we're basically always going to have one or more casts *somewhere*, even if we were to play it safe and return everything as iomem instead. I guess for read-only access to tables, the core code might be able to maintain a shadow copy of anything device-memory-mapped in normal memory and expose that instead, but if anything has to be writeable I'm not sure how we could abstract that "properly". Robin.