From patchwork Sat Aug 15 21:31:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 40270 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DD3F73857C50; Sat, 15 Aug 2020 21:31:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD3F73857C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1597527104; bh=EnH7Nhh9k/IU+FY0DbdUEI3HisuIpTrbUWWHPaxdssA=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=LqrIRInYnZOFtuHmwcaH4gp5iwDyOZFKhl3VP1o40/sDDU4lxlZ9yYUrcpUuS+gaz T7B009+9cFF48gr+/ZGTPytKMoQxlmjJUjFyszGBpJUMOz95PyIty12cqY7iFIG/yo aS5V4rrDSVERjsLEBXVX71NLii+PZTcAi2QFRULA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by sourceware.org (Postfix) with ESMTPS id BBB7B3857C50 for ; Sat, 15 Aug 2020 21:31:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BBB7B3857C50 Received: by mail-pj1-x1043.google.com with SMTP id ep8so5876232pjb.3 for ; Sat, 15 Aug 2020 14:31:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=EnH7Nhh9k/IU+FY0DbdUEI3HisuIpTrbUWWHPaxdssA=; b=l58pN6Fd9P+7U1AWeM0K5oK1vuqqhUq1N7pQr7vah62QT20K14fW+N6ZnDi5YIDn0j TbhJrx9kVJIChaasnjlRDTvMqWEzraI+15B9YoFWO/m9kJ+xSdJhv8NWn4v29LE9xkvi 9kF49HHfn51TRCOaq+3QIofEFwT7tQfJkZMO9AKNIo5wbRNd8zl/6nPfT+2GLz1R/rjv uwZWdeKrgqF7RVos/jlybGHkOOIXsyc83WayFWDm/b6u9C+fJ795fHLtVNPo4/azyJoA N400dYWB8y/oLSvYaOWW/WneTc5Cp1hhFtOCRiMqo0Z6jBsDPz90VEQL4AzG4xxYwPkP XguA== X-Gm-Message-State: AOAM533+5Ru+xMNqRV9ccQM667pccXGRGfy7fBh7fQNsr8X+XSxeaji/ /5BART6inSQaTMP4esYVX0eKWC7pQvr0bA== X-Google-Smtp-Source: ABdhPJycvKO24gH/nJ/dMogQ1bxbI/Uojdm7P2w2U7h1ctsoPAzRSlGfklBzK6cEyN6V1hg3UdgdDA== X-Received: by 2002:a17:90a:7485:: with SMTP id p5mr1401386pjk.130.1597527100600; Sat, 15 Aug 2020 14:31:40 -0700 (PDT) Received: from gnu-cfl-2.localdomain (c-69-181-90-243.hsd1.ca.comcast.net. [69.181.90.243]) by smtp.gmail.com with ESMTPSA id 12sm12914224pfn.173.2020.08.15.14.31.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Aug 2020 14:31:39 -0700 (PDT) Received: from gnu-cfl-2.localdomain (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id 080151A0168 for ; Sat, 15 Aug 2020 14:31:39 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH] x32: Add and regenerate arch-syscall.h Date: Sat, 15 Aug 2020 14:31:38 -0700 Message-Id: <20200815213138.1375595-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Libc-alpha" From: "H.J. Lu" Reply-To: "H.J. Lu" Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" X32 uses the same 64-bit syscall interface for set_thread_area. But __NR_set_thread_area is missing from . A kernel patch was submitted: From 7b05d5b43ae2545e0d4a3edb24205d18bc883626 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sat, 15 Aug 2020 10:34:00 -0700 Subject: [PATCH] x86-64: Enable x32 set_thread_area X32 uses the common 64-bit syscall interface for set_thread_area. Tested with tools/testing/selftests/x86/sigreturn.c on x32. Signed-off-by: H.J. Lu --- arch/x86/entry/syscalls/syscall_64.tbl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl index 37b844f839bc..670193a73f6e 100644 --- a/arch/x86/entry/syscalls/syscall_64.tbl +++ b/arch/x86/entry/syscalls/syscall_64.tbl @@ -213,7 +213,7 @@ 202 common futex sys_futex 203 common sched_setaffinity sys_sched_setaffinity 204 common sched_getaffinity sys_sched_getaffinity -205 64 set_thread_area +205 common set_thread_area 206 64 io_setup sys_io_setup 207 common io_destroy sys_io_destroy 208 common io_getevents sys_io_getevents -- 2.26.2 Add for older kernel header files and regenerate x32 arch-syscall.h. --- sysdeps/unix/sysv/linux/x86/include/asm/unistd_x32.h | 9 +++++++++ sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h | 1 + 2 files changed, 10 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/x86/include/asm/unistd_x32.h diff --git a/sysdeps/unix/sysv/linux/x86/include/asm/unistd_x32.h b/sysdeps/unix/sysv/linux/x86/include/asm/unistd_x32.h new file mode 100644 index 0000000000..4de22a7737 --- /dev/null +++ b/sysdeps/unix/sysv/linux/x86/include/asm/unistd_x32.h @@ -0,0 +1,9 @@ +/* FIXME: __NR_set_thread_area should come from the kernel header file. + This file should be removed if from the kernel + header file contains __NR_set_thread_area. */ + +#include_next + +#ifndef __NR_set_thread_area +# define __NR_set_thread_area 1073742029 +#endif diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h b/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h index 1a701c1472..7b64b1fa0c 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h +++ b/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h @@ -260,6 +260,7 @@ #define __NR_sendto 1073741868 #define __NR_set_mempolicy 1073742062 #define __NR_set_robust_list 1073742354 +#define __NR_set_thread_area 1073742029 #define __NR_set_tid_address 1073742042 #define __NR_setdomainname 1073741995 #define __NR_setfsgid 1073741947