From nobody Mon Jul 13 02:52:32 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gz6S006csz6lPyD for ; Mon, 13 Jul 2026 02:52:48 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gz6Rx4XDcz3Pry for ; Mon, 13 Jul 2026 02:52:45 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4938d5f86f3so19461415e9.1 for ; Sun, 12 Jul 2026 19:52:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783911164; x=1784515964; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Tm6eOf316qgwNmc0Fu0xf3A/8XHqRifFkXED0Bvr4RY=; b=Z3gM/iSnatR2yC8MeNBt8qENLCgwit7EB/NRe1k/TbpB1Gc+5n9bi6yhnE2vpoNfpu mS/c0dMYERL6g8PX7wa0ykTuYzL6M7lX0dL82jdo13noIBC3ziQtakG+ncFV3JNfOmI0 Czzo7U0HUlQ3D2XvBekg+8DqRWXQckrjxAZmd8z1y2SJrhlQ2u8tRKbcOvk79psfHO2O pP2gL0XKJf+m//x9q+ofkMHo7oDno4c20rRj7kRnVVF+q6WFuAFsJbX/cz0AwWZxJ+4E 1TESeIcZMoeTRi9Mo5RvAAAB+OfDUMQy7h+fd88T1e1fUIrUq8W3Qt7M+Aw/zd9OZnz0 QDLw== X-Forwarded-Encrypted: i=1; AHgh+RpGVBn1J2T1cC36RhHm6Fc6NYmKBHEP9htnwvySXXzwEieJblJwHCyCj5U8kDHP+ivwwxe9z/n35MvGBcP7DKocdtPPgw==@freebsd.org X-Gm-Message-State: AOJu0YwCLSBt4qehk8bOT5VIqvSidsRAJJLApss35+qYL9/ZJ51wpmtx 4eO/UGzPrskF19EeuxnY4dBvR+Th5Ldd/SlLb7oe/H2N4YnNfiLdMiUr2ysdNYKMI4YdT68htf4 bQenXmnU= X-Gm-Gg: AfdE7cmbZ7DnO7pEKXA2TIGQdiJZQVt3LjByqpR5gE7VhnVyLiBDu8gdlbqDG6T7Fre HPYrOJyc9LMX19WY0nj+BMwjVl9/76/HIMyRLTI9bcnIZsHxZJWOWItUSqYteE0ThhCKeqC0XEY HmPjko9d4vAh3n9sddvZ7djEFMC690rmVbq95Jiu1XzAfbnnldOY3bR35RfnULH/IPeJHhTS/Yz fRlvVei00ESLNeOmflF0hIedO0UZxtwFPJSbXBrKebR5HZqEKdfqA4204+gcGD9UyV2RHY4HJa3 5CF17lu3LOAzoXg+kbz+GNSaUYSF+0qxnNxrGbLd+zFLldJUYWN6N5U0GLBZnF8r8rjaGu6XAtK MAWhluFw6Sc2CmDz6lEEgFOcbR6zwTylyXB5PtjF7kOMBZwiIkIBc4L5QRr9f5HkSFOd8DaE4Uw BrI8wzdBJQiRugL8333TMwT41hlAxjC76A90K7ixXcSDlKjOq/h0wZluJA01k= X-Received: by 2002:a05:600c:1c27:b0:492:3fb5:3a17 with SMTP id 5b1f17b1804b1-493f887ab70mr76621345e9.2.1783911163970; Sun, 12 Jul 2026 19:52:43 -0700 (PDT) Received: from smtpclient.apple (nat-184-161.net.cam.ac.uk. [131.111.184.161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493f2dd8376sm156023465e9.2.2026.07.12.19.52.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jul 2026 19:52:43 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3893.100.7.1.1\)) Subject: Re: git: 9313f6b01485 - main - acpi: Add a pseudo-bus for APEI devices to manage resources From: Jessica Clarke In-Reply-To: <6a4d50f8.3f168.563a50cc@gitrepo.freebsd.org> Date: Mon, 13 Jul 2026 03:52:32 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <5A66BB03-C115-4A59-8236-CAAC127185DA@freebsd.org> References: <6a4d50f8.3f168.563a50cc@gitrepo.freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.3893.100.7.1.1) X-Spamd-Result: default: False [-2.18 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.78)[-0.775]; MV_CASE(0.50)[]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEFALL_USER(0.00)[jrtc27]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_HAS_DN(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.41:from]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.41:from] X-Rspamd-Queue-Id: 4gz6Rx4XDcz3Pry X-Spamd-Bar: -- On 7 Jul 2026, at 20:18, John Baldwin wrote: >=20 > The branch main has been updated by jhb: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D9313f6b01485ad9a0b7cc59b459f5714= 533587c3 >=20 > commit 9313f6b01485ad9a0b7cc59b459f5714533587c3 > Author: John Baldwin > AuthorDate: 2026-07-07 18:13:51 +0000 > Commit: John Baldwin > CommitDate: 2026-07-07 18:13:51 +0000 >=20 > acpi: Add a pseudo-bus for APEI devices to manage resources >=20 > Different APEI tables can reuse the same registers (and sometimes > different views of the same register, e.g. 32- vs 64-bit mappings = of > the same register). To enable this sharing, apei0 now acts as a = bus > device managing a pool of allocated resources and handing out = mappings > to child devices which handle individual tables. >=20 > Most of the previous apei(4) driver has been moved into a new > hest0 device that is a child of apei0. >=20 > Reviewed by: gallatin > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D58024 > --- > ... > @@ -128,26 +125,6 @@ struct apei_pcie_error { > uint8_t AERInfo[96]; > }; >=20 > -#ifdef __i386__ > -static __inline uint64_t > -apei_bus_read_8(struct resource *res, bus_size_t offset) > -{ > - return (bus_read_4(res, offset) | > - ((uint64_t)bus_read_4(res, offset + 4)) << 32); > -} > -static __inline void > -apei_bus_write_8(struct resource *res, bus_size_t offset, uint64_t = val) > -{ > - bus_write_4(res, offset, val); > - bus_write_4(res, offset + 4, val >> 32); > -} > -#define READ8(r, o) apei_bus_read_8((r), (o)) > -#define WRITE8(r, o, v) apei_bus_write_8((r), (o), (v)) > -#else > -#define READ8(r, o) bus_read_8((r), (o)) > -#define WRITE8(r, o, v) bus_write_8((r), (o), (v)) > -#endif > - > #define GED_SIZE(ged) ((ged)->Revision >=3D 0x300 ? \ > sizeof(ACPI_HEST_GENERIC_DATA_V300) : = sizeof(ACPI_HEST_GENERIC_DATA)) > #define GED_DATA(ged) ((uint8_t *)(ged) + GED_SIZE(ged)) > @@ -431,10 +408,10 @@ apei_ge_handler(struct apei_ge *ge, bool copy) > ... > diff --git a/sys/dev/acpica/apeivar.h b/sys/dev/acpica/apeivar.h > new file mode 100644 > index 000000000000..7820641aef1f > --- /dev/null > +++ b/sys/dev/acpica/apeivar.h > @@ -0,0 +1,54 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright (c) 2020 Alexander Motin > + * Copyright (c) 2025 Netflix, Inc. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above = copyright > + * notice, this list of conditions and the following disclaimer in = the > + * documentation and/or other materials provided with the = distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' = AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, = THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR = PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE = LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR = CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE = GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS = INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN = CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN = ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE = POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#ifndef __APEIVAR_H__ > +#define __APEIVAR_H__ > + > +#include "apei_if.h" > + > +struct resource_map *apei_map_register(device_t dev, = ACPI_GENERIC_ADDRESS *gas); > +struct resource_map *apei_map_memory(device_t dev, rman_res_t start, > + rman_res_t len); > +int apei_unmap_register(device_t dev, struct resource_map *map); > + > +#ifdef __i386__ > +static __inline uint64_t > +bus_read_8(struct resource_map *res, bus_size_t offset) > +{ > + return (bus_read_4(res, offset) | > + ((uint64_t)bus_read_4(res, offset + 4)) << 32); > +} > +static __inline void > +bus_write_8(struct resource_map *res, bus_size_t offset, uint64_t = val) > +{ > + bus_write_4(res, offset, val); > + bus_write_4(res, offset + 4, val >> 32); > +} > +#endif > + > +#endif /* !__APEIVAR_H__ */ Dropping the indirection / namespacing for these breaks i386; = bus_read/write_8 are macros in sys/sys/bus.h: > In file included from = /local/scratch/jrtc4/cheribuild-root/freebsd/sys/dev/acpica/acpi_apei_bus.= c:39: > = /local/scratch/jrtc4/cheribuild-root/freebsd/sys/dev/acpica/apeivar.h:41:1= 2: error: type specifier missing, defaults to 'int'; ISO C99 and later = do not support implicit int [-Werror,-Wimplicit-int] > 41 | bus_read_8(struct resource_map *res, bus_size_t offset) > | ^ > /local/scratch/jrtc4/cheribuild-root/freebsd/sys/sys/bus.h:1137:20: = note: expanded from macro 'bus_read_8' > 1137 | bus_space_read_8((r)->r_bustag, (r)->r_bushandle, (o)) > | ^ Jessica