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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 07D39C433EF for ; Mon, 7 Mar 2022 19:03:20 +0000 (UTC) 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YrclHs6t6DQmuYrMZnFNPjkWjUCgQs1DrgCPY8R1OJ4=; b=irxMMu1yaSMjpm sQW9g47B0t2QJwd0Lt5eESn3otcck6RLWQ2E2AlyM9U3Oz+JzcsKkSAsgjWE8U84RgjW4f0oDDF0p lBmLTBejGF8zujnEkKtme+cAIFcskobsgB6q0Jh6i7LxcdBB6HBiMQZ0/iiQ8M6k+snerOU9jbEO0 CQ9fPoFLic7Y+dZMgwutFwWqvrOoyIEboOknQ5q0QWfXuDn7eoLFGvlpByVHw3vIJT1i4cPU89N8p gu/NXHX/dMdJpQpJT9GN7Ecni/CART85XAxbukzuFglmh1IyjctXUrOlztD+4JTJxXp7Ha5ZXRhkY qgOd0S1VfYCdsSaouugQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRIcF-001I2j-L9; Mon, 07 Mar 2022 19:01:55 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRIc9-001I12-8S for linux-arm-kernel@lists.infradead.org; Mon, 07 Mar 2022 19:01:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646679706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VuCvyr+5GW9oGPv/jNgY/watrnMAJ4PnB/YdJjkoA/0=; b=FV4baG4JDA02Vvtdw8pBtcqLjnEZ26shKICYRXraet9okwYnM2LnAJFxDpTcWXgx7c5KGp ESltOMhy1ugikZ7oLz9o4LSXttDjv8T5wkbNsHxZ3RunwItszkkNP92+eATPkHb7qR+Ctd 1bPSkdu0fiIQDRACt4bg4dLMVHpCxHs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-416-zJg4kLxhPviSi4BmC7kEEA-1; Mon, 07 Mar 2022 14:01:43 -0500 X-MC-Unique: zJg4kLxhPviSi4BmC7kEEA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AF30E801AFE; Mon, 7 Mar 2022 19:01:41 +0000 (UTC) Received: from napanee.usersys.redhat.com (ovpn-112-7.rdu2.redhat.com [10.10.112.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6D7C35C1CF; Mon, 7 Mar 2022 19:01:41 +0000 (UTC) Received: by napanee.usersys.redhat.com (Postfix, from userid 1000) id D28C9C04AD; Mon, 7 Mar 2022 14:01:40 -0500 (EST) Date: Mon, 7 Mar 2022 14:01:40 -0500 From: Aristeu Rozanski To: Lorenzo Pieralisi Cc: Robin Murphy , Will Deacon , Catalin Marinas , linux-arm-kernel@lists.infradead.org Subject: Re: ??? FAIL: Test report for kernel 5.13.0-rc7 (arm-next, 8ab9b1a9) Message-ID: <20220307190140.ge72tz4opnmnmij4@redhat.com> References: <31ffe8fc-f5ee-2858-26c5-0fd8bdd68702@arm.com> <20210625110944.GB20835@arm.com> <48b23351-3dba-bec8-242f-3c918ae55708@arm.com> <8a28663f-6541-6ff4-3de0-b140e3f8a5b9@arm.com> <20210629144415.GA28457@lpieralisi> <14ca6f72-9b0f-ebd7-9cf8-a5d6190c8e5d@arm.com> <7c058806-6967-5df9-2a33-b8f9be0d2a5f@arm.com> <20220304193920.kj3mvrguepklgb3m@redhat.com> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20211029 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=aris@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220307_110149_429779_F25FF063 X-CRM114-Status: GOOD ( 31.12 ) 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 Hi Lorenzo, On Mon, Mar 07, 2022 at 10:19:07AM +0000, Lorenzo Pieralisi wrote: > I put together the patch below that I need to send to see whether > that's acceptable, if you can help me test it in the meantime, that'd > great. > > -- >8 -- > Subject: [PATCH] ACPI: osl: Fix BERT error region memory mapping > > Currently the sysfs interface maps the BERT error region as "memory" > (through acpi_os_map_memory()) in order to copy the error records into > memory buffers through memory operations (eg memory_read_from_buffer()). > > The OS system cannot detect whether the BERT error region is part of > system RAM or it is "device memory" (eg BMC memory) and therefore it > cannot detect which memory attributes the bus to memory support (and > corresponding kernel mapping, unless firmware provides the required > information). > > The acpi_os_map_memory() arch backend implementation determines the > mapping attributes. On arm64, if the BERT error region is not present in > the EFI memory map, the error region is mapped as device-nGnRnE; this > triggers alignment faults since memcpy unaligned accesses are not > allowed in device-nGnRnE regions. > > The ACPI sysfs code cannot therefore map by default the BERT error > region with memory semantics but should use a safer default. > > Change the sysfs code to map the BERT error region as MMIO (through > acpi_os_map_iomem()) and use the memcpy_fromio() interface to read the > error region into the kernel buffer. > > Link: https://lore.kernel.org/linux-arm-kernel/31ffe8fc-f5ee-2858-26c5-0fd8bdd68702@arm.com > Link: https://lore.kernel.org/linux-acpi/CAJZ5v0g+OVbhuUUDrLUCfX_mVqY_e8ubgLTU98=jfjTeb4t+Pw@mail.gmail.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" > --- > drivers/acpi/sysfs.c | 25 ++++++++++++++++++------- > 1 file changed, 18 insertions(+), 7 deletions(-) > > diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c > index a4b638bea6f1..cc2fe0618178 100644 > --- a/drivers/acpi/sysfs.c > +++ b/drivers/acpi/sysfs.c > @@ -415,19 +415,30 @@ static ssize_t acpi_data_show(struct file *filp, struct kobject *kobj, > loff_t offset, size_t count) > { > struct acpi_data_attr *data_attr; > - void *base; > - ssize_t rc; > + void __iomem *base; > + ssize_t size; > > data_attr = container_of(bin_attr, struct acpi_data_attr, attr); > + size = data_attr->attr.size; > + > + if (offset < 0) > + return -EINVAL; > + > + if (offset >= size) > + return 0; > > - base = acpi_os_map_memory(data_attr->addr, data_attr->attr.size); > + if (count > size - offset) > + count = size - offset; > + > + base = acpi_os_map_iomem(data_attr->addr, size); > if (!base) > return -ENOMEM; > - rc = memory_read_from_buffer(buf, count, &offset, base, > - data_attr->attr.size); > - acpi_os_unmap_memory(base, data_attr->attr.size); > > - return rc; > + memcpy_fromio(buf, base + offset, count); > + > + acpi_os_unmap_iomem(base, size); > + > + return count; > } Tested on the same machine I can trigger reliably and this fixes the issue. Thanks! -- Aristeu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel