Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3162202rwb; Fri, 16 Dec 2022 10:54:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf4ZZVfXQNYhdQaARLIrHeKORWqKjcdHpXURD0B7uFdT0fhJ/gcJaTfiLiMZy610OQZShi9D X-Received: by 2002:a17:907:208d:b0:7c0:fe60:be12 with SMTP id pv13-20020a170907208d00b007c0fe60be12mr28865324ejb.25.1671216871336; Fri, 16 Dec 2022 10:54:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671216871; cv=none; d=google.com; s=arc-20160816; b=GCDmn0hr0huSQoC1uhv4lOQMGXFeJkLCJ7dra7/EAETh5+SUpv7BnRuUKcu1nOSWO5 iOmuNXs1FquZ8V1jHgAioqVXcVCe5+pTY2h0tyftf/6m67zbt1PnELfgCf4n7VLFa3Fa vd+wCQE8KjwH+cLFao/mr+BPllvmrKJ9dSfJRvNIuQfNgRaek7QNfGAeu7BmQqxJQe6r mzqpP/29Ga0zhvvwWzbrDvyBV2Ri9pTQgtqFhwi3B+YCQmYYQk8003Te3K8w0CJSoz13 MEu/A3h27wEmrqA71VIw6lEMuKMEMztQ6QGhmdrTKmNKZsm+cgLuQ+kFUEjowImQPexN tr8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=bNtTuJjKZhDPZGumGznxTwsj8Z2m7nu2Un5Q4E7YAsQ=; b=NE6EQy96/uWRxBb57sR11pUuBd6+qM5/s1ZuoSoaYwlyqyguianUrF2Tx2kJlOCm8m QYrCFtR+WyLqDp5msExECQYTgg6MQ0x8eH8wG+BbiYMTiCS1k1R1SWO0dyMqeduhQjOq 6LjOOG17gpzBLfV7UAGRX2FXyKWJNFbEEZyWILrcv3vuVTdKIzi+hcYMD4vfi02i9eMJ wrmfX/uQ8yby0LZbChOdgYdPFfdhQFDO8bd6VLd1S1fY9P1wURcAPX36gr/9V6TteXKw avMqfrqFGm/gfvX+sq5tC/3pJc0dDJJ5aXRfX3VEQUS516pnqkaX0FIWCmh2scKNXURM /png== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o17-20020a1709062e9100b007c111fc30absi2325074eji.865.2022.12.16.10.54.15; Fri, 16 Dec 2022 10:54:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231555AbiLPSmX (ORCPT + 68 others); Fri, 16 Dec 2022 13:42:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231485AbiLPSmV (ORCPT ); Fri, 16 Dec 2022 13:42:21 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AA61DB6; Fri, 16 Dec 2022 10:42:19 -0800 (PST) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4NYdCR4sVLz6HJW1; Sat, 17 Dec 2022 02:38:27 +0800 (CST) Received: from localhost (10.45.152.125) 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.34; Fri, 16 Dec 2022 18:42:16 +0000 Date: Fri, 16 Dec 2022 18:42:15 +0000 From: Jonathan Cameron To: CC: Dan Williams , Davidlohr Bueso , Bjorn Helgaas , Bjorn Helgaas , Alison Schofield , Vishal Verma , Dave Jiang , , , , Subject: Re: [PATCH V4 3/9] cxl/mem: Wire up event interrupts Message-ID: <20221216184215.000015dd@Huawei.com> In-Reply-To: <20221216142438.00006588@Huawei.com> References: <20221212070627.1372402-1-ira.weiny@intel.com> <20221212070627.1372402-4-ira.weiny@intel.com> <20221216142438.00006588@Huawei.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.45.152.125] X-ClientProxiedBy: lhrpeml100005.china.huawei.com (7.191.160.25) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 16 Dec 2022 14:24:38 +0000 Jonathan Cameron wrote: > On Sun, 11 Dec 2022 23:06:21 -0800 > ira.weiny@intel.com wrote: > > > From: Davidlohr Bueso > > > > Currently the only CXL features targeted for irq support require their > > message numbers to be within the first 16 entries. The device may > > however support less than 16 entries depending on the support it > > provides. > > > > Attempt to allocate these 16 irq vectors. If the device supports less > > then the PCI infrastructure will allocate that number. Upon successful > > allocation, users can plug in their respective isr at any point > > thereafter. > > > > CXL device events are signaled via interrupts. Each event log may have > > a different interrupt message number. These message numbers are > > reported in the Get Event Interrupt Policy mailbox command. > > > > Add interrupt support for event logs. Interrupts are allocated as > > shared interrupts. Therefore, all or some event logs can share the same > > message number. > > > > In addition all logs are queried on any interrupt in order of the most > > to least severe based on the status register. > > > > Cc: Bjorn Helgaas > > Cc: Jonathan Cameron > > Co-developed-by: Ira Weiny > > Signed-off-by: Ira Weiny > > Signed-off-by: Davidlohr Bueso > > > > > +/** > > + * Event Interrupt Policy > > + * > > + * CXL rev 3.0 section 8.2.9.2.4; Table 8-52 > > + */ > > +enum cxl_event_int_mode { > > + CXL_INT_NONE = 0x00, > > + CXL_INT_MSI_MSIX = 0x01, > > + CXL_INT_FW = 0x02 > > +}; > > +struct cxl_event_interrupt_policy { > > + u8 info_settings; > > + u8 warn_settings; > > + u8 failure_settings; > > + u8 fatal_settings; > > This is an issue for your QEMU code which has this set at 5 bytes. > Guess our handling of record lengths needs updating now we have two different > spec versions to support and hence these can have multiple lengths. > > Btw, do you have an updated version of the QEMU patches you can share? Note that I'm happy to take your QEMU series forwards, just don't want to duplicate stuff you have already done! Jonathan > I was planning on just doing the AER type RAS stuff for the first pull this cycle > but given this set means we never reach that code I probably need to do QEMU > support for this and the stuff to support those all in one go - otherwise > no one will be able to test it :) We rather optimistically have the OSC set > to say the OS can have control of these, but upstream code doesn't emulate > anything yet. Oops. Should have pretended the hardware was handling them > until we had this support in place in QEMU. > > Jonathan > > > +} __packed; > > + > > /** > > * struct cxl_event_state - Event log driver state > > * > > @@ -288,6 +305,8 @@ enum cxl_opcode { > > CXL_MBOX_OP_RAW = CXL_MBOX_OP_INVALID, > > CXL_MBOX_OP_GET_EVENT_RECORD = 0x0100, > > CXL_MBOX_OP_CLEAR_EVENT_RECORD = 0x0101, > > + CXL_MBOX_OP_GET_EVT_INT_POLICY = 0x0102, > > + CXL_MBOX_OP_SET_EVT_INT_POLICY = 0x0103, > > CXL_MBOX_OP_GET_FW_INFO = 0x0200, > > CXL_MBOX_OP_ACTIVATE_FW = 0x0202, > > CXL_MBOX_OP_GET_SUPPORTED_LOGS = 0x0400,