From patchwork Tue Oct 4 09:32:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 1685833 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Y6ZSITQD; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MhXj76Wcfz1yqn for ; Tue, 4 Oct 2022 20:39:22 +1100 (AEDT) Received: from localhost ([::1]:42258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofeOU-0005Or-16 for incoming@patchwork.ozlabs.org; Tue, 04 Oct 2022 05:39:18 -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 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= 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 X-MC-Unique: lgpy_HI1Pcq4NdqtrJLK8g-1 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) From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eduardo Habkost , Richard Henderson , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=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 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" GLibc changes prevent us from including linux/fs.h anymore, and we previously adjusted to this in commit 3cd3df2a9584e6f753bb62a0028bd67124ab5532 Author: Daniel P. Berrangé Date: Tue Aug 2 12:41:34 2022 -0400 linux-user: fix compat with glibc >= 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é 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 From patchwork Tue Oct 4 09:32:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 1685834 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=hE+MLH2P; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MhXmg1VNfz23jR for ; Tue, 4 Oct 2022 20:42:27 +1100 (AEDT) Received: from localhost ([::1]:48176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofeRV-0007hy-0x for incoming@patchwork.ozlabs.org; Tue, 04 Oct 2022 05:42:25 -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 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= 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 X-MC-Unique: PyEz9f_nNmKuh37v4_Yn3Q-1 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) From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eduardo Habkost , Richard Henderson , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=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 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é 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))) -#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 IOCTL(FDMSGON, 0, TYPE_NULL) IOCTL(FDMSGOFF, 0, TYPE_NULL) @@ -149,17 +129,13 @@ IOCTL(FDTWADDLE, 0, TYPE_NULL) IOCTL(FDEJECT, 0, TYPE_NULL) -#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 -#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))) From patchwork Tue Oct 4 09:32:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 1685835 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=MWvxaTA/; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MhXpm3Gg8z1yqj for ; Tue, 4 Oct 2022 20:44:16 +1100 (AEDT) Received: from localhost ([::1]:43932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofeTE-0001gf-Ub for incoming@patchwork.ozlabs.org; Tue, 04 Oct 2022 05:44:12 -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 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= 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 X-MC-Unique: w4UwOrvVML2DwXH3ev7vrg-1 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) From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eduardo Habkost , Richard Henderson , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=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 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é --- 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 == 'linux' add_project_arguments('-isystem', meson.current_source_dir() / 'linux-headers', '-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 >= 4.18.0" +#endif + return 0; + }''') + error('QEMU requires Linux kernel headers version >= 4.18.0') +endif + endif add_project_arguments('-iquote', '.', From patchwork Tue Oct 4 09:32:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 1685823 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fQxTSMrQ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MhXd632KXz1yqn for ; Tue, 4 Oct 2022 20:35:54 +1100 (AEDT) Received: from localhost ([::1]:42952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofeLA-0008Jt-8e for incoming@patchwork.ozlabs.org; Tue, 04 Oct 2022 05:35:52 -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 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= 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 X-MC-Unique: eWUCtJCvNgemP2nfWTMo3A-1 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) From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Eduardo Habkost , Richard Henderson , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=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 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é 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 */ -#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 >= KERNEL_VERSION(4, 2, 0) case NETLINK_LISTEN_ALL_NSID: case NETLINK_CAP_ACK: -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) case NETLINK_EXT_ACK: -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) case NETLINK_GET_STRICT_CHK: -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) */ +#endif /* LINUX_VERSION_CODE >= 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 >= KERNEL_VERSION(4, 2, 0) case NETLINK_LISTEN_ALL_NSID: case NETLINK_CAP_ACK: -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) case NETLINK_EXT_ACK: -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) case NETLINK_GET_STRICT_CHK: -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) */ +#endif /* LINUX_VERSION_CODE >= 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 >= 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 >= 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, unsigned long bytecount) return syscall(__NR_modify_ldt, func, ptr, bytecount); } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 66) -#define modify_ldt_ldt_s user_desc -#endif - #define MK_SEL(n) (((n) << 3) | 7) 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; void test_code16(void) { - struct modify_ldt_ldt_s ldt; + struct user_desc ldt; int res, res2; /* build a code segment */ @@ -1774,7 +1770,7 @@ void test_exceptions(void) } { - struct modify_ldt_ldt_s ldt; + struct user_desc ldt; ldt.entry_number = 1; ldt.base_addr = (unsigned long)&seg_data1; ldt.limit = (sizeof(seg_data1) + 0xfff) >> 12;