Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp910843lqo; Fri, 17 May 2024 05:36:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWml2WZBfH/HUMfxf9NAUn6aZktqt2Vnv4Z75rwQ118CeqUeh9+QJAByQNU5bOaV3zbXr24Q/jDTEY/QVNyCiZDZX7kJ89S5j5ojRtGGA== X-Google-Smtp-Source: AGHT+IEVGXZrX7LrQKH5HyIyZaai/dwwZia564rLmjLxzK5gDA01uMQTbqMg6q/60UT+0rrjr71W X-Received: by 2002:a05:6a20:c909:b0:1ad:999b:de47 with SMTP id adf61e73a8af0-1afde1d7b38mr23105271637.51.1715949402647; Fri, 17 May 2024 05:36:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715949402; cv=pass; d=google.com; s=arc-20160816; b=ssGL9W+hNv/i6BA28SkzszM69nNOTGBt9D/7csMZeiL9mJ8cjDPuRYJeO4W/jHFh0L WMONhbmVOF1SWEOq9eRvJQO3bkmx74ss93DnTZvuzsltgiOj1rh93BGuLO6bPJu/fELE 2CQ3iIs7EmGWUbEgEhiZUgRObLh83QIGShK1PNWX1Cy4+Y9Hz21cD7Av8cauCNSFEqeW tGEq/A6FBUR2gI/7j9sPqzYEUvEtFr8HdIgev1M4j+l47SNQsnTGLMiRES3BaLW2yAET /VGJr9rATb+yOsJeY0mmkMZA0M2lYcLJ0jz/Rf0gNitfiArNiTDSyEuP7QA9bshbdI31 JZfg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=jskEitw3WfFO2/PmgJWWRXcR/LfewjWVD39pFv5/540=; fh=lL+xUWFBlS4/V6eKTSjBh1iPsh/TryeaEamEzSG25SU=; b=d6Ipig77nXNZMaZlZi8YuOxwdYPIk0dumNGmVG3pV51y3pkqCR2PYR+Va00qeLNoTo jbU939mQOKu+piI9GGoIW2GNQOLgb+1E7zC6xlW7t5sJs3eT1+HVuslgylIOC+ByMRzq lkDkDLfS4VkuOPoT7FLW7l4c+sAVoNqD9JQmN/djfX8K67wIwB0541acrYGhnMD3ATzi UgL5oW5OD24lERn8nS1hJ2amix/7bjcLCBRpKNntxC4E4o9oDTuuChPDuqdyR+ACBlDC /IZ4jFTFDk8h+7MDbBZ8s+Otajb/ZalPnR33uT51P0eHrqgoRIdFJbMfMn0MNr+rKrRn 8m4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Pbev1wbq; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-181979-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181979-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2b15902si18175084b3a.232.2024.05.17.05.36.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 05:36:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181979-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Pbev1wbq; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-181979-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181979-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9E123B21829 for ; Fri, 17 May 2024 10:09:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0B632E41C; Fri, 17 May 2024 10:08:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Pbev1wbq" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 0AD6A2C69C; Fri, 17 May 2024 10:08:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715940533; cv=none; b=lG/3f37AsMJQUbl5o+PeDa6Dot/uQ42K3/bFH6XQ2ANwF37/ska9BC8/ZZzCVu2lUC6Lfq+4zpHbEaTIS/BqAJX6xNMlERsdJKmuqjboESwJzMOCVgQhvhpCVcCqO0DusI2Ho+INV2yQH517mrzF9N2ubnFvgLdPDibZiAFU/og= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715940533; c=relaxed/simple; bh=pfuCaal2BbH2H2hAduZ+yPJwkOr35rv6GubynynOKNs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XEGrk6DO/HtLyDuShdqmfBFNiURuHSKqzF4MyrChUlKEU0l5TnveN0n4FMyml+C2zprg6Up1awkwy6wqWThRYmrHAxWLtYglRPwzyx5qE79jrXxsQnEDFpMRpEHfJB02DEipCu+if5xc25adIoqG1/krImFL33v4klERyM7AggA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Pbev1wbq; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715940533; x=1747476533; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pfuCaal2BbH2H2hAduZ+yPJwkOr35rv6GubynynOKNs=; b=Pbev1wbqIcHUvtorJeWO6z2sOdpx59AE68pxNIgljVF2amXVEfNBGdqn WFqYMmnzA4fcyYWW+feuV2EwcqV4D8UqlAqGZ1oScQeBdbQKx3iYEKTCi TgwULxDjEXuzEl1WvY+E4QUtnpcvtO11vXjwL2Gt+kg0VGWfiiQbpcKZb J4FqASJe+37Vyb92OMZT4IvVjz5QKF3xU67KKO5ifHVa429vAnQBuQUaI S6u2CoBCy+rbUlEYIB7/qbyIw1ebYjzZ7a3bbqaS1Bw6PqxsdxGBiwkht RZQaHgDUoEf99E+RguMyFbpC6pP2fOl8Dq+a2oDUQBZGpCBrPv2mdSUFb w==; X-CSE-ConnectionGUID: BTgj9ey/Tmu/6pWl9wgTTQ== X-CSE-MsgGUID: c1HcfxBySPGO0vwKF/dEpA== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="11950421" X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="11950421" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 03:08:52 -0700 X-CSE-ConnectionGUID: 0KBlDWPsRzq3yu15syg1rw== X-CSE-MsgGUID: 43lF/XZvQ8yTvCWhav0Ytw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="31571973" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.localnet) ([10.245.246.21]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 03:08:49 -0700 From: "Fabio M. De Francesco" To: Jonathan Cameron Cc: Davidlohr Bueso , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] cxl/events: Use a common struct for DRAM and General Media events Date: Fri, 17 May 2024 12:08:45 +0200 Message-ID: <6226704.vuYhMxLoTh@fdefranc-mobl3> In-Reply-To: <20240516173319.00007429@Huawei.com> References: <20240516102116.3512377-1-fabio.m.de.francesco@linux.intel.com> <20240516173319.00007429@Huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Jonathan, Thanks for your comments. On Thursday, May 16, 2024 6:33:19=E2=80=AFPM GMT+2 Jonathan Cameron wrote: > On Thu, 16 May 2024 12:19:53 +0200 >=20 > "Fabio M. De Francesco" wrote: > > cxl_event_common was a poor naming choice and caused confusion with the > > existing Common Event Record. > >=20 > > Use cxl_event_media as a common structure to record information about D= RAM > > and General Media events because it simplifies handling the two events. > >=20 > > Suggested-by: Dan Williams > > Fixes: 6aec00139d3a ("cxl/core: Add region info to cxl_general_media and > > cxl_dram events") Signed-off-by: Fabio M. De Francesco > > --- >=20 > Packing question inline. > > > [...] > >=20 > > -struct cxl_event_dram { > > +struct cxl_event_media { > >=20 > > struct cxl_event_record_hdr hdr; > >=20 > > - __le64 phys_addr; > > - u8 descriptor; > > - u8 type; > > - u8 transaction_type; > > - u8 validity_flags[2]; > > - u8 channel; > > - u8 rank; > > - u8 nibble_mask[3]; > > - u8 bank_group; > > - u8 bank; > > - u8 row[3]; > > - u8 column[2]; > > - u8 correction_mask[CXL_EVENT_DER_CORRECTION_MASK_SIZE]; > > - u8 reserved[0x17]; > > + struct_group_tagged(cxl_event_media_hdr, media_hdr, > > + __le64 phys_addr; > > + u8 descriptor; > > + u8 type; > > + u8 transaction_type; > > + u8 validity_flags[2]; > > + u8 channel; > > + u8 rank; > > + ); >=20 > Does the struct that is created end up __packed? No, I should have noticed it. > Also, why is tagged useful here? It is not useful. I'll rework it not tagged. Again thanks, =46abio > > + union { > > + struct_group(general, > > + u8 device[3]; > > + u8=20 component_id[CXL_EVENT_GEN_MED_COMP_ID_SIZE]; > > + u8 gen_reserved[46]; > > + ); > > + struct_group(dram, > > + u8 nibble_mask[3]; > > + u8 bank_group; > > + u8 bank; > > + u8 row[3]; > > + u8 column[2]; > > + u8=20 correction_mask[CXL_EVENT_DER_CORRECTION_MASK_SIZE]; > > + u8 dram_reserved[0x17]; > > + ); > > + }; > >=20 > > } __packed; > > =20