From nobody Sun May 12 22:25:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1664876415; cv=none; d=zohomail.com; s=zohoarc; b=Zi0LhI6nM7YUiJhh69S64jFS9ayiQYfxpIoTjPRF/KqlT9btymSZ/kG9S4Pw4fsytzsyon0Z6njT1TCmtQTfgZaDi1s5BWWKJ8fizi+/G9iN0alLWrY094w3xPrZMHjuqdFbB4AueRD/JQxla7TiE5vouxBvsFD1RJm/divLe4A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664876415; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0pdDLYVkVwdzHhw/TAtDZWzMdTQ5gNidDr00X3PpiF0=; b=E22azk2BNeAubifqXjHVtdB2yHiytW4Q0jOSMXW3ceIqKzCIozkfoEhbipAlN/AsuT/RCyAsUir9Qy4X6Q9n5Z6IujBSlzRS/v6fpJSTblaST+kWHFbMRn1A+UyzWjNUjlBjlWPMAOswNNrP6raNvYsm6hyTzTprW0aOfyCR0po= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1664876415139560.8355372464489; Tue, 4 Oct 2022 02:40:15 -0700 (PDT) Received: from localhost ([::1]:38490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofePM-0006RX-UB for importer@patchew.org; Tue, 04 Oct 2022 05:40:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofeHg-0005JO-Ca for qemu-devel@nongnu.org; Tue, 04 Oct 2022 05:32:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:36092) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofeHc-000528-06 for qemu-devel@nongnu.org; Tue, 04 Oct 2022 05:32:15 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-639-lgpy_HI1Pcq4NdqtrJLK8g-1; Tue, 04 Oct 2022 05:32:09 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 79E4629ABA3F; Tue, 4 Oct 2022 09:32:09 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7EF34492B04; Tue, 4 Oct 2022 09:32:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664875931; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0pdDLYVkVwdzHhw/TAtDZWzMdTQ5gNidDr00X3PpiF0=; b=Y6ZSITQD/7mQlCJziJbkW4Ob6gFNkSCd8GOZV/RYDieiURPX5GVSFds3FlJgNbUsAe99dV 6Wdn6pYq/YKGIBOedc32LiSdljzWYGpire7ByfuM1D6RxM5TC+gkWr2v23nM8TGwiN1E/v Y5jCx2PH1JC9O6IyT28BDIJQwlu06ow= X-MC-Unique: lgpy_HI1Pcq4NdqtrJLK8g-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eduardo Habkost , Richard Henderson , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 1/4] linux-user: add more compat ioctl definitions Date: Tue, 4 Oct 2022 10:32:03 +0100 Message-Id: <20221004093206.652431-2-berrange@redhat.com> In-Reply-To: <20221004093206.652431-1-berrange@redhat.com> References: <20221004093206.652431-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664876417511100001 GLibc changes prevent us from including linux/fs.h anymore, and we previously adjusted to this in commit 3cd3df2a9584e6f753bb62a0028bd67124ab5532 Author: Daniel P. Berrang=C3=A9 Date: Tue Aug 2 12:41:34 2022 -0400 linux-user: fix compat with glibc >=3D 2.36 sys/mount.h That change required adding compat ioctl definitions on the QEMU side for any ioctls that we would otherwise obtain from linux/fs.h. This commit adds more that were initially missed, due to their usage being conditionalized in QEMU. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Laurent Vivier --- linux-user/syscall.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 2e954d8dbd..f6a15df69d 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -111,6 +111,31 @@ #define FS_IOC32_SETFLAGS _IOW('f', 2, int) #define FS_IOC32_GETVERSION _IOR('v', 1, int) #define FS_IOC32_SETVERSION _IOW('v', 2, int) + +#define BLKGETSIZE64 _IOR(0x12,114,size_t) +#define BLKDISCARD _IO(0x12,119) +#define BLKIOMIN _IO(0x12,120) +#define BLKIOOPT _IO(0x12,121) +#define BLKALIGNOFF _IO(0x12,122) +#define BLKPBSZGET _IO(0x12,123) +#define BLKDISCARDZEROES _IO(0x12,124) +#define BLKSECDISCARD _IO(0x12,125) +#define BLKROTATIONAL _IO(0x12,126) +#define BLKZEROOUT _IO(0x12,127) + +#define FIBMAP _IO(0x00,1) +#define FIGETBSZ _IO(0x00,2) + +struct file_clone_range { + __s64 src_fd; + __u64 src_offset; + __u64 src_length; + __u64 dest_offset; +}; + +#define FICLONE _IOW(0x94, 9, int) +#define FICLONERANGE _IOW(0x94, 13, struct file_clone_range) + #else #include #endif --=20 2.37.3 From nobody Sun May 12 22:25:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1664876599; cv=none; d=zohomail.com; s=zohoarc; b=EtYKRl9ozD3nDDicUZIhMmROx30SScIUL0en1V2EypI1Hz8ZosDwoMOTFJ0+a6Ib+UENw5ZSncnP49BHJUMV0m9i2Spb1x3FnL375VBw7an/soCCy8ho/QBcRVWSID1NuF+BiSFs1J2a/ZtOqxFa7DqgH23r7znakC/c64XV9ig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664876599; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FBgkdlMBwjy7bhLxcoxN0RVYIcbT9m4Uf5Cu1Ql8m80=; b=jvNfehTsNaEP0sOY/B8WM4F8F30DUh5qI40ARrD1h7rLQEfhpI1sHZg3ewwl9mydOgU3W1+MUKaNfSBjEJyJ6nLmTWlg25cPBLRzpb7gDLMXmUxgU9gYUNA2Nn6xa2Hxhza43i7al9tMthYoGT5/0WPnQULEsJZ0DcLu+0MXvAg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1664876599546937.0119090120613; Tue, 4 Oct 2022 02:43:19 -0700 (PDT) Received: from localhost ([::1]:41424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofeSM-0000hj-Au for importer@patchew.org; Tue, 04 Oct 2022 05:43:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofeHi-0005KC-79 for qemu-devel@nongnu.org; Tue, 04 Oct 2022 05:32:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:40707) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofeHf-00052M-5O for qemu-devel@nongnu.org; Tue, 04 Oct 2022 05:32:17 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-127-PyEz9f_nNmKuh37v4_Yn3Q-1; Tue, 04 Oct 2022 05:32:11 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CCA041C05AAF; Tue, 4 Oct 2022 09:32:10 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id B4389492B04; Tue, 4 Oct 2022 09:32:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664875934; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FBgkdlMBwjy7bhLxcoxN0RVYIcbT9m4Uf5Cu1Ql8m80=; b=hE+MLH2PQXUHRFFVbPbyxt/Gx4gLKcGqcUWjcZ4muaK2RaPZEDPSctlm6ZZAQP2C3SWPsc ip9g9+cPyZT8k0TnNGpwJCrtSAqqoEUpjwD5vL9pkBWBuGWem6BI6ZRYFNqWSSc3Pin25H g/2RORvPPR/akfOaOYhXJrW6JP7R71Y= X-MC-Unique: PyEz9f_nNmKuh37v4_Yn3Q-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eduardo Habkost , Richard Henderson , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 2/4] linux-user: remove conditionals for many fs.h ioctls Date: Tue, 4 Oct 2022 10:32:04 +0100 Message-Id: <20221004093206.652431-3-berrange@redhat.com> In-Reply-To: <20221004093206.652431-1-berrange@redhat.com> References: <20221004093206.652431-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664876601373100001 These ioctls have been defined in linux/fs.h for a long time * BLKGETSIZE64 - <2.6.12 (linux.git epoch) * BLKDISCARD - 2.6.28 (d30a2605be9d5132d95944916e8f578fcfe4f976) * BLKIOMIN - 2.6.32 (ac481c20ef8f6c6f2be75d581863f40c43874ef7) * BLKIOOPT - 2.6.32 (ac481c20ef8f6c6f2be75d581863f40c43874ef7) * BLKALIGNOFF - 2.6.32 (ac481c20ef8f6c6f2be75d581863f40c43874ef7) * BLKPBSZGET - 2.6.32 (ac481c20ef8f6c6f2be75d581863f40c43874ef7) * BLKDISCARDZEROES - 2.6.32 (98262f2762f0067375f83824d81ea929e37e6bfe) * BLKSECDISCARD - 2.6.36 (8d57a98ccd0b4489003473979da8f5a1363ba7a3) * BLKROTATIONAL - 3.2 (ef00f59c95fe6e002e7c6e3663cdea65e253f4cc) * BLKZEROOUT - 3.6 (66ba32dc167202c3cf8c86806581a9393ec7f488) * FIBMAP - <2.6.12 (linux.git epoch) * FIGETBSZ - <2.6.12 (linux.git epoch) and when building with latest glibc, we'll see compat definitions in syscall.c anyway thanks to the previous patch. Thus we can assume they always exist and remove the conditional checks. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Laurent Vivier --- linux-user/ioctls.h | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index f182d40190..071f7ca253 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -96,9 +96,7 @@ IOCTL(BLKROGET, IOC_R, MK_PTR(TYPE_INT)) IOCTL(BLKRRPART, 0, TYPE_NULL) IOCTL(BLKGETSIZE, IOC_R, MK_PTR(TYPE_ULONG)) -#ifdef BLKGETSIZE64 IOCTL(BLKGETSIZE64, IOC_R, MK_PTR(TYPE_ULONGLONG)) -#endif IOCTL(BLKFLSBUF, 0, TYPE_NULL) IOCTL(BLKRASET, 0, TYPE_INT) IOCTL(BLKRAGET, IOC_R, MK_PTR(TYPE_LONG)) @@ -107,33 +105,15 @@ IOCTL_SPECIAL(BLKPG, IOC_W, do_ioctl_blkpg, MK_PTR(MK_STRUCT(STRUCT_blkpg_ioctl_arg))) =20 -#ifdef BLKDISCARD IOCTL(BLKDISCARD, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2))) -#endif -#ifdef BLKIOMIN IOCTL(BLKIOMIN, IOC_R, MK_PTR(TYPE_INT)) -#endif -#ifdef BLKIOOPT IOCTL(BLKIOOPT, IOC_R, MK_PTR(TYPE_INT)) -#endif -#ifdef BLKALIGNOFF IOCTL(BLKALIGNOFF, IOC_R, MK_PTR(TYPE_INT)) -#endif -#ifdef BLKPBSZGET IOCTL(BLKPBSZGET, IOC_R, MK_PTR(TYPE_INT)) -#endif -#ifdef BLKDISCARDZEROES IOCTL(BLKDISCARDZEROES, IOC_R, MK_PTR(TYPE_INT)) -#endif -#ifdef BLKSECDISCARD IOCTL(BLKSECDISCARD, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2))) -#endif -#ifdef BLKROTATIONAL IOCTL(BLKROTATIONAL, IOC_R, MK_PTR(TYPE_SHORT)) -#endif -#ifdef BLKZEROOUT IOCTL(BLKZEROOUT, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2))) -#endif =20 IOCTL(FDMSGON, 0, TYPE_NULL) IOCTL(FDMSGOFF, 0, TYPE_NULL) @@ -149,17 +129,13 @@ IOCTL(FDTWADDLE, 0, TYPE_NULL) IOCTL(FDEJECT, 0, TYPE_NULL) =20 -#ifdef FIBMAP IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG)) -#endif #ifdef FICLONE IOCTL(FICLONE, IOC_W, TYPE_INT) IOCTL(FICLONERANGE, IOC_W, MK_PTR(MK_STRUCT(STRUCT_file_clone_range))) #endif =20 -#ifdef FIGETBSZ IOCTL(FIGETBSZ, IOC_R, MK_PTR(TYPE_LONG)) -#endif #ifdef CONFIG_FIEMAP IOCTL_SPECIAL(FS_IOC_FIEMAP, IOC_W | IOC_R, do_ioctl_fs_ioc_fiemap, MK_PTR(MK_STRUCT(STRUCT_fiemap))) --=20 2.37.3 From nobody Sun May 12 22:25:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1664876689; cv=none; d=zohomail.com; s=zohoarc; b=WHb2V24LQRb3Io9MhfX/GzTysYypwkyXI7IF0q/7tGH7QVqx5AkW1idG1W9J+7NX7zVxTXwGz/fIJrqRJay+zu/tk2RS2nNj2KEV8qyWNvy7MaC38Sn6pCCNrBXwr6wrDNaoQL9plnov/yDbqnpXKRWu/XJmSlWxYjtey9aqA0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664876689; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DoHxUBovNXkqvqDwUAVYmiKYeFGt5kDexnYw1EqIa7w=; b=TUwFRqAMMReCGyI6mq2VxokZqZRtDccKt/NJ4fBVkO+gF/HDWeraQBnJszttDxmsHDq03JHyIWi1mC9WiPv+gEzM1wKMgSKwuP5zW+LtyQVhF+gL+qRr3cv40hY2D5CG4QY2ImuuPsaBX8v6Eb8YMEZIGTDhQt7ti4bgbQgm5SU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1664876689832642.2048697500029; Tue, 4 Oct 2022 02:44:49 -0700 (PDT) Received: from localhost ([::1]:57180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofeTn-0002zK-Td for importer@patchew.org; Tue, 04 Oct 2022 05:44:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofeHh-0005KA-Oh for qemu-devel@nongnu.org; Tue, 04 Oct 2022 05:32:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56469) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofeHe-00052H-P6 for qemu-devel@nongnu.org; Tue, 04 Oct 2022 05:32:17 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-372-w4UwOrvVML2DwXH3ev7vrg-1; Tue, 04 Oct 2022 05:32:12 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 10655185A79C; Tue, 4 Oct 2022 09:32:12 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 11C9F492B04; Tue, 4 Oct 2022 09:32:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664875933; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DoHxUBovNXkqvqDwUAVYmiKYeFGt5kDexnYw1EqIa7w=; b=MWvxaTA/C5CsWI3oHOolu6LgGSP17RMrQnYnzJC+FbDgPq/8Ga5vA9k14Krl55TYSA+t+o E4miPwA8tMcBNOPZU0TNly6h4aEl1fDzSkpdPRKgdwJ51bwsNxYR+RD9uaPJNKtLrXRExL uBDVxoITGZF7PvPyX+yKxM+HDQn8KOA= X-MC-Unique: w4UwOrvVML2DwXH3ev7vrg-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eduardo Habkost , Richard Henderson , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 3/4] meson: enforce a minimum Linux kernel headers version >= 4.18 Date: Tue, 4 Oct 2022 10:32:05 +0100 Message-Id: <20221004093206.652431-4-berrange@redhat.com> In-Reply-To: <20221004093206.652431-1-berrange@redhat.com> References: <20221004093206.652431-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664876690477100001 Various areas of QEMU have a dependency on Linux kernel header definitions. This falls under the scope of our supported platforms matrix, but historically we've not checked for a minimum kernel headers version. This has made it unclear when we can drop support for older kernel headers. * Alpine 3.14: 5.10 * CentOS 8: 4.18 * CentOS 9: 5.14 * Debian 10: 4.19 * Debian 11: 5.10 * Fedora 35: 5.19 * Fedora 36: 5.19 * OpenSUSE 15.3: 5.3.0 * Ubuntu 20.04: 5.4 * Ubuntu 22.04: 5.15 The above ignores the 3rd version digit since distros update their packages periodically and such updates don't generally affect public APIs to the extent that it matters for our build time check. Overall, we can set the baseline to 4.18 currently. Signed-off-by: Daniel P. Berrang=C3=A9 --- meson.build | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/meson.build b/meson.build index 8dc661363f..ea434767ac 100644 --- a/meson.build +++ b/meson.build @@ -248,6 +248,18 @@ if targetos =3D=3D 'linux' add_project_arguments('-isystem', meson.current_source_dir() / 'linux-he= aders', '-isystem', 'linux-headers', language: ['c', 'cpp']) + + if not cc.compiles(''' + #include + int main(void) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0) +#error "QEMU requires Linux kernel headers version >=3D 4.18.0" +#endif + return 0; + }''') + error('QEMU requires Linux kernel headers version >=3D 4.18.0') +endif + endif =20 add_project_arguments('-iquote', '.', --=20 2.37.3 From nobody Sun May 12 22:25:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1664876229; cv=none; d=zohomail.com; s=zohoarc; b=CJIE/2y8v0V8XjiOb4CNc49i7DjtTIjyYWTr0MeYDOMFW7bTmu+fOipRsBfKfjo/NL41y8DEQ+CXokFkwLNUD7tmYH5K8HgxAFvPrrL2vycJ0Nt06cYH8RE5og2r416gFdh7+IOSB3mxHkyxENTSGIGgnXev7GEi2zQLlgO8tnE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664876229; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NzNom8J7jVkaET+ZhmUNxw57g0LK26fsGkBtMwcDM3Q=; b=XjyX4gOw29CYVVvfTX8JIUqVKFWf/4kaojM6BAvUa2Gf5oupgMcNtgJTAnx4bVlNpWXqRd0LRhZNGwdQ+RVoKVgiMeANicAKqKy02kGKvnAh/X9nVYiKafyD6lNOmCqZc5+GbEY9anAKX/gyOhYUH1X4Qo6FiQ9fWh9Uh3ZLi2Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1664876229097211.8544212046918; Tue, 4 Oct 2022 02:37:09 -0700 (PDT) Received: from localhost ([::1]:38526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofeMO-0001wH-2z for importer@patchew.org; Tue, 04 Oct 2022 05:37:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofeHl-0005KK-1W for qemu-devel@nongnu.org; Tue, 04 Oct 2022 05:32:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:40744) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofeHi-00052f-7k for qemu-devel@nongnu.org; Tue, 04 Oct 2022 05:32:20 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-434-eWUCtJCvNgemP2nfWTMo3A-1; Tue, 04 Oct 2022 05:32:13 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 517C7101CC62; Tue, 4 Oct 2022 09:32:13 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49910492B04; Tue, 4 Oct 2022 09:32:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664875937; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NzNom8J7jVkaET+ZhmUNxw57g0LK26fsGkBtMwcDM3Q=; b=fQxTSMrQnDSy8L+gSuQnzHZ9XWFF5aJWqhSXwTl9rew1qIfvff/Mrruo8vYDen/xWrpxYk lB+XSYfNrZfJZyI1yXOShHr2NzSiSJsEcsbGW24pKulr6N+XQqVFThERR/GVISp4wDzzQR MsP4f0vRf4aZdRz2Dp9VX3LlWjIl6ws= X-MC-Unique: eWUCtJCvNgemP2nfWTMo3A-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eduardo Habkost , Richard Henderson , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 4/4] linux-user: drop conditionals for obsolete kernel header versions Date: Tue, 4 Oct 2022 10:32:06 +0100 Message-Id: <20221004093206.652431-5-berrange@redhat.com> In-Reply-To: <20221004093206.652431-1-berrange@redhat.com> References: <20221004093206.652431-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664876230097100001 Given our newly enforced 4.18 baseline for the kernel headers version, we can drop any conditional checks for older versions. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Laurent Vivier --- linux-user/linux_loop.h | 4 ---- linux-user/syscall.c | 14 ++------------ tests/tcg/i386/test-i386.c | 10 +++------- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/linux-user/linux_loop.h b/linux-user/linux_loop.h index f80b96f1ff..5a9e0edef2 100644 --- a/linux-user/linux_loop.h +++ b/linux-user/linux_loop.h @@ -31,10 +31,6 @@ enum { #include /* for __kernel_old_dev_t */ #include /* for __u64 */ =20 -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) /* This is a guess. */ -#define __kernel_old_dev_t __kernel_dev_t -#endif - /* Backwards compatibility version */ struct loop_info { int lo_number; /* ioctl r/o */ diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f6a15df69d..377867907a 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2540,16 +2540,12 @@ set_timeout: case NETLINK_DROP_MEMBERSHIP: case NETLINK_BROADCAST_ERROR: case NETLINK_NO_ENOBUFS: -#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 2, 0) case NETLINK_LISTEN_ALL_NSID: case NETLINK_CAP_ACK: -#endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 2, 0) */ -#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 12, 0) case NETLINK_EXT_ACK: -#endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 12, 0) */ #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 20, 0) case NETLINK_GET_STRICT_CHK: -#endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 12, 0) */ +#endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 20, 0) */ break; default: goto unimplemented; @@ -2918,16 +2914,12 @@ get_timeout: case NETLINK_PKTINFO: case NETLINK_BROADCAST_ERROR: case NETLINK_NO_ENOBUFS: -#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 2, 0) case NETLINK_LISTEN_ALL_NSID: case NETLINK_CAP_ACK: -#endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 2, 0) */ -#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 12, 0) case NETLINK_EXT_ACK: -#endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 12, 0) */ #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 20, 0) case NETLINK_GET_STRICT_CHK: -#endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 12, 0) */ +#endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 20, 0) */ if (get_user_u32(len, optlen)) { return -TARGET_EFAULT; } @@ -2944,7 +2936,6 @@ get_timeout: return -TARGET_EFAULT; } break; -#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 2, 0) case NETLINK_LIST_MEMBERSHIPS: { uint32_t *results; @@ -2975,7 +2966,6 @@ get_timeout: unlock_user(results, optval_addr, 0); break; } -#endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 2, 0) */ default: goto unimplemented; } diff --git a/tests/tcg/i386/test-i386.c b/tests/tcg/i386/test-i386.c index 864c4e620d..881b45cd19 100644 --- a/tests/tcg/i386/test-i386.c +++ b/tests/tcg/i386/test-i386.c @@ -1224,10 +1224,6 @@ static inline int modify_ldt(int func, void * ptr, u= nsigned long bytecount) return syscall(__NR_modify_ldt, func, ptr, bytecount); } =20 -#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2, 5, 66) -#define modify_ldt_ldt_s user_desc -#endif - #define MK_SEL(n) (((n) << 3) | 7) =20 uint8_t seg_data1[4096]; @@ -1265,7 +1261,7 @@ uint8_t seg_data2[4096]; /* NOTE: we use Linux modify_ldt syscall */ void test_segs(void) { - struct modify_ldt_ldt_s ldt; + struct user_desc ldt; long long ldt_table[3]; int res, res2; char tmp; @@ -1367,7 +1363,7 @@ extern char code16_func3; =20 void test_code16(void) { - struct modify_ldt_ldt_s ldt; + struct user_desc ldt; int res, res2; =20 /* build a code segment */ @@ -1774,7 +1770,7 @@ void test_exceptions(void) } =20 { - struct modify_ldt_ldt_s ldt; + struct user_desc ldt; ldt.entry_number =3D 1; ldt.base_addr =3D (unsigned long)&seg_data1; ldt.limit =3D (sizeof(seg_data1) + 0xfff) >> 12; --=20 2.37.3