From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B9E7C4332F for ; Wed, 16 Nov 2022 12:52:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233045AbiKPMwD (ORCPT ); Wed, 16 Nov 2022 07:52:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233719AbiKPMvx (ORCPT ); Wed, 16 Nov 2022 07:51:53 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6252D24092; Wed, 16 Nov 2022 04:51:49 -0800 (PST) Received: from frapeml100004.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4NC2qv4cPSz687rH; Wed, 16 Nov 2022 20:47:07 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (7.191.163.240) by frapeml100004.china.huawei.com (7.182.85.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 16 Nov 2022 13:51:47 +0100 Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 16 Nov 2022 12:51:46 +0000 Date: Wed, 16 Nov 2022 12:51:45 +0000 From: Jonathan Cameron To: CC: Dan Williams , Ira Weiny , Vishal Verma , Dave Jiang , Ben Widawsky , Steven Rostedt , Ingo Molnar , , Subject: Re: [PATCH v3 5/6] tools/testing/cxl: Mock the max err records field of Identify cmd Message-ID: <20221116125145.000009c2@Huawei.com> In-Reply-To: <14b883bd220ff388cc3a287cf104d83d53a2f520.1668115235.git.alison.schofield@intel.com> References: <14b883bd220ff388cc3a287cf104d83d53a2f520.1668115235.git.alison.schofield@intel.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 10 Nov 2022 19:12:43 -0800 alison.schofield@intel.com wrote: > From: Alison Schofield > > The CXL mbox command Identify reports the maximum media error > records that a device will report. Mock it here for testing > the GET POISON LIST mbox command. > > Signed-off-by: Alison Schofield > --- > tools/testing/cxl/test/mem.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/tools/testing/cxl/test/mem.c b/tools/testing/cxl/test/mem.c > index aa2df3a15051..f0704d090073 100644 > --- a/tools/testing/cxl/test/mem.c > +++ b/tools/testing/cxl/test/mem.c > @@ -111,6 +111,10 @@ static int mock_id(struct cxl_dev_state *cxlds, struct cxl_mbox_cmd *cmd) > cpu_to_le64(DEV_SIZE / CXL_CAPACITY_MULTIPLIER), > }; > > + __le32 val = cpu_to_le32(SZ_64); > + > + memcpy(id.poison_list_max_mer, &val, 3); As in other direction, can we do this with a buffer of the right size if we can't do a put_unaligned_le24() directly. > + > if (cmd->size_out < sizeof(id)) > return -EINVAL; >