From nobody Thu Feb 01 21:42:55 2024 X-Original-To: dev-commits-src-all@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 4TQsp75bqRz58k9v; Thu, 1 Feb 2024 21:42:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TQsp74yzxz4hyk; Thu, 1 Feb 2024 21:42:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823775; 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=fpQS9GtZ38gTECW1ONT+9veEQodF/L6WcNhjY4sL13o=; b=iAm/bz5BbETFHxQBoBikhjRdKXYZVQsS+bSMobx474KTX/ty9o3110mTS3JO0H5HHKUIod XBWCCCJrGynkFZKeo45i/8+8COhfntzv/6RSlBBHBYFwOH+tVgKYUgKEDJAzxPxuqt0Fki WHzpuYZG0yFPi7wMR3QVc7x4NbrSf619EtKDYMeKbfclcgmMCfmkdbRYOy2HQ6NahjaTYV Zg3cpzZ333VMUw65CM2HCPaUw8E9ffrWL5aDfP/FOtqhUxle/3Fju8wRBjnBBXyX4MxUjH yaRjR3HpXL+304tXMgezwWBofl/vahtDow3XhN1Huk0PWQPzxXPd/wUp9T4Zfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823775; 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=fpQS9GtZ38gTECW1ONT+9veEQodF/L6WcNhjY4sL13o=; b=CCPGgfRlyCUYHob10SIlLf8Cg8rwPIP/GuRW+fk6egIZ++Seb7uaPHNDCDatGUACl2FGCq OrK5Z+8hSRiM4Y9nM9HePHRHPdKLX/dNYplmV16QuTQy3c2vqv7TJ5uyvlUEt0C5ac4G5S Rz1Mdadm9o6U5hCuRqu/cCOULWXqsgqL+pmQdXGQTiThKbWKVsyGpG2xIcSRWZduyGo/06 iwAx7pMgA1ik4pqZNIzdbN0QMTwPEFhvfYM3DHeMKvrC6D8Eed8ffHwPt1beSwAhAvpYbq fpyd+nRsa7A3FWPWaPsgjPvS0BkeHZl/pak8h5yCIHvQfzmcIJ0kWpb/tS3MhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823775; a=rsa-sha256; cv=none; b=o7SUATtNpQHsOYVp/9gS19Spbe5gu7Q/ZZNETxNjZciz/y/wEP8RStJEftYKEnQi+KmHTO N5tnO8SWEM1gtsyPdfH+ZbT9eK49uJNBXAj+20vq+bMBguIyxjSXD5oTkD0cMrIphhZs7A w5dQmPJ4pkz5bsSs/PT27sxlJMwhXxaBMns5R9KMyTQmgg7ajgX2p8T2nDtgme0jNiMdXT Z1LW0bbmLuguPDN0SdJQuP3Fk9tPJ2YtlntuwGopEgOVYfNKWHNePvfIDvRVLGUa+Bob93 kHWGSF/GKVQC0iruxe/iM/WWlEKSMFL1e3EsQ/waA5tgcizZ6zQl6A780TIAtw== Received: from freefall.freebsd.org (pool-108-53-202-102.nwrknj.fios.verizon.net [108.53.202.102]) (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 did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4TQsp73VQVzGs8; Thu, 1 Feb 2024 21:42:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Content-Type: multipart/mixed; boundary="------------cjikkbECSwXq41OizwlgXpQS" Message-ID: Date: Thu, 1 Feb 2024 16:42:55 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 07c64d74917e - main - acpica: Import ACPICA 20230628 Content-Language: en-US To: Dmitry Salychev Cc: Baptiste Daroussin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202401310406.40V46B9a000876@gitrepo.freebsd.org> <04c4a0e1-aa79-4d25-a1f7-2196cfa65578@FreeBSD.org> <86o7cz99u6.fsf@peasant.tower.home> From: Jung-uk Kim Organization: FreeBSD.org In-Reply-To: <86o7cz99u6.fsf@peasant.tower.home> This is a multi-part message in MIME format. --------------cjikkbECSwXq41OizwlgXpQS Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 24. 2. 1., Dmitry Salychev wrote: > > Hi, > > Jung-uk Kim writes: > >> On 24. 1. 31., Baptiste Daroussin wrote: >>> Hello, >>> Either this one or the previous import is breaking arm64 build >>> --- acpi_iort.o --- >>> /home/bapt/worktrees/main/sys/arm64/acpica/acpi_iort.c:103:4: error: field >>> 'data' with variable sized type 'union (unnamed union at >>> /home/bapt/worktrees/main/sys/arm64/acpica/acpi_iort.c:98:2 >>> )' not at the end of a struct or class is a GNU extension >>> [-Werror,-Wgnu-variable-sized-type-not-at-end] >>> 103 | } data; >>> | ^ >> >> Sorry for the breakage. I will fix it soon. >> >> BTW, this code was added by this: >> >> https://reviews.freebsd.org/D31267 >> >> It seems struct iort_named_component was a hack, which duplicated >> ACPI_IORT_NAMED_COMPONENT but with a fixed length field >> DeviceName[32]. Is it really necessary? >> >> Jung-uk Kim > > I'm struggling to understand (a) how the entire anonymous "data" union > was added by https://reviews.freebsd.org/D31267 as was "named_comp" > only and (b) what the problem with the "struct iort_named_component" really > is as ACPI_IORT_ROOT_COMPLEX and ACPI_IORT_SMMU were re-defined as > incomplete types in the new version of ACPICA. Everything is compilable > as it used to be with the attached patch. FYI, ACPICA 20230331 dropped support for ANSI C (C89) and minimum requirement is C99 now. One of the first feature they used was the variable-length array, which replaced "foo[1]" hack. Previously, "sizeof(struct bar)" was not real size because of the (fake variable-length) array at the end of it. Now they removed the hack and started using real variable-length arrays. I believe the hack in acpi_iort.c was to work around the fake 1-byte array but it does not work any more because all ACPI_IORT_* are now using correct VLA. So, the cleanest way to fix this is using ACPI_IORT_NAMED_COMPONENT instead of "struct iort_named_component" (see attached PoC patch), which also eliminates the need for DeviceName[32]. Jung-uk Kim --------------cjikkbECSwXq41OizwlgXpQS Content-Type: text/x-patch; charset=UTF-8; name="iort.diff" Content-Disposition: attachment; filename="iort.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3N5cy9hcm02NC9hY3BpY2EvYWNwaV9pb3J0LmMgYi9zeXMvYXJtNjQv YWNwaWNhL2FjcGlfaW9ydC5jCmluZGV4IGEwZTI0Nzg4Yjc3NS4uMjk4Njc5ZDA1YzdkIDEw MDY0NAotLS0gYS9zeXMvYXJtNjQvYWNwaWNhL2FjcGlfaW9ydC5jCisrKyBiL3N5cy9hcm02 NC9hY3BpY2EvYWNwaV9pb3J0LmMKQEAgLTc0LDE0ICs3NCw2IEBAIHN0cnVjdCBpb3J0X2l0 c19lbnRyeSB7CiAJaW50CQkJcHhtOwogfTsKIAotc3RydWN0IGlvcnRfbmFtZWRfY29tcG9u ZW50Ci17Ci0JVUlOVDMyICAgICAgICAgICAgICAgICAgTm9kZUZsYWdzOwotCVVJTlQ2NCAg ICAgICAgICAgICAgICAgIE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