From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5CAC6C02199 for ; Fri, 7 Feb 2025 16:20:12 +0000 (UTC) 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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MWm1gRfKHbL5YHWs//KaTiFNmKntZJzO7yxBuXpx+Fg=; b=4jnYhXUD3TeiHr 9dkCqxKn0//3kBvjaSQ2MgK0anGRFVDfQgE+YstW9UGRz8KbrMRW6NZMAI10QbK1uPymlpQ1liKSL ZrWZUbOhBUjQY94oZ/5kUDbyh64MS95ieWp87R5jUWTlMZTc2REcR+HN8qoTOXleI6FaKtf1fWGFT QiAPaXl/y31mgMYhQ7swqHRadyS4FIWW0E7IpYagm77tTzOe92SK8Cz1ag5+lyQOTu4zh+evPUOxK J03ySK1OPpBmpLCSAnkdaKWkTH5QmKcpTJ0UnpQQ8VPMS6LeY+C9Zh67fxW6ZgZVSC9KNyGB+mtIh AxQ/LSPqPolKCB3jakEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tgR5M-0000000AFLK-1I1o; Fri, 07 Feb 2025 16:20:08 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tgR5J-0000000AFJG-3Scr for linux-riscv@lists.infradead.org; Fri, 07 Feb 2025 16:20:06 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43635796b48so13915145e9.0 for ; Fri, 07 Feb 2025 08:20:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1738945204; x=1739550004; darn=lists.infradead.org; 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=uuW8lN3LlL4CuR3qOD5OEg9Po1ieu6WyRch8wZV6JCU=; b=CwG/vRE8eDHMpoFllGAwmc/V9oh+ev75UYBHzUiXEReX3vANv9CIoN1gItlsvdFhLW IJ8nNw6jCdtPyC+XDQznkDtk/oGsXCp4NqLvsCcY30/TqtriBPWKdfcbFrMhGSUH07tm ulZMYSc5rl1Qk1XyOcK0Xc48fT+P0849LgZER5ZWSnTcbkJBH6ueEeTBQp2ZMGtxbbr/ +FUEUlC1SWd6zSny9437oKN91RnXcDT3uSlGcPZo6Rs/1oUhfwkl2Uv6712EG/fkBlLQ dmhS5EzLIZ2ARutG0bXFNUNzohI9Kxaqf8QPL4VP8lJywBW2JQXU6D/6CEzJjCD7oqSt 1qJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738945204; x=1739550004; 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=uuW8lN3LlL4CuR3qOD5OEg9Po1ieu6WyRch8wZV6JCU=; b=u42X+6RPhvSO82LBnrh/a4NbXEwXU/+FzTWoOSky9tZ8tuLCe6DyLdtaZNIe2MB6uv XSD+pirfbbdrfCs0Dw2dNZ7eaDmU2CCssNl0OYLzQHPDOEnurV5JWNGX4JA6URz0BG29 lWEDrjG4nvKWMN6Q3h7vnY1xXmTj7hHkNMv/Svtmq14YdQpG4biKsIYgSgf74PdRpnex RuQy6XaQ23a+3njZXV0TYDkwBamuJGIuUhtGK9hPPJ9wF19oIBXYrb9vRRt2m5o++abM wOJ6eN+Cn2JdhlR9Vyhn9m3/NDDhdWHeyzIhw5I0Y6MQ4QkmRppQgJxVl+D4bopPq7xC WD3g== X-Gm-Message-State: AOJu0Yy+Koa4lD3/+tgUphQ1D7vg4FYYj+dh8zzGdIzJA/weZi3QCCL+ tcofqtC5oEgQpIN5CsOcXY2pC6ox9gmkuJF6GjTst3PjMz2iIrt7ekDgup/0eUXtBe0EYRuS8j3 qf8o= X-Gm-Gg: ASbGncuF1UohCdnrIoxMk2GwLQRbO1wHhYCVqZtUl79/WgVY5kfJs2th1CPh7I2oL7k 2TaIu5lGMCpTfBkb49FSFYGdbzn0YeFRn7vQlxZ7d62c0CVTMHmtUD4UcGH/530BLFrxADhOsh1 I6abPzaUu6fIpU7Vqc4b/zie4M9Zgo0jE8NS3UgcuLnYI4/LDGDHIuj514VMFXqTpuoospstlMv LoUeQzId6WcRz4mLlAjYWDEysieG7nDTjB2730ECXusX2+JvMfSy6g6s4Fq6+Y9cAt/Id9S7CBj TqdZ7GAdwzdn6ZC3lbfE3n9LCiFDJfRI8cGLCXS9HE3t7RENIJbap8pOFA== X-Google-Smtp-Source: AGHT+IGMKi65e/Z5vWbx7WgCmphLVzyy3Q2WyYGIC9JFl7WcR1tKm4dOZKbtrD9rcb9U1JUgAquIdw== X-Received: by 2002:a05:600c:6c01:b0:436:1b77:b5aa with SMTP id 5b1f17b1804b1-43912d22565mr59485145e9.8.1738945203976; Fri, 07 Feb 2025 08:20:03 -0800 (PST) Received: from localhost (089144193052.atnat0002.highway.a1.net. [89.144.193.52]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391da96640sm62546005e9.8.2025.02.07.08.20.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2025 08:20:03 -0800 (PST) From: Andrew Jones To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: paul.walmsley@sifive.com, palmer@dabbelt.com, charlie@rivosinc.com, jesse@rivosinc.com, Anup Patel Subject: [PATCH 4/9] riscv: Change check_unaligned_access_speed_all_cpus to void Date: Fri, 7 Feb 2025 17:19:44 +0100 Message-ID: <20250207161939.46139-15-ajones@ventanamicro.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250207161939.46139-11-ajones@ventanamicro.com> References: <20250207161939.46139-11-ajones@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250207_082005_860384_3580F076 X-CRM114-Status: GOOD ( 11.15 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The return value of check_unaligned_access_speed_all_cpus() is always zero, so make the function void so we don't need to concern ourselves with it. The change also allows us to tidy up check_unaligned_access_all_cpus() a bit. Signed-off-by: Andrew Jones --- arch/riscv/kernel/unaligned_access_speed.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/arch/riscv/kernel/unaligned_access_speed.c b/arch/riscv/kernel/unaligned_access_speed.c index 02b485dc4bc4..780f1c5f512a 100644 --- a/arch/riscv/kernel/unaligned_access_speed.c +++ b/arch/riscv/kernel/unaligned_access_speed.c @@ -218,7 +218,7 @@ static int riscv_offline_cpu(unsigned int cpu) } /* Measure unaligned access speed on all CPUs present at boot in parallel. */ -static int __init check_unaligned_access_speed_all_cpus(void) +static void __init check_unaligned_access_speed_all_cpus(void) { unsigned int cpu; unsigned int cpu_count = num_possible_cpus(); @@ -226,7 +226,7 @@ static int __init check_unaligned_access_speed_all_cpus(void) if (!bufs) { pr_warn("Allocation failure, not measuring misaligned performance\n"); - return 0; + return; } /* @@ -261,12 +261,10 @@ static int __init check_unaligned_access_speed_all_cpus(void) } kfree(bufs); - return 0; } #else /* CONFIG_RISCV_PROBE_UNALIGNED_ACCESS */ -static int __init check_unaligned_access_speed_all_cpus(void) +static void __init check_unaligned_access_speed_all_cpus(void) { - return 0; } #endif @@ -403,10 +401,10 @@ static int __init vec_check_unaligned_access_speed_all_cpus(void *unused __alway static int __init check_unaligned_access_all_cpus(void) { - bool all_cpus_emulated; int cpu; - all_cpus_emulated = check_unaligned_access_emulated_all_cpus(); + if (!check_unaligned_access_emulated_all_cpus()) + check_unaligned_access_speed_all_cpus(); if (!has_vector()) { for_each_online_cpu(cpu) @@ -417,9 +415,6 @@ static int __init check_unaligned_access_all_cpus(void) NULL, "vec_check_unaligned_access_speed_all_cpus"); } - if (!all_cpus_emulated) - return check_unaligned_access_speed_all_cpus(); - return 0; } -- 2.48.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 095C8182D9 for ; Fri, 7 Feb 2025 16:20:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738945207; cv=none; b=XugmY+qxnosfWjTdFDMCcW36TiKGNUUQSCVhoarXIHK13teUMtzxvMJPH4PFRpMNPDvGBW3L6UdQktONI+HvJmzDVsPMH4DlzaQqRpgRQducnIh/nhkKPeI2PplQ6I2jhOoUGaIfq5ue73OUSaYqwPg+CyXoIcPxTQlDt6ManW4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738945207; c=relaxed/simple; bh=gt6Fw2XKGx6sF/gq8i36RjjcfICtnuHbiXOCGkVO0kk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L2VjbfRxSqG/zzBaTcFVyWAol0IzuPVynkTBNdY2+PBuJOlK5/Nl9JUFfw7LiV14meFBrj0GTDLtQpiFoVSitHJNSmc9qJ2bVDVghWtDtUM7gz5czBA6YB+ETwzMWo8lKq5rqjHpYlhfTXsSQA34bAlhUb0D+6zyiVuv+btQzMY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=KftCLIi6; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="KftCLIi6" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4361b6f9faeso13800465e9.1 for ; Fri, 07 Feb 2025 08:20:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1738945204; x=1739550004; darn=vger.kernel.org; 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=uuW8lN3LlL4CuR3qOD5OEg9Po1ieu6WyRch8wZV6JCU=; b=KftCLIi6LniKERuAr+Q46HtLLq8dziUGUzUgH1F5/hkgui98HXRtszKAggsoZ2RtVh 6HDDZEXDDuOmYoVF7NGJpp4lhxHDObvVHeeQFUL7kWptPixOhQnaQkY9QcWjmoKLvEiZ FREgClRHfp1z+0CcCophxk5+6fxi5p+sZVYkcJwZqhjQSkSRrawTu3vkk17JiphzRUEU 705GgeT3WEFBNdJmDf21k8N84q7dbspKCmEzDA2MfY67mbKGhB/UJhZ1jBoADVPk/wVg Td2iNf+830SLw2zQuqf9am9dC+BL/u00AGXY0gDZ2fmWrGaOSyjsj5rGgXXbhkH31B8I DLpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738945204; x=1739550004; 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=uuW8lN3LlL4CuR3qOD5OEg9Po1ieu6WyRch8wZV6JCU=; b=ZbmNTq23YKOJWChCLzEV/bAz+KR4GSI77k6XshNn/oHYcO31m/C8zzSTrY1FlHd3tF ZTlSyJkuQuvXVthSj5MD1RZtwSZ2hUz1p0S0X+SZTWhSvxapY2VEDnWTHl0nAi8RT8X1 YCNbN7nA/Yt87YH5jcO0+O9WCgG4Lmkq5nKKbdgXXjV1NJmhC6jp7fUwiELiqgGoJ6K4 fzwvVXk1dl1tuxuKu0M73sjcrhKzVkLx2/GaXvmw270syMfhpLWCz8d+g4guCBFzM4Vl Unr74owTa774+em4fFriW98fu9BVK6ORfkPdE3lQachRLgW4Y08h0eGZsb/EWuyeIxdt 3utA== X-Forwarded-Encrypted: i=1; AJvYcCVbxgzEmlc9eHJKw3GtTNwMQMHkQQcfsGE1OXQWZ5t5+9GOlnRoEKpPAamUVUj3xCIW5/xPS9Nzq2NGjKs=@vger.kernel.org X-Gm-Message-State: AOJu0YwXevv03Gf/iQXiAOJx47FpHGNEhsLvnVveE6MDfOQBI/1hUehY LlL/MVX0JfPRmPbvmjTTa3SZir7x9bSt9xjV3+a1IxNyjN8tBwfwqbXcAQEOPW0= X-Gm-Gg: ASbGncsTW8Bv55kxNAiRUPjnVBkF1HjhOJghIyRB218AlAvpW7kQ+CBkG+dDrTQXwWF OPIWjPPuXSTN8BdusoytdPz8/gDsPSQrvRPB+PFhmG2DPEQZDXctsXBzNAbao1dlsw3n9p2SeZf 322L708oinVe/EM3dBA+5rwPRtIglHbpZc0AVpursPflOI3y1x6To6wSGzk10bmWTi774113Eer A17eYsJxwp/EnVB/ImbvrsA2tujUXu3IEM1Hc6oRMWVzwI0bKrvdgpuWc38SWvGs3dGTa9zL9rK A3iAgQV721B+Bfoj19KVMiDQLxrHhN15wLH2fxCqFnill71adEiu7qD0Zw== X-Google-Smtp-Source: AGHT+IGMKi65e/Z5vWbx7WgCmphLVzyy3Q2WyYGIC9JFl7WcR1tKm4dOZKbtrD9rcb9U1JUgAquIdw== X-Received: by 2002:a05:600c:6c01:b0:436:1b77:b5aa with SMTP id 5b1f17b1804b1-43912d22565mr59485145e9.8.1738945203976; Fri, 07 Feb 2025 08:20:03 -0800 (PST) Received: from localhost (089144193052.atnat0002.highway.a1.net. [89.144.193.52]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391da96640sm62546005e9.8.2025.02.07.08.20.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2025 08:20:03 -0800 (PST) From: Andrew Jones To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: paul.walmsley@sifive.com, palmer@dabbelt.com, charlie@rivosinc.com, jesse@rivosinc.com, Anup Patel Subject: [PATCH 4/9] riscv: Change check_unaligned_access_speed_all_cpus to void Date: Fri, 7 Feb 2025 17:19:44 +0100 Message-ID: <20250207161939.46139-15-ajones@ventanamicro.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250207161939.46139-11-ajones@ventanamicro.com> References: <20250207161939.46139-11-ajones@ventanamicro.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The return value of check_unaligned_access_speed_all_cpus() is always zero, so make the function void so we don't need to concern ourselves with it. The change also allows us to tidy up check_unaligned_access_all_cpus() a bit. Signed-off-by: Andrew Jones --- arch/riscv/kernel/unaligned_access_speed.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/arch/riscv/kernel/unaligned_access_speed.c b/arch/riscv/kernel/unaligned_access_speed.c index 02b485dc4bc4..780f1c5f512a 100644 --- a/arch/riscv/kernel/unaligned_access_speed.c +++ b/arch/riscv/kernel/unaligned_access_speed.c @@ -218,7 +218,7 @@ static int riscv_offline_cpu(unsigned int cpu) } /* Measure unaligned access speed on all CPUs present at boot in parallel. */ -static int __init check_unaligned_access_speed_all_cpus(void) +static void __init check_unaligned_access_speed_all_cpus(void) { unsigned int cpu; unsigned int cpu_count = num_possible_cpus(); @@ -226,7 +226,7 @@ static int __init check_unaligned_access_speed_all_cpus(void) if (!bufs) { pr_warn("Allocation failure, not measuring misaligned performance\n"); - return 0; + return; } /* @@ -261,12 +261,10 @@ static int __init check_unaligned_access_speed_all_cpus(void) } kfree(bufs); - return 0; } #else /* CONFIG_RISCV_PROBE_UNALIGNED_ACCESS */ -static int __init check_unaligned_access_speed_all_cpus(void) +static void __init check_unaligned_access_speed_all_cpus(void) { - return 0; } #endif @@ -403,10 +401,10 @@ static int __init vec_check_unaligned_access_speed_all_cpus(void *unused __alway static int __init check_unaligned_access_all_cpus(void) { - bool all_cpus_emulated; int cpu; - all_cpus_emulated = check_unaligned_access_emulated_all_cpus(); + if (!check_unaligned_access_emulated_all_cpus()) + check_unaligned_access_speed_all_cpus(); if (!has_vector()) { for_each_online_cpu(cpu) @@ -417,9 +415,6 @@ static int __init check_unaligned_access_all_cpus(void) NULL, "vec_check_unaligned_access_speed_all_cpus"); } - if (!all_cpus_emulated) - return check_unaligned_access_speed_all_cpus(); - return 0; } -- 2.48.1