Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2533626lqz; Wed, 3 Apr 2024 00:10:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWNBaCBy5RFrmOpZVspHU4Rku0X6pIf+I80XSuHuxVynuD75oOHycd6ebn+aRYN+At7TUttp62+jRAXITCxC62UmWseDdDqbDjrdmQA2A== X-Google-Smtp-Source: AGHT+IGbd0uzqx+tKw9XaKkZBgSl8tB2VQweBNlFuk76+cdonJJvw/3Q3x+hiGK7NojXTb4vybD7 X-Received: by 2002:a05:6a20:d415:b0:1a3:6bd8:f487 with SMTP id il21-20020a056a20d41500b001a36bd8f487mr1571224pzb.51.1712128252733; Wed, 03 Apr 2024 00:10:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712128252; cv=pass; d=google.com; s=arc-20160816; b=L5WXVVNUHqpx1lgMIGNDaQiYM4DGjbV19WpPNiTTqTepJDOpDfWCVtCdpZ8RTqUAJo W2EwlpkBbwAbsh5OhlTPFYkNgW7DWSolY7P7OI5BqHMwDnX7t9LYnTqH9t1Y7j0EzoWY 6CGj34gnHmmghJ4KEU7MgZYEPJoZ7i3NCAFtAYxMGy/kMCszv84N2Qx0ruT4jcCI5TvQ kfQeLLl62hYOgjjjsI8hkrpIj3/Xa+hlT4y+Ptliq9b4ePbB2a/E/gthSUdWGluALZnz FHYqjkid3fOXOhfVUfUgG3/OdlXtSAWdnpVdvA5Q5Iq+4MDoClGD5ekCe8DQYHcZaH3p dkWA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=kX//15BztzPoscCO6BK+vfCh48Eu32fB7AasZnjTLjs=; fh=VH3OGBcUIgsSEGqXZYcuGZnpKcP4LuuxmpGmqtOyWMo=; b=FZgduKLiOFmHfdYQx8WAOQuLOqm/wwQpaU7EmRC9UL40M+Di/g98dk/vdMEn1MuwIZ /urXj1+0wCNo5xzt6fUMTgV16zP3fJTb9ZURu4jurJYYYOVaz0EViqrHSuVedAvCYYM3 A5cz44yY9WzxreRmXu3M7RlNnukE6O30hLJZWFVFEDBovtpcUP5R02ETUZXOPp44OQ59 kC0fS4eYeviJmpVn7iS+irYDuoGA2ADqYUlMYrm5TSO4eIiTkqEzetNCZ7T+rLf5rnmL azlZyS+pZ6HmBylD/e1V7+QO9MvOKFZAMSabkIH+1rflywoMB242hsPL9IY04yiUnbUZ KjRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=jX1LOOo1; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-129136-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129136-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g6-20020a056a000b8600b006eaff9375b7si7677455pfj.340.2024.04.03.00.10.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 00:10:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-129136-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=jX1LOOo1; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-129136-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129136-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 68FD6284776 for ; Wed, 3 Apr 2024 07:10:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D7BB358ACE; Wed, 3 Apr 2024 07:08:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="jX1LOOo1"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2Ln3dULy" 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 9AA3455E74; Wed, 3 Apr 2024 07:08:25 +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=1712128107; cv=none; b=SNQHH2cYxmIdk+/3SjnjrrmxdaWmrpeE5kpZp0oCMfPrixgIQ6OhR+D+C8aSEMe+LTB9+5Xp++JzLMh9S5b2kk89QxtpzCwqqA6UFxKUQdamgwJqB24tlzIPnpUarT4oLPqCJHhJkuutcw81UeF5JCPEDYRsucnCpvIfneLh4Vg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712128107; c=relaxed/simple; bh=T4yhKl7TrANqUAds2tjpE8Je/TuDt+FVyVtJ/SbQRMU=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=KBQ6J9Vlsk2E/8x+HiznAT8lb3PW962beDuFkSG4y4eA/BzLBwL8qr/l+pzBqqX96bmIdMspCiLnf5R7Y52HxJmeYzesRw5ib/HY8wJtmlEkW6sv1DHC40QqnM4NXwsLZoD+Nng42NBKeS96hjxPQU3MSbLFAcT0hiyLcQnNuVk= 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=jX1LOOo1; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=2Ln3dULy; 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 Date: Wed, 03 Apr 2024 07:08:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1712128104; 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=kX//15BztzPoscCO6BK+vfCh48Eu32fB7AasZnjTLjs=; b=jX1LOOo1Q+mTqDTBntU7Avrzz7IVWJRGi3StBywuCtd9I31h2qRTDd/GWcqth+9DELhhrg izUsupEn3OiS4qv2kLO1eWE2x8aWPDb2SharHkoeX5bIl/b3EQJoVCGQ0VzqudXB//ioZx n6Vr57JcUFWb58jf+9+tc0nwzVSKDXCMXl3q1MGmydvsFIXpWHNHXSvRU5cV/vnhII3eAo hZUvA6YE8SL+aw06tIDbCfpbOVR5SpidhsIu3sO1iWelttAQ5GzMp9oq1Nv0WpBtPJV4ya td/mbxMvF64TSGkVXIPSKuTGts6RrrdbLdnm9kd13vuG+GfWtr8skWyOJ0+45g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1712128104; 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=kX//15BztzPoscCO6BK+vfCh48Eu32fB7AasZnjTLjs=; b=2Ln3dULyffs/S+XOO6oBpNQc1LYdK1QxajOnA+wZtXWSDF6Bgm/n6SHZPDOcu+TwoDARh0 LqFvaedSaS2sfyBA== 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/percpu] x86/percpu: Use __force to cast from __percpu address space Cc: Charlemagne Lasse , Uros Bizjak , Ingo Molnar , Linus Torvalds , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240402175058.52649-1-ubizjak@gmail.com> References: <20240402175058.52649-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: <171212810325.10875.17377924831396823871.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: 7bit The following commit has been merged into the x86/percpu branch of tip: Commit-ID: a55c1fdad5f61b4bfe42319694b23671a758cb28 Gitweb: https://git.kernel.org/tip/a55c1fdad5f61b4bfe42319694b23671a758cb28 Author: Uros Bizjak AuthorDate: Tue, 02 Apr 2024 19:50:38 +02:00 Committer: Ingo Molnar CommitterDate: Wed, 03 Apr 2024 08:59:15 +02:00 x86/percpu: Use __force to cast from __percpu address space Fix Sparse warning when casting from __percpu address space by using __force in the cast. x86 named address spaces are not considered to be subspaces of the generic (flat) address space, so explicit casts are required to convert pointers between these address spaces and the generic address space (the application should cast to uintptr_t and apply the segment base offset). The cast to uintptr_t removes __percpu address space tag and Sparse reports: warning: cast removes address space '__percpu' of expression Use __force to inform Sparse that the cast is intentional. Fixes: 9a462b9eafa6 ("x86/percpu: Use compiler segment prefix qualifier") Reported-by: Charlemagne Lasse Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Cc: Linus Torvalds Link: https://lore.kernel.org/r/20240402175058.52649-1-ubizjak@gmail.com Closes: https://lore.kernel.org/lkml/CAFGhKbzev7W4aHwhFPWwMZQEHenVgZUj7=aunFieVqZg3mt14A@mail.gmail.com/ --- arch/x86/include/asm/percpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index 1f6404e..20696df 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h @@ -77,7 +77,7 @@ #define arch_raw_cpu_ptr(_ptr) \ ({ \ unsigned long tcp_ptr__ = __raw_my_cpu_offset; \ - tcp_ptr__ += (unsigned long)(_ptr); \ + tcp_ptr__ += (__force unsigned long)(_ptr); \ (typeof(*(_ptr)) __kernel __force *)tcp_ptr__; \ }) #else @@ -96,8 +96,8 @@ #endif /* CONFIG_SMP */ #define __my_cpu_type(var) typeof(var) __percpu_seg_override -#define __my_cpu_ptr(ptr) (__my_cpu_type(*ptr) *)(uintptr_t)(ptr) -#define __my_cpu_var(var) (*__my_cpu_ptr(&var)) +#define __my_cpu_ptr(ptr) (__my_cpu_type(*ptr)*)(__force uintptr_t)(ptr) +#define __my_cpu_var(var) (*__my_cpu_ptr(&(var))) #define __percpu_arg(x) __percpu_prefix "%" #x #define __force_percpu_arg(x) __force_percpu_prefix "%" #x