Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp393735rdb; Tue, 31 Oct 2023 10:14:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFbH44JxqC92f19HcZ+LrmGmswNxt4ptE9y+RYlTlYTyfPxiICNs3r6LVN+fcNhmiqA/ye/ X-Received: by 2002:a17:90a:cf09:b0:27d:3f93:c148 with SMTP id h9-20020a17090acf0900b0027d3f93c148mr12196950pju.13.1698772458216; Tue, 31 Oct 2023 10:14:18 -0700 (PDT) Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id a1-20020a17090a688100b002802da109fasi1207286pjd.165.2023.10.31.10.14.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 10:14:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=M0voZJjB; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 44C3B802D2C0; Tue, 31 Oct 2023 10:14:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346167AbjJaROB (ORCPT + 99 others); Tue, 31 Oct 2023 13:14:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346014AbjJaRNt (ORCPT ); Tue, 31 Oct 2023 13:13:49 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68CA4DA; Tue, 31 Oct 2023 10:13:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698772427; x=1730308427; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=NjJ67+RGeyc1aboXfZVgmCKDhiwHuo4PxuFtb33xW/4=; b=M0voZJjB0eIgmmG+78bb4mdLe/+lP2YF5ZRec82Xtzv4dhCPnG9VQoYt GkSRrA4ymNdz1m1HWlTya5h2UDVuOnFeUSPxIIZ64UKSHqHVBUugd8bwp LPL0LxSqlqlQ65X4lskz8+sYDrvE/eGAJHA1Hb/iLZiN1EJ3Vuz9L/GtB B1zsO8ruUkQvVjP49AhXB979ymu1pgSQHg1SL4F+nHU5OUbyDcoqc0seJ QIfX92IwMaZtanmaoVIpH2/DS1gZRHfIX11iCqp/1PZvhEfjmCxlKr8ln hL0EE8yHrBiF22N5NU7Ucs4IcLUx7OCHvQ8Okb+yqdXPKSgi79Kstvge3 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10880"; a="368542252" X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208";a="368542252" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2023 10:13:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208";a="8384271" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orviesa001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 31 Oct 2023 10:13:47 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 31 Oct 2023 10:13:45 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Tue, 31 Oct 2023 10:13:45 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.101) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Tue, 31 Oct 2023 10:13:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=coCmPgBstIau9DIjqaXUPSl+/G/+rSFMprDachKJi1NZbQYoL3ji0AjrhcKBgD0RA4QpmHVU7tV3kPYXN5IgR8YxM1MdU/e+lSQbCUIdHbkmW47a2dloTNHm/Sprpbre+A7sgWZCEpYJBm4uv0AkqQtOk20MBq4v/mjQhawoafkTahM6qb6FPnzhLFbw2dgZtfF/nbZ5WUbxZscTp29w3vZ6Z68ZFfMAaL6NxaYBdw3VQPfgVgJ49Z4ycUYKmRkuH6hHKeUYQs5R+Xz83LPCiTKfp0W86paKcwP7/RIunVs32/MbKiY6s/iVSYhDnijVxTFJD8zcb6rhmGTSzjNS9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=szu+z/TqVc4TgRTFplogEH8d5BJk/94Hoy81ndyqCPc=; b=IViu/b4/0z1tljl3i0879OFULoY82H0tfzbiAu8Yk8pJL75yAP3LFI3Ul2039StBmPVssHGcKsyouxYwakvAgSDg/NTenGbWMDQOCtPFEKQATkp93kKPUYeUm3L/I2nn1iKUUb3rx/9GLqX/uCYHFLCegf3DOQ2y18Zft/6l63ZQPO6NZaCIgsikSOynj5aZiUVYxuY2n3M9pNxIdULH6Rf5Ad/0swtciETU2otOYa55eYFsd5J8JhHzdi+blr6IkzptJnsiRyIjOY+Q1ljk/vlNfDx4AtF/jdMlzkIUZbvBf11Ck/4/bSOsFudmKYD/islZsV4ZQCpc4Mx1HOOHsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SA1PR11MB6733.namprd11.prod.outlook.com (2603:10b6:806:25c::17) by PH7PR11MB8273.namprd11.prod.outlook.com (2603:10b6:510:1ac::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.28; Tue, 31 Oct 2023 17:13:43 +0000 Received: from SA1PR11MB6733.namprd11.prod.outlook.com ([fe80::6874:74cc:1c23:7f1c]) by SA1PR11MB6733.namprd11.prod.outlook.com ([fe80::6874:74cc:1c23:7f1c%4]) with mapi id 15.20.6933.028; Tue, 31 Oct 2023 17:13:42 +0000 Date: Tue, 31 Oct 2023 10:13:40 -0700 From: Ira Weiny To: Dan Williams , Ira Weiny , Jonathan Cameron , Smita Koralahalli CC: Yazen Ghannam , Davidlohr Bueso , Dave Jiang , Alison Schofield , Vishal Verma , "Ard Biesheuvel" , , , , Ira Weiny Subject: RE: [PATCH RFC v2 3/3] cxl/memdev: Register for and process CPER events Message-ID: <654135c4f3e0_2e75b2949e@iweiny-mobl.notmuch> References: <20230601-cxl-cper-v2-0-314d9c36ab02@intel.com> <20230601-cxl-cper-v2-3-314d9c36ab02@intel.com> <653aee8ad2717_780ef29418@dwillia2-xfh.jf.intel.com.notmuch> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <653aee8ad2717_780ef29418@dwillia2-xfh.jf.intel.com.notmuch> X-ClientProxiedBy: BYAPR01CA0028.prod.exchangelabs.com (2603:10b6:a02:80::41) To SA1PR11MB6733.namprd11.prod.outlook.com (2603:10b6:806:25c::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA1PR11MB6733:EE_|PH7PR11MB8273:EE_ X-MS-Office365-Filtering-Correlation-Id: 40e4d141-bec0-46ed-0280-08dbda34bb9f X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IW9DryTBvSpq/A50OgF0nne5s+k+aRjGdfyt+WJF8Kr/1/TrMKh6J4A/y2B6TG+T7BNnzW6Llfhy3aXj1EiV/ISR8LdU514ylaQfiVH8v1f4V1BFBISBCKyVu5gnxsiaHnWPGuYbn79D5b6s8shhutWP7xZOxPgyWloE6yntSRLSxYdi18QvJhsi3cChVLBybvVFpqnRoqd545Xw/cxj7CaEtIJ0+Y95D8HUsgXq/H08mc65Lr6OFy276vmgyzp4k3ZSLoXRdfzz0TtyjSCexMFzfvpCRFKblqESqJhy4O9v9FiCCjQEmhKzrNXQE3x0Umzx6r4b9mqRqc6aHSeOcs4ev3JCVMCnrPb0cXAwwyC2XPY6F34rVqtuZ92GNYtwCWW97YLE/Zcbxc3q82lnDqxm8VYgrVBw3baOWxLY1R6MFvGWHsYVEzpB2alCULdHcjDsl0o2GYCcGcBEcOl5pr9xeT/cbeTqkIwSUcXoFyOo088JeXYosrzFXyXq4KBcQ9lLJmoYfsd4PZAXNXWHoEx/9LXp2FjO1ILKDZyo7QT7RZ8PhusXgt3TG7P77MAt X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR11MB6733.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(346002)(136003)(396003)(39860400002)(230922051799003)(1800799009)(64100799003)(451199024)(186009)(86362001)(82960400001)(2906002)(107886003)(6512007)(9686003)(6486002)(41300700001)(478600001)(8936002)(8676002)(4326008)(44832011)(83380400001)(26005)(6506007)(5660300002)(66556008)(110136005)(316002)(66946007)(54906003)(66476007)(38100700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?dirKpfbRGxrRXfu2Q0yiG7OuAZI+RWyB4/OjEQ9teuNfbhrnDA7MdpEqHNpW?= =?us-ascii?Q?F34kcMoG6IFh+jVtWgtbpQ4gdpePSpGKUG8rdgH904zVuBiJmO4huTyz7PnG?= =?us-ascii?Q?vCUnZ8DhlWUYijyKfX0b/iCxsSNsR42FzTPiGz/FbTtw8qTNsYvsFY49am94?= =?us-ascii?Q?TmBLkT1tFliBBwSICIcL05D/27wcQSSzJtUcUgegl/wTsXLco3dFxzrqx0Pf?= =?us-ascii?Q?Gx4InAhgEb4P0WEYBwX6DtNP/13qPU3N/Y1NY+27A5RoCrId2GddAg5UqEyt?= =?us-ascii?Q?CLx9s+124UnmXxqqR8+MCFfeEHr0zofScpF59q2dA21h+Pl+ZrS2ZRQnpnIS?= =?us-ascii?Q?XU7+0ZdrGBtDjOpTL3b/XH79no37mczLZlPgovKyMrxKq3K58gTKp14K8FAR?= =?us-ascii?Q?Bpe9cZKFpXxVZfbqWWtO7sopxwx8RwRSRiVBZOwhsFK5StBLrYOm1n7Jj3q/?= =?us-ascii?Q?F9c5TkiiK32ynPy0brg6LZ7vYCcsgfGJcW8vc4GCM6OwlW8hV1Nf+AkvcFQT?= =?us-ascii?Q?VoBdVwXN6q/4GybMYx5xlxHv5Y96Qyehaq0wNO+36T8mczaGBbLoDQTk+0/h?= =?us-ascii?Q?Mo1CCQqwJKc9+GfRCMmppj/7k7XDwMvxD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ascii?Q?nGaHJIz6O5lefi6+fvaht5AIqREJ80rOdEKN18CkTQo+DNRGwT2uf8qneGei?= =?us-ascii?Q?EjU09hz6nWBPdxzQaPZUrQHjEtJY5OJi5Mka8f3H?= X-MS-Exchange-CrossTenant-Network-Message-Id: 40e4d141-bec0-46ed-0280-08dbda34bb9f X-MS-Exchange-CrossTenant-AuthSource: SA1PR11MB6733.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2023 17:13:42.6780 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: peH7Eb4KBcspi7iWDn3PTxbrO7iLnJqS1s2J90S7dm9Bvo8kZPCuNFdXqzs9OLNO1WbbV/UhwzL1koqiHCaIew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB8273 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 31 Oct 2023 10:14:15 -0700 (PDT) Dan Williams wrote: > Ira Weiny wrote: > > If the firmware has configured CXL event support to be firmware first > > the OS can process those events through CPER records. Matching memory > > devices to the CPER records can be done via the serial number which is > > part of the CPER record header. > > > > Detect firmware first, register a notifier callback for each memdev, and > > trace events when they match a device registered. > > > > Signed-off-by: Ira Weiny > > > [..] > > The changes requested in patch2 cover all of the comments I currently > have on this patch, just one more cleanup below: > > > +#define CXL_EVENT_HDR_FLAGS_REC_SEVERITY GENMASK(1, 0) > > +int cxl_cper_event_call(struct notifier_block *nb, unsigned long action, void *data) > > +{ > > + struct cxl_cper_notifier_data *nd = data; > > + struct cxl_event_record_raw record = (struct cxl_event_record_raw) { > > + .hdr.id = UUID_INIT(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), > > + }; > > Just do: > > struct cxl_event_record_raw record = { 0 }; > > ...and the compiler will take care of the rest as initializing any field > automatically initializes everything else to zero. Not quite sure what I was thinking. This works better but I think I can avoid needing this initialization all together by reworking the structures. For now I have made the change and I'll see how it falls out. Thanks, Ira