From patchwork Fri Nov 25 09:42:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 25897 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3887385wrr; Fri, 25 Nov 2022 01:45:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf714yPy56/PgVJceamu6bMIvr9qCiyyUyH+H5CWEOi462OfOEbWOQwBB7whA94zXZOCQg7X X-Received: by 2002:a17:90a:7304:b0:20a:9810:86ab with SMTP id m4-20020a17090a730400b0020a981086abmr44694420pjk.10.1669369501212; Fri, 25 Nov 2022 01:45:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669369501; cv=none; d=google.com; s=arc-20160816; b=ZOjYKBWduuNRyuIMVsw6Ksg3K6DpCkr2YNYeHWFGISMEIuIuu2WZ5PQpilk8zFG5NZ dONiyqNQjnBfIpOmx+9FmqTcMyDDbj8rYnfUbOGV0whURas25QG0Mo2BNac3cgyLChcv T9TU6tQcStsUyrDhOyEHfXE5m0ObDPWL53nmCAse1ntPwcnBeEI1ducMOZifjW0Ppp5W WWfirdmTBNGCpgnyXt9Iv/StS+kwFDjk9x2awb8/2Kz+502naEz/6JleoHezoIhO4s73 gigt9hqo8QvDS8tOzfrmfk/UO+GgqbWqoIFXXNcJJVCBDuPVrZf0M0fveBWer6GVufLA 9EBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=SYtDKXEAvjEf1YJAc3x9GyPrR/5UvNDnbCTQFLZPR1w=; b=CB8p3PTCJn7XDs+HoucLkbLnuPPJbotQgpABoQMyg3u4PEHh3cHCRGRoL+2JSP11YO S7v2dVH9IyCI48ajRGkU2bI1F43JIfMPVdn/bJfPNvo8ORh5ifQIyF62c0sjXibI7GnR gKQT2FKeqTL7iTPDS4d37DaFgDrT1HRGNT2q7+LQmFSXnScXa33MYVNDQCDn+dMqispZ QdR6g8ZJ4PEs08AnHeCENSzHPti1shZVDfcZjMsZQGv+U+KcDIKc3m2EwFBVkKmLfZWF iF6TYzpOI8qfOhXgN1EXwqqa+YPqcJD6jdHRNDFf9b+4qPIqYCRH0QjJTdGQVGSnv6FQ X8tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JPV14Mvt; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=ZJrOcsZX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d6-20020a17090ab30600b00213566a9fa9si6265311pjr.25.2022.11.25.01.44.48; Fri, 25 Nov 2022 01:45:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JPV14Mvt; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=ZJrOcsZX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229767AbiKYJmz (ORCPT + 99 others); Fri, 25 Nov 2022 04:42:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbiKYJmo (ORCPT ); Fri, 25 Nov 2022 04:42:44 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08D061A830 for ; Fri, 25 Nov 2022 01:42:38 -0800 (PST) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669369357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SYtDKXEAvjEf1YJAc3x9GyPrR/5UvNDnbCTQFLZPR1w=; b=JPV14MvtFeNQp++zT40Gqm8cARU4bfG1isYMsoAiY1/WXq385FYLd5KVgD+uhAhEduV7+I 3BtKsCL85s+p2MsSjLeMIAOvX2eeX5zSYJxvQ0UPRqKVhGOVoQ9PykSJt583Z0Ng7fWAJR JAtZlCwKakltdLb8YhYyzKZnsT/sLaorNW9qJeTzwhU9Ftvwkx1yglWnCi0SrsTGvzzzCk FLOYri3OJzFJWDHT64mHZpecz/Sxm/2quSGXl0jqPjMQKmJWW3G/trbwIqSABjauBA6wZH +feookW5xemzgdB6E4xZtS1FJ06AespFxKvlVRJZ/+h4aduc06DCdMCmuhmWXA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669369357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SYtDKXEAvjEf1YJAc3x9GyPrR/5UvNDnbCTQFLZPR1w=; b=ZJrOcsZXlB3YdtykG4rliywnUljEYGheHx6C02eBpywX2uS5WzsXsWv+L2J327+YyJPnYD yKGYZo+bYQc4o4BQ== To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Roland Mainz , "H. Peter Anvin" , Borislav Petkov , Dave Hansen , Ingo Molnar , Thomas Gleixner , Sebastian Andrzej Siewior Subject: [PATCH 1/3] x86: Provide a full setup for getcpu on x86-32. Date: Fri, 25 Nov 2022 10:42:14 +0100 Message-Id: <20221125094216.3663444-2-bigeasy@linutronix.de> In-Reply-To: <20221125094216.3663444-1-bigeasy@linutronix.de> References: <20221125094216.3663444-1-bigeasy@linutronix.de> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750460794242625564?= X-GMAIL-MSGID: =?utf-8?q?1750460794242625564?= setup_getcpu() configures two things: - writes the current CPU & node information into the MSR_TSC_AUX. - writes the same information as a GDT entry. By using the "full" setup_getcpu() on i386 it is possible to read the CPU information in userland via rdtscp. Provide an GDT_ENTRY_CPUNODE for x86-32. Move the CONFIG_X86_64 so the x86-64 implementation becomes also available for x86-32. Reviewed-By: Roland Mainz Signed-off-by: Sebastian Andrzej Siewior --- arch/x86/include/asm/segment.h | 8 ++++---- arch/x86/kernel/cpu/common.c | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h index 2e7890dd58a47..662281c2a907c 100644 --- a/arch/x86/include/asm/segment.h +++ b/arch/x86/include/asm/segment.h @@ -96,7 +96,7 @@ * * 26 - ESPFIX small SS * 27 - per-cpu [ offset to per-cpu data area ] - * 28 - unused + * 28 - VDSO getcpu * 29 - unused * 30 - unused * 31 - TSS for double fault handler @@ -119,6 +119,7 @@ #define GDT_ENTRY_ESPFIX_SS 26 #define GDT_ENTRY_PERCPU 27 +#define GDT_ENTRY_CPUNODE 28 #define GDT_ENTRY_DOUBLEFAULT_TSS 31 @@ -158,6 +159,8 @@ # define __KERNEL_PERCPU 0 #endif +#define __CPUNODE_SEG (GDT_ENTRY_CPUNODE*8 + 3) + #else /* 64-bit: */ #include @@ -226,8 +229,6 @@ #define GDT_ENTRY_TLS_ENTRIES 3 #define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES* 8) -#ifdef CONFIG_X86_64 - /* Bit size and mask of CPU number stored in the per CPU data (and TSC_AUX) */ #define VDSO_CPUNODE_BITS 12 #define VDSO_CPUNODE_MASK 0xfff @@ -265,7 +266,6 @@ static inline void vdso_read_cpunode(unsigned *cpu, unsigned *node) } #endif /* !__ASSEMBLY__ */ -#endif /* CONFIG_X86_64 */ #ifdef __KERNEL__ diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 3e508f2390983..520a0a2e765d3 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -2128,7 +2128,6 @@ static void wait_for_master_cpu(int cpu) #endif } -#ifdef CONFIG_X86_64 static inline void setup_getcpu(int cpu) { unsigned long cpudata = vdso_encode_cpunode(cpu, early_cpu_to_node(cpu)); @@ -2150,6 +2149,7 @@ static inline void setup_getcpu(int cpu) write_gdt_entry(get_cpu_gdt_rw(cpu), GDT_ENTRY_CPUNODE, &d, DESCTYPE_S); } +#ifdef CONFIG_X86_64 static inline void ucode_cpu_init(int cpu) { if (cpu) @@ -2169,8 +2169,6 @@ static inline void tss_setup_ist(struct tss_struct *tss) #else /* CONFIG_X86_64 */ -static inline void setup_getcpu(int cpu) { } - static inline void ucode_cpu_init(int cpu) { show_ucode_info_early(); From patchwork Fri Nov 25 09:42:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 25898 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3887700wrr; Fri, 25 Nov 2022 01:45:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf721gjw8ldX+yqoaIlPeyruLGfJLqfO8diQTewmKd0N4HamUcZvOKfWhXYfXjgjNcvLA0sV X-Received: by 2002:a17:903:2683:b0:186:6f1e:5087 with SMTP id jf3-20020a170903268300b001866f1e5087mr18106212plb.119.1669369538485; Fri, 25 Nov 2022 01:45:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669369538; cv=none; d=google.com; s=arc-20160816; b=LiNoRhhmx7CIh0yh+8O9RcFQ418CwsjwBKVCbOikHhdcSaMGyCZPqq3+a4DGFeuRHY DPN9yb6CzEnvvR9vF7pHmFZnyYgoG3h4L0SGEyX65DIJLo/Rif6W6HQ3n9g0MEWAz3uj przg03P5hMFhrBey056PIn9W0vZVtqT/5pzOaYSwjxZZklkBkNWjoUC7R5mz5kkmAnEf V6NXQlhXtDsG97IF4CdRVP8rB1kzbV7UhVVE/g4mMTCxf1xQY4tGJfA9esJ0xotQIdvi C1hUOCZ5SdXapIMfQoSS8UdIHqKFhgYDv+xY8/AhkttniI0S7p1Fb2Sonkg4lkDkE5b0 bQWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=ksDDcmQCY+1As7J2HctVpfMXUOEO/R8OEqcyPN1HAtc=; b=pzZSLuxI2onfZ2bZngAtl3tT5LiL/mAVFq2ydV7J8FxL7rQBXxXpKD7lVl3PFMOnvH h2SfijMf/0ZUnGo5XzWZmrJajnau++866oI7y5lqu4YiwyACn9wYb2rGv/SpsyBBYP7U nPTV4seLf5JKLOZ/2rlz7hCDXFcBkpva9wcBU3DrhZNngLPGec5sGRS248BQ+sXTJOEm 1kPw9CgEzpTSUDw870MUo6ZriS57D3Srmxj1Gy0XtJ/r3e3lTUI4CJtiB+9h5MFLR3Ps pWSy+pnjwYJnShrDS+5qSzCZgwad25BOySck4AEsyKgnRlrFb+cVgaESKTgquHLHa/0Z fP8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=sV3Ks6Wn; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=dGP36mBt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a16-20020a17090a8c1000b00214064c6c55si4401020pjo.50.2022.11.25.01.45.25; Fri, 25 Nov 2022 01:45:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=sV3Ks6Wn; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=dGP36mBt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229863AbiKYJnA (ORCPT + 99 others); Fri, 25 Nov 2022 04:43:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbiKYJmo (ORCPT ); Fri, 25 Nov 2022 04:42:44 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FDBB23BF9 for ; Fri, 25 Nov 2022 01:42:39 -0800 (PST) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669369357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ksDDcmQCY+1As7J2HctVpfMXUOEO/R8OEqcyPN1HAtc=; b=sV3Ks6WnkZ68pgk95VzupBIV3V6E8bwuylnssY4zHQwhs0VzeWVz3mq+F3DpVZmvr6RXC0 FyEifY8N1A2E3UQzxkJaS9OuijDNpIz/Bzn1b0H8eeoucEpBSGVRcYvgt3LQTR2ooxBI+f iogtYQ9zLp4PR3xG0tUVeAwIcjrQLIPh8m4fd6Zhm9qIHcGaqgSmK6MZc7bYWrbH7nqJaj gApVZUYjEg5JdGWG8H12V2q832ho0b5NSbcszudy5JxvW7qAXXrkIDHrbif3PEwye+P7lc DnvG27Dj6+vrh+qMLKwEmTGzthj5ulN43WArk0AheUHGMXKN2DatzcH0KTOxUg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669369357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ksDDcmQCY+1As7J2HctVpfMXUOEO/R8OEqcyPN1HAtc=; b=dGP36mBtjGK+hzexrC2h0GV58AMU2lCv//tdl3WWVpcD5QvjxW3lrHK6uuc3d8caDFXHjD 1XY/wPu77bAOe1Bw== To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Roland Mainz , "H. Peter Anvin" , Borislav Petkov , Dave Hansen , Ingo Molnar , Thomas Gleixner , Sebastian Andrzej Siewior Subject: [PATCH 2/3] x86/vdso: Provide getcpu for x86-32. Date: Fri, 25 Nov 2022 10:42:15 +0100 Message-Id: <20221125094216.3663444-3-bigeasy@linutronix.de> In-Reply-To: <20221125094216.3663444-1-bigeasy@linutronix.de> References: <20221125094216.3663444-1-bigeasy@linutronix.de> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750460832871547519?= X-GMAIL-MSGID: =?utf-8?q?1750460832871547519?= Wire up __vdso_getcpu() for x86-32. The version for 64bit can be reused. The defines must no be faked (like it is done for vclock_gettime.c) because we need the 64bit defines for the 32bit VDSO because the segment number of the host kernel is required. Reuse the vgetcpu.c for vdso32. Remove the time* header files which lead to compile errors on 32bit. Add segment.h which provides vdso_read_cpunode() and its requirements. Signed-off-by: Sebastian Andrzej Siewior --- arch/x86/entry/vdso/Makefile | 3 ++- arch/x86/entry/vdso/vdso32/vdso32.lds.S | 1 + arch/x86/entry/vdso/vdso32/vgetcpu.c | 2 ++ arch/x86/entry/vdso/vgetcpu.c | 3 +-- 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 arch/x86/entry/vdso/vdso32/vgetcpu.c diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile index 3e88b9df8c8f1..fcbcfc2b4e1a7 100644 --- a/arch/x86/entry/vdso/Makefile +++ b/arch/x86/entry/vdso/Makefile @@ -29,7 +29,7 @@ VDSO32-$(CONFIG_IA32_EMULATION) := y # files to link into the vdso vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o vobjs32-y := vdso32/note.o vdso32/system_call.o vdso32/sigreturn.o -vobjs32-y += vdso32/vclock_gettime.o +vobjs32-y += vdso32/vclock_gettime.o vdso32/vgetcpu.o vobjs-$(CONFIG_X86_SGX) += vsgx.o # files to link into kernel @@ -103,6 +103,7 @@ $(vobjs): KBUILD_AFLAGS += -DBUILD_VDSO CFLAGS_REMOVE_vclock_gettime.o = -pg CFLAGS_REMOVE_vdso32/vclock_gettime.o = -pg CFLAGS_REMOVE_vgetcpu.o = -pg +CFLAGS_REMOVE_vdso32/vgetcpu.o = -pg CFLAGS_REMOVE_vsgx.o = -pg # diff --git a/arch/x86/entry/vdso/vdso32/vdso32.lds.S b/arch/x86/entry/vdso/vdso32/vdso32.lds.S index c7720995ab1af..8a3be07006bb6 100644 --- a/arch/x86/entry/vdso/vdso32/vdso32.lds.S +++ b/arch/x86/entry/vdso/vdso32/vdso32.lds.S @@ -28,6 +28,7 @@ VERSION __vdso_time; __vdso_clock_getres; __vdso_clock_gettime64; + __vdso_getcpu; }; LINUX_2.5 { diff --git a/arch/x86/entry/vdso/vdso32/vgetcpu.c b/arch/x86/entry/vdso/vdso32/vgetcpu.c new file mode 100644 index 0000000000000..b777f84ffae9b --- /dev/null +++ b/arch/x86/entry/vdso/vdso32/vgetcpu.c @@ -0,0 +1,2 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "../vgetcpu.c" diff --git a/arch/x86/entry/vdso/vgetcpu.c b/arch/x86/entry/vdso/vgetcpu.c index b88a82bbc3593..0a9007c240568 100644 --- a/arch/x86/entry/vdso/vgetcpu.c +++ b/arch/x86/entry/vdso/vgetcpu.c @@ -7,8 +7,7 @@ #include #include -#include -#include +#include notrace long __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused) From patchwork Fri Nov 25 09:42:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 25902 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3888081wrr; Fri, 25 Nov 2022 01:46:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf5cjWYr5E8lgp6I8+aWp8MRAUCOcfZqRMUqzQFPTEfnDNn/GAkjs9fqdKD0AQ43TpDZ8itM X-Received: by 2002:a17:906:1c56:b0:7bb:344a:3c30 with SMTP id l22-20020a1709061c5600b007bb344a3c30mr5777943ejg.692.1669369584041; Fri, 25 Nov 2022 01:46:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669369584; cv=none; d=google.com; s=arc-20160816; b=yW1OEw9QOMJ+fEBtgXUot1QKE2RchSEJX0hpwuW74H0KJ4QhviEfRy/B5Q6gwOf4bR xN81dQA2Zlz4eL3ZCvSB41tHU/DhzeCcqtwUh6YDIXcImcFa3x/lB5WzvtUisEQMkSYB UUQ4gkNX179kvwAw0z/86n0H4ZicILgmoa9Cw/ed86DxLm5OHHy3wMlWCnANRBgFFkvM 3msjGsIOtW0gEOT+r4k0T5ApZr6ErotN09lIkVn1/5bhd3YNfBpc0/6A6+IAfLLfSTwU HEe9tePgOGb1tleX7/qwj2WPp/DZgD6emlRt86cdvbLDb3KeY3N/BVDbQFp/RQ8KTaCN t5yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=tkHfIWZ+AXddA17Vln4Zv2kJvTG9y3spaF3cG2QDrJU=; b=SfXeWTPmuO76r/xVRSqZIB/X2HOxWB4xApEyijAu8MPCbteai2m/f4sfkHIKeSyENh scTjDu5yYbd2cxnhf+7j4/dYYjuyOMymrNq6lor+poymvXUvwpHuW9X46Gd1RrB5yn5C 4G7OZ2jlIAwAPyhb5a6MmxjzK+oB7AMApn+N18JK30C45TsDsJNs0xepnyigh1fQ53BO RVUrkT2iqRpU3qt3G80ss9E1tinaMjufi5zj8WTWlow1gikR5ll5btb3aZ2jTKLyx2Cm 4ba85De58nT8bttcxu5hXpYWrRC3vBR2Ju8rSPRN7b83OEKpj81Qn7XEJGi7nBm3Kbb2 GTHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=U9GnlAVl; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc34-20020a1709078a2200b007808f3f4cbcsi3438417ejc.239.2022.11.25.01.46.00; Fri, 25 Nov 2022 01:46:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=U9GnlAVl; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229775AbiKYJnE (ORCPT + 99 others); Fri, 25 Nov 2022 04:43:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229778AbiKYJmo (ORCPT ); Fri, 25 Nov 2022 04:42:44 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FE2E23BFE; Fri, 25 Nov 2022 01:42:39 -0800 (PST) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669369357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tkHfIWZ+AXddA17Vln4Zv2kJvTG9y3spaF3cG2QDrJU=; b=U9GnlAVlA00LESkky61O56pvX9stU5T9eAGYoI06mvV7ObkG7eQmZw6BDKMJpjzb2Kbcgk P1ikq9bsh06PjSX/DyKKNpGxfl2CQ8m/Mk+dh0w7bYfH/1x2spaJjayHM+MaDoca7aa9JI nIvyEv2d4dlgkxMZulNU0mjKoHHCbOEMizE2XD1EKKWQPPsJ8nIU14EdvsBJHugSEDslJL YlcepZNvqBFqYfWMdS5dzjpPFtSExSayFWDbMDYYKWPtVEnkjoiKfO6nVsg6Y9v93CtD/0 Jd2JSPaq08cS/ZivTWkdb6I18BxKL7z1HPbWK4ZtOVdoDrGqUDEqj9x4uh8tXA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669369357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tkHfIWZ+AXddA17Vln4Zv2kJvTG9y3spaF3cG2QDrJU=; b=/nPSkX2ux5m+/P5mpV/FRizufVbb7UsOHs/O4CpzXs35wg3eH1hgnEmBsJAVPHcsxjOrHX AxcsAWw9yHd7pzDg== To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Roland Mainz , "H. Peter Anvin" , Borislav Petkov , Dave Hansen , Ingo Molnar , Thomas Gleixner , Sebastian Andrzej Siewior , Shuah Khan , linux-kselftest@vger.kernel.org Subject: [PATCH 3/3] selftests: Make a warning if getcpu is missing on 32bit. Date: Fri, 25 Nov 2022 10:42:16 +0100 Message-Id: <20221125094216.3663444-4-bigeasy@linutronix.de> In-Reply-To: <20221125094216.3663444-1-bigeasy@linutronix.de> References: <20221125094216.3663444-1-bigeasy@linutronix.de> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750460880975944809?= X-GMAIL-MSGID: =?utf-8?q?1750460880975944809?= The vsyscall for getcpu has been wired up on 32bit so it can be warned now if missing. Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Acked-by: Shuah Khan --- tools/testing/selftests/x86/test_vsyscall.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/x86/test_vsyscall.c b/tools/testing/selftests/x86/test_vsyscall.c index 5b45e6986aeab..47cab972807c4 100644 --- a/tools/testing/selftests/x86/test_vsyscall.c +++ b/tools/testing/selftests/x86/test_vsyscall.c @@ -92,11 +92,8 @@ static void init_vdso(void) printf("[WARN]\tfailed to find time in vDSO\n"); vdso_getcpu = (getcpu_t)dlsym(vdso, "__vdso_getcpu"); - if (!vdso_getcpu) { - /* getcpu() was never wired up in the 32-bit vDSO. */ - printf("[%s]\tfailed to find getcpu in vDSO\n", - sizeof(long) == 8 ? "WARN" : "NOTE"); - } + if (!vdso_getcpu) + printf("[WARN]\tfailed to find getcpu in vDSO\n"); } static int init_vsys(void)