Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp588240rdb; Thu, 15 Feb 2024 09:04:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW9lRvIMBJzWxArmurb7pjv8JA82/8iks0MvgT13C+viCoToXPOq8F34+vQ/wZaqwBSkQe+AyeqfTs7uZIfmTgtL3TaX0CxkZDFiMt3TQ== X-Google-Smtp-Source: AGHT+IENaCPIGKSKBg7MSmU5P92pyhlwQ6nR9zAWqKFonm2MZY322RjQ78EkPUEPDfSEEPWZEemj X-Received: by 2002:a25:c7c4:0:b0:dcc:55e9:ec34 with SMTP id w187-20020a25c7c4000000b00dcc55e9ec34mr1385986ybe.30.1708016665791; Thu, 15 Feb 2024 09:04:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708016665; cv=pass; d=google.com; s=arc-20160816; b=0zwuZDVchvM8IidTaY9ALvv+4SvSDH5T+vEp1Fj57vxGnpJl/+uYHR1BUwVssO0lEt +DP4FYg3c4DLOwPqxNN0gsw3tcfMvDokNG6hpH4oLGGzSdADPP4qcbrjjTbSjpDn9MpA nbSuu8s50tDMkgKYGkcfsk6C0e7XM7TS1RjNlRsQNLTC5+wZzmQOCqXQEEaCXp43Lq5M MuHYn5YdScqldUO2Vo4wO0a8bH2gCEa3q0AcJqvus3acPaQHHhi7vGXHIaLQMYtSmcb3 MHgMi/0vjhwDK8PAHwG3wK9HteiholqgQznKf8/wYg7ZRmNHieL53H8hMGUntVNQkPSz 9Omw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=KKvgz6hFPrq3Yt2GwJdIIlDAGA+dk5HzFk1bja/wdOY=; fh=1SZlCjDK9tOd3Etv05DCwSskJmU6D5My3EqmtVgEHZw=; b=aIcMH0Ph+a9S/S2ynp5zKoFQDQvq63kxq6HAKEQcbqhHO66vsX6WPMqAe0A/Vy89OY LId+MCf0TDvf8MCEfUjXjqE7zVGe+z/IYIPmfgMBrwUChIpVtQXxfB3m9133oN7AMlWb +/xRkiACVw2895RN3mxfGGS/Qx6zREb0DBm29RPwizgyZTcvjYECQRmySPgxbN9MV0p5 oBKmg1wctHOjNqD5Zyw2Djma+8oFA6rZ9AYrcBEBtMYqk6aBetWsgyc1pW03m5MauYtm 3gqzTcprT2LaVY8DDVoXrVy31zgELHCoe0m22WWZ04rb0Kf62ZNPDF/tW8NJJ2J3T5uO szhA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@bell.net header.s=selector1 header.b=FS9z68lJ; arc=pass (i=1 spf=pass spfdomain=bell.net dkim=pass dkdomain=bell.net); spf=pass (google.com: domain of linux-kernel+bounces-67365-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67365-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x64-20020a254a43000000b00dbed85ec338si701771yba.415.2024.02.15.09.04.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 09:04:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67365-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@bell.net header.s=selector1 header.b=FS9z68lJ; arc=pass (i=1 spf=pass spfdomain=bell.net dkim=pass dkdomain=bell.net); spf=pass (google.com: domain of linux-kernel+bounces-67365-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67365-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 774891C23DF2 for ; Thu, 15 Feb 2024 17:04:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF2D21369A2; Thu, 15 Feb 2024 17:04:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bell.net header.i=@bell.net header.b="FS9z68lJ" Received: from cmx-torrgo002.bell.net (mta-tor-005.bell.net [209.71.212.37]) (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 204E413698F; Thu, 15 Feb 2024 17:03:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.71.212.37 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708016639; cv=none; b=Pfp7LZn+CDykFKPMFMh9dc6nyph6yvSjxEA6IltAVuZzzqDLW5GGbq12DFTxH+FQzmQcPO66XkvuQQrXwIYjEUYSm1LVgMy5ivhGxlZ778Pusiee1/t+OcgbmoNAyqzqJ2zJpacoAF5YUGoj9qzbxzTrb7Z02Yg/RUL6aTIZk64= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708016639; c=relaxed/simple; bh=JxaHZLwKPKtb9xWMBkfltHXf2WY7/2Se4NIKHvyS9II=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Tv8rUrW6LEe6ox3j4BPHyoN+JGDPMJJR8GsO/wVpKrBQlQH9CID6OrO1quzr73oKm2fX+yGTaFIbtOHFMIC65bBMZTTZ1EFY6yU13JD32A1N8qwhsoQ1FEcFrYqj7hL7Hnq0sDwZ4JdSS6pnwR7Udy32mFSkmn5DN8bZNY9F1KI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bell.net; spf=pass smtp.mailfrom=bell.net; dkim=pass (2048-bit key) header.d=bell.net header.i=@bell.net header.b=FS9z68lJ; arc=none smtp.client-ip=209.71.212.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bell.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bell.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bell.net; s=selector1; t=1708016637; bh=KKvgz6hFPrq3Yt2GwJdIIlDAGA+dk5HzFk1bja/wdOY=; h=Message-ID:Date:MIME-Version:Subject:To:References:From:In-Reply-To:Content-Type; b=FS9z68lJTq8UQ0DDce4ffUKoYT4LurrwPeg+ZXEKmMonbIZ15Jxd432xCIDzNAxhBUE1DKsPLwnkRIm1Ri4CzBwWNZQXg9tIFrdxoBmDrCD708hRlwKU4O4gVYnjRlLjJbasEylkVdQzFQLwB47M5iNTFCep7ZXQwNl6TwEKwPrPazbSzJk4+qQymmD15H8VMI3cKV5bLhEAkrhOFEiwH2eT6TlQuyHYUo6duVeUDvPLchKhEHvag/tkKmZKj8buriapUnzY9XANDpbJKlU656VdYx2cf9LRj/663qHd543Sce8A9kBc+SEF/o5OBToVo0Roi3RB4f0K3YIgReTnUA== X-RG-SOPHOS: Clean X-RG-VADE-SC: 0 X-RG-VADE: Clean X-RG-Env-Sender: dave.anglin@bell.net X-RG-Rigid: 65CD7507000E1CEE X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvledrvddtgdelgecutefuodetggdotefrodftvfcurfhrohhfihhlvgemuceugffnnfdpqfgfvfenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeflohhhnhcuffgrvhhiugcutehnghhlihhnuceouggrvhgvrdgrnhhglhhinhessggvlhhlrdhnvghtqeenucggtffrrghtthgvrhhnpeelhfevheeftefhtdevteegheejtdeifeejffduuedugeffleevheegteeugfeugeenucffohhmrghinhepvghnthhrhidrshgsnecukfhppedugedvrdduvdeirdduuddvrddvfeefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplgduledvrdduieekrddvrdeglegnpdhinhgvthepudegvddruddviedrudduvddrvdeffedpmhgrihhlfhhrohhmpegurghvvgdrrghnghhlihhnsegsvghllhdrnhgvthdpnhgspghrtghpthhtohepuddupdhrtghpthhtohepffgrvhhiugdrnfgrihhghhhtseetvegfnfetuedrvefqofdprhgtphhtthhopeflrghmvghsrdeuohhtthhomhhlvgihsehhrghnshgvnhhprghrthhnvghrshhhihhprdgtohhmpdhrtghpthhtoheprghkphhmsehlihhnuhigqdhfohhunhgurghtihhonhdrohhrghdprhgtphhtthhopegthhgrrhhlihgvsehrihhvohhsihhntgdrtghomhdprhgtphht thhopegurghvvgdrrghnghhlihhnsegsvghllhdrnhgvthdprhgtphhtthhopeguvghllhgvrhesghhmgidruggv X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from [192.168.2.49] (142.126.112.233) by cmx-torrgo002.bell.net (5.8.814) (authenticated as dave.anglin@bell.net) id 65CD7507000E1CEE; Thu, 15 Feb 2024 11:51:38 -0500 Message-ID: <4723822c-2acf-4c41-899c-1e3d5659d1d8@bell.net> Date: Thu, 15 Feb 2024 11:51:39 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 2/2] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests Content-Language: en-US To: Guenter Roeck , David Laight , Charlie Jenkins , Palmer Dabbelt , Andrew Morton , Helge Deller , "James E.J. Bottomley" , Parisc List , Al Viro Cc: "linux-kernel@vger.kernel.org" References: <20240214-fix_sparse_errors_checksum_tests-v8-0-36b60e673593@rivosinc.com> <20240214-fix_sparse_errors_checksum_tests-v8-2-36b60e673593@rivosinc.com> <2ec91b11-23c7-4beb-8cef-c68367c8f029@roeck-us.net> From: John David Anglin Autocrypt: addr=dave.anglin@bell.net; keydata= xsFNBFJfN1MBEACxBrfJ+5RdCO+UQOUARQLSsnVewkvmNlJRgykqJkkI5BjO2hhScE+MHoTK MoAeKwoLfBwltwoohH5RKxDSAIWajTY5BtkJBT23y0hm37fN2JXHGS4PwwgHTSz63cu5N1MK n8DZ3xbXFmqKtyaWRwdA40dy11UfI4xzX/qWR3llW5lp6ERdsDDGHm5u/xwXdjrAilPDk/av d9WmA4s7TvM/DY3/GCJyNp0aJPcLShU2+1JgBxC6NO6oImVwW07Ico89ETcyaQtlXuGeXYTK UoKdEHQsRf669vwcV5XbmQ6qhur7QYTlOOIdDT+8zmBSlqBLLe09soATDciJnyyXDO1Nf/hZ gcI3lFX86i8Fm7lQvp2oM5tLsODZUTWVT1qAFkHCOJknVwqRZ8MfOvaTE7L9hzQ9QKgIKrSE FRgf+gs1t1vQMRHkIxVWb730C0TGiMGNn2oRUV5O5QEdb/tnH0Te1l+hX540adKZ8/CWzzW9 vcx+qD9IWLRyZMsM9JnmAIvYv06+YIcdpbRYOngWPd2BqvktzIs9mC4n9oU6WmUhBIaGOGnt t/49bTRtJznqm/lgqxtE2NliJN79dbZJuJWe5HkjVa7mP4xtsG59Rh2hat9ByUfROOfoZ0dS sVHF/N6NLWcf44trK9HZdT/wUeftEWtMV9WqxIwsA4cgSHFR2QARAQABzTdKb2huIERhdmlk IEFuZ2xpbiAoRGViaWFuIFBvcnRzKSA8ZGF2ZS5hbmdsaW5AYmVsbC5uZXQ+wsF3BBMBCAAh BQJSXzdTAhsDBQsJCAcDBRUKCQgLBRYCAwEAAh4BAheAAAoJEF2/za5fGU3x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UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024-02-15 10:44 a.m., Guenter Roeck wrote: > On 2/15/24 02:27, David Laight wrote: >> ... >>> It would be worthwhile tracking this down since there are >>> lots of unaligned data accesses (8-byte accesses on 4-byte aligned addresses) >>> when running the kernel in 64-bit mode. >> >> Hmmm.... >> For performance reasons you really don't want any of them. >> The misaligned 64bit fields need an __attribute((aligned(4)) marker. >> >> If the checksum code can do them it really needs to detect >> and handle the misalignment. >> >> The misaligned trap handler probably ought to contain a >> warn_on_once() to dump stack on the first such error. >> They can then be fixed one at a time. >> > > Unaligned LDD at unwind_once+0x4a8/0x5e0 > > Decoded: > > Unaligned LDD at unwind_once (arch/parisc/kernel/unwind.c:212 arch/parisc/kernel/unwind.c:243 arch/parisc/kernel/unwind.c:371 > arch/parisc/kernel/unwind.c:445) > > Source: > > static bool pc_is_kernel_fn(unsigned long pc, void *fn) > { >         return (unsigned long)dereference_kernel_function_descriptor(fn) == pc; This looks wrong to me.  Function descriptors should always be 8-byte aligned.  I think this routine should return false if fn isn't 8-byte aligned. > } > > Disassembled: > >  c38:   50 3c 00 00     ldd 0(r1),ret0 >  c3c:   08 1b 02 44     copy dp,r4 >  c40:   0f 80 10 da     ldd 0(ret0),r26    <-- >  c44:   37 dd 3f a1     ldo -30(sp),ret1 >  c48:   51 02 00 20     ldd 10(r8),rp >  c4c:   e8 40 f0 00     bve,l (rp),rp >  c50:   51 1b 00 30     ldd 18(r8),dp > > Hmm, interesting. See below for a possible fix. Should I submit a patch ? > > Thanks, > Guenter > > --- > diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S > index ab23e61a6f01..1d2aab619466 100644 > --- a/arch/parisc/kernel/entry.S > +++ b/arch/parisc/kernel/entry.S > @@ -772,6 +772,7 @@ ENTRY_CFI(_switch_to) >         bv      %r0(%r2) >         mtctl   %r25,%cr30 > > +       .align  8 Code entry points only need 4-byte alignment. >  ENTRY(_switch_to_ret) >         mtctl   %r0, %cr0               /* Needed for single stepping */ >         callee_rest > @@ -1702,6 +1703,7 @@ ENTRY_CFI(sys_rt_sigreturn_wrapper) >         LDREG   PT_GR28(%r1),%r28  /* reload original r28 for syscall_exit */ >  ENDPROC_CFI(sys_rt_sigreturn_wrapper) > > +       .align 8 Ditto. >  ENTRY(syscall_exit) >         /* NOTE: Not all syscalls exit this way.  rt_sigreturn will exit >          * via syscall_exit_rfi if the signal was received while the process Dave -- John David Anglin dave.anglin@bell.net