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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 994CDC48BC3 for ; Mon, 19 Feb 2024 17:40:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 07A3F8D0003; Mon, 19 Feb 2024 12:40:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 02B1E8D0001; Mon, 19 Feb 2024 12:40:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E0E1A8D0003; Mon, 19 Feb 2024 12:40:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D029C8D0001 for ; Mon, 19 Feb 2024 12:40:16 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 7A3D61C044C for ; Mon, 19 Feb 2024 17:40:16 +0000 (UTC) X-FDA: 81809267232.11.EBFB519 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf27.hostedemail.com (Postfix) with ESMTP id 8F43C4001D for ; Mon, 19 Feb 2024 17:40:13 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of jonathan.cameron@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=jonathan.cameron@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708364414; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=USoL2UjyrhXjTmphlhyMn2ckXrn0ZQ/sd93X6ZS1vF0=; b=1ELb44pWT+3o6KhxypVfIKuytNFfYhOaJYHzq9wSIFBBrbju1Mupp9gWorTe00rq/r/pWV IBgrI1WyrkPlFIjDsKyb6/cVvKGegwPf4Vw4Q0GAV9Tn2iytJFqqR1/qT8PGMXcT8ra5ZS r9z6I/byz1+zsjhmdVA/Em9YihHbqT8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708364414; a=rsa-sha256; cv=none; b=4kAoIXYzUUy4nGuhuMzwrNDLL8MtJn5wbOZadfeFRp8dnnlUd6oD8/ojScEk6eABLiQfZe UdAjAWCu87QZb+WcknzpwFhfEQ4eb+qn/3490aYCc4zjlhWfszlg99kkgzVolbTprWnKdj o9bKUvtEv+UsQkUhVYmrd3l1QucY/8w= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of jonathan.cameron@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=jonathan.cameron@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4TdqTb6FGcz6K9Fx; Tue, 20 Feb 2024 01:36:35 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 58417140D1D; Tue, 20 Feb 2024 01:40:09 +0800 (CST) 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.2507.35; Mon, 19 Feb 2024 17:40:08 +0000 Date: Mon, 19 Feb 2024 17:40:08 +0000 From: Jonathan Cameron To: Srinivasulu Opensrc CC: "linux-cxl@vger.kernel.org" , "linux-mm@kvack.org" , "dan.j.williams@intel.com" , "john@jagalactic.com" , Eishan Mirakhur , Ajay Joshi , Ravis OpenSrc , Srinivasulu Thanneeru , "shiju.jose@huawei.com" Subject: Re: [EXT] Re: [PATCH] cxl/mbox: Add Get Log Capabilities, Clear Log and Get Supported Logs Sub-List commands Message-ID: <20240219174008.000061b4@Huawei.com> In-Reply-To: <9a9e96a742e8417bb84945563d80163f@micron.com> References: <20240207103634.199-1-sthanneeru.opensrc@micron.com> <20240208125713.00004776@Huawei.com> <834c6fec2ed74f9da7643ee61843373d@micron.com> <20240215122653.00005ce2@Huawei.com> <9a9e96a742e8417bb84945563d80163f@micron.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: lhrpeml100003.china.huawei.com (7.191.160.210) To lhrpeml500005.china.huawei.com (7.191.163.240) X-Stat-Signature: f3a4i7s73jiti9wrzi7h3g8dir4s7b19 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 8F43C4001D X-Rspam-User: X-HE-Tag: 1708364413-265293 X-HE-Meta: U2FsdGVkX1/e8CT4JBTWLrx6GWjLz1qFe0RPEd8XZdF4aTDuH+nVNOIY6JSd1BRyPjC5beOuQYTU0c9rgBoUeBqhk9y97Za2G6dKyI/9ijbduIpn77+BCMtC4ER1ogAgIjpsd2mb94vrjnQz9s42rtskxigfUp08Jy9+26dDBdRhQ5WK3Z8LptQ9RH1UMkeZbWb4vGPKmuQfAevkzTU9bMwOGKSMkl2YSB4NAieB8k6xXGic6cLn7ZQkC5K09h0U76QyRyyG2FsMFoKTKv6MReLnSRdQ9Q9qZb9KE+WtkK4HMcVT/gqRWC/D+e9n+S1bul9gFKN486DdWLJ48ueQnoIaaYE25pc4P32NRjad60DQ9jgGZZoDQ9L5307jmuHAYKz0NzRBilO4YkK20xVG2OZEDwquLC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BMc2bwm2GEFJcBMitunyAjYynWeCEl8w== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Mon, 19 Feb 2024 17:32:25 +0000 Srinivasulu Opensrc wrote: > > -----Original Message----- > > From: Jonathan Cameron > > Sent: Thursday, February 15, 2024 5:57 PM > > To: Srinivasulu Opensrc > > Cc: linux-cxl@vger.kernel.org; linux-mm@kvack.org; > > dan.j.williams@intel.com; john@jagalactic.com; Eishan Mirakhur > > ; Ajay Joshi ; Ravis > > OpenSrc ; Srinivasulu Thanneeru > > ; shiju.jose@huawei.com > > Subject: Re: [EXT] Re: [PATCH] cxl/mbox: Add Get Log Capabilities, Clear Log > > and Get Supported Logs Sub-List commands > > > > CAUTION: EXTERNAL EMAIL. Do not click links or open attachments unless > > you recognize the sender and were expecting this message. > > > > > > On Wed, 14 Feb 2024 16:09:01 +0000 > > Srinivasulu Opensrc wrote: > > > > > > -----Original Message----- > > > > From: Jonathan Cameron > > > > Sent: Thursday, February 8, 2024 6:27 PM > > > > To: Srinivasulu Opensrc > > > > Cc: linux-cxl@vger.kernel.org; linux-mm@kvack.org; > > > > dan.j.williams@intel.com; john@jagalactic.com; Eishan Mirakhur > > > > ; Ajay Joshi ; Ravis > > > > OpenSrc ; Srinivasulu Thanneeru > > > > ; shiju.jose@huawei.com > > > > Subject: [EXT] Re: [PATCH] cxl/mbox: Add Get Log Capabilities, Clear Log > > and > > > > Get Supported Logs Sub-List commands > > > > > > > > CAUTION: EXTERNAL EMAIL. Do not click links or open attachments unless > > > > you recognize the sender and were expecting this message. > > > > > > > > > > > > On Wed, 7 Feb 2024 16:06:34 +0530 > > > > wrote: > > > > > > > > > From: Srinivasulu Thanneeru > > > > > > > > > > Adding UAPI support for > > > > > 1. CXL r3.1 8.2.9.5.3 Get Log Capabilities. > > > > > 2. CXL r3.1 8.2.9.5.4 Clear Log commands. > > > > > 3. CXL r3.1 8.2.9.5.6 Get Supported Logs Sub-List. > > > > > > > > > > Signed-off-by: Srinivasulu Thanneeru > > > > > > > > > > Hi Srinivasulu, > > > > > > > > Whilst I can conjecture some valid reasons to expose these to > > > > userspace, can you add some examples to this patch description? > > > > > > > > We might want to filter the clear in particular to avoid a clash > > > > with the driver log handling. That is only allow it for vendor > > > > logs. > > > > > > Are you suggesting that I should restrict the "Vendor Debug Log" > > functionality to > > > only apply to Vendor logs.? Why not include Component State Dumps logs > > that > > > support the clear log feature? > > > > > > I might be overlooking something; please enlighten me. > > > > I had an old copy of the spec open. Indeed component state dumps > > should be safe to expose as well. > > Thank you, Jonathan. > I'm considering adding the following snippet to the V2 patch for "clear log" filtering. > Any initial feedback would be appreciated. That's definitely an improvement and should let the discussion move forwards. Jonathan > > -------------- > --- a/drivers/cxl/core/mbox.c > +++ b/drivers/cxl/core/mbox.c > enum { > CEL_UUID, > VENDOR_DEBUG_UUID, > + COMPONENT_STATE_DUMP_UUID, > }; > > /* See CXL 2.0 Table 170. Get Log Input Payload */ > static const uuid_t log_uuid[] = { > [CEL_UUID] = DEFINE_CXL_CEL_UUID, > [VENDOR_DEBUG_UUID] = DEFINE_CXL_VENDOR_DEBUG_UUID, > + [COMPONENT_STATE_DUMP_UUID] = DEFINE_CXL_COMPONENT_STATE_DUMP_UUID, > }; > > /* > @@ -333,6 +346,12 @@ static bool cxl_payload_from_user_allowed(u16 opcode, void *payload_in) > return false; > break; > } > + > + case CXL_MBOX_OP_CLEAR_LOG: { > + const uuid_t *uuid = (uuid_t *)payload_in; > + return (uuid_equal(uuid, &log_uuid[VENDOR_DEBUG_UUID])) || > + (uuid_equal(uuid, &log_uuid[COMPONENT_STATE_DUMP_UUID])) > + } > } > > diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h > --- a/drivers/cxl/cxlmem.h > +++ b/drivers/cxl/cxlmem.h > @@ -565,6 +565,9 @@ enum cxl_opcode { > #define DEFINE_CXL_VENDOR_DEBUG_UUID \ > UUID_INIT(0xe1819d9, 0x11a9, 0x400c, 0x81, 0x1f, 0xd6, 0x07, 0x19, \ > 0x40, 0x3d, 0x86) > +#define DEFINE_CXL_COMPONENT_STATE_DUMP_UUID > + UUID_INIT(0x3fab4cf, 0x01b6, 0x4332, 0x94, 0x3e, 0x5e, 0x99, 0x62, \ > + 0xf2, 0x35, 0x67) > -------------- > > > > > > For example, following both supports Clear log in our setups. > > > * 5e1819d9-11a9-400c-811f-d60719403d86 - Vendor Debug Log > > > * b3fab4cf-01b6-4332-943e-5e9962f23567 - Component State Dump Log > > > > > > > > > > > Perhaps split the patch into 2 parts. The less controversial > > > > GET_LOG_CAPS and GET_LOG_SUBLIST, followed by a patch for the > > > > destructive clear log. > > > > > > > > The memory scrub handling might well > > > > access the ECS log for example (I don't think the current proposal > > > > yet does this). > > > > > > > > Jonathan > > > > > > > > > > > > > --- > > > > > drivers/cxl/core/mbox.c | 3 +++ > > > > > drivers/cxl/cxlmem.h | 3 +++ > > > > > include/uapi/linux/cxl_mem.h | 3 +++ > > > > > 3 files changed, 9 insertions(+) > > > > > > > > > > diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c > > > > > index 27166a411705..64a44e286488 100644 > > > > > --- a/drivers/cxl/core/mbox.c > > > > > +++ b/drivers/cxl/core/mbox.c > > > > > @@ -64,6 +64,9 @@ static struct cxl_mem_command > > > > cxl_mem_commands[CXL_MEM_COMMAND_ID_MAX] = { > > > > > CXL_CMD(SET_SHUTDOWN_STATE, 0x1, 0, 0), > > > > > CXL_CMD(GET_SCAN_MEDIA_CAPS, 0x10, 0x4, 0), > > > > > CXL_CMD(GET_TIMESTAMP, 0, 0x8, 0), > > > > > + CXL_CMD(GET_LOG_CAPS, 0x10, 0x4, 0), > > > > > + CXL_CMD(CLEAR_LOG, 0x10, 0, 0), > > > > > + CXL_CMD(GET_LOG_SUBLIST, 0x2, CXL_VARIABLE_PAYLOAD, 0), > > > > > }; > > > > > > > > > > /* > > > > > diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h > > > > > index 5303d6942b88..4128c810051c 100644 > > > > > --- a/drivers/cxl/cxlmem.h > > > > > +++ b/drivers/cxl/cxlmem.h > > > > > @@ -529,6 +529,9 @@ enum cxl_opcode { > > > > > CXL_MBOX_OP_SET_TIMESTAMP = 0x0301, > > > > > CXL_MBOX_OP_GET_SUPPORTED_LOGS = 0x0400, > > > > > CXL_MBOX_OP_GET_LOG = 0x0401, > > > > > + CXL_MBOX_OP_GET_LOG_CAPS = 0x0402, > > > > > + CXL_MBOX_OP_CLEAR_LOG = 0x0403, > > > > > + CXL_MBOX_OP_GET_LOG_SUBLIST = 0x0405, > > > > > > > > Name should include something to make it clear this is getting > > > > sublist of 'supported' logs. Not the log. > > > > > > > > > CXL_MBOX_OP_IDENTIFY = 0x4000, > > > > > CXL_MBOX_OP_GET_PARTITION_INFO = 0x4100, > > > > > CXL_MBOX_OP_SET_PARTITION_INFO = 0x4101, > > > > > diff --git a/include/uapi/linux/cxl_mem.h > > b/include/uapi/linux/cxl_mem.h > > > > > index 42066f4eb890..d2df9782a5ef 100644 > > > > > --- a/include/uapi/linux/cxl_mem.h > > > > > +++ b/include/uapi/linux/cxl_mem.h > > > > > @@ -47,6 +47,9 @@ > > > > > ___DEPRECATED(SCAN_MEDIA, "Scan Media"), \ > > > > > ___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"), > > \ > > > > > ___C(GET_TIMESTAMP, "Get Timestamp"), \ > > > > > + ___C(GET_LOG_CAPS, "Get Log Capabilities"), \ > > > > > + ___C(CLEAR_LOG, "Clear Log"), \ > > > > > + ___C(GET_LOG_SUBLIST, "Get Log Sublist"), \ > > > > > > > > Likewise, mention it's list of supported logs. > > > > > > > > > ___C(MAX, "invalid / last command") > > > > > > > > > > #define ___C(a, b) CXL_MEM_COMMAND_ID_##a > > > >