Skip to content

add support for loongarch#46

Open
wuruilong01 wants to merge 120 commits into
kernelslacker:masterfrom
wuruilong01:master
Open

add support for loongarch#46
wuruilong01 wants to merge 120 commits into
kernelslacker:masterfrom
wuruilong01:master

Conversation

@wuruilong01

Copy link
Copy Markdown

No description provided.

kernelslacker and others added 30 commits September 18, 2017 20:13
Still needs some cleanup, but this is a braindump of my private TODO
that has a mix of old/new stuff.
These are usually only seen by libc, and never passed on to apps,
but Trinity is doing raw syscalls, so we have to worry about these.
This patch brings perf_event_open() support up to date as of 4.14-rc6.

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
In file included from ioctls/autofs.c:4:0:
ioctls/autofs.c:241:8: error: 'AUTOFS_IOC_EXPIRE_INDIRECT' undeclared here (not in a function); did you mean 'AUTOFS_IOC_EXPIRE_CMD'?
  IOCTL(AUTOFS_IOC_EXPIRE_INDIRECT),
        ^
include/ioctls.h:53:15: note: in definition of macro 'IOCTL'
  { .request = _request, .name = #_request, }
               ^~~~~~~~
ioctls/autofs.c:242:8: error: 'AUTOFS_IOC_EXPIRE_DIRECT' undeclared here (not in a function); did you mean 'AUTOFS_IOC_EXPIRE_INDIRECT'?
  IOCTL(AUTOFS_IOC_EXPIRE_DIRECT),
        ^
include/ioctls.h:53:15: note: in definition of macro 'IOCTL'
  { .request = _request, .name = #_request, }
               ^~~~~~~~

Define them as AUTOFS_IOC_EXPIRE_MULTI as they used to be.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Commit 1f28c5d055032e7e8ee5e48198dca7e125d0eec6
("autofs: remove unused AUTOFS_IOC_EXPIRE_DIRECT/INDIRECT")

in the linux kernel removed the 2 defines
AUTOFS_IOC_EXPIRE_INDIRECT
AUTOFS_IOC_EXPIRE_DIRECT

Since they are used unconditionally the build fails.
To fix this add #ifdef/#endif around it.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Update and add some comments on the system call
tables for s390x (64bit) and s390 (31bit).

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Add support for s390x (64 bit) and s390 (31 bit)
support for system calls preadv2 and pwritev2.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Add support for s390x (64 bit) and s390 (31 bit)
support for system call statx.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Add support for s390x (64 bit) and s390 (31 bit)
support for system call mlock2.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Add support for s390x (64 bit) and s390 (31 bit)
support for system call copy_file_range.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Add support for system call readdir on s390 (31 bit).

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
This patch adds support for the s390 specific system
call runtime_instr() for 31 and 64 bit.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Add support for s390 specific system calls
s390_pci_mmio_read and 390_pci_mmio_write
for 31 bit and 64 bit.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Add support for s390 specific system call s390_guarded_storage
for 31 bit and 64 bit.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Add support for s390 specific system call s390_sthyi
for 31 bit and 64 bit.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
	modified:   ioctls/sgx.c
kernelslacker and others added 27 commits March 30, 2021 13:54
Fix the following build failure with kernel >= 5.13:

In file included from /home/buildroot/autobuild/instance-2/output-1/host/powerpc-buildroot-linux-uclibc/sysroot/usr/include/linux/icmp.h:23,
                 from net/proto-ip-raw.c:1:
/home/buildroot/autobuild/instance-2/output-1/host/powerpc-buildroot-linux-uclibc/sysroot/usr/include/netinet/in.h:33:5: error: redeclaration of enumerator 'IPPROTO_IP'
   33 |     IPPROTO_IP = 0,    /* Dummy protocol for TCP.  */
      |     ^~~~~~~~~~
/home/buildroot/autobuild/instance-2/output-1/host/powerpc-buildroot-linux-uclibc/sysroot/usr/include/linux/in.h:29:3: note: previous definition of 'IPPROTO_IP' was here
   29 |   IPPROTO_IP = 0,  /* Dummy protocol for TCP  */
      |   ^~~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/c58119baed8d7711da799e34a5ee1117f46b96f4

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Should fix:

In file included from /usr/include/bits/statx.h:31,
                 from /usr/include/sys/stat.h:446,
                 from include/files.h:3,
                 from include/shm.h:6,
                 from syscalls/x86/modify_ldt.c:12:
/usr/include/linux/stat.h:57:2: error: unknown type name ‘__s64’
  __s64 tv_sec;
  ^~~~~
/usr/include/linux/stat.h:58:2: error: unknown type name ‘__u32’
  __u32 tv_nsec;
  ^~~~~
/usr/include/linux/stat.h:59:2: error: unknown type name ‘__s32’
  __s32 __reserved;
  ^~~~~
/usr/include/linux/stat.h:101:2: error: unknown type name ‘__u32’
  __u32 stx_mask; /* What results were written [uncond] */
When one child is corrupt,we want to know who is corrupt. But when
it corrupts other one's shm,we can not know who caused the corruption.
So protect other children from corruption.

Signed-off-by: Hongchen Zhang <zhanghongchen@loongson.cn>
protect other children's shm from corruption
When a child process tests timer_create interface with sigev->sigev_signo
equal to SIGINT, and then timer_settime let the timer go.When the timer
has expired, a SIGINT would send to our child process. But SIGINT signal
means ctrl-c is pressed,and then trinity-main will exit.

To Avoid it, do not let timer_create create a timer with
sigev->sigev_signo equal to SIGINT.

Change-Id: I3aa1b99ff447a4a0a8bc2a9d33cf91f7e48cd275
Signed-off-by: Hongchen Zhang <zhanghongchen@loongson.cn>
This only adds support for riscv64, riscv32 is not included. The riscv64
syscall table is very close to aarch64 with small difference.

Signed-off-by: Changbin Du <changbin.du@gmail.com>
fds/drm.c: In function ‘drmfd_dump’:
fds/drm.c:31:49: warning: unused parameter ‘global’ [-Wunused-parameter]
   31 | static void drmfd_dump(struct object *obj, bool global)
      |                                            ~~~~~^~~~~~

Print 'global' to fix warning.
Trinity on cpus which have many cores may open large number of
child->pidstatfile, and may be reach the limition(1024 on most
platforms), so just panic and warn user to increase the limition.
nukes those warnings like..

main.c:467:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

because it isn't 1990 any more.
this needs >10000 threads, but gcc has started warning, so this shuts it up
Both sockaddr_pn and sockaddr_pppox are defined as "packed"
on x86-64, unlike struct sockaddr, which generates warnings
like this:

net/proto-phonet.c: In function ‘phonet_gen_sockaddr’:
net/proto-phonet.c:22:18: warning: converting a packed ‘struct sockaddr_pn’ pointer (alignment 1) to a ‘struct sockaddr’ pointer (alignment 2) may result in an unaligned pointer value [-Waddress-of-packed-member]
   22 |  *addr = (struct sockaddr *) pn;
      |                  ^~~~~~~~
In file included from net/proto-phonet.c:5:
/usr/include/linux/phonet.h:102:8: note: defined here
  102 | struct sockaddr_pn {
      |        ^~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/socket.h:33,
                 from net/proto-phonet.c:2:
/usr/include/x86_64-linux-gnu/bits/socket.h:178:8: note: defined here
  178 | struct sockaddr
      |        ^~~~~~~~

I'm pretty sure the alignment is fine as other things would
be broken if they weren't, so just ignore the warnings in
these two files.
Drop decnet as it has been removed since kernel 6.1 and
torvalds/linux@1202cdd
resulting in the following build failure:

net/proto-decnet.c:5:10: fatal error: linux/dn.h: No such file or directory
    5 | #include <linux/dn.h>
      |          ^~~~~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/47e0a5e0b6fcf33ab4f9848d5d8c2be9e5283950

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
It was dropped in upstream in commit 61e15f871241 (KVM: Delete all
references to removed KVM_SET_MEMORY_REGION ioctl).

Co-authored-by: Jiri Slaby <jslaby@suse.cz>
…viders. (kernelslacker#43)

Signed-off-by: Weisson <hanxiaobupt@bupt.cn>
Co-authored-by: Weisson <wenshu.hx@alibaba-inc.com>
kernel v6.3-rc1 removed some drm drivers, so add the extra check to make
the compile succeed.

7872bc2cb13e drm: Remove the obsolete driver-savage
28483b8666bf drm: Remove the obsolete driver-r128
96ed7db55bef drm: Remove the obsolete driver-mga
cab18866fead drm: Remove the obsolete driver-i810

Signed-off-by: Chunyu Hu <chuhu@redhat.com>
Some IOCTL_NOUVEAU tests are checked under USE_DRM_MGA macro, this is
not correct, correct it.

Fixes: 6823bac (ioctls/drm: check i810,mga,r128 and savage support (kernelslacker#44))

Signed-off-by: Chunyu Hu <chuhu@redhat.com>

@kernelslacker kernelslacker left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loongarch bits look ok, the other bits should be broken out, with separate explanations/commits.

Comment thread ioctls/autofs.c

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this part should be a separate diff.

Comment thread ioctls/scsi.c

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separate diff.

Comment thread syscalls/vmsplice.c

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separate diff, and some explanation why ?

Comment thread sysv-shm.c

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separate diff too.

@wuruilong01

Copy link
Copy Markdown
Author

Other files have been fixed for bugs caused by SEGV and tested on LoongArch.

  • the used address to fill data should exist,otherwise trinity may get SEGV signal.
  • arg3type of vmsplice is ARG_IOVECLEN,if you modify it,you should also modify arg2 accordingly.

Sorry, I'm a beginner; perhaps fixing the errors should be done in the next submission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.