From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDB23C3600D for ; Wed, 26 Mar 2025 03:36:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8303B280055; Tue, 25 Mar 2025 23:36:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7DDDA280051; Tue, 25 Mar 2025 23:36:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 631ED280055; Tue, 25 Mar 2025 23:36:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 40F2F280051 for ; Tue, 25 Mar 2025 23:36:01 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A46DA1616DB for ; Wed, 26 Mar 2025 03:36:02 +0000 (UTC) X-FDA: 83262288564.21.6C6F826 Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf09.hostedemail.com (Postfix) with ESMTP id 3E2BB14000E for ; Wed, 26 Mar 2025 03:35:59 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Obw1flVE; spf=pass (imf09.hostedemail.com: domain of guoren@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=guoren@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1742960160; h=from:from:sender: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:dkim-signature; bh=xZR4RSuZbaqzv3cItoiuFiWIYcWBatAqJVaYUja/XR8=; b=QoPYJoXzdirQ9vVQT2SNBWjPlcrA01WH/YtkzJNdFtRcmanP0qPKgl5wKcHrBAjBSeMak+ okIe9ftH5M+DBDdxkKfxUbX+XOGrJqTpx1ihtuH2tnQybf4L5sRBQUvLzT5McJmkEULwbm 0bNGAjNkb0uZEYQhqygdEvBhPVl4avk= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Obw1flVE; spf=pass (imf09.hostedemail.com: domain of guoren@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=guoren@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1742960160; a=rsa-sha256; cv=none; b=Yx9DBLbO/92isfpzXqENMz+k4ETsKD25yx4wSi8AYwyvG8xcm0AH1Dj7eR2YZxU0YouHGw 0UfcfKZjFNYkec2MC3+X3Hw+6R23hG+oA5K0fyKCyynNK/MGukzXkRkyfDGq3lHzygLHu7 VR7CAZcZxJ3QjxF54AaGpdY0NYP6XFs= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 6CD9544487 for ; Wed, 26 Mar 2025 03:35:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60836C4CEFF for ; Wed, 26 Mar 2025 03:35:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1742960158; bh=zQNN1ki8h9kqS90OTVQimlrFmuW5TF2JapKQcSFEGKQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Obw1flVEtxyMUW/At/kneqHxfCrKDMIfEBFv6McvFjYFOdcgZ6npv9tpvKo8mv8ez wGZczvLlTbwcByRGQXLWST31lvnljN0K1TYOEQNl++JU6gesu67Lv09Sf66/NYLzNi /BlGafMrBXix8SlQf7Ytl8uqTnChZahZwTUOXdN5gobvhjt5mEDD01xJpFOu0bvDPf 5OrUG8/fLcLDvWMTCvvqLQzKrAPQzWEoHP21x4jU85mEJpCNChLVCiwhu1hXuNLtfi CQrEykMsCttEVhpMlGtOu4ZYvulksl9mU2IGksPM9t0ie19bmWEXivkDoSyGD/JTFt c3ClMFEb/+6hA== Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-43d0618746bso43352865e9.2 for ; Tue, 25 Mar 2025 20:35:58 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCX20xbWPsIjy9+m+gNJfmIFDpV+vg94PpIkLZzsiwORPaXLNqaqY2DeInwpJCZJzSps1WXZL9d9ZQ==@kvack.org X-Gm-Message-State: AOJu0YxkFF/xyPu2g6XuW+rrZkkoGYbY2d7ORppRN/QWOCDAJRf4YqJ4 fwUNwV457/CEIeUqxhECobZPJnJYrW9oq1uU6Ygt+A3a23eCg4GTMLJC++ZI3XmTPeyJ0TT8eHf c8kc7xLsOcTgsZOSbF9PQuRd7Hl0= X-Google-Smtp-Source: AGHT+IH1qAC7M1zI/GB1SjlJsBUYduB5Ay6a4l3UglXrL2dMWn8mYzFqq7sfxGeFxk8syVmgNIyhBxbe8f3JJEoNutw= X-Received: by 2002:a5d:5885:0:b0:391:23e7:968d with SMTP id ffacd0b85a97d-3997f959582mr18193138f8f.47.1742960156337; Tue, 25 Mar 2025 20:35:56 -0700 (PDT) MIME-Version: 1.0 References: <20250325121624.523258-1-guoren@kernel.org> <20250325121624.523258-2-guoren@kernel.org> <0024788o-35r0-73q1-1s54-q564p457q33s@vanv.qr> In-Reply-To: <0024788o-35r0-73q1-1s54-q564p457q33s@vanv.qr> From: Guo Ren Date: Wed, 26 Mar 2025 11:35:43 +0800 X-Gmail-Original-Message-ID: X-Gm-Features: AQ5f1JrGUbEH86Vmh44AHPZHOEZYFZr2PCQWEd8Vzn0mDV8EcIgvHnzVisOp1Qw Message-ID: Subject: Re: [RFC PATCH V3 01/43] rv64ilp32_abi: uapi: Reuse lp64 ABI interface To: Jan Engelhardt Cc: arnd@arndb.de, gregkh@linuxfoundation.org, torvalds@linux-foundation.org, paul.walmsley@sifive.com, palmer@dabbelt.com, anup@brainfault.org, atishp@atishpatra.org, oleg@redhat.com, kees@kernel.org, tglx@linutronix.de, will@kernel.org, mark.rutland@arm.com, brauner@kernel.org, akpm@linux-foundation.org, rostedt@goodmis.org, edumazet@google.com, unicorn_wang@outlook.com, inochiama@outlook.com, gaohan@iscas.ac.cn, shihua@iscas.ac.cn, jiawei@iscas.ac.cn, wuwei2016@iscas.ac.cn, drew@pdp7.com, prabhakar.mahadev-lad.rj@bp.renesas.com, ctsai390@andestech.com, wefu@redhat.com, kuba@kernel.org, pabeni@redhat.com, josef@toxicpanda.com, dsterba@suse.com, mingo@redhat.com, peterz@infradead.org, boqun.feng@gmail.com, xiao.w.wang@intel.com, qingfang.deng@siflower.com.cn, leobras@redhat.com, jszhang@kernel.org, conor.dooley@microchip.com, samuel.holland@sifive.com, yongxuan.wang@sifive.com, luxu.kernel@bytedance.com, david@redhat.com, ruanjinjie@huawei.com, cuiyunhui@bytedance.com, wangkefeng.wang@huawei.com, qiaozhe@iscas.ac.cn, ardb@kernel.org, ast@kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-mm@kvack.org, linux-crypto@vger.kernel.org, bpf@vger.kernel.org, linux-input@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-serial@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, maple-tree@lists.infradead.org, linux-trace-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-atm-general@lists.sourceforge.net, linux-btrfs@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, linux-nfs@vger.kernel.org, linux-sctp@vger.kernel.org, linux-usb@vger.kernel.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 3E2BB14000E X-Stat-Signature: gxga8gep53a1e6a5usuh8j3fhytf1fx7 X-HE-Tag: 1742960159-337518 X-HE-Meta: U2FsdGVkX1+of7D9f9YW16sYLZpcLFHXhnwUlg6dsAA1IEs5/TQfNQEL/5C/9RKTpM5YvSFeaK/ajBmAA4g7nKycDrg7IrMD76IDFqmEcapYy0xOUW4nyGp7L3L5JoF9HSRTQBkL9R63hQabUGpyHkF7T39xRVVHRncT/3xXRqRcjDjLF7nVscLqM0i7MvaTtGhnUl9bBCqfxDEGLQ843y9NU9W9tVd0bSYpFDnVZ8LdNXku1xztzi0p16wxQa1qcl2PQq+Lq0SEWgxQNIKgqdAdfEqLUDN5/OewVc9yKeJl1cFONkn8yflwbEVMdYFqUSin53uMfwbY/0mBl9Qp+b5qWqXlbfJsq1XJc0a2ERfdWsqJBX0QWbcWcQEufC1NRhAefkC2iNFK+7dlkFOld2G8kyvwJZ7VnAQ8UabJcTobs0M+YdnVc4oSs/JcaJPbYFGDGSvRtcjUlg07lm0ENS8x5GDgSBF2TwVBJ9ER0Cf97Q1KF9+LXLd+tudMeqt2ct1feR2i+1K4izPd3LzhUkznQhLimPeq+wDqNIV9VjWPww0X9ELEhndtumKPBA5ockya4GCWwc+sdFAFWxLkmI1D5OuJTsc9xWS2ywoztPIU6EMJOfds43wrbUoM+dOsTwT1wJCRYthu+T/W/ilXaSyEgCkfoARlzFLwPAc5CjSOwLjkrVK9TQuzXrsqbTelG4vQjoRmL9AZ2khBjGjeSDH1FRvRLiZxi4Gd0qokLeiGEmAIzgTNZZLt5ahSAjrgczdZTNuG3Z8nuFfg/F1h2Tv3c5Sc7fkz5rawGlyiq4ZAPTZwAhheSSMy5v4+JGBHqeJzqn7fD0j9ji3v10byhUGc8Lrx8mIxklj8IDa8MyXWBTJnSwu2bgLI8sFFWPxMMtFPbVkSaHkLuoK1dqJZsjnBgQIM1FxdiCRfXabxvY0teVeVFEUhDyHdvQgFPDZQ3WO/VDcglItZbCYh+cZ G/92lS/a 4kiV03PIw91HQwkUQ4aFT9AcR2D0gUcqhYH6mGvay0A8kA9qTK8ZTGoaA5Wbj5Q5A7iujxJUAOVr0EnO/ECxJeYRxoZ72bxsODel+scjKoIE2QXy0zoknFwU5T0NmJDCCvDyVrK+oBMbx+RB7+Babd4sXNcyFxPjMHASrc+UqwgqoVhwxvx1gQDrhOVKaKtOdYMuv91NagI0OzIVj21u3WOoW8QzizLNNrXriGT0Nr+9utnvQaalG3EvPK3Dn67XTKKZiOdsPStnUYCXneAM8y+8qBQIelijj74yVAXxKc4bDA5AiTcwX8kU1V7Xa8r8oPYpvDLz9NxAsPvHPfkWf6K050zULCSO9yXF3IjtK9K3z2O1d8v2lCI+TvXIQZVxrvW67pLMpZLjiSZaeG/+cELTXyA5sTBc0gC5Cx/XgOyZPVio= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, Mar 26, 2025 at 4:31=E2=80=AFAM Jan Engelhardt wrote: > > > On Tuesday 2025-03-25 13:15, guoren@kernel.org wrote: > > >diff --git a/include/uapi/linux/netfilter/x_tables.h b/include/uapi/linu= x/netfilter/x_tables.h > >index 796af83a963a..7e02e34c6fad 100644 > >--- a/include/uapi/linux/netfilter/x_tables.h > >+++ b/include/uapi/linux/netfilter/x_tables.h > >@@ -18,7 +18,11 @@ struct xt_entry_match { > > __u8 revision; > > } user; > > struct { > >+#if __riscv_xlen =3D=3D 64 > >+ __u64 match_size; > >+#else > > __u16 match_size; > >+#endif > > > > /* Used inside the kernel */ > > struct xt_match *match; > > The __u16 is the common prefix of the union which is exposed to userspace= . > If anything, you need to use __attribute__((aligned(8))) to move > `match` to a fixed location. > > However, that sub-struct is only used inside the kernel and never exposed= , > so the alignment of `match` should not play a role. > > Moreover, change from u16 to u64 would break RISC-V Big-Endian. Even if t= here > currently is no big-endian variant, let's not introduce such breakage. You're correct. The __u64 modification is too raw from the proof of concept. It's not correct, so I would accept your advice. > > > >--- a/include/uapi/linux/netfilter_ipv4/ip_tables.h > >+++ b/include/uapi/linux/netfilter_ipv4/ip_tables.h > >@@ -200,7 +200,14 @@ struct ipt_replace { > > /* Number of counters (must be equal to current number of entries= ). */ > > unsigned int num_counters; > > /* The old entries' counters. */ > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ struct xt_counters __user *counters; > >+ __u64 __counters; > >+ }; > >+#else > > struct xt_counters __user *counters; > >+#endif > > > > /* The entries (hang off end: not really an array). */ > > struct ipt_entry entries[]; > > This seems ok, but perhaps there is a better name for __riscv_xlen (ifdef > CONFIG_????ilp32), so it is not strictly tied to riscv, > in case other platform wants to try ilp32-self mode. Yes, I want that macro, but Linus has suggested "compat stuff". I would have to try. Thx for the reviewing! > > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ int __user *auth_flavours; /* 1 */ > >+ __u64 __auth_flavours; > >+ }; > >+#else > > int __user *auth_flavours; /* 1 */ > >+#endif > > }; > > > > /* bits in the flags field */ > >diff --git a/include/uapi/linux/ppp-ioctl.h b/include/uapi/linux/ppp-ioc= tl.h > >index 1cc5ce0ae062..8d48eab430c1 100644 > >--- a/include/uapi/linux/ppp-ioctl.h > >+++ b/include/uapi/linux/ppp-ioctl.h > >@@ -59,7 +59,14 @@ struct npioctl { > > > > /* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS= */ > > struct ppp_option_data { > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ __u8 __user *ptr; > >+ __u64 __ptr; > >+ }; > >+#else > > __u8 __user *ptr; > >+#endif > > __u32 length; > > int transmit; > > }; > >diff --git a/include/uapi/linux/sctp.h b/include/uapi/linux/sctp.h > >index b7d91d4cf0db..46a06fddcd2f 100644 > >--- a/include/uapi/linux/sctp.h > >+++ b/include/uapi/linux/sctp.h > >@@ -1024,6 +1024,9 @@ struct sctp_getaddrs_old { > > #else > > struct sockaddr *addrs; > > #endif > >+#if (__riscv_xlen =3D=3D 64) && (__SIZEOF_LONG__ =3D=3D 4) > >+ __u32 unused; > >+#endif > > }; > > > > > > struct sctp_getaddrs { > >diff --git a/include/uapi/linux/sem.h b/include/uapi/linux/sem.h > >index 75aa3b273cd9..de9f441913cd 100644 > >--- a/include/uapi/linux/sem.h > >+++ b/include/uapi/linux/sem.h > >@@ -26,10 +26,29 @@ struct semid_ds { > > struct ipc_perm sem_perm; /* permissions .. see ipc= .h */ > > __kernel_old_time_t sem_otime; /* last semop time */ > > __kernel_old_time_t sem_ctime; /* create/last semctl() t= ime */ > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ struct sem *sem_base; /* ptr to first s= emaphore in array */ > >+ __u64 __sem_base; > >+ }; > >+ union { > >+ struct sem_queue *sem_pending; /* pending operat= ions to be processed */ > >+ __u64 __sem_pending; > >+ }; > >+ union { > >+ struct sem_queue **sem_pending_last; /* last pending o= peration */ > >+ __u64 __sem_pending_last; > >+ }; > >+ union { > >+ struct sem_undo *undo; /* undo requests = on this array */ > >+ __u64 __undo; > >+ }; > >+#else > > struct sem *sem_base; /* ptr to first semaphore= in array */ > > struct sem_queue *sem_pending; /* pending operations to = be processed */ > > struct sem_queue **sem_pending_last; /* last pending operation= */ > > struct sem_undo *undo; /* undo requests on this = array */ > >+#endif > > unsigned short sem_nsems; /* no. of semaphores in a= rray */ > > }; > > > >@@ -46,10 +65,29 @@ struct sembuf { > > /* arg for semctl system calls. */ > > union semun { > > int val; /* value for SETVAL */ > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ struct semid_ds __user *buf; /* buffer for IPC_STAT & = IPC_SET */ > >+ __u64 ___buf; > >+ }; > >+ union { > >+ unsigned short __user *array; /* array for GETALL & SET= ALL */ > >+ __u64 __array; > >+ }; > >+ union { > >+ struct seminfo __user *__buf; /* buffer for IPC_INFO */ > >+ __u64 ____buf; > >+ }; > >+ union { > >+ void __user *__pad; > >+ __u64 ____pad; > >+ }; > >+#else > > struct semid_ds __user *buf; /* buffer for IPC_STAT & IPC_SET = */ > > unsigned short __user *array; /* array for GETALL & SETALL */ > > struct seminfo __user *__buf; /* buffer for IPC_INFO */ > > void __user *__pad; > >+#endif > > }; > > > > struct seminfo { > >diff --git a/include/uapi/linux/socket.h b/include/uapi/linux/socket.h > >index d3fcd3b5ec53..5f7a83649395 100644 > >--- a/include/uapi/linux/socket.h > >+++ b/include/uapi/linux/socket.h > >@@ -22,7 +22,14 @@ struct __kernel_sockaddr_storage { > > /* space to achieve desired size, */ > > /* _SS_MAXSIZE value minus size of ss_fam= ily */ > > }; > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ void *__align; /* implementation specific desired= alignment */ > >+ u64 ___align; > >+ }; > >+#else > > void *__align; /* implementation specific desired alignme= nt */ > >+#endif > > }; > > }; > > > >diff --git a/include/uapi/linux/sysctl.h b/include/uapi/linux/sysctl.h > >index 8981f00204db..8ed7b29897f9 100644 > >--- a/include/uapi/linux/sysctl.h > >+++ b/include/uapi/linux/sysctl.h > >@@ -33,13 +33,45 @@ > > member of a struct __sysctl_args to ha= ve? */ > > > > struct __sysctl_args { > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ int __user *name; > >+ __u64 __name; > >+ }; > >+#else > > int __user *name; > >+#endif > > int nlen; > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ void __user *oldval; > >+ __u64 __oldval; > >+ }; > >+#else > > void __user *oldval; > >+#endif > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ size_t __user *oldlenp; > >+ __u64 __oldlenp; > >+ }; > >+#else > > size_t __user *oldlenp; > >+#endif > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ void __user *newval; > >+ __u64 __newval; > >+ }; > >+#else > > void __user *newval; > >+#endif > > size_t newlen; > >+#if __riscv_xlen =3D=3D 64 > >+ unsigned long long __unused[4]; > >+#else > > unsigned long __unused[4]; > >+#endif > > }; > > > > /* Define sysctl names first */ > >diff --git a/include/uapi/linux/uhid.h b/include/uapi/linux/uhid.h > >index cef7534d2d19..4a774dbd3de8 100644 > >--- a/include/uapi/linux/uhid.h > >+++ b/include/uapi/linux/uhid.h > >@@ -130,7 +130,14 @@ struct uhid_create_req { > > __u8 name[128]; > > __u8 phys[64]; > > __u8 uniq[64]; > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ __u8 __user *rd_data; > >+ __u64 __rd_data; > >+ }; > >+#else > > __u8 __user *rd_data; > >+#endif > > __u16 rd_size; > > > > __u16 bus; > >diff --git a/include/uapi/linux/uio.h b/include/uapi/linux/uio.h > >index 649739e0c404..27dfd6032dc6 100644 > >--- a/include/uapi/linux/uio.h > >+++ b/include/uapi/linux/uio.h > >@@ -16,8 +16,19 @@ > > > > struct iovec > > { > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ void __user *iov_base; /* BSD uses caddr_t (1003.1g requ= ires void *) */ > >+ __u64 __iov_base; > >+ }; > >+ union { > >+ __kernel_size_t iov_len; /* Must be size_t (1003.1g) */ > >+ __u64 __iov_len; > >+ }; > >+#else > > void __user *iov_base; /* BSD uses caddr_t (1003.1g requires voi= d *) */ > > __kernel_size_t iov_len; /* Must be size_t (1003.1g) */ > >+#endif > > }; > > > > struct dmabuf_cmsg { > >diff --git a/include/uapi/linux/usb/tmc.h b/include/uapi/linux/usb/tmc.h > >index d791cc58a7f0..443ec5356caf 100644 > >--- a/include/uapi/linux/usb/tmc.h > >+++ b/include/uapi/linux/usb/tmc.h > >@@ -51,7 +51,14 @@ struct usbtmc_request { > > > > struct usbtmc_ctrlrequest { > > struct usbtmc_request req; > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ void __user *data; /* pointer to user space */ > >+ __u64 __data; /* pointer to user space */ > >+ }; > >+#else > > void __user *data; /* pointer to user space */ > >+#endif > > } __attribute__ ((packed)); > > > > struct usbtmc_termchar { > >@@ -70,7 +77,14 @@ struct usbtmc_message { > > __u32 transfer_size; /* size of bytes to transfer */ > > __u32 transferred; /* size of received/written bytes */ > > __u32 flags; /* bit 0: 0 =3D synchronous; 1 =3D asynchronous */ > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ void __user *message; /* pointer to header and data in us= er space */ > >+ __u64 __message; > >+ }; > >+#else > > void __user *message; /* pointer to header and data in user space= */ > >+#endif > > } __attribute__ ((packed)); > > > > /* Request values for USBTMC driver's ioctl entry point */ > >diff --git a/include/uapi/linux/usbdevice_fs.h b/include/uapi/linux/usbd= evice_fs.h > >index 74a84e02422a..8c8efef74c3c 100644 > >--- a/include/uapi/linux/usbdevice_fs.h > >+++ b/include/uapi/linux/usbdevice_fs.h > >@@ -44,14 +44,28 @@ struct usbdevfs_ctrltransfer { > > __u16 wIndex; > > __u16 wLength; > > __u32 timeout; /* in milliseconds */ > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ void __user *data; > >+ __u64 __data; > >+ }; > >+#else > > void __user *data; > >+#endif > > }; > > > > struct usbdevfs_bulktransfer { > > unsigned int ep; > > unsigned int len; > > unsigned int timeout; /* in milliseconds */ > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ void __user *data; > >+ __u64 __data; > >+ }; > >+#else > > void __user *data; > >+#endif > > }; > > > > struct usbdevfs_setinterface { > >@@ -61,7 +75,14 @@ struct usbdevfs_setinterface { > > > > struct usbdevfs_disconnectsignal { > > unsigned int signr; > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ void __user *context; > >+ __u64 __context; > >+ }; > >+#else > > void __user *context; > >+#endif > > }; > > > > #define USBDEVFS_MAXDRIVERNAME 255 > >@@ -119,7 +140,14 @@ struct usbdevfs_urb { > > unsigned char endpoint; > > int status; > > unsigned int flags; > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ void __user *buffer; > >+ __u64 __buffer; > >+ }; > >+#else > > void __user *buffer; > >+#endif > > int buffer_length; > > int actual_length; > > int start_frame; > >@@ -130,7 +158,14 @@ struct usbdevfs_urb { > > int error_count; > > unsigned int signr; /* signal to be sent on completion, > > or 0 if none should be sent. */ > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ void __user *usercontext; > >+ __u64 __usercontext; > >+ }; > >+#else > > void __user *usercontext; > >+#endif > > struct usbdevfs_iso_packet_desc iso_frame_desc[]; > > }; > > > >@@ -139,7 +174,14 @@ struct usbdevfs_ioctl { > > int ifno; /* interface 0..N ; negative numbers rese= rved */ > > int ioctl_code; /* MUST encode size + direction of data s= o the > > * macros in give correct v= alues */ > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ void __user *data; /* param buffer (in, or out) */ > >+ __u64 __pad; > >+ }; > >+#else > > void __user *data; /* param buffer (in, or out) */ > >+#endif > > }; > > > > /* You can do most things with hubs just through control messages, > >@@ -195,9 +237,17 @@ struct usbdevfs_streams { > > #define USBDEVFS_SUBMITURB _IOR('U', 10, struct usbdevfs_urb) > > #define USBDEVFS_SUBMITURB32 _IOR('U', 10, struct usbdevfs_urb32) > > #define USBDEVFS_DISCARDURB _IO('U', 11) > >+#if __riscv_xlen =3D=3D 64 > >+#define USBDEVFS_REAPURB _IOW('U', 12, __u64) > >+#else > > #define USBDEVFS_REAPURB _IOW('U', 12, void *) > >+#endif > > #define USBDEVFS_REAPURB32 _IOW('U', 12, __u32) > >+#if __riscv_xlen =3D=3D 64 > >+#define USBDEVFS_REAPURBNDELAY _IOW('U', 13, __u64) > >+#else > > #define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *) > >+#endif > > #define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32) > > #define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_discon= nectsignal) > > #define USBDEVFS_DISCSIGNAL32 _IOR('U', 14, struct usbdevfs_discon= nectsignal32) > >diff --git a/include/uapi/linux/uvcvideo.h b/include/uapi/linux/uvcvideo= .h > >index f86185456dc5..3ccb99039a43 100644 > >--- a/include/uapi/linux/uvcvideo.h > >+++ b/include/uapi/linux/uvcvideo.h > >@@ -54,7 +54,14 @@ struct uvc_xu_control_mapping { > > __u32 v4l2_type; > > __u32 data_type; > > > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ struct uvc_menu_info __user *menu_info; > >+ __u64 __menu_info; > >+ }; > >+#else > > struct uvc_menu_info __user *menu_info; > >+#endif > > __u32 menu_count; > > > > __u32 reserved[4]; > >@@ -66,7 +73,14 @@ struct uvc_xu_control_query { > > __u8 query; /* Video Class-Specific Request Code, */ > > /* defined in linux/usb/video.h A.8. */ > > __u16 size; > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ __u8 __user *data; > >+ __u64 __data; > >+ }; > >+#else > > __u8 __user *data; > >+#endif > > }; > > > > #define UVCIOC_CTRL_MAP _IOWR('u', 0x20, struct uvc_xu_co= ntrol_mapping) > >diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h > >index c8dbf8219c4f..0a1dc2a780fb 100644 > >--- a/include/uapi/linux/vfio.h > >+++ b/include/uapi/linux/vfio.h > >@@ -1570,7 +1570,14 @@ struct vfio_iommu_type1_dma_map { > > struct vfio_bitmap { > > __u64 pgsize; /* page size for bitmap in bytes */ > > __u64 size; /* in bytes */ > >+ #if __riscv_xlen =3D=3D 64 > >+ union { > >+ __u64 __user *data; /* one bit per page */ > >+ __u64 __data; > >+ }; > >+ #else > > __u64 __user *data; /* one bit per page */ > >+ #endif > > }; > > > > /** > >diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videode= v2.h > >index e7c4dce39007..8e5391f07626 100644 > >--- a/include/uapi/linux/videodev2.h > >+++ b/include/uapi/linux/videodev2.h > >@@ -1898,7 +1898,14 @@ struct v4l2_ext_controls { > > __u32 error_idx; > > __s32 request_fd; > > __u32 reserved[1]; > >+#if __riscv_xlen =3D=3D 64 > >+ union { > >+ struct v4l2_ext_control *controls; > >+ __u64 __controls; > >+ }; > >+#else > > struct v4l2_ext_control *controls; > >+#endif > > }; > > > > #define V4L2_CTRL_ID_MASK (0x0fffffff) > >-- > >2.40.1 > > > > --=20 Best Regards Guo Ren