Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3540273pxb; Mon, 4 Apr 2022 20:30:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznaEw236nPCKg5M20eB0v1RWytvau1JNeotX0d5BP6uI0YfDzSXqs8MNDpIIpUuHCRH5JQ X-Received: by 2002:a05:6a00:cd2:b0:4fa:a4f6:74b8 with SMTP id b18-20020a056a000cd200b004faa4f674b8mr1482569pfv.19.1649129448850; Mon, 04 Apr 2022 20:30:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1649129448; cv=pass; d=google.com; s=arc-20160816; b=yR7Y/WicL4faN0sNTCff39Y+BLoVCtr+Q1RbNoFlNZv1jTZheOl5A82qKVVEVU8kye ysXasmqLtdmkfUQjgJt20++z2EcSXPmhwz0PIsEBjz/l1B2JBx9w/wgz9X/pjBnjX03I D7jOWFpLbSiDqBMdRRUWAM+juhCpMU38NuIWFT096x1QM/S5qa5T0F4D8N0Nlu57gmOd NXPuZDzmZlvA3EMFLmUulZoF8F61lhUN2Hd9nOURUwWi5uCKoq5l8KHpWVUEZ/+VIEK1 5oKEUQ7i32mkO7XSLr+1GliXefWr4joj7KLbGUDI5GDja7nvZWdxyuY4Gen96MQ8eLXf 66uA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:references:cc:to:from:subject:user-agent:date :message-id:dkim-signature; bh=eCuYbSVcNnph4oNpJqeLTPFMBZHrvvW34OFMBwmIoYU=; b=Haz44/kfOTdO1dj0br8tQbb+5kQJizB7EyZHZcdLyH7KgEPUV8qSfHohSbaLqWZlEn sspiNG9nA3N5UrBRF1YXvc8F85lIa/lwkJKHaNynFNF4yyoL1G12ftgPgSneXCVy8Bhc kZRNkrQ86/nXKzIueyitkDyVc+98e8ijE1h3UooI8Esplz2p3hsosXiGB+RjQsS3Xlaw ciN3nUikfpL9XGDrmL+qEx7po7AovLkWG49MSFzxZ5456taEj9DrB4OhDYGyaSqnbm3f 4JIZbQqsySTXs23HAIQGNwynjDd2f7xzzp3z0cVWz1Q8E+NDtr2JUgXTLTjJI9ryURr1 Jtng== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=ZQI+D67o; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v1-20020a637a01000000b003816043f125si12978375pgc.794.2022.04.04.20.30.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 20:30:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=ZQI+D67o; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A0EC83588B9; Mon, 4 Apr 2022 18:30:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350942AbiDASFf (ORCPT + 99 others); Fri, 1 Apr 2022 14:05:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347061AbiDASFb (ORCPT ); Fri, 1 Apr 2022 14:05:31 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2105.outbound.protection.outlook.com [40.107.102.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DD4EA190; Fri, 1 Apr 2022 11:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PQNdwQmdhWhVF5LEZvUMrAo/31kOUAO4RXmjLuLxntBGhMwuT6q2ReYmkL9bPHsuN0RwIbuRrBIZvJZoilO031qe/17n2JiTYtsMnOLfljPzbkCHE4edVonRznEOx5Ebel1gnnQ7hlxH0ZButCuNqUt89R5v1hvuhyi7+ZR7DVWwsiJ1ovKficFrJDm2bQaUyby1nV5rts+zxxHrRitZhpuKiJgYA8yLHOzPv8qIFHQ9PAl9HBXN3odPxxjY4P4B4xYB4W3KTBvczrqYjjmROZmKj7uralv1Di4dvE5wBGxYJPq43Xn7BiJLO1tE1fkM131m/YSr2Q/RBJ116EOcVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eCuYbSVcNnph4oNpJqeLTPFMBZHrvvW34OFMBwmIoYU=; b=kVyfYAZ8BVzAw5ej0QZtYCJctqUrHCK7xW4kCKjaDfRUmK1WpHyDFZtWEgFBwkiDiyfk9aZWIzQvNU9NEtKn7gX5RPHVBJ6T1c+MYMEnxiFczaUxTRuE1Koc9j06WcWb7qqCiVYh7hVr0iK64RgBrplZ4EEChZrV794YcOTDeavPbsVzrznr4cOGzraLEz+65/wClDB84y3PFhYaL1H0eL1sAVfB7/hTkm7k2PsyqCKcPfFfJ718XiHFfeRKsfLjZPnvmfTdtbxsHJY+wR2Ct+h+Q90aifXxIXIUFV9OIt3C0vJmNlUTDO7bJla9wD+vIaiVro+WY6JIW9Ns8/1g8w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eCuYbSVcNnph4oNpJqeLTPFMBZHrvvW34OFMBwmIoYU=; b=ZQI+D67oTOvSkYaNeczkZkztzuUuqwCsUlK3iOK5l2rfMsH772ucb+lJugV3vrpWwowxz/qH85LVXZ/Erpk/nqKX2mBfa6G/JVGDIKLU6DgOau79HR2H0KRoXhj+gOXRSM5sDW6+FwWatHyIlimze6WB3h0YVSXpv7IhPPVdJ2E= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from DM6PR01MB3915.prod.exchangelabs.com (2603:10b6:5:8d::28) by BL0PR01MB5169.prod.exchangelabs.com (2603:10b6:208:69::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.16; Fri, 1 Apr 2022 18:03:32 +0000 Received: from DM6PR01MB3915.prod.exchangelabs.com ([fe80::cc44:99d1:f22a:b3c4]) by DM6PR01MB3915.prod.exchangelabs.com ([fe80::cc44:99d1:f22a:b3c4%3]) with mapi id 15.20.5123.028; Fri, 1 Apr 2022 18:03:31 +0000 Message-ID: <60ee55d4-3485-ad20-da01-a3464d5b9799@os.amperecomputing.com> Date: Fri, 1 Apr 2022 11:03:27 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH][V2] ACPI: sysfs: copy ACPI data using io memory copying From: doug rady OS To: Lorenzo Pieralisi , Henry Willard Cc: James Morse , Mark Rutland , Colin King , "Rafael J . Wysocki" , Len Brown , Alexander Viro , Andrew Morton , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kernel-janitors@vger.kernel.org" References: <20200317165409.469013-1-colin.king@canonical.com> <20200320131951.GA6555@lakrids.cambridge.arm.com> <698da6fc-3334-5420-5c97-4406914e4599@arm.com> <88DFC1B9-D444-4D44-963F-34D0F5B9EC01@oracle.com> <345c99af-4f65-6776-fb21-f9fe8662566c@os.amperecomputing.com> In-Reply-To: <345c99af-4f65-6776-fb21-f9fe8662566c@os.amperecomputing.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: CH2PR14CA0020.namprd14.prod.outlook.com (2603:10b6:610:60::30) To DM6PR01MB3915.prod.exchangelabs.com (2603:10b6:5:8d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 62f9fc95-cb3e-4bf2-4f9a-08da1409ee9e X-MS-TrafficTypeDiagnostic: BL0PR01MB5169:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ft38GaMuG1svtRB9C7Hr/LxNEuvFuEEFJsYrkT3cvn56D6iMKwaZmkWU/j1+0QRqaGYFLGbHlpLO3yk/5U56csv3kRCC9SEHFYjbR4uNWELxe0leOdx58QKQNeLGrdgn1ZNmrv0c9Y9HiGpUVzK9lrsqh5HRJDA8v5mdPmZ9/tOjLYU57gda3Nh4oqHVjFA8AGiCDQQQADWBJmHPcvoh5FqOmYDB5IPifvMup7UVgu0/ucOF9AAwuilJwK3C7k+Nkv77I3OJgNmtwiQV95tJCFZl2fHgrSlStYuYzfxMxbQe0A21nnPk+6ATDVAxaARsSdG0q1Gx/ugUA60+H9U9gXOsplPhE8hOGgWySViFKxnJV8t9kkZo5G1rnslUtkggbpOg+5YOILz2XhybW+yFycmT9DtxibktyJKU1nUYL0/SdAsDyUmBy1c2AvUirgnQjGNleGLs2GLKNg5CmP5hU3GHlATgI6kYX6dIoOFmn6esxE1oC4seeelY/TTJJhcm6XWdXTno9HWtzRA8WeTqGqG02VxQXT18GEHdUDhU0xYyQFymlUWtSsmSyxZfD8fVqVIJU1z6BhKUHIM1IkwKLIp3HKhVKiOKJCnBCocFbhRjZ9VeISjRLCwZHaDNOPJRBW6Is5HBItWMIW2WmrJo+iBLGkKFX3ccwQHWzEUIoU6r13fBkMApy6oifqIBDQg3nen1rgRAFDlv+yk+JKQ2WwatO9BRmPdqxE0pDhf1FU8puhHD6CmRQCAi0tmwQqOKVm5Bcv8t0q7R6o6iVS/DuvVKpTv6aHWctMVRuuype638k8a1FzevN9AXBhC67CXY X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR01MB3915.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(53546011)(52116002)(5660300002)(38100700002)(86362001)(31686004)(110136005)(7416002)(54906003)(6506007)(6486002)(966005)(316002)(38350700002)(66476007)(66946007)(4326008)(8676002)(6512007)(508600001)(83380400001)(8936002)(66556008)(6666004)(31696002)(2906002)(26005)(186003)(2616005)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Ym1SWVJUcmdLQUgwS2MzSkwyQ3dvUE4yOEFLL1BiQU1NMVBNYk5zN2MxN0JO?= =?utf-8?B?VEk3MmEvSXVESm52dVhSOGgveWkreVY3N3Q1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zhHL1k0VHA4WEhFaFVCNnpmTjVqcHRrTnlwNEY2dzYralNudVZM?= =?utf-8?B?cVRwY3VjVHVSMmQyMmNUd1E4YXBZNEIrWGxNL2RpdVdhRTNVQTNRN0F4NXlQ?= =?utf-8?B?dW12WUF2MWIxQWcvdDdBekZIQ09OOVcwVlZ6YkZhT0w0NzNxaEwxRzB5VTRr?= =?utf-8?B?SUlsTzFrbXZwVXA4d2prdmsxUWNHMXB1dU41UWUybFQvMTZvYnNjRGRFUW40?= =?utf-8?B?Z05veFN2UkZVd280UzNwWkRPajJqVG5qRitFTHY1OEh1ZEdmbVozRlNGc09M?= =?utf-8?B?L3BVNWc1Qnl5VnpyaWpoZUM3RlBwcy8vTkRkQUVGL0lKMlNTZk5zVVZNd2FU?= =?utf-8?B?TTBqZFJUR25CT0c5UWhDS1Q2KzN3L3k1MmJ3Y0ZlRU9kNjhqejYva1A3bkpB?= =?utf-8?B?M0VOam9zUDROY25DaVN2blQ5eHJJb0lhQ1Q2UVRCYm03WXVZekdJVEExNHZn?= =?utf-8?Q?gbe8qnbpPkHD92b99uO4qZkiOA+0KBRvj6Q8q?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62f9fc95-cb3e-4bf2-4f9a-08da1409ee9e X-MS-Exchange-CrossTenant-AuthSource: DM6PR01MB3915.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2022 18:03:31.8053 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AZrcSTcv78sGxEYnYQfV1u8aS+4PfWVSuQfZ1Vc2VGSXnDK+GNydbEykIExQSGZxUwV7K62pXL6W8AVOrv4+GzfbIqlUiiRKo+6LUT3nMV+0VGjG41oTGilUMV/ZyKDO X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR01MB5169 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lorenzo, Just checking the status on this patch? Are you planning to submit for Rafael to pull? It is more important now that the below has gone into 5.18: '[PATCH] ACPI/APEI: Limit printable size of BERT table data' https://lore.kernel.org/lkml/CAJZ5v0gMh2ed+ZWOnd-t_uTrZtm=AUfxOAkAKWT7WQK3=gf+7w@mail.gmail.com/ Thank you! doug On 22-03-07 13:22, doug rady OS wrote: > On 22-03-01 08:00, Lorenzo Pieralisi wrote: >> On Mon, Feb 28, 2022 at 11:51:23PM +0000, Henry Willard wrote: >>> >>> >>>> On Apr 1, 2020, at 5:44 AM, James Morse wrote: >>>> >>>> Hello! >>>> >>>> On 3/20/20 1:19 PM, Mark Rutland wrote: >>>>> [adding James and Lorenzo] >>>> >>>> (but not actually...) >>>> >>>> >>>>> On Tue, Mar 17, 2020 at 04:54:09PM +0000, Colin King wrote: >>>>>> From: Colin Ian King >>>>>> >>>>>> Reading ACPI data on ARM64 at a non-aligned offset from >>>>>> /sys/firmware/acpi/tables/data/BERT will cause a splat because >>>>>> the data is I/O memory mapped >>>> >>>> On your platform, on someone else's it may be in memory. >>>> >>>> Which platform is this on? >>>> (I've never seen one generate a BERT!) >>> >>> I have seen this on several platforms. The latest is an Altra based machine. It shows up in the Linux Test Project: ltp test "read_all -d /sys -q -r 10”. >>>> >>>> >>>>>> and being read with just a memcpy. >>>>>> Fix this by introducing an I/O variant of memory_read_from_buffer >>>>>> and using I/O memory mapped copies instead. >>>> >>>>> Just to check, is that correct is it correct to map those tables with >>>>> Device attributes in the first place, or should we be mapping the tables >>>>> with Normal Cacheable attributes with memremap()? >>>>> >>>>> If the FW placed those into memory using cacheavble attributes, reading >>>>> them using Device attributes could result in stale values, which could >>>>> be garbage. >>>> >>>> Yes. The BERT code should be using arch_apei_get_mem_attribute() to use the >>>> correct attributes. See ghes_map() for an example. bert_init() will need to use >>>> a version of ioremap() that takes the pgprot_t. >>>> >>>> Always using ioremap_cache() means you get a cacheable mapping, regardless of >>>> how firmware described this region in the UEFI memory map. This doesn't explain >>>> why you got an alignment fault. >>> >>> The BERT error region doesn’t appear in the UEFI memory map on any of the systems I have looked at. This means that acpi_os_map_memory() will always map the area as PROT_DEVICE_nGnRnE, which results in an alignment fault on an unaligned access. For some reason this does not fail on some implementations. >>> >>> It isn’t clear to me from the ACPI spec whether this can be in anything other than normal memory as bert_init() seems to assume it is. >>> >>> We have used this patch to resolve this problem on the assumption it >>> will eventually make it into the mainline kernel. Is there any chance >>> this will happen? >> >> Yes this should be fixed. I put together a patch that I needed to post, >> below. >> >> -- >8 -- >> Subject: [PATCH] ACPI: osl: Fix BERT error region memory mapping > > I hit this read issue while debugging something else and this addressed > the problem for me on Ampere Altra and AltraMax systems. Previously I > could only read the BERT file using dd with BS of 1-4. > With this patch, now I can 'cp' the BERT file. > > Tested-by: Doug Rady > > >> >> 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; >> } >> >> static int acpi_bert_data_init(void *th, struct acpi_data_attr *data_attr) >