Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4529384pxb; Tue, 25 Jan 2022 12:22:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzdHoPSbmlUFzM/NEiEpsZsyKZFzkvq4eFuJnM5YhUTLcYGEDCoULEZgvxzO6EGLC0xWBf2 X-Received: by 2002:a17:90a:e387:: with SMTP id b7mr5257526pjz.89.1643142133010; Tue, 25 Jan 2022 12:22:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643142133; cv=none; d=google.com; s=arc-20160816; b=H8fgO6lCwtdxqIEl0ym2vg7CxkI3MUf/OALrjpmqGcEomb+TaAa7dYQM61VjEdSE8U lU0/O76dQjp+/PeIidbFWFLPf7OU+e/3+c3WWoZrcAt78xiL+GagQZK8UxssofoZuvUw AjsO/2vRJJ3bhz4GCR3ptF8aJDrWOqvLDUG0+Em6Hv+hTWc2e9sxI03dbjwjT9s8A5VV tO9Wc+QQxh64eagnUsRGS64MP8MgaOacbgQp/tSlIywn9v0j9ZaqYEJFllOnfNpr2y0F cqaDroU4oMVjwzR7emm2FLigo1hWQdDSVqp3Be+F0KvslzDTAHaCvfMlTnzULk/8fCT/ 5J8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FmNennP2E1Srxpp/fcleOZgmfWGnml38KdonbDFAk9g=; b=pcGC8uEiUdwZr3NVS0NqZaN12etaPz08SLlVgdur2W1hCYN5phmbNfoXkpGdYNGgRc d0R/bxyqr17tLjzB4kdxNZNsDhk44d2A9YhpAObpFtiv+6oul9MP3LUcRQnDF7oujP1X 6g5Vp0qYqppmnPY+SShYKGtNr8j2xfZdoUHgc/tICvGJPpj3gEKbyzcSDZVOMIR1pscA 62T5JTrpmcnF6rhqOu1vfQ0+P0c8XUem/PzV3e+P90tIEh9lQBP9czoPYnANIxlCEt00 ybbyvPTao9eKUyXIkGGROs001wtNKQx3wovZ6vwRrO+orIF8dtYK4PtvGg7z5jn6cNRC N0vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=EY5D4y8O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q7si15667717pfs.215.2022.01.25.12.22.01; Tue, 25 Jan 2022 12:22:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=EY5D4y8O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1579919AbiAYOlB (ORCPT + 99 others); Tue, 25 Jan 2022 09:41:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1388418AbiAYOhW (ORCPT ); Tue, 25 Jan 2022 09:37:22 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 395CAC061751; Tue, 25 Jan 2022 06:37:21 -0800 (PST) Received: from zn.tnic (dslb-088-067-221-104.088.067.pools.vodafone-ip.de [88.67.221.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 37D821EC0304; Tue, 25 Jan 2022 15:37:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1643121436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=FmNennP2E1Srxpp/fcleOZgmfWGnml38KdonbDFAk9g=; b=EY5D4y8OnsmgsbSTWnFGOQ3FPGX5qVZzzYXSqqnGcAnVCeoU+QY5snRdZyUseMJPoVqQ+V TQV00VRxFTHqSTsGWYfdLn5zs73ZKvxsHv5zVprxoI0iSWuSB6j0oaVzlqmot4AmhD2bUV eDemfqtQpBw2PQ+5we9APSh7B0yQ0w4= Date: Tue, 25 Jan 2022 15:37:11 +0100 From: Borislav Petkov To: Eliav Farber Cc: mchehab@kernel.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, ronenk@amazon.com, talel@amazon.com, hhhawa@amazon.com, jonnyc@amazon.com, hanochu@amazon.com Subject: Re: [PATCH 1/4] EDAC: Fix calculation of returned address and next offset in edac_align_ptr() Message-ID: References: <20220113100622.12783-1-farbere@amazon.com> <20220113100622.12783-2-farbere@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220113100622.12783-2-farbere@amazon.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 13, 2022 at 10:06:19AM +0000, Eliav Farber wrote: > Do alignment logic properly and use 'ptr' for calculating the remainder > of the alignment. > > This became an issue because 'struct edac_mc_layer' has a size that is > not zero modulo eight, and the next offset that was prepared for the > private-data was unaligned, causing an alignment exception. How exactly did this "become an issue"? I'm asking because I have been hearing about weird bugs with that pointer alignment contraption and have never managed to reproduce them myself or hear a proper explanation from people. And that thing is an abomination, frankly, and I'd like to get rid of it but maybe some other time... So, please explain more verbosely, a specific example or how I could reproduce it, would be even better. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette