Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp556839rdb; Thu, 15 Feb 2024 08:11:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWOWmyWEYkV8+FfhRzBYqgJPJYSXGZNwQhXwL3AermK8nhjnW5tuUQNFhU0XF6Mx8zTdASxRsVfevdf92RBBLnsmdiPYOxNtAjQc8KJAg== X-Google-Smtp-Source: AGHT+IFj+eDUG3JWKfwMQHrqSeHGnfj3X0X0VrSsQDO91PFVqIUlKUs3lg18QXIoW1lWZwh+JHDR X-Received: by 2002:a17:903:8d0:b0:1db:9e54:bbb2 with SMTP id lk16-20020a17090308d000b001db9e54bbb2mr717051plb.26.1708013473909; Thu, 15 Feb 2024 08:11:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708013473; cv=pass; d=google.com; s=arc-20160816; b=RIvfmuPb6vd/Spx4GDPBuNkiF9J3ycHTRLl43i814b0oMu1d0FrSjpdJTo/7PhzbCr cg0UJ53i6Efrz81HG+nOxD1lW3WmO9Xam9XLic+c2U1roVjDtqY3di5McbvkH7j6PY/a LWB6ELTQGq/RM8CJbl3FJ8ENThjl2V6eXCpy4QZIs0NQROjVmz6k7bGdts+9E8m86V3y q6GAWMPAr1I+7Xh3Awphb8pIkHfFWcEwp8imbPnR3JSHjUvHB/t/vttOQi2uoQKW03oR ahp/4/QgAkjgqjeQTm90JJCRoDco4JL7Q789zAeGu1qPi8W4ztQnJtPnG7gk5lHIsEnz uixw== 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 :sender:dkim-signature; bh=daYSfFMwEOlQLZSVRUQJEmuIcA/M/NirswRAJ8iX3Yw=; fh=INcS7A2Bz3hd3QIlRsPmuuRLpVNq2UT4CiYk7+luUno=; b=HtFJ5k5UtagptQRkuSJ/PqtBHVCGvxdUcZBvpKC6STlxF+yd9HWpv8r4TnY4B7zv+n ikCCizkTbyQL/nIH2Iq+FIpKWO36voIjp8tb51cCxl7unFTnZnkSjdJOYoSi77MhqgJv aFiJhOAMVx010Lui2GXZ1MGdCn42O1zvVjEdimqB0nK2ZYnrfyrTAnXfOaBWuO5PdQMZ 8kSPwRe/3C2Das8T5zSPzFhC/j1vzQfCziM/ItXUu8471mhoIT4GZEvH5Zz7LGW8iABT 1Tofc0t2UcWsdx7q36OgRRBwpfWS1auBahrlxyIAwRSb2qX7pzFC9AnJMWFgn4ZS2E+p h2sg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RwcSqMyo; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-67234-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67234-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e6-20020a17090301c600b001db3ec8503asi1384044plh.418.2024.02.15.08.11.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 08:11:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67234-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RwcSqMyo; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-67234-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67234-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C5E18290B92 for ; Thu, 15 Feb 2024 15:48:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9AF61384A4; Thu, 15 Feb 2024 15:44:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RwcSqMyo" Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 98D131369B0; Thu, 15 Feb 2024 15:44:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708011881; cv=none; b=ooTp+jJqh2RD7mKMXJvRaEKxXL4SxlWR2VabXB//CJ6hDFY+qolsKMy9krLongVu1Iwgg6b0nUVP8K/u4hNrDVOk9LKD2MXvmHYQCkN03EkyJ8dODj3rwr3e0O9LBscSIErVUZ+B5kItVjj9PnODofeeyU1H2P60AeyRHV3GJGQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708011881; c=relaxed/simple; bh=cF7RZ2ei90P4jrq8L2zSfWpmQDRweJvjYImQjBVUrSk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=QfF14ze4veLP5HZgtFp8W7MyCt48vMKrfr/f2VPbTunil/8FR+dwcBukOlAzQ6StcrcC1bZ2Mxi9wXHIyAXn1SSQG4Ncd/Ugb86tsuxUw7+J+SRFCKvXb6XPovl/zx7YMNp/wG+wqk/UDAR1yiwKwAVpGWP+jQxNmR1atuIHxYI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RwcSqMyo; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1d731314e67so7891275ad.1; Thu, 15 Feb 2024 07:44:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708011879; x=1708616679; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=daYSfFMwEOlQLZSVRUQJEmuIcA/M/NirswRAJ8iX3Yw=; b=RwcSqMyoxaGZyXCudjuiMwEbW5sjd46OP1KqY/g7Gm7j1LiZFrqSyqvhaBIK7qknpt rAyB8/IcEDLiN53AQ7eYijayU5rNaE3G5yXpmLBC8r3sSff59lpbWsUWbOkcz06jQat7 B5mwRb1Ksl0mJ5NTSiDYUTG7DsDY3EV3OwFqnL1EoLpRAfGPJGZbmo0INXrnIap6hkyp /daaoAQSAeplArPcnjoGJWny06YxJAySn62Q+4Bvuwqr0SBnERNFtVPSl1XnSiQIACaq 7DrgcLJn3K9dCFM2GImf4BzqeUJR18E5baYlW87b+edvgRhiF9zAt9qMiV1UZJgPj3Ty cEUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708011879; x=1708616679; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=daYSfFMwEOlQLZSVRUQJEmuIcA/M/NirswRAJ8iX3Yw=; b=MepWJH5Yg5kFE0AnK+US7qdlmujRZxzucUZfNCbWqx8JBsTRq/ScrnypqQK8JT3YPj wjZFCr4WZKMyn3bhQwyLcvUYULnmQsW/JMbToYkijQZ7TbcazuB5PEboINB5WuBdCBsz mlcegz7a22XzsnaGPauo6COY1i/outYLsooE3jMMlYfRfU3aGFhHGcyYmuLiu93qJBf9 Q/Nf1zJEEyY3ArXlTrepsglh1obJZ1xXEi1P2as/Lz1PwQbQ8lGAdIHE02FZ25MKNUi2 +e+L6y37DZG6HY7mMnpSh7/7jxmSrfk5OQ7wVWfQwU3LnVKyUodesFQjFUfNqXjGhCfs S6nQ== X-Forwarded-Encrypted: i=1; AJvYcCVXWpvspCsHfoopt3ZUJSjZVHpGSmO4X5+/aM0hU7okwYZ9RPX5sVn7HzmubtHVHBHpF4rm2X9gpxK+KnjxVjRJPrW0fgCcfAAj9o+/ X-Gm-Message-State: AOJu0YwxnEhNeuMGJSxruUNadrIT1XOVJ+l2G80PYxKc49msLxtTJAvf P/0+zaX12NDRWhtsX6HrAM3JIQVDSGepvgOk0zB3gVNxOShi/8Cc X-Received: by 2002:a17:902:ba94:b0:1d9:a890:e72f with SMTP id k20-20020a170902ba9400b001d9a890e72fmr1663676pls.50.1708011878678; Thu, 15 Feb 2024 07:44:38 -0800 (PST) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id f3-20020a170902e98300b001da294ff6d5sm1399882plb.189.2024.02.15.07.44.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Feb 2024 07:44:37 -0800 (PST) Sender: Guenter Roeck Message-ID: Date: Thu, 15 Feb 2024 07:44:36 -0800 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: 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: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJMaWOhks//7d92Uf3EArDlDShwR2+D+AMon8NULuLBHiE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FKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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; } 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 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 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