From nobody Tue May 21 17:40:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1671228826; cv=none; d=zohomail.com; s=zohoarc; b=fvXt7l3zj2ZglQyyr4/nrpGjQefcGGZHyeFjsKfIEruq5Qo8xqft6Sy0PcSRy7JEOei52vHd/5KAYN2UOeQcGs1IVLbaycX/s7m/LcungjxeuOX5VoFSGNkBLQL4UhCjnNnlqkKCyeVB7kEozz27N8RDRxCBaYALq40RkAwg2g0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671228826; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=H7Kne5R8D0Rl7GtSzSpXaWZg8hIRjGsF2UHueTzlyfo=; b=aAbetrdWmFxRUkVUSuWC3TAmh/ppDzJtAoqyxSruCbidf3beDveJVkTijjjEvERjAmMk/gQ+Fblfc56oYx8dmwbeyjVJdw+zANFlh4v8S6rHpQQV1Ipbo1jVYyUQG0t3N/snoWF8Wo3IBY9wR2XIgEQ6mIeuUeEl3Wrz4hIReFg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1671228826539581.5874126445879; Fri, 16 Dec 2022 14:13:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IaJ-0000UO-VG; Fri, 16 Dec 2022 16:49:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6IaH-0000TX-Ho for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:49:38 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6IaF-0001gL-U2 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:49:37 -0500 Received: by mail-ej1-x633.google.com with SMTP id vv4so9260807ejc.2 for ; Fri, 16 Dec 2022 13:49:35 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id la7-20020a170907780700b007815ca7ae57sm1277767ejc.212.2022.12.16.13.49.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Dec 2022 13:49:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H7Kne5R8D0Rl7GtSzSpXaWZg8hIRjGsF2UHueTzlyfo=; b=wzChl2ecf3kJGbxNzkDuocBKmQZIRVUnz8UAuKsHkaxCVOmnMa9l8L3ZKE+6vAIlnG +5MWhTPEgwcIafLJnCzs/NJ97SINT02VoaZsPYJdWOLWgnzmQgFNh9RTFisfzq58LZvR 1lQl0Vw16hgEJiMiSpo/PpAGRMMihR95ciZxe+wBuqLM+MjnkYDuRt19nNZxxOK4M/UC 9m4FgomJUFrj+IhYPYtbBAiTRWOPBdDYHY42N6Fw53u0Ae/E7OK5b7WqrHLDkxaKp4ow gzlG9naoq1ezOhthscIuYhgI6tGbbyYe3kslmNqtCuw5hQdH2Jd052sgBi56hanHFHtG QUZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H7Kne5R8D0Rl7GtSzSpXaWZg8hIRjGsF2UHueTzlyfo=; b=cm1fvDkLrAB/2Z/7wOoO50zJ1AYV3kpn6MoX3dYMfEp6QtsZe7zB4beCD4D5vBtUAt bf8ytCliO+0EFEQ6MlXtwkTB4af8rtRSytZPFQ8X2AKjl2E8MoHePx4fBm4MfhhO/M3d 3lSUUJ8GHOdZ2lQEdlbAMZLw3HG/bglQ+1PmYtxLnX7xSv8OY5WFLTzvurTUBNxRGwRs QFn/+vL904mBeV/uXIN14mNKJn4YO2na1RhFBQBZTyVm1WM08lTQ40lGWhffljc8e7Sb YLCCVboqk5FvLh4imqRtCOkh/HA8zFkuZ8XJ5o7W43vtEhLnLytC50JBXAPpNPTe5cOk 63SQ== X-Gm-Message-State: ANoB5pl6uQERZUoj6NAkyFHxj/vQ3Hal3a32GjZWh+39/19UDA+mTq2P qjerjHePJgXx/II37qL3naHFMMxq6PbC8AH/aB4= X-Google-Smtp-Source: AA0mqf7wdbSjrBOim1row7CcfFaGHzrW+H6teEwJr8vFko7C3OZKtJEg0O2YQl8IuLgzY1nvJGTNyw== X-Received: by 2002:a17:906:f741:b0:7b4:edca:739 with SMTP id jp1-20020a170906f74100b007b4edca0739mr28900914ejb.5.1671227374156; Fri, 16 Dec 2022 13:49:34 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Stefan Weil , Peter Maydell , Eric Auger , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/2] hw/arm/smmu-common: Reduce smmu_inv_notifiers_mr() scope Date: Fri, 16 Dec 2022 22:49:23 +0100 Message-Id: <20221216214924.4711-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221216214924.4711-1-philmd@linaro.org> References: <20221216214924.4711-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1671228827227100002 This function is not used anywhere outside this file, so we can make the function "static void". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Auger Reviewed-by: Richard Henderson --- hw/arm/smmu-common.c | 2 +- include/hw/arm/smmu-common.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c index 220838525d..9f196625a2 100644 --- a/hw/arm/smmu-common.c +++ b/hw/arm/smmu-common.c @@ -483,7 +483,7 @@ static void smmu_unmap_notifier_range(IOMMUNotifier *n) } =20 /* Unmap all notifiers attached to @mr */ -inline void smmu_inv_notifiers_mr(IOMMUMemoryRegion *mr) +static void smmu_inv_notifiers_mr(IOMMUMemoryRegion *mr) { IOMMUNotifier *n; =20 diff --git a/include/hw/arm/smmu-common.h b/include/hw/arm/smmu-common.h index 21e62342e9..c5683af07d 100644 --- a/include/hw/arm/smmu-common.h +++ b/include/hw/arm/smmu-common.h @@ -173,7 +173,4 @@ void smmu_iotlb_inv_iova(SMMUState *s, int asid, dma_ad= dr_t iova, /* Unmap the range of all the notifiers registered to any IOMMU mr */ void smmu_inv_notifiers_all(SMMUState *s); =20 -/* Unmap the range of all the notifiers registered to @mr */ -void smmu_inv_notifiers_mr(IOMMUMemoryRegion *mr); - #endif /* HW_ARM_SMMU_COMMON_H */ --=20 2.38.1 From nobody Tue May 21 17:40:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1671228323; cv=none; d=zohomail.com; s=zohoarc; b=eWVsjb4HbUYGaNg5siQ19ulVFcJ+Jx/aA+QfDzSjE8Dihh3ullM1vis2mv8zvvDn9oEYmyb/W8iJ+XHh1vJq0ea0oVAzn9guEt3hb0BMugw0HWQsvqrPprqcYHjTxVR76PrL+yyF/jGwkoZf46NAlWK2iOp8guIvfagneLE/bhc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671228323; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YEOmiH6ZA2K4WWTAuLU3ov9+lPjBsfcIXnzt1rbZt/4=; b=YiYIEH3uYlaZNLOyuVmmxeolhqXF8cVqI4+abB0VeGfj6ybbY38JFB5CSrUGXcGbBYjGYKLu2id7+u0SfZHGI4f5OVKBDDZ/OZLx61XPhVy7oD2ln6YKbmPEI9sYVuE2jwlnK7O9aUVJFuekJys++OcJkjlywpaohbZH3Ren3y8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1671228323742494.28227788637787; Fri, 16 Dec 2022 14:05:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IaP-0000WF-Gw; Fri, 16 Dec 2022 16:49:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6IaO-0000VY-6i for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:49:44 -0500 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6IaM-0001h1-2t for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:49:43 -0500 Received: by mail-ej1-x62f.google.com with SMTP id ud5so9226237ejc.4 for ; Fri, 16 Dec 2022 13:49:41 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id el14-20020a056402360e00b0046c5baa1f58sm1267640edb.97.2022.12.16.13.49.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Dec 2022 13:49:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YEOmiH6ZA2K4WWTAuLU3ov9+lPjBsfcIXnzt1rbZt/4=; b=laMhzE+AwsXrsrudqbScu2qa2Dylv82/F9Dqp34B3kL6Ij/CW9PPHWhTF/lxiqfjr7 1KMswOW9ocC42drmC1WdDO+OQrzkloghkcxI3i7MXsET0Qequ5j9/rbJzI7Q8qN0HJih aUmWT96h3U8/uICs2Cyr6S8lJ10oLmJXJvZhCKp/XHboD/9k08NNoIFyANsoVu9Gxmp8 1ZGn/1Zzj0Yr1cied7GGL2TjuEg3YTZGj1zfuGtrOwzx5iU5x6hmxYLmMVRnZepbOKbf zdZALytXaBwhzwGz/wQuvX0zNuQwdX9kTJh5V+nMnBq7V8XXTXi+sJxkpeDbo7XwKBnv HSVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YEOmiH6ZA2K4WWTAuLU3ov9+lPjBsfcIXnzt1rbZt/4=; b=8MgqdlPuyS3qjIVWVe0231SH46tTL7ogipUoEhw+AyxgLwwaNuflBCyrbQw2N736Lv nirKdiuU1g05FuIxoCldN+3G+T2fHNd5d3XDSvO5eCFaeg/JDLz4KK/8hyilxqeFaCrg +Nj+es5TihHrSpzVzR8mN0OrIiut5j1Q182lxHsc3nETVbRtxYJppD70az7O5rOCqTZ1 cZCa2UqOO8rbJUC6v1lnLhjEHLOaP4UuTA8HPzfcmRn0g0IlTl0By/3olOKEKGtPu1nF wRSxevhY2a4oIUp2HaC4KPJ8JRGawwnJ4Jvhmb6B4ivnFCGTqqPyLaPMEW/R64JPhyrW 5E7A== X-Gm-Message-State: ANoB5pnhDQyzeqBrOMlo+cNKJOX3k1K/ulOUQ+ZIkiqYGBfnn2U8SgKa GWejBxMuFO6ko3d0snlRmJPyfG8ZJfDC14VyVZQ= X-Google-Smtp-Source: AA0mqf5Bl5dHW1gG5CdpiPptsdKzfB/xcZ7E4o9b9c2pcjovz2OME029SjAq4DfQ4vM7Eyqv52W/wQ== X-Received: by 2002:a17:906:5509:b0:7b2:7ae8:3661 with SMTP id r9-20020a170906550900b007b27ae83661mr41769770ejp.21.1671227380452; Fri, 16 Dec 2022 13:49:40 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Stefan Weil , Peter Maydell , Eric Auger , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/2] hw/arm/smmu-common: Avoid using inlined functions with external linkage Date: Fri, 16 Dec 2022 22:49:24 +0100 Message-Id: <20221216214924.4711-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221216214924.4711-1-philmd@linaro.org> References: <20221216214924.4711-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=philmd@linaro.org; helo=mail-ej1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1671228326023100003 When using Clang ("Apple clang version 14.0.0 (clang-1400.0.29.202)") and building with -Wall we get: hw/arm/smmu-common.c:173:33: warning: static function 'smmu_hash_remove_b= y_asid_iova' is used in an inline function with external linkage [-Wstatic-= in-inline] hw/arm/smmu-common.h:170:1: note: use 'static' to give inline function 's= mmu_iotlb_inv_iova' internal linkage void smmu_iotlb_inv_iova(SMMUState *s, int asid, dma_addr_t iova, ^ static None of our code base require / use inlined functions with external linkage. Some places use internal inlining in the hot path. These two functions are certainly not in any hot path and don't justify any inlining, so these are likely oversights rather than intentional. Reported-by: Stefan Weil Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Auger Reviewed-by: Richard Henderson --- hw/arm/smmu-common.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c index 9f196625a2..54186f31cb 100644 --- a/hw/arm/smmu-common.c +++ b/hw/arm/smmu-common.c @@ -116,7 +116,7 @@ void smmu_iotlb_insert(SMMUState *bs, SMMUTransCfg *cfg= , SMMUTLBEntry *new) g_hash_table_insert(bs->iotlb, key, new); } =20 -inline void smmu_iotlb_inv_all(SMMUState *s) +void smmu_iotlb_inv_all(SMMUState *s) { trace_smmu_iotlb_inv_all(); g_hash_table_remove_all(s->iotlb); @@ -146,9 +146,8 @@ static gboolean smmu_hash_remove_by_asid_iova(gpointer = key, gpointer value, ((entry->iova & ~info->mask) =3D=3D info->iova); } =20 -inline void -smmu_iotlb_inv_iova(SMMUState *s, int asid, dma_addr_t iova, - uint8_t tg, uint64_t num_pages, uint8_t ttl) +void smmu_iotlb_inv_iova(SMMUState *s, int asid, dma_addr_t iova, + uint8_t tg, uint64_t num_pages, uint8_t ttl) { /* if tg is not set we use 4KB range invalidation */ uint8_t granule =3D tg ? tg * 2 + 10 : 12; @@ -174,7 +173,7 @@ smmu_iotlb_inv_iova(SMMUState *s, int asid, dma_addr_t = iova, &info); } =20 -inline void smmu_iotlb_inv_asid(SMMUState *s, uint16_t asid) +void smmu_iotlb_inv_asid(SMMUState *s, uint16_t asid) { trace_smmu_iotlb_inv_asid(asid); g_hash_table_foreach_remove(s->iotlb, smmu_hash_remove_by_asid, &asid); @@ -374,8 +373,8 @@ error: * * return 0 on success */ -inline int smmu_ptw(SMMUTransCfg *cfg, dma_addr_t iova, IOMMUAccessFlags p= erm, - SMMUTLBEntry *tlbe, SMMUPTWEventInfo *info) +int smmu_ptw(SMMUTransCfg *cfg, dma_addr_t iova, IOMMUAccessFlags perm, + SMMUTLBEntry *tlbe, SMMUPTWEventInfo *info) { if (!cfg->aa64) { /* --=20 2.38.1