Received: by 2002:ac8:6d01:0:b0:423:7e07:f8e4 with SMTP id o1csp6918513qtt; Mon, 18 Dec 2023 10:13:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IG0Zw0nSjhOfsth2g+H77LoECl/R24OG8GakkbiF7uqMrOujl1i7d0OqWP2wKZsPXYUeB0k X-Received: by 2002:ac8:7d0e:0:b0:41e:9953:ff93 with SMTP id g14-20020ac87d0e000000b0041e9953ff93mr23730320qtb.19.1702923213855; Mon, 18 Dec 2023 10:13:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702923213; cv=pass; d=google.com; s=arc-20160816; b=0rI/FerQ02tzgGarHi7Ykr+/Dq6E2EYIDdN6hWXeILEQdx2zSevbsv9m+Z1FjvU7ID VhbppxKURVS7of8yT9u+nq5XTkRINhFKW5QuXJtnuZpIn4T7uN8rxudCwwYa5kK1BpuR Lx3bhujpMPqw90VvvIcDUn3TRzfaOlMdErx1UEZfZ3KXEggEDgWuBuuTMUARo/YjI3DF 5SWYhrhmBA11lTfwJRs25gs8V0eJiY1OqlE/OxutbEUH+nHZ9DxZMbuf6jOaaDzW85KL 45AvKc3VtzV21wynp4RdBEfFu0sE3eFXmoyGvjFYINj7k7SEVXos9L1HeEl+wBOs3jZd kwuw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:content-language:in-reply-to:user-agent :date:message-id:from:references:cc:to:subject:dkim-signature; bh=y0TiCDvJMEelyFf584S0FTAM+I3ApNf8MZF5Mav20CE=; fh=cytxNl5RLTy7r1wQ1xsmo9o0Yz84nlCVuYVUkqttWmY=; b=tW29D2XG8kmjPAnHoHBNlqAaY40ZcLULEASvQWlEVf7fOtA+e4pmcHSZ9ws2vO2LSi NKBVKc02J5pNUYALWMeSWyXGbqz5ub1comyb4Mga+fZ0cvjOPyYTjqn2JBElX6OFeoz/ Wr3isP9AaDM5XBoW6hKNMTI642NJ7HgqMM/VI4Q38j7vhHvWQRKvSGZWT4f538CpjUAc 9hJHHZeAu2OS2JzRXI+WsquETCpSuGnzKjycSyoN2LYUxjAc0ry7fPpo/0Kp4iZcHLmw xPknDXQWRBApUna1PzjQZYUuRxkN1Fd/c3Y+unQ5twJMhzEMP4N4a7KOrjQtU2GtpfrY dPpA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="wFI/A0sv"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel+bounces-4233-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4233-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t14-20020ac8738e000000b00423aafa5f11si23285059qtp.506.2023.12.18.10.13.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 10:13:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4233-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="wFI/A0sv"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel+bounces-4233-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4233-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A1EBE1C21F2B for ; Mon, 18 Dec 2023 18:13:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E6BDF5D753; Mon, 18 Dec 2023 18:13:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="wFI/A0sv" X-Original-To: linux-kernel@vger.kernel.org Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2087.outbound.protection.outlook.com [40.107.100.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06DDF5D732; Mon, 18 Dec 2023 18:13:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WX6+dfZlekgYthzemwkbjiybg1SGDBbo6ur3KP5Y4LStMJHkTxK2+UU0ZGOH0sK5bLLdluji/3WTkyZSJSI6+Jf/dwc5/marHjWS2sPPqoFUa1hXKjeEABCm8F/retCL+4SOgm+XhFhqEt4apfEJ4lGkqft1b0dHHBkrVzYfOqcLdcOOB+s0mwAjsrOhkSwHLKFJdPjxEwpI6ReB6OiBM3VRpzIr8ErqBGUG3AY9cGRRWAW8mMzHXXmakrFTw10+Ka8NtBNDe6TLq2XtC32cDypP9wK0EyLrVtSQArF1zr8+d+gvjXmHYrzfvES2XRcocfEKzOMslFsY9P02XXQ6sA== 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=y0TiCDvJMEelyFf584S0FTAM+I3ApNf8MZF5Mav20CE=; b=TYMys15Pb5UokprZzWPWvCFVIBpYGsSaFlTaO7bEg3VzJaDa7/0FmrJfz84H60c/YtLdY8EOx2hMGou+JNDm7mnnxadIdjNfeKZlTJpEUDWK2vYsDEubjI3GvtH0/oMSm3T2Z5z2R66V357Cdfggupe/cV5hDwGTT2qGrg5grSoGeDXO1MKWEGSSmHe1mxALomR82MaxzXABLRTNwXhoroX14d5nI5h52kMtwQnUGVVTEdp7XpheyYT6RAuwmiHtNaYIXkdcNu9WebtUJUYClrNkpU4mhavQh+SE2VE0JWFMeswGB4BPwSWY9v9iySVWWr7xExdfQ4mInU/FWIzQsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y0TiCDvJMEelyFf584S0FTAM+I3ApNf8MZF5Mav20CE=; b=wFI/A0svZmQ+tT56B22ScIETCGINDIVFSMcjfrkd3vrl1QIJ5mWd+wScJFeWnQhWJV8bYe4+JWm4c+evRNkd9QvaqsDhCPUBr2LVdf/UrR7EuBYgxSF5XHAyLw9hhcTwBZG1WHpM4bb1UhbStGQxe+Y6qI0gjQyQyIBSmwfg/Pk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BYAPR12MB2869.namprd12.prod.outlook.com (2603:10b6:a03:132::30) by MW6PR12MB8959.namprd12.prod.outlook.com (2603:10b6:303:23c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.37; Mon, 18 Dec 2023 18:13:19 +0000 Received: from BYAPR12MB2869.namprd12.prod.outlook.com ([fe80::ea10:2f7:ef14:9c]) by BYAPR12MB2869.namprd12.prod.outlook.com ([fe80::ea10:2f7:ef14:9c%5]) with mapi id 15.20.7091.034; Mon, 18 Dec 2023 18:13:18 +0000 Subject: Re: [PATCH v4 6/7] firmware/efi: Process CXL Component Events To: Ira Weiny , Dan Williams , Jonathan Cameron , Shiju Jose Cc: Yazen Ghannam , Davidlohr Bueso , Dave Jiang , Alison Schofield , Vishal Verma , Ard Biesheuvel , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org References: <20231215-cxl-cper-v4-0-01b6dab44fcd@intel.com> <20231215-cxl-cper-v4-6-01b6dab44fcd@intel.com> From: Smita Koralahalli Message-ID: Date: Mon, 18 Dec 2023 10:13:16 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 In-Reply-To: <20231215-cxl-cper-v4-6-01b6dab44fcd@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SJ0PR13CA0213.namprd13.prod.outlook.com (2603:10b6:a03:2c1::8) To BYAPR12MB2869.namprd12.prod.outlook.com (2603:10b6:a03:132::30) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2869:EE_|MW6PR12MB8959:EE_ X-MS-Office365-Filtering-Correlation-Id: e6321d2c-42b4-4a2a-5652-08dbfff502c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XzCjr3Znh7QS1QxwYzWHVfkCdoOz2ay/m/dojWUJQNMukPwu05wjO2Mejfcmxh4E72BNz9rJDERmduwx2R5iRCsbT0dEeoGaXFFIA9+zTCGWCG5rUXFAlwASb0GyNkGqz6t45PDZHaqcdedckqdTrd9WPfHOWVTq6+hXlPT193DxhdiL02i7CEzKhnKVXIFIUVRpsHJC5mSRQAxyEnm+Hk21Pwio9NnPWBUlkhoHEeBVxRoj1QaDxWF9VA0EWEkkvDX0wpkNtaN0fiEsRsdIcdA0VChAZJykGvXRuUg/En4s9QPsjj78/F05IdJmq+oiNzzllQpd9eLAnTWTyDx294xy2hegQfYbLki7JgYz80J1nufn3m61uGpqEVYSiU4Vgq1VMiEawUqJ27ByEctR3cxKcCYbU2NKhbHAGf7Xy5UB7enXd+e9IEP1fRN7n8tOrlwm7l/wEmgo8213ZFNs14t+ZXlp0BCletvKEmSzes/488/n/4swJUNYNeiKxC0ffoiaU8V9wYW0HHt5Y/5p13q/dx5YMkC5KaiTiFEY8cdLJzknV258TLYXdpIfC1SIivTtKDrtIu8s7k7oQnKi7iu3P/T8QXNfMFignFdMHj6v4tVyCsZNsDRs38BlwzyRE573J7wFV+vEGNrSiGZYkw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(346002)(39860400002)(366004)(376002)(136003)(230922051799003)(186009)(64100799003)(1800799012)(451199024)(5660300002)(54906003)(8676002)(8936002)(478600001)(66476007)(66556008)(316002)(66946007)(4326008)(41300700001)(6486002)(110136005)(36756003)(31696002)(86362001)(7416002)(38100700002)(2616005)(2906002)(6512007)(53546011)(83380400001)(26005)(6506007)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VFFPMzFwcU5keHhpTWU3WitPc3BRbExXQk9Rby9aZjRE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?ZFRyVEVqaTRKeElTSzdic0VJV2kzZW9keUV0bXRock5kYXpZWkpVY3Y2UGxX?= =?utf-8?B?d0N2NCtRRGkxZ1V1a1BmS0E4WXVsUklsaHNBbTZpSTk4ZEIxRGtac0ZXcFBV?= =?utf-8?B?ZHFzeEhwOXUrODRXZlh2dWNUU29pd0tuSWV1cTBsZHdGSEFBRHh6aVJqY1k2?= =?utf-8?B?UFhEU0QrSWpCMkkwQWZQdHB3MERtUFVJUEkyU1oxaUEwN2picVEyT0FvRFo2?= =?utf-8?B?SWF2Z21tRFJHZm00Ym1CNmlhdlNmdFVKd2RaWGpUWFBlUDA3K0RKQkdMaUth?= =?utf-8?Q?4qdtQQUuyA7qp6Rw1mHLUfhNu?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e6321d2c-42b4-4a2a-5652-08dbfff502c5 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2023 18:13:18.5425 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HxrIjL9fmc9RCwetU7+j8yCn54kactRDtfF02so/57JGtuMqjOfNnKRTJs96JAkL0/exx55Mss7swuf9nQncQw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8959 On 12/15/2023 3:26 PM, Ira Weiny wrote: > BIOS can configure memory devices as firmware first. This will send CXL > events to the firmware instead of the OS. The firmware can then send > these events to the OS via UEFI. > > UEFI v2.10 section N.2.14 defines a Common Platform Error Record (CPER) > format for CXL Component Events. The format is mostly the same as the > CXL Common Event Record Format. The difference is the use of a GUID in > the Section Type rather than a UUID as part of the event itself. > > Add EFI support to detect CXL CPER records and call a registered > notifier with the event. Enforce that only one notifier call can be > registered at any time. > > Cc: Ard Biesheuvel > Signed-off-by: Ira Weiny > [snip] > + struct { > + u32 length; > + u64 validation_bits; > + struct cper_cxl_event_devid { > + u16 vendor_id; > + u16 device_id; > + u8 func_num; > + u8 device_num; > + u8 bus_num; > + u16 segment_num; > + u16 slot_num; /* bits 2:0 reserved */ > + u8 reserved; > + } device_id __packed; > + struct cper_cxl_event_sn { > + u32 lower_dw; > + u32 upper_dw; > + } dev_serial_num __packed; > + } hdr __packed; > + > + union cxl_event event; > +} __packed; > + For some reason, prefixing the struct name with __packed attribute seems to do the job. ("__packed device_id" and "__packed dev_serial_num"). Thanks, Smita