From nobody Tue Aug 01 06:42:20 2023 X-Original-To: freebsd-arm@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 4RFQXK2HYKz4ptD3 for ; Tue, 1 Aug 2023 06:42:41 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic317-22.consmr.mail.gq1.yahoo.com (sonic317-22.consmr.mail.gq1.yahoo.com [98.137.66.148]) (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) by mx1.freebsd.org (Postfix) with ESMTPS id 4RFQXG59bwz3C6n for ; Tue, 1 Aug 2023 06:42:38 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=ZR+EC8Qq; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.66.148 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1690872156; bh=C3sOZNqChWqRfuu6BH30J7qpjUsS1CwpLCWDPHedAKM=; h=From:Subject:Date:References:To:In-Reply-To:From:Subject:Reply-To; b=ZR+EC8QqkBxCXEZxO+42EKMjSBfFPZF0V1leUGAoKWSmY1swPO2HejPASKmpSwQVFjtUeo09VGNK/BfGm+g69kXOfD6tOAO9LAaueZgx0II253pqTfQY/qHUAOL07XrzeefTsNTgzpymBnLOA/bzEVcQ1waFIaczUBvnvN9peZYTDw7KLv7bxOi2zrVuzRZibpASkF2mjNEfEis9CCk58VIxiKT+weh1oIADYGMf/s60TZ8Oc7F+vdqaIwNAD/3O2fU35oY0++rmvo8iOv5iVhNkuOkDq7+/ALKE39AsFIfKeqgAOLPFcH0q1LgNxYMu0sA9O8rzZbz1+ElLhVSoxQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1690872156; bh=9B/b34mr0TXUWWe4lf2UC5h+xzkyse5uMUA4cebmbR+=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=hWN7tPJUkWk43kylb16TK5M96Aq0sMlB/a9H01arqWd1wvq7t6obvgblEiwJLGHa6bIrfuCsdTDfYYIs5ojPmD6t9Lo8ihh59075Y92wImYQJXDD7cyqkbQmAbfIuwVHsncMZ8GCi+5hH2VNwvKeXzYVv08tDSqwJKSUJ+0qsgbZNnjQGjBgN71xVXfeZ8Pa7ywYSn11nZtRWLnaIDN99kCrDKsRg51erkJCV6hcg+34JLTDvmKOY66Tlwf9CFXr+WUF9xiqCL6WHPGeJPIgWLK2Pdp1aSsEgCCl36koylXWKJVcAewj9g/qVHRR1e4FtsFLBwFq+vN+kzVq+A9JAQ== X-YMail-OSG: KqD42twVM1lJLAI0vV6gsz2469xugU29Tx3.b3ilqQt_FbxCLQIhpobI762knvx n0KUxF4elkD1NTFuAPqb6ngpxPcf9_QOoElVJAKmpgpFssUWPYTOlV3bVLBIFZAfoz00c6PdYjkU h3ZKyiTNBBhS8oxkycai8YfB83HfoNRpdODNBed5ywt1u6L8yexhkIKjkMzsfnAoGSs6qOGHGf7i 36Xr0ievzbebZ3cxVeF2ZivZx5Zc3aqt3YuQhwkWkx2y4_Q46JS_vq173VYeN7cPBk0tWtvHx_xa aVFMZ.TvzDmtjCaODL9NeRKfX3D7eiH699DIRzEcI4VPhm4Jh3hlegaEXlfDyE0VR6QBy8ZI_bXh 9TkuLIU3sj2l8RU3ZUknFPgluMVoIt1Mvf.aHN6FfYQeqBn.kqJotrtWrW_tnKUYmROJ.X216a.w ZhiHQc7IxqV2bZFwfhyrRH63Q97SHT3bvlUmX2n9ZWPONeFiv_aK0AJ6lPBEvJJ875_SSu5x6AOn L3PMZksBxRwWdvw17iE74BlI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g0V33aO.wT6dkkxtmDqo5QDnBKSd2pv9EJzIQlJyvdW17 bbw.IPj7Yfmm.BS6inEerVjne8V6cvRRUh8M._JSx9OUTy7GCxG2KYZBP_lsTNMqZ63tr67UFAru 9K3dKCxMB0EYIefZUGFVNiwvCiJ605Pknd6ij1reyXRoZk5ifxGufyCfls0LXxltHtcZYnwHLV9c Xm5U7geLEExJNpipGGZAyQJzRa3c5RpX7RzOZuXc5LKO02.6_tB6raq3XZxekCndP0WniW1HJqKg 3xd3E_Ky_OTTRp.rU.J4FfP8G5Z6Jthg6cMAyv10I4F0lVs_US6AoWnjY7AmyI.fkBnjIpl.EE4d wuCnBUjjOl5_2CRFYwbIsplUYAHCSUrVewE69bKMtq6_q5Rw5a5BU7WCB88Lx57mh0K3MLIcpWzW cQaWGPttb8Pgkk34IVCG0fIu2Z7SUOddAYQqn0hxmu8T7gmETVWp__RXHGmFrpGasTGDIHlgwwsp .FabAl__5YOtkeMYELq4GZLkVLiro_01NG97oRuvGvlffu8AigeWsV_92dC_.Bv6KKDAZwKxBtT2 kObDSS.TPpdnRQy1S8fIjpLIvvpl5poaYknYrlEXN9YA1JwcX1PFhP5pueqFpnoFuJTp7E85Vzf3 XDUHkkaBM.sAX55tBOLpAsutMA1cDUFqgbEw6oWR.TvN.bIXmTWvDM1lYzWLLOpw4V9gY_I9GMQ- - X-Sonic-MF: X-Sonic-ID: 2e69fc3f-baba-4f70-a915-ae0d36e0e955 Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.gq1.yahoo.com with HTTP; Tue, 1 Aug 2023 06:42:36 +0000 Received: by hermes--production-bf1-7c4db57b6-wcllk (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 01062b1ecdfa67f9dcea08f65f217b62; Tue, 01 Aug 2023 06:42:32 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: aarch64 lib32 vs. armv7 mdconfig behavior: "mdconfig: ioctl(/dev/mdctl): Inappropriate ioctl for device" Date: Mon, 31 Jul 2023 23:42:20 -0700 References: <49479F21-3CCD-469F-BF23-FF332D8EF0E8@yahoo.com> To: Mike Karels , FreeBSD ARM List , Current FreeBSD In-Reply-To: <49479F21-3CCD-469F-BF23-FF332D8EF0E8@yahoo.com> Message-Id: X-Mailer: Apple Mail (2.3731.700.6) X-Spamd-Result: default: False [-3.10 / 15.00]; NEURAL_HAM_SHORT(-1.00)[-0.996]; NEURAL_HAM_MEDIUM(-0.99)[-0.993]; NEURAL_HAM_LONG(-0.61)[-0.608]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.66.148:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCVD_TLS_LAST(0.00)[]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org]; TO_DN_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[yahoo.com]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.66.148:from] X-Rspamd-Queue-Id: 4RFQXG59bwz3C6n X-Spamd-Bar: --- On Jul 31, 2023, at 23:22, Mark Millard wrote: > Not via a chroot'd context, but using the files from a > directory tree that allows an armv7 chroot: >=20 > # /usr/obj/DESTDIRs/main-CA7-chroot/sbin/mdconfig -s40m > mdconfig: ioctl(/dev/mdctl): Inappropriate ioctl for device >=20 > This sort of thing messes up the operation of the likes > of the /usr/tests/sbin/growfs/legacy_test logic: >=20 > #! /usr/local/bin/perl > # $FreeBSD$ >=20 > use strict; > use warnings; > use POSIX; > use Test::More tests =3D> 19; > use Fcntl qw(:DEFAULT :seek); > . . . > SKIP: { > skip "Cannot test without UID 0", 19 if $<; >=20 > chomp(my $md =3D `mdconfig -s40m`); > like($md, qr/^md\d+$/, "Created $md with size 40m") or die; > $unit =3D substr $md, 2; > . . . >=20 >=20 > Other ioctl complaints: >=20 > sys/aio/aio_test:md_kq -> failed: ioctl MDIOCATTACH failed: = Inappropriate ioctl for device > sys/aio/aio_test:md_poll -> failed: ioctl MDIOCATTACH failed: = Inappropriate ioctl for device > sys/aio/aio_test:md_signal -> failed: ioctl MDIOCATTACH failed: = Inappropriate ioctl for device > sys/aio/aio_test:md_suspend -> failed: ioctl MDIOCATTACH failed: = Inappropriate ioctl for device > sys/aio/aio_test:md_thread -> failed: ioctl MDIOCATTACH failed: = Inappropriate ioctl for device > sys/aio/aio_test:md_waitcomplete -> failed: ioctl MDIOCATTACH = failed: Inappropriate ioctl for device > sys/aio/aio_test:vectored_md_poll -> failed: ioctl MDIOCATTACH = failed: Inappropriate ioctl for device >=20 >=20 > For reference: >=20 > # uname -apKU > FreeBSD CA78C-WDK23-ZFS 14.0-CURRENT FreeBSD 14.0-CURRENT aarch64 = 1400093 #5 main-n264334-215bab7924f6-dirty: Wed Jul 26 02:13:44 PDT 2023 = = root@CA78C-WDK23-ZFS:/usr/obj/BUILDs/main-CA78C-nodbg-clang/usr/main-src/a= rm64.aarch64/sys/GENERIC-NODBG-CA78C arm64 aarch64 1400093 1400093 Adding more examples of ioctl failure contexts . . . sys/netpfil/pf/ioctl/validation:clrtstats -> failed: Request with size = -1 failed=20 is actually at least associated with a ioctl use: ATF_TC_BODY(clrtstats, tc) { struct pfioc_table io; struct pfr_table tbl; int flags; COMMON_HEAD(); flags =3D 0; common_init_tbl(&tbl); bzero(&io, sizeof(io)); io.pfrio_flags =3D flags; io.pfrio_buffer =3D &tbl; io.pfrio_esize =3D sizeof(tbl); /* Negative size. This will succeed, because = the kernel will not copy * tables than it has. */ io.pfrio_size =3D -1; if (ioctl(dev, DIOCRCLRTSTATS, &io) !=3D 0) atf_tc_fail("Request with size -1 failed "); DIOCGETSRCNODES, DIOCRGETTABLES, DIOCRGETTSTATS, and DIOCRSETTFLAGS are similar and get the notice as well. The earlier aio_test examples are from: static int aio_md_setup(void) { int error, fd, mdctl_fd, unit; char pathname[PATH_MAX]; struct md_ioctl mdio; char buf[80]; =20 ATF_REQUIRE_KERNEL_MODULE("aio"); =20 mdctl_fd =3D open("/dev/" MDCTL_NAME, O_RDWR, 0); ATF_REQUIRE_MSG(mdctl_fd !=3D -1, "opening /dev/%s failed: %s", MDCTL_NAME, strerror(errno)); =20 bzero(&mdio, sizeof(mdio)); mdio.md_version =3D MDIOVERSION; mdio.md_type =3D MD_MALLOC; mdio.md_options =3D MD_AUTOUNIT | MD_COMPRESS; mdio.md_mediasize =3D GLOBAL_MAX; mdio.md_sectorsize =3D 512; strlcpy(buf, __func__, sizeof(buf)); mdio.md_label =3D buf; if (ioctl(mdctl_fd, MDIOCATTACH, &mdio) < 0) { error =3D errno; errno =3D error; atf_tc_fail("ioctl MDIOCATTACH failed: %s", = strerror(errno)); } . . . =3D=3D=3D Mark Millard marklmi at yahoo.com