From patchwork Fri Jan 13 04:49:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Foley X-Patchwork-Id: 1725686 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=KUqHgZ91; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=pefoley.com header.i=@pefoley.com header.a=rsa-sha256 header.s=google header.b=oSg0uTIK; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NtTV63PxNz23fp for ; Fri, 13 Jan 2023 15:49:34 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=b4BKDSwLnuDlEM0QdUL4x6bj0QS9hISLNF5BHiHQoh8=; b=KUqHgZ91udH5vw 8uXSYojZcqkkwYXUxybSEnWWzYsgufwJA7MroMyZRYv1RQTBX5jG39iZUEgRJpY0RWgq5znUbVyq0 YHuTBCI2ZPgE1WbBaSreY4FeHDl+TRybYyjDgTfC+TE4MctsyTZHscJT8qxdV315WlW1TxlYdgbIC h//XfZ3wt+2G+9WMcHy+6K/0TVSXk6ZLWTOuFKdCoO3T3gpxaF4/CWWbO80VBJBcTUtX90IJr0t1z gZTJBPXcbR7kwvQCRIvG6dZqg77E90Vk1pM4H4/mjmZML5cW+Rs9maR360qAfNM2eB4H53oOYM5Un oE/8kUUFmjhw4VkF3Bag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGC0I-000RN8-KO; Fri, 13 Jan 2023 04:49:22 +0000 Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGC0E-000RLD-3s for linux-um@lists.infradead.org; Fri, 13 Jan 2023 04:49:19 +0000 Received: by mail-qt1-x82f.google.com with SMTP id g9so3641843qtu.2 for ; Thu, 12 Jan 2023 20:49:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pefoley.com; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=lVbqtFvEqcEY6PTmCOfzPzIYvqXqj8MQaEjPBYbJAVg=; b=oSg0uTIKfexVL+8ythAlt7gKQD/HGKHc+xpRHILJIbXc/Q6TtTwAm9x3UWR9dlzThP PjoCNQjMofO/IuVqMEF74cp1PkNogOp+PcpAFL2pivlh//Mz+FnEt/Zc80N/JXgNln/A 8mcDcquFzM7ANPNCVQiN/Bsv6C2yDAJnlJf6o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lVbqtFvEqcEY6PTmCOfzPzIYvqXqj8MQaEjPBYbJAVg=; b=f/g06w9hXiibh6LX34G6DJUzoCZyKPEs8whEWzST4y7+K9XB50E5RJ1nIwm4ne3b3Z Awaicb/5vDLAxHO1JBxjORh7YywteyLhGnxiLPt+rsZScda9QHD7rGpEJdIO8TaW/Wea Plf/2PODE8yW6JL/zz8Hh+/0lg4w1P7Wqn5OTi5RBUO7c4bAWLyAE7Pk0ijl1UOrYZVt Tiu3VPVDQ/e+jm9OGzGaU15eYQoCgjX18E7kvp3ueLCfz+MgIdPAUdN7jDPQPED6FAwM xsjQlCY9hlPfpQKuXe0U7abZnH+2mqYdG6CDnilZcjII+RqPbdsjOeuiiPUe0j9BhBaK Ijhg== X-Gm-Message-State: AFqh2kpAU14kpOnjDytRQJkO75dPHQd3pUeHc3vexWnzv9wytY0/A6JK rG7ruDNkAuUG4m2gzSIGHExpaA== X-Google-Smtp-Source: AMrXdXs+4Q/0riaBJeBu43Ip9QqbHlVe2IR4rPwv7GEQW2g23YhJETxm7QMFvfo07vTpZzy0lcWyfA== X-Received: by 2002:a05:622a:1750:b0:3ad:d7a6:76d8 with SMTP id l16-20020a05622a175000b003add7a676d8mr30209523qtk.38.1673585355266; Thu, 12 Jan 2023 20:49:15 -0800 (PST) Received: from [192.168.1.3] ([2600:4040:29fb:d300:887b:7eff:fe74:68b2]) by smtp.gmail.com with ESMTPSA id s11-20020a05620a0bcb00b00704a9942708sm12099472qki.73.2023.01.12.20.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 20:49:14 -0800 (PST) From: Peter Foley Date: Thu, 12 Jan 2023 23:49:07 -0500 Subject: [PATCH 1/4] um: Make the definition of cpu_data more compatible MIME-Version: 1.0 Message-Id: <20230112-um-v1-1-6bec9e97ad13@pefoley.com> References: <20230112-um-v1-0-6bec9e97ad13@pefoley.com> In-Reply-To: <20230112-um-v1-0-6bec9e97ad13@pefoley.com> To: Richard Weinberger , Anton Ivanov , Johannes Berg Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, Peter Foley X-Mailer: b4 0.11.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1673585354; l=1683; i=pefoley2@pefoley.com; s=20230111; h=from:subject:message-id; bh=aGrL0ysPMYznOqdL0cA76sdMuDBI2JGj/mTkJStMEDk=; b=N2azVPGy0zYLU0iU3/UHyqtpzJsGGCVO2bIRlbOLxNGtGUyvZZ/Jdj31qhwLcIqfA33a965MpYY5 tv/1TV+mARDuKlsafc554to1VTS6vsw1ltMTV8PZOe4nzSx4GHum X-Developer-Key: i=pefoley2@pefoley.com; a=ed25519; pk=DCQqIdN6rHnvfQH58WQiQzJFfGUo1HyWSvdYG8vnO5o= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230112_204918_198580_E6E83E20 X-CRM114-Status: GOOD ( 10.53 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Match the x86 implementation to improve build errors. Noticed when building allyesconfig. e.g. ../arch/um/include/asm/processor-generic.h:94:19: error: called object is not a function or function pointer 94 | #define cpu_data (&boot_cpu_data) | ~^~~~~~~~~~~~~~~ ../drivers/gpu/drm/amd/amdgp [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:82f listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Match the x86 implementation to improve build errors. Noticed when building allyesconfig. e.g. ../arch/um/include/asm/processor-generic.h:94:19: error: called object is not a function or function pointer 94 | #define cpu_data (&boot_cpu_data) | ~^~~~~~~~~~~~~~~ ../drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c:2157:16: note: in expansion of macro ‘cpu_data’ 2157 | return cpu_data(first_cpu_of_numa_node).apicid; Signed-off-by: Peter Foley --- arch/um/include/asm/processor-generic.h | 2 +- arch/um/kernel/um_arch.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/um/include/asm/processor-generic.h b/arch/um/include/asm/processor-generic.h index bb5f06480da9..7414154b8e9a 100644 --- a/arch/um/include/asm/processor-generic.h +++ b/arch/um/include/asm/processor-generic.h @@ -91,7 +91,7 @@ struct cpuinfo_um { extern struct cpuinfo_um boot_cpu_data; -#define cpu_data (&boot_cpu_data) +#define cpu_data(cpu) boot_cpu_data #define current_cpu_data boot_cpu_data #define cache_line_size() (boot_cpu_data.cache_alignment) diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 786b44dc20c9..8dcda617b8bf 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -96,7 +96,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) static void *c_start(struct seq_file *m, loff_t *pos) { - return *pos < nr_cpu_ids ? cpu_data + *pos : NULL; + return *pos < nr_cpu_ids ? &boot_cpu_data + *pos : NULL; } static void *c_next(struct seq_file *m, void *v, loff_t *pos)