Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3738014ybl; Mon, 12 Aug 2019 05:40:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5zsXJdA4RRoVJPoUUlzMZ98uOtlv9u7qroAvNlX8stEZCO0ExtlVRHfj52Tu1fbhnQ6xQ X-Received: by 2002:a62:198d:: with SMTP id 135mr35172955pfz.169.1565613624310; Mon, 12 Aug 2019 05:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565613624; cv=none; d=google.com; s=arc-20160816; b=aOxuRBNKcAV/Ikw7HAkrcVvAlQyHX8XTkb+D6Ss9ydGUPsTW2HZ0fA8LzGEk5OuIrV PHChIVEj3qfx/vo4YeZ6lv14jHV54jUqXqelULk1b5umKBvxap7N4+JpiTuCtTvDIwWl lqDQs3a7Od+MCb84N4f6dQ6kfRth+dZziU56HW6eKnxogJ40QdB0+gsydkGi1VN400P9 iFtptQK3GwQWWrEau6GEupOVxPsvn+l9Vb63Y1pNUXJTlRvjxX0gYrJkHVwaRAq0KiF+ VT8t/vuejRo3gmi7tShK/f+a8CvBwvDWYZWoFQgXJ0n6YcH51ywmVvOYAWlME1w6/SVg f4KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SaArodZx+5q7Iuxt2E8Pyvzs8NOQXSzRyvMaHdT3syI=; b=wCcfgk76mDDyC19UmGvkQStb7bpyRuSVlLLVAR8jzUCMYHH0DT9JDRwecucXQhrJhN 0NpjBn3Dsl4pW5aw4dZsS4fXRtpXknZ6zP01CIurEL31AOJsIHjhCiR9fR9W7j7XxZE6 adHPKeQf8Ws0vRN/wzlX7Jas04ZvTl2gXIjI3N+UhYUg6ls/ISh3yRPqo4OOXvDfnZIp P/IGSvGv44KQnVqoCtBFNzwK2xP3GwQkptb68N2T6Qn0RSZKB9Xuk2RoLKEhzRpuJc3C YZDpWJqzN37bX1zTTSolUf0ZOKnVox9F2qowyXUBsrjjsSzG9m+XE5O97sbDuc9EUN13 bmaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=eSmgO6DX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id t5si13656334plz.371.2019.08.12.05.40.08; Mon, 12 Aug 2019 05:40:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=eSmgO6DX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726497AbfHLMiE (ORCPT + 99 others); Mon, 12 Aug 2019 08:38:04 -0400 Received: from mail.skyhub.de ([5.9.137.197]:58618 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726219AbfHLMiD (ORCPT ); Mon, 12 Aug 2019 08:38:03 -0400 Received: from zn.tnic (p200300EC2F06270038B9220C3BC92516.dip0.t-ipconnect.de [IPv6:2003:ec:2f06:2700:38b9:220c:3bc9:2516]) (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 6522C1EC067D; Mon, 12 Aug 2019 14:38:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1565613482; 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=SaArodZx+5q7Iuxt2E8Pyvzs8NOQXSzRyvMaHdT3syI=; b=eSmgO6DXKEyca86l5+4J4tIVGCZ/wU4V9IB66NTCZ71OAAM2iR8Wb1scWcC33SOpXpN7MB To8Tyy7l39W585Yf4gFkhLT/H5R4fBkf3FGThVe9LoUmumsD8FmviH4Gpuk7IMaZukXl67 0DBk5dI7EgOvPkrtT8od+y5oD2qAYq4= Date: Mon, 12 Aug 2019 14:38:47 +0200 From: Borislav Petkov To: Robert Richter Cc: James Morse , Mauro Carvalho Chehab , "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 02/24] EDAC, ghes: Fix grain calculation Message-ID: <20190812123847.GC23772@zn.tnic> References: <20190624150758.6695-1-rrichter@marvell.com> <20190624150758.6695-3-rrichter@marvell.com> <20190809131559.GF2152@zn.tnic> <20190812064147.5czmkj7e6hxgvje3@rric.localdomain> <20190812073221.GA23772@zn.tnic> <20190812120517.2kktugib244ujgvb@rric.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190812120517.2kktugib244ujgvb@rric.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 12, 2019 at 12:05:25PM +0000, Robert Richter wrote: > So for masks in the range from 0xffffffffff000000 to > 0xffffffffff7fffff we have grain_bits set to 24, which corresponds to > a grain of 0x1000000. I don't think you're reading what I'm trying to say so let me go into more detail: I'm very suspicious about any and all information we get from firmware. I think that is clear why by now. If we get an address mask, we better sanity-check that mask. For example, whether it is contiguous or whether the set bits in it are even making any sense and so on. What you're doing is assuming the firmware will give you a sensible mask and you start working with it without checking it. For example, if you get a mask of 0xffffffffff00ff00, how do you know that the grain bits are really 24? Says who? There's a hole in the damn mask so it could just as well be *anything* *but* an address mask. Hell, it can be some random garbage. Do you catch my drift now? But, since we don't use the grain all too much and don't depend on it yet, we keep it simple and lazy for now: > > "I guess we can leave it like that for now until some "inventive" > > firmware actually does it." -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.