Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2828870lqo; Mon, 20 May 2024 20:02:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWK+idox0knqZn3TtDafjjKZd2tQeNCzfUH16Pz6OH2w8VAgVt2gFZ18aF4OxIquE8j+8dSTVjTl4zmhhxGAWuXKiY9x7MGeaybLdPYew== X-Google-Smtp-Source: AGHT+IFg/3Wzlf+xSOmTnO8PsJ609P3KXsXEaHmU8cxAYms+vq9qH7/ciLJbPharQex7YqJfUuue X-Received: by 2002:ac2:4645:0:b0:521:7885:150f with SMTP id 2adb3069b0e04-5220fc7dd0bmr18088631e87.28.1716260547210; Mon, 20 May 2024 20:02:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716260547; cv=pass; d=google.com; s=arc-20160816; b=gWTHGz/dxif8HdNYgiFt60rTxCJSVgpDyWGb6P7YU8o7R2qLF1BeUIScppvOnz/xNk owAexeYtwzeYJkthp5aDkHUK8mpqwNGlr/46ez47lIc1JAI/LZjMrbWuay89XwTQcx8x ry4uE4GzzdHw4DSznHqzWiIUYq0NoBxUKZmtKMye5upJ3kGOixdPoL7AGp6QT+FwGc4V tm0DBrPuugi4GSffCX1v1pn1qQSd2zwhh5zDr9oYUM35DHhk/bu8VSzoP8+f4sjl+w94 0auxFnrIiTs14WnpNondgG8QBeuA5OlfoZ94EEiYhm4OuNOAUnfTyZnBGypIZVYL2gIb rARg== 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=xLoJgCIiBRSjXsm2hV7tn4VzKdzvYJI16DSUpZ8vAO8=; fh=B9QjCX89+p3eZeWF2orjygikOtFL+9cqLms9hi6oBw4=; b=yH86HwqFl23+ogd56w5SXDwwIPB8I20Sia8DZZTq7Jq6BuVk+8xFLN6BvlGsdgFE1b SzEYfjC4gqJx/7kPhBKzBy/RnucbZZfTWONV/ysMtkTjt4Ta8szSBkg+TZqjv3Hf484f EhB6lqodzB4ki3gKNP8gXZiU9EyGyEhqNVAjmbVuxNG4ofR2vZnn1C3eV22VOcn3cfrP mBhsdKWScdfb6l1/VOHSFnn01rq9tnJ+d3WA94FPc2+v5Drkk2Xl2ihJF7iw6MZ6b4oR 5neZ/zxyOBg+l5ML2vpVPZaVQ1rS7y41jKbydHoXW9f2eWi4lUgflMHlJ1clBl5euxK0 x7Pw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SURuoBz5; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-184281-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184281-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a1871e3ccsi1389872666b.185.2024.05.20.20.02.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 20:02:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184281-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SURuoBz5; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-184281-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184281-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 105561F210FA for ; Mon, 20 May 2024 22:57:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E68295026E; Mon, 20 May 2024 22:57:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SURuoBz5" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 7A0F82BB02; Mon, 20 May 2024 22:57:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716245840; cv=none; b=oXKzWladLpHNCTPhWqwOIhvPedbysNrg5d798qpcWaSxsAdjckqHmaWgDs9qj9onz6DyFuTsTeffJ15lchlDsHu2h22ub0rESqX/+cNR4xo08pKNxGMo1wKS75e76lOqK2OPxs3aghHtIrXz1+cWwrLBJajyjGrko9kAQSDR3YY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716245840; c=relaxed/simple; bh=hw1CkrVZiWcYewlm4mKxXcEMU+gmLH6V9X14+HZy/Tg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pIbMalKxrNZLZR9b0OoQmZ4iCbQVbBU4vUlvEGe6E6iC3SeDnvIWHKutcLG4IYIjR7UdpBA6wtP0aS8Kky+XHnDxcOzDgFYAAQrzbDXpVPg+9uG/ue7cpx1HNLw3dySB0O2POTkaVyqsBF2ZqRA91GJ1ltH948XE26yQvgn+FJI= 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=SURuoBz5; arc=none smtp.client-ip=198.175.65.10 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=1716245838; x=1747781838; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hw1CkrVZiWcYewlm4mKxXcEMU+gmLH6V9X14+HZy/Tg=; b=SURuoBz5saHrNkfILzMv6936FV93p16kgZJ1aYrceRlsJKeEc+aHyVPN uo1UwSrIBOeBxV1rJz43zbuRwPY/9SXQ/CKdv2Uua2xfSNvyyTa0v/G0j 8RwvxBLG3qoNza3bh2pDzyoNgE2MOspneaCnireo73udrPWEiexgT+18t sjLdjRs5ObqPx3ISfBsEqIYIea+BLhD5qH6OSpbjwYq+y2eTzq//dxisN 2pqw90ItSGxLHxHhRTYXKPe7mlC2e78D3dfMfLV3MrLOtJONHJxRQhCss hHuJa1m5QFw/Z7D2KrnEpzMp0/vH/OTItgCM0E9JiIIo2p3UPMshaNQ/i g==; X-CSE-ConnectionGUID: Vv4Z91c/SaScjW2E4+bx8Q== X-CSE-MsgGUID: KrvQ03twSrifqtNvsjHi6A== X-IronPort-AV: E=McAfee;i="6600,9927,11078"; a="29915599" X-IronPort-AV: E=Sophos;i="6.08,176,1712646000"; d="scan'208";a="29915599" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2024 15:57:18 -0700 X-CSE-ConnectionGUID: RX5/4wY5Qdi779Niwq4Gcg== X-CSE-MsgGUID: j89SCt2zSkyfPCdlGd4z1w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,176,1712646000"; d="scan'208";a="37461387" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.localnet) ([10.245.246.132]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2024 15:57:14 -0700 From: "Fabio M. De Francesco" To: Dan Williams , linux-cxl@vger.kernel.org Cc: Ira Weiny , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] cxl/events: Use a common struct for DRAM and General Media events Date: Tue, 21 May 2024 00:57:10 +0200 Message-ID: <2114228.Jadu78ljVU@fdefranc-mobl3> In-Reply-To: <4446774.UPlyArG6xL@fdefranc-mobl3> References: <20240518113317.3683718-1-fabio.m.de.francesco@linux.intel.com> <4446774.UPlyArG6xL@fdefranc-mobl3> 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" On Monday, May 20, 2024 7:55:17=E2=80=AFPM GMT+2 Fabio M. De Francesco wrot= e: > On Saturday, May 18, 2024 1:26:21=E2=80=AFPM GMT+2 Fabio M. De Francesco = wrote: > [...] > > diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c > index a08f050cc1ca..05de8836adea 100644 > --- a/drivers/cxl/core/mbox.c > +++ b/drivers/cxl/core/mbox.c > @@ -875,7 +875,13 @@ void cxl_event_trace_record(const struct cxl_memdev= =20 > *cxlmd, > guard(rwsem_read)(&cxl_region_rwsem); > guard(rwsem_read)(&cxl_dpa_rwsem); > =20 > - dpa =3D le64_to_cpu(evt->media_hdr.phys_addr) & CXL_DPA_M= ASK; > + if (event_type =3D=3D CXL_CPER_EVENT_GEN_MEDIA) > + dpa =3D le64_to_cpu(evt- >gen_media.media_hdr.phys_addr) > + & CXL_DPA_MASK; > + else if (event_type =3D=3D CXL_CPER_EVENT_GEN_MEDIA) > + dpa =3D le64_to_cpu(evt->dram.media_hdr.phys_addr) > + & CXL_DPA_MASK; > + > cxlr =3D cxl_dpa_to_region(cxlmd, dpa); > if (cxlr) > hpa =3D cxl_trace_hpa(cxlr, cxlmd, dpa); > diff --git a/include/linux/cxl-event.h b/include/linux/cxl-event.h > index 6562663a036d..f0a5be131e6a 100644 > --- a/include/linux/cxl-event.h > +++ b/include/linux/cxl-event.h > @@ -97,7 +97,6 @@ union cxl_event { > struct cxl_event_gen_media gen_media; > struct cxl_event_dram dram; > struct cxl_event_mem_module mem_module; > - struct cxl_event_media_hdr media_hdr; > } __packed; > =20 > /* >=20 I suspect that I didn't clarify that the diff above is proposing an additio= nal=20 little change to this patch (for v4) and that I wanted to collect comments= =20 before applying and respinning. To be clearer, that diff is meant only to show that cxl_event_media_hdr can= be=20 removed from union cxl_event at no cost while still be used for the common= =20 fields in the definitions of cxl_event_dram and cxl_event_gen_media. =46abio