From nobody Mon Nov 25 10:49:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1716486643; cv=none; d=zohomail.com; s=zohoarc; b=ccWZc4MmFxN90FG2ZeDeoxKgfizrzn2DttLYAIdU9gJqbtQ5S3qrzgKcQhSjJMapRc9FVCg5pwzT/xDXtdsivfohATcx1Coje4Yx+jsD6mEH2kaACz4vi+I8144iq2nopAmtjsVGAxZrsUbcoG8Y6IsGb5V8U8SVKqask2sO+Tc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716486643; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=clywKlwl+RTvBV7mwlXItxpVpcuULIu2xU0NldTj1A8=; b=BFYaWMJ4MPcbiX4IVFpWXBHeMEqFHWY4LSPNelAdl9UaJHspjoJuOXeUe3KNonn5Cd7giTAohtYR3XnFWmZh3WPBiQY3Hqx0theAKcRLuyPuLBe+A44i1iaLwvuNHcRN3t3CmZA3pwCkQ8+EmZCqXGL7pyImuvOwimWdwgN1tWY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1716486643919297.7460775810747; Thu, 23 May 2024 10:50:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sACZH-0006Qc-Rg; Thu, 23 May 2024 13:49:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sACYk-0005yP-KI for qemu-devel@nongnu.org; Thu, 23 May 2024 13:49:03 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sACYX-0003eT-Lk for qemu-devel@nongnu.org; Thu, 23 May 2024 13:48:49 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1ee5235f5c9so122444335ad.2 for ; Thu, 23 May 2024 10:48:43 -0700 (PDT) Received: from localhost.localdomain ([2601:646:8f03:9fee:4f9e:216e:ed5a:642d]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0c137e7esm253436265ad.257.2024.05.23.10.48.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 10:48:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716486522; x=1717091322; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=clywKlwl+RTvBV7mwlXItxpVpcuULIu2xU0NldTj1A8=; b=YOvwPqYaUAAKjGixJR9mhgkDRw4xrGsc28h97GsfExuCN4szIikkzkRLeHGpOA4irx GQqMtpQw5gZhXCX/tpCQs00BqXrlzFoWu/ViMiPrwo5VatPs7mFYRiHLLL8Q5umL8WLn YeEMqnVtCymD8Rhx9RGorMsNIiVp+ttoAMIvdMARmN4Zmm51l1Ysbb1dXVhEx3VzrKoS Xhptysq2Yd+fY0dKTJIwnLFZcDk4uaRDgQjkXVS4pTHL15xI/4ftQTAYlq/2byzFzDTh 2zAm5M8S7N5VmsqdBTSUY0VRAkkDPBajGQZCyoPYl2NXjJNRyl0Pz6bcUytOrkhH8ha3 oF7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716486522; x=1717091322; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=clywKlwl+RTvBV7mwlXItxpVpcuULIu2xU0NldTj1A8=; b=fHSV03XWiMYMI3JIlzREgTIyefzF5UNXBobr+NsKgOnur/qtOw1aGBLIivfyOqCeNF IlTEAQ2380JZkhYUdS7jcGB0D/h+Lu2nrEqHCJuHiqlluGgulR7j8O/kOvhqV9xUGlQO IB5juMYNGtZDg1iSiENu/hn6/7ack6Z4pH3PfIXla05pkEHKsyAG8JFsDO1FkvdudbNS dEtsyWbiwn25J/MgrRwfHNVQTUNBJQQBrBc5HS8urI5oyp7VlUJgY//RuI6qORVuLKzb 1/y0i9hAvvjcDCZuwEhw7HZU9FNTesDOVU8rEo9w9kqZ9B215djNXlXb7EyDx40G36rY yx0w== X-Gm-Message-State: AOJu0YxKeP9ZAJTxFfu6qer1Xax3EFKldL41whK6sCvFihuFO8QQZgBx ENHWetgg3cfFWWqbWjLQZdnJzkeiX3YwvklEF8eUwllkfhXftIocnWZUZw== X-Google-Smtp-Source: AGHT+IF1+uz93o85wiyhvEHCSjso2zhI95Lq8pWaJRgvaUUckzRdrRduv7BscqUJRGL8LOFeTTZY6w== X-Received: by 2002:a17:902:e80f:b0:1f3:3102:1609 with SMTP id d9443c01a7336-1f4497e588amr367845ad.50.1716486522306; Thu, 23 May 2024 10:48:42 -0700 (PDT) From: nifan.cxl@gmail.com To: qemu-devel@nongnu.org Cc: jonathan.cameron@huawei.com, linux-cxl@vger.kernel.org, gregory.price@memverge.com, ira.weiny@intel.com, dan.j.williams@intel.com, a.manzanares@samsung.com, dave@stgolabs.net, nmtadam.samsung@gmail.com, nifan.cxl@gmail.com, jim.harris@samsung.com, Jorgen.Hansen@wdc.com, wj28.lee@gmail.com, armbru@redhat.com, mst@redhat.com, Fan Ni , Jonathan Cameron Subject: [PATCH v8 03/14] hw/cxl/cxl-mailbox-utils: Add dc_event_log_size field to output payload of identify memory device command Date: Thu, 23 May 2024 10:44:43 -0700 Message-ID: <20240523174651.1089554-4-nifan.cxl@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240523174651.1089554-1-nifan.cxl@gmail.com> References: <20240523174651.1089554-1-nifan.cxl@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=nifan.cxl@gmail.com; helo=mail-pl1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1716486644714100003 Content-Type: text/plain; charset="utf-8" From: Fan Ni Based on CXL spec r3.1 Table 8-127 (Identify Memory Device Output Payload), dynamic capacity event log size should be part of output of the Identify command. Add dc_event_log_size to the output payload for the host to get the info. Reviewed-by: Gregory Price Reviewed-by: Jonathan Cameron Signed-off-by: Fan Ni --- hw/cxl/cxl-mailbox-utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c index 4bcd727f4c..ba1d9901df 100644 --- a/hw/cxl/cxl-mailbox-utils.c +++ b/hw/cxl/cxl-mailbox-utils.c @@ -21,6 +21,7 @@ #include "sysemu/hostmem.h" =20 #define CXL_CAPACITY_MULTIPLIER (256 * MiB) +#define CXL_DC_EVENT_LOG_SIZE 8 =20 /* * How to add a new command, example. The command set FOO, with cmd BAR. @@ -780,8 +781,9 @@ static CXLRetCode cmd_identify_memory_device(const stru= ct cxl_cmd *cmd, uint16_t inject_poison_limit; uint8_t poison_caps; uint8_t qos_telemetry_caps; + uint16_t dc_event_log_size; } QEMU_PACKED *id; - QEMU_BUILD_BUG_ON(sizeof(*id) !=3D 0x43); + QEMU_BUILD_BUG_ON(sizeof(*id) !=3D 0x45); CXLType3Dev *ct3d =3D CXL_TYPE3(cci->d); CXLType3Class *cvc =3D CXL_TYPE3_GET_CLASS(ct3d); CXLDeviceState *cxl_dstate =3D &ct3d->cxl_dstate; @@ -807,6 +809,7 @@ static CXLRetCode cmd_identify_memory_device(const stru= ct cxl_cmd *cmd, st24_le_p(id->poison_list_max_mer, 256); /* No limit - so limited by main poison record limit */ stw_le_p(&id->inject_poison_limit, 0); + stw_le_p(&id->dc_event_log_size, CXL_DC_EVENT_LOG_SIZE); =20 *len_out =3D sizeof(*id); return CXL_MBOX_SUCCESS; --=20 2.43.0