Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp508487pxk; Thu, 24 Sep 2020 10:52:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyXK8LSJpSE7arfKbrynLX6uZl0VSugfizqwIllHtLNsOJ6UrS4XHcfdzXN0mv9ucsXOoM X-Received: by 2002:a05:6402:22b4:: with SMTP id cx20mr1148294edb.372.1600969926510; Thu, 24 Sep 2020 10:52:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600969926; cv=none; d=google.com; s=arc-20160816; b=qwLN6t5RTQEMStc8xXkcEr4B27PZazOWKrNEQ2carXEzu5IZTQgQRP9FxyhHt12RVm 8hUU5jD4xT3TQimWLeYSp5FwXCrgjvUrQ26vQiHtShFROVnXcFbxGJGHiWReHPx919mk fL+guKJRzthV9WmwEN2lMujy+E0KWrJ+JvvFLGHHxxmqkt9DbipzZ3b2jSaHfTXtFKyv F2fKD+5tuelCDqrOJfT3bNMfadCboZFvhBHlVNEBddA9Jol5avxLRm1SOi7LfHptQRyD Trz7M2XVNU7L4oaqktvKzXZToLGKW/uCp5R5LLF7iTflk6vRd6frdbv3Ftxmczk+hrc2 PJJw== 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=jfRzOGxtZvjYf5N7iGsgF7Urgvx5Y3pGCuZvz+8Q08g=; b=YlX/NQ96dj/n/Pk5uWvl3IyoIzHagGKYAQ65A5NS30kkzdcQy0d9DafnZJK9TFMaRT O1Os3ShWDSxzi8YxYy88agG5qPXPfw9s01X94MdDSzAAtlTpb1sduIO7+jomxpo6+K3A ecTlZ8V/Tjvg8NZPS2VwMgfqVZBvfg8cb2JWAx802FLF2mO6eTqYB47OojqXTL5zJo4Z w6A6wngL7NOZAH+nQyCR57TPTwfIrZ9HhG5Xo+BO5KSG33isTaDS8Fw8NQtgUw9kb8+L QM/qRul8nuBk/CLHMZfH0JIsCvvLGSx1PteVKfmY57FN7wV9ItPBTuGOngz28Znn2i8w 752A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=fJQrWWBx; 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 gs20si175980ejb.230.2020.09.24.10.51.38; Thu, 24 Sep 2020 10:52:06 -0700 (PDT) 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=fJQrWWBx; 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 S1728448AbgIXRud (ORCPT + 99 others); Thu, 24 Sep 2020 13:50:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726477AbgIXRuc (ORCPT ); Thu, 24 Sep 2020 13:50:32 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA809C0613CE; Thu, 24 Sep 2020 10:50:32 -0700 (PDT) Received: from zn.tnic (p200300ec2f0c950018c19313925c730a.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:9500:18c1:9313:925c:730a]) (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 2067F1EC032C; Thu, 24 Sep 2020 19:50:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1600969831; 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=jfRzOGxtZvjYf5N7iGsgF7Urgvx5Y3pGCuZvz+8Q08g=; b=fJQrWWBxWiTJFxYjQsiJTA0UTQ/IXImt1eu0XyQf2ZG3rCByXxu+0aHFUwX6chYSD8LHjm 4FOKL0nUOJPCgbvpVCJSMXElbiXyD8lymAvjxl/GnWEePzZWZ2WTgSCTo9gPlIQCEXxYPV oVSyuPywWRjrUQiqdxdMs7p3RPSgpI4= Date: Thu, 24 Sep 2020 19:50:23 +0200 From: Borislav Petkov To: Smita Koralahalli Channabasappa , Punit Agrawal Cc: Smita Koralahalli , x86@kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-edac@vger.kernel.org, linux-efi@vger.kernel.org, linux-acpi@vger.kernel.org, devel@acpica.org, Tony Luck , "Rafael J . Wysocki" , Len Brown , Ard Biesheuvel , Yazen Ghannam Subject: Re: [PATCH v4] cper, apei, mce: Pass x86 CPER through the MCA handling chain Message-ID: <20200924175023.GN5030@zn.tnic> References: <20200904140444.161291-1-Smita.KoralahalliChannabasappa@amd.com> <87wo0kiz6y.fsf@kokedama.swc.toshiba.co.jp> <20200923140512.GJ28545@zn.tnic> <87pn6chwil.fsf@kokedama.swc.toshiba.co.jp> <52c50f37-a86c-57ad-30e0-dac0857e4ef7@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <52c50f37-a86c-57ad-30e0-dac0857e4ef7@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 24, 2020 at 12:23:27PM -0500, Smita Koralahalli Channabasappa wrote: > > Even though it's not defined in the UEFI spec, it doesn't mean a > > structure definition cannot be created. Created for what? That structure better have a big fat comment above it, what firmware generates its layout. > > After all, the patch is relying on some guarantee of the meaning of > > the values and their ordering. AFAICT, this looks like an ad-hoc definition and the moment they change it in some future revision, that struct of yours becomes invalid so we'd need to add another one. > > If the patch is relying on the definitions in the SMCA spec it is a good Yes, what SMCA spec is that? > > idea to reference it here - both for review and providing relevant > > context for future developers. > > Okay, I agree the structure definition will make the code less arbitrary > and provides relevant context compared to pointer arithmetic. I did not > think this way. I can try this out if no objections. Again, this struct better have "versioning" info because the moment your fw people change it in some future platform, this code needs touching again. It probably would need touching even with the offsets if those offsets change but at least not having it adhere to some slow-moving spec is probably easier in case they wanna add/change fields. So Smita, you probably should talk to fw people about how stable that layout at ctx_info + 1 is going to be wrt future platforms so that we make sure we only access the correct offsets, now and on future platforms. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette