From owner-svn-src-stable-12@freebsd.org Sun Aug 23 20:12:09 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3857D3C912A; Sun, 23 Aug 2020 20:12:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZRHY0pCRz4Qtl; Sun, 23 Aug 2020 20:12:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F358DCF9B; Sun, 23 Aug 2020 20:12:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NKC8JJ014693; Sun, 23 Aug 2020 20:12:08 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NKC8wi014687; Sun, 23 Aug 2020 20:12:08 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202008232012.07NKC8wi014687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 23 Aug 2020 20:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r364525 - in stable/12/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in stable/12/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux X-SVN-Commit-Revision: 364525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 20:12:09 -0000 Author: trasz Date: Sun Aug 23 20:12:07 2020 New Revision: 364525 URL: https://svnweb.freebsd.org/changeset/base/364525 Log: MFC r356241: Add basic getcpu(2) support to linuxulator. The purpose of this syscall is to query the CPU number and the NUMA domain the calling thread is currently running on. The third argument is ignored. It doesn't do anything regarding scheduling - it's literally just a way to query the current state, without any guarantees you won't get rescheduled an opcode later. This unbreaks Java from CentOS 8 (java-11-openjdk-11.0.5.10-0.el8_0.x86_64). Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/amd64/linux/linux_dummy.c stable/12/sys/amd64/linux32/linux32_dummy.c stable/12/sys/arm64/linux/linux_dummy.c stable/12/sys/compat/linux/linux_misc.c stable/12/sys/i386/linux/linux_dummy.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/12/sys/amd64/linux/linux_dummy.c Sun Aug 23 20:10:10 2020 (r364524) +++ stable/12/sys/amd64/linux/linux_dummy.c Sun Aug 23 20:12:07 2020 (r364525) @@ -102,8 +102,6 @@ DUMMY(tee); DUMMY(vmsplice); /* Linux 2.6.18: */ DUMMY(move_pages); -/* Linux 2.6.19: */ -DUMMY(getcpu); /* Linux 2.6.22: */ DUMMY(signalfd); /* Linux 2.6.27: */ Modified: stable/12/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/12/sys/amd64/linux32/linux32_dummy.c Sun Aug 23 20:10:10 2020 (r364524) +++ stable/12/sys/amd64/linux32/linux32_dummy.c Sun Aug 23 20:12:07 2020 (r364525) @@ -108,8 +108,6 @@ DUMMY(tee); DUMMY(vmsplice); /* Linux 2.6.18: */ DUMMY(move_pages); -/* Linux 2.6.19: */ -DUMMY(getcpu); /* Linux 2.6.22: */ DUMMY(signalfd); /* Linux 2.6.27: */ Modified: stable/12/sys/arm64/linux/linux_dummy.c ============================================================================== --- stable/12/sys/arm64/linux/linux_dummy.c Sun Aug 23 20:10:10 2020 (r364524) +++ stable/12/sys/arm64/linux/linux_dummy.c Sun Aug 23 20:12:07 2020 (r364525) @@ -104,8 +104,6 @@ DUMMY(tee); DUMMY(vmsplice); /* Linux 2.6.18: */ DUMMY(move_pages); -/* Linux 2.6.19: */ -DUMMY(getcpu); /* Linux 2.6.27: */ DUMMY(signalfd4); DUMMY(inotify_init1); Modified: stable/12/sys/compat/linux/linux_misc.c ============================================================================== --- stable/12/sys/compat/linux/linux_misc.c Sun Aug 23 20:10:10 2020 (r364524) +++ stable/12/sys/compat/linux/linux_misc.c Sun Aug 23 20:12:07 2020 (r364525) @@ -2691,3 +2691,19 @@ out: td->td_retval[0] = dst - args->buf; return (error); } + +int +linux_getcpu(struct thread *td, struct linux_getcpu_args *args) +{ + int cpu, error, node; + + cpu = td->td_oncpu; /* Make sure it doesn't change during copyout(9) */ + error = 0; + node = 0; /* XXX: Fake NUMA node 0 for now */ + + if (args->cpu != NULL) + error = copyout(&cpu, args->cpu, sizeof(l_int)); + if (args->node != NULL) + error = copyout(&node, args->node, sizeof(l_int)); + return (error); +} Modified: stable/12/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/12/sys/i386/linux/linux_dummy.c Sun Aug 23 20:10:10 2020 (r364524) +++ stable/12/sys/i386/linux/linux_dummy.c Sun Aug 23 20:12:07 2020 (r364525) @@ -104,8 +104,6 @@ DUMMY(tee); DUMMY(vmsplice); /* Linux 2.6.18: */ DUMMY(move_pages); -/* Linux 2.6.19: */ -DUMMY(getcpu); /* Linux 2.6.22: */ DUMMY(signalfd); /* Linux 2.6.27: */