All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Laurent Vivier" <laurent@vivier.eu>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Subject: [PATCH 4/4] linux-user: drop conditionals for obsolete kernel header versions
Date: Tue,  4 Oct 2022 10:32:06 +0100	[thread overview]
Message-ID: <20221004093206.652431-5-berrange@redhat.com> (raw)
In-Reply-To: <20221004093206.652431-1-berrange@redhat.com>

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é <berrange@redhat.com>
---
 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 <asm/posix_types.h>	/* for __kernel_old_dev_t */
 #include <asm/types.h>		/* 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;
-- 
2.37.3



  parent reply	other threads:[~2022-10-04  9:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-04  9:32 [PATCH 0/4] linux-user: fix regression with some ioctls with newest glibc Daniel P. Berrangé
2022-10-04  9:32 ` [PATCH 1/4] linux-user: add more compat ioctl definitions Daniel P. Berrangé
2022-10-21 14:21   ` Laurent Vivier
2022-10-21 15:17   ` Laurent Vivier
2022-10-04  9:32 ` [PATCH 2/4] linux-user: remove conditionals for many fs.h ioctls Daniel P. Berrangé
2022-10-21 14:21   ` Laurent Vivier
2022-10-21 15:17   ` Laurent Vivier
2022-10-04  9:32 ` [PATCH 3/4] meson: enforce a minimum Linux kernel headers version >= 4.18 Daniel P. Berrangé
2022-10-04  9:49   ` Peter Maydell
2022-10-04 10:00     ` Daniel P. Berrangé
2022-10-21 14:30   ` Laurent Vivier
2022-10-21 14:38     ` Peter Maydell
2022-10-21 14:50       ` Daniel P. Berrangé
2022-10-21 15:05         ` Peter Maydell
2022-10-21 15:28           ` Daniel P. Berrangé
2022-10-21 16:50         ` Alex Bennée
2022-10-27 10:50   ` Daniel P. Berrangé
2022-10-04  9:32 ` Daniel P. Berrangé [this message]
2022-10-21 14:32   ` [PATCH 4/4] linux-user: drop conditionals for obsolete kernel header versions Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221004093206.652431-5-berrange@redhat.com \
    --to=berrange@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=laurent@vivier.eu \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.