Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3463244rdb; Wed, 13 Sep 2023 12:49:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdj8kODNr1dTu3IuyU7td2wou4+64L/o1yIVg+Pid3oWXqj9bEBEMa7BFE/jLH5J/0plbE X-Received: by 2002:a17:90a:e2ca:b0:261:2824:6b8c with SMTP id fr10-20020a17090ae2ca00b0026128246b8cmr9373535pjb.13.1694634563231; Wed, 13 Sep 2023 12:49:23 -0700 (PDT) Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id ha6-20020a17090af3c600b002632c1fc68dsi2131120pjb.72.2023.09.13.12.49.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 12:49:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@stgolabs.net header.s=dreamhost header.b=V5ULnT0j; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id B49DD80BB1FF; Wed, 13 Sep 2023 12:45:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232569AbjIMTpe (ORCPT + 99 others); Wed, 13 Sep 2023 15:45:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232600AbjIMTpa (ORCPT ); Wed, 13 Sep 2023 15:45:30 -0400 Received: from bee.birch.relay.mailchannels.net (bee.birch.relay.mailchannels.net [23.83.209.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1754F9B; Wed, 13 Sep 2023 12:45:26 -0700 (PDT) X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 020C3C0F9A; Wed, 13 Sep 2023 19:45:25 +0000 (UTC) Received: from pdx1-sub0-mail-a273.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 798FFC08C3; Wed, 13 Sep 2023 19:45:24 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1694634324; a=rsa-sha256; cv=none; b=WEJGQ8JeXgDgigOb7Zb1nsZ3vsqBgwMWGZhzdqlsc0RZ+WOaGogL4Ey+CeuRM/XXZjyGM1 G6ozkzwiYz5p4S24qBuwtQi4WqLFKlG/FXN2zQHYwdyHX7QWDYsQTEJH5CyZPp6U8kqxwV fKHA1phWW/u7bplee/aRjSsk7Jdrr9YsTT5OGVgRtyrmc/dSicdHB2On67TqiuUDjmLxdV LIYomqpZUugpj7q1T3k4KQyAJZHkRkh9dgiJNL6EHtFc4Q4Bu+ESYzLm9f0h5cV+jf6L5U RdoQseT0bYK1KzjSWgA3EubOGQymxY30RAzOiaRZNs1sejWaC6Nvz9okemH6og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1694634324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=t/4S28WbLLUM6kEPRkt99xCgd02PMnu1Es+2h6o9n6A=; b=HoMwFZaeVNoDJzRhxrXBIqIK6fQ3qxh6uE8jKuEmJCkAlVS07MYJQ599a3kaIs/j14of1p p+lRoFsYbCnlseMFQ5J+Uho75nL/9sBM6TJOVaLzxR8bV1rXklKt1MU57O7AIjGhMDBxf0 dchwmYnL0IcNJ0f4cCU9DTIz8pw7mFEMXJUnzdCIliYGthqtKBGBZFMf1+DGB2SBplcDwJ VCNKhHSYASqyH5ZWCqkDqwkApxUcqTNPVf7KdJFfaPGrwZlvP9t3Et1K2qQw7t4rsz6aVT gFFe4cD8opA7VhCTLxb0bjlpS1UB/uojN+0bR0hqgJTM3oLr0O245nnCXCwcPg== ARC-Authentication-Results: i=1; rspamd-7d5dc8fd68-5s46g; auth=pass smtp.auth=dreamhost smtp.mailfrom=dave@stgolabs.net X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|dave@stgolabs.net X-MailChannels-Auth-Id: dreamhost X-White-Gusty: 29f3b477372f4be8_1694634324802_2187681599 X-MC-Loop-Signature: 1694634324802:530843640 X-MC-Ingress-Time: 1694634324801 Received: from pdx1-sub0-mail-a273.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.115.138.83 (trex/6.9.1); Wed, 13 Sep 2023 19:45:24 +0000 Received: from offworld (ip72-199-50-187.sd.sd.cox.net [72.199.50.187]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dave@stgolabs.net) by pdx1-sub0-mail-a273.dreamhost.com (Postfix) with ESMTPSA id 4Rm9sb6GVgz36; Wed, 13 Sep 2023 12:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stgolabs.net; s=dreamhost; t=1694634324; bh=TRCLQlF2VO6s7nPtH5xn3QeQY4pWXTBPoW22AeYXlQo=; h=Date:From:To:Cc:Subject:Content-Type; b=V5ULnT0j8eDK0AOQbPCphfs36EIssoN2AA4BRb04c1LcF5ohNPAqfwN2fw3AaBQFA hbEjKIzc4YFi76VEDdCsJFqgPn9i6ZrWsy7Kh1A/5eHXI+Df592I6xLcpJ0d4MkW4O Dik0v6lYyGQOCj8G9SvgyPFeGSorZCxu2WCSnek5RuGIkXK58JZT+h0oZk5ti0P6Ue ogiDoyrkmefSiBlBJ34tHhoGa+4IOC7AVu8rSRTYqNTyhT8te71Nf5wF+qgCD8lhlw ua2+pIN9/mcnCLHnjBi4b/UFyaQRES/IzpOQlDuVrEpkCxLgD/9d76zvSS/c+jmnZX sBWdoEz109sHQ== Date: Wed, 13 Sep 2023 12:45:15 -0700 From: Davidlohr Bueso To: Dan Williams Cc: Ira Weiny , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cxl/mbox: Fix CEL logic for poison and security commands Message-ID: References: <20230903-cxl-cel-fix-v1-1-e260c9467be3@intel.com> <6500e8a179440_12747294a3@dwillia2-xfh.jf.intel.com.notmuch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <6500e8a179440_12747294a3@dwillia2-xfh.jf.intel.com.notmuch> User-Agent: NeoMutt/20230517 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 13 Sep 2023 12:45:33 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email On Tue, 12 Sep 2023, Dan Williams wrote: >Ira Weiny wrote: >> The following debug output was observed while testing CXL >> >> cxl_core:cxl_walk_cel:721: cxl_mock_mem cxl_mem.0: Opcode 0x4300 unsupported by driver >> >> opcode 0x4300 (Get Poison) is supported by the driver and the mock >> device supports it. The logic should be checking that the opcode is >> both not poison and not security. >> >> Fix the logic to allow poison and security commands. >> >> Fixes: ad64f5952ce3 ("cxl/memdev: Only show sanitize sysfs files when supported") >> Cc: Davidlohr Bueso >> Signed-off-by: Ira Weiny >> --- >> drivers/cxl/core/mbox.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c >> index ca60bb8114f2..b315bdab9197 100644 >> --- a/drivers/cxl/core/mbox.c >> +++ b/drivers/cxl/core/mbox.c >> @@ -716,8 +716,8 @@ static void cxl_walk_cel(struct cxl_memdev_state *mds, size_t size, u8 *cel) >> u16 opcode = le16_to_cpu(cel_entry[i].opcode); >> struct cxl_mem_command *cmd = cxl_mem_find_command(opcode); >> >> - if (!cmd && (!cxl_is_poison_command(opcode) || >> - !cxl_is_security_command(opcode))) { >> + if (!cmd && !cxl_is_poison_command(opcode) && >> + !cxl_is_security_command(opcode)) { > >Given that this is going to be a recurring pattern to add optional >command support, I am not a fan of continuing to expand this boolean >algebra eye exam. > >How about the following to only do the validation check and enabling in >one place: Agreed. Reviewed-by: Davidlohr Bueso ... this also is a reminder of the need for regression testing/CI. Thanks, Davidlohr