From nobody Fri Oct 3 18:10:11 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11FC43164A0; Wed, 27 Aug 2025 06:45:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756277148; cv=none; b=QhFgc6pdd+E+/AVu0L/6k9x0M6i822LTxhgSmnrq/eLBr447xs3VIK6Djrk2KWKYmx2BdyxKeRoqzCzBbhugWCwwFOiEZOn3cr1S9GJNaI5hbpw5BpqMYHZLWdyVP033Q7e4SahJv2gpEonTC/IS13qZAylqL9EcYs0DY9hHxWQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756277148; c=relaxed/simple; bh=9SjDZPZ3yWnuH3ilT4r7Jf0JA+pjGnMuwPBUdHzcCEQ=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=G10xlOPNGVAdwYUuR2jbwSY9sy3Mw3MAgzd6wDF7w/zoeTeS5DfxNGKKQtfDGX/mUJ/V9pvX/gTceu1HPJFEeJgl9WjQx2POLTiXol4TePHtba9ooHz6dT8pIpmf2ESHBsYNgKg+qrGn7kxseztdvVt7bk3YW8hHe8Oe4NyllFg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=XaEinBVn; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=xrKI5dDK; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="XaEinBVn"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="xrKI5dDK" Date: Wed, 27 Aug 2025 06:45:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1756277145; h=from:from:sender:sender:reply-to: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; bh=WlThLM8Di/nYqVNktWX+VskQZNjn0QqAMw4uf0ywqpQ=; b=XaEinBVnCi6Xs7G+zkHu/visqMIorIA87Ar2Mg5UAz0vk4fYHP6pMxZZ+TYsaVdlTupB/F 1gA/b5GemvUXaPHBjKFCZw/rxLTDYrHXUz0NyQk/L0CY3wQNODs6JWrv9ZFuVZJ9BR6zwJ 4Y3oP9kmD31W2PjjBnouo4dtZk7Jltq1qPjb4wRgkmTlwANJHPY6vnY+apvU80uawrF/cr aS1d6kFgXPVWxhA15CAwCCPTRf82SCosqiJfgu850bJiAR4Xc+z/kL7aM5sH4OQpi2A7jh X+HyGklbz2tunT+GOqqgpn1/vB+QBkwL/9GTEkVADrV1rjKs0fs1/jCQTo6N1Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1756277145; h=from:from:sender:sender:reply-to: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; bh=WlThLM8Di/nYqVNktWX+VskQZNjn0QqAMw4uf0ywqpQ=; b=xrKI5dDKny6pVqyuJRydfb+0py0dc9g5bXnuG+M8a7DLdDFVzsn2+z+9VmmAXnHuYDlBUe lnno628u6pHRu2Bg== From: "tip-bot2 for Uros Bizjak" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/asm] x86/vdso: Fix output operand size of RDPID Cc: Uros Bizjak , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20250616095315.230620-1-ubizjak@gmail.com> References: <20250616095315.230620-1-ubizjak@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <175627714358.1920.14102647257754782558.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/asm branch of tip: Commit-ID: ac9c408ed19d535289ca59200dd6a44a6a2d6036 Gitweb: https://git.kernel.org/tip/ac9c408ed19d535289ca59200dd6a44a6= a2d6036 Author: Uros Bizjak AuthorDate: Mon, 16 Jun 2025 11:52:57 +02:00 Committer: Borislav Petkov (AMD) CommitterDate: Tue, 26 Aug 2025 19:33:19 +02:00 x86/vdso: Fix output operand size of RDPID RDPID instruction outputs to a word-sized register (64-bit on x86_64 and 32-bit on x86_32). Use an unsigned long variable to store the correct size. LSL outputs to 32-bit register, use %k operand prefix to always print the 32-bit name of the register. Use RDPID insn mnemonic while at it as the minimum binutils version of 2.30 supports it. [ bp: Merge two patches touching the same function into a single one. ] Fixes: ffebbaedc861 ("x86/vdso: Introduce helper functions for CPU and node= number") Signed-off-by: Uros Bizjak Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/20250616095315.230620-1-ubizjak@gmail.com --- arch/x86/include/asm/segment.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h index 77d8f49..f59ae71 100644 --- a/arch/x86/include/asm/segment.h +++ b/arch/x86/include/asm/segment.h @@ -244,7 +244,7 @@ static inline unsigned long vdso_encode_cpunode(int cpu= , unsigned long node) =20 static inline void vdso_read_cpunode(unsigned *cpu, unsigned *node) { - unsigned int p; + unsigned long p; =20 /* * Load CPU and node number from the GDT. LSL is faster than RDTSCP @@ -254,10 +254,10 @@ static inline void vdso_read_cpunode(unsigned *cpu, u= nsigned *node) * * If RDPID is available, use it. */ - alternative_io ("lsl %[seg],%[p]", - ".byte 0xf3,0x0f,0xc7,0xf8", /* RDPID %eax/rax */ + alternative_io ("lsl %[seg],%k[p]", + "rdpid %[p]", X86_FEATURE_RDPID, - [p] "=3Da" (p), [seg] "r" (__CPUNODE_SEG)); + [p] "=3Dr" (p), [seg] "r" (__CPUNODE_SEG)); =20 if (cpu) *cpu =3D (p & VDSO_CPUNODE_MASK);