Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1140605pxb; Tue, 19 Oct 2021 22:13:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4DaxPxoep8vemN5JC8vyjIaSPoIkAxaEN9pgZFGy/KyMxkHiNhEMcXU127fVMtGVWCaMd X-Received: by 2002:a17:90a:e7c8:: with SMTP id kb8mr4694786pjb.95.1634706791431; Tue, 19 Oct 2021 22:13:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634706791; cv=none; d=google.com; s=arc-20160816; b=LXDCfYzhn7UTuewIuAWc1AQCtcGt2C451tfGZSKUY5sE5qcpsDLNBu2s4F9fO4HETO bm2Z2O3KDiyXyD0Iuwcb7jhHGMOc5BXRwi4BHatMJWh/FJYYr8OPUJi86mOEpcO3Jlj4 nXuJZar30gvR0iwiO1Cnm15kDnQU5TIgO0UZlp5DnM/Q4hdXSggk6GkdtYZgH45RnCn/ hp7QcOVTSKfT2KkPvxsaBdyq6FZeYPvrXDEXVQfyg0pFN8OM7wK1Wmdun8lcIYEORbVE h646ZH7TPcYRgaIMtXCWjKvVh1xB/zlhiBjDEakt2mdeJJQZNuWx47TFZKv9DJkeK+Ei vm+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=cA9skDxHOwT77QivBMmI5FcshyLPFpwMdp/YnfuvIgU=; b=Lk+vbZWPAFwTzOMc1P2q+fuhygxweSfsJO+xgbQqDbB8KMAf7nlUThSlxmVGb00C4y w0Q6WO+uYOSylkRQfi5S0eQ+0qVUwYWOblkqDCc3roOw2Q+VIyXhu9lCC4FsOoR9wiay 7Ead5VZAmqIRXHjPsk2Db4UPP0m/AKONxOmxI0ikWSVAa+oNDKP667QxYXVVqrxu9mxt GT1mRGgN+Hk+++oPjeDOd9H0gsohevSECWQLakSF8UnMgDUfJBg74PdPpMQURHjjpG3B w8L7lw1SswntW9dHMkP4/U3kBCQBjZvwBsD9nSu48bVBqrMJ7Vnco07bLRBlKtMo6wML /EAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nEYcMhI4; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u20si2151218pfk.226.2021.10.19.22.13.02; Tue, 19 Oct 2021 22:13:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nEYcMhI4; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229910AbhJTFMp (ORCPT + 64 others); Wed, 20 Oct 2021 01:12:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbhJTFMo (ORCPT ); Wed, 20 Oct 2021 01:12:44 -0400 Received: from mail-ua1-x931.google.com (mail-ua1-x931.google.com [IPv6:2607:f8b0:4864:20::931]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB9F6C06161C for ; Tue, 19 Oct 2021 22:10:30 -0700 (PDT) Received: by mail-ua1-x931.google.com with SMTP id i22so4296789ual.10 for ; Tue, 19 Oct 2021 22:10:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cA9skDxHOwT77QivBMmI5FcshyLPFpwMdp/YnfuvIgU=; b=nEYcMhI4VYqnlOVIRGiDw6tEx7dwdm9t8ObNfHd1zxslld86gXAX03q5EP3BDDfvjS +AdVtRzQwQTFVn+PQmO3MZ6whz3N6keKUH6pmMt9KmDZnEbbN4dNhD9tr9CCrIKVJW39 mLz2jgi0CE/P0kc8oGr4BwAvRgEx52f1Ltu/ZDxUJWJeN7EZLAcXzFZSRaifD17zoVUC fVRQkOy8kvVdxmXC+SnoPOJU6Ttcmd/L0kRzxM41Yzz5XFXPwrJdlZcu4j8eHJXHFt6r chTSgAbqgve/upesbR6lnZ1Uicjmux/uLLqyrbt7rmN40Asfvk/c0tLNb3UN2/vheYjb 8+5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cA9skDxHOwT77QivBMmI5FcshyLPFpwMdp/YnfuvIgU=; b=a+N9u6RPxjtEysixJA7CegmgjDCVnQE2+hIQet9z1pcPQvX9oMCq1KwL4As7weQRMz 129/XanI568LsPQElx9Bd8M3beM0r+Zbxs035ketDszXAsMAR1w0oY20qZDZQKpSq36b D0Ga3IjSdhwwN3fTw62zT8nvcYZD2YQx5D2hZ4Jivcrl5zFpzbgSLbTti2esyaO5OBjd tPfrcVSSgl2yPfSpROGwffNHciSxMSjTxYl8kF89VgFi2qXLQtjt9JhgONj/Ex6GlUy7 JQn6RkSv59V4O/vcWawcPvcx8KZmTqA1sRliZDiCVMVX4zhGYUy5Iwat9DTiixNHQ9iG 6PgA== X-Gm-Message-State: AOAM533nCTci4qbJjqKYKZyG4XKP6NsEtAx9VU0hklqgrZwGsRKmD8dm jicm/6Sx2w2Uw+6aJoBSyGEvlMRHjJ1wU40ApP5k9sks X-Received: by 2002:ab0:58c1:: with SMTP id r1mr4914344uac.89.1634706629671; Tue, 19 Oct 2021 22:10:29 -0700 (PDT) MIME-Version: 1.0 References: <20210811105541.43426-1-emmanuel.grumbach@intel.com> <20210811105541.43426-2-emmanuel.grumbach@intel.com> <87lf2qvbg2.fsf@codeaurora.org> In-Reply-To: From: Emmanuel Grumbach Date: Wed, 20 Oct 2021 08:10:18 +0300 Message-ID: Subject: Re: [PATCH v6 2/7] iwlwifi: mei: add the driver to allow cooperation with CSME To: Kalle Valo Cc: Emmanuel Grumbach , linux-wireless Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, Oct 18, 2021 at 10:17 PM Emmanuel Grumbach wrote: > > On Mon, Oct 18, 2021 at 2:08 PM Kalle Valo wrote: > > > > Emmanuel Grumbach writes: > > > > > CSME in two words > > > ----------------- > > > CSME stands for Converged Security and Management Engine. It is > > > a CPU on the chipset and runs a dedicated firmware. > > > AMT (Active Management Technology) is one of the applications > > > that run on that CPU. AMT allows to control the platform remotely. > > > Here is a partial list of the use cases: > > > * View the screen of the plaform, with keyboard and mouse (KVM) > > > * Attach a remote IDE device > > > * Have a serial console to the device > > > * Query the state of the platform > > > * Reset / shut down / boot the platform > > > > > > Networking in CSME > > > ------------------ > > > For those uses cases, CSME's firmware has an embedded network > > > stack and is able to use the network devices of the system: LAN > > > and WLAN. This is thanks to the CSME's firmware WLAN driver. > > > > > > One can add a profile (SSID / key / certificate) to the CSME's OS > > > and CSME will connect to that profile. Then, one can use the WLAN > > > link to access the applications that run on CSME (AMT is one of > > > them). Note that CSME is active during power state and power state > > > transitions. For example, it is possible to have a KVM session > > > open to the system while the system is rebooting and actually > > > configure the BIOS remotely over WLAN thanks to AMT. > > > > > > How all this is related to Linux > > > -------------------------------- > > > In Linux, there is a driver that allows the OS to talk to the > > > CSME firmware, this driver is drivers/misc/mei. This driver > > > advertises a bus that allows other kernel drivers or even user > > > space) to talk to components inside the CSME firmware. > > > In practice, the system advertises a PCI device that allows > > > to send / receive data to / from the CSME firmware. The mei > > > bus drivers in drivers/misc/mei is an abstration on top of > > > this PCI device. > > > The driver being added here is called iwlmei and talks to the > > > WLAN driver inside the CSME firmware through the mei bus driver. > > > Note that the mei bus driver only gives bus services, it doesn't > > > define the content of the communication. > > > > > > Why do we need this driver? > > > -------------------------- > > > CSME uses the same WLAN device that the OS is expecting to see > > > hence we need an arbitration mechanism. This is what iwlmei is > > > in charge of. iwlmei maintains the communication with the CSME > > > firmware's WLAN driver. The language / protocol that is used > > > between the CSME's firmware WLAN driver and iwlmei is OS agnostic > > > and is called SAP which stands for Software Abritration Protocol. > > > With SAP, iwlmei will be able to tell the CSME firmware's WLAN > > > driver: > > > 1) Please give me the device. > > > 2) Please note that the SW/HW rfkill state change. > > > 3) Please note that I am now associated to X. > > > 4) Please note that I received this packet. > > > etc... > > > > > > There are messages that go the opposite direction as well: > > > 1) Please note that AMT is en/disable. > > > 2) Please note that I believe the OS is broken and hence I'll take > > > the device *now*, whether you like it or not, to make sure that > > > connectivity is preserved. > > > 3) Please note that I am willing to give the device if the OS > > > needs it. > > > 4) Please give me any packet that is sent on UDP / TCP on IP address > > > XX.XX.XX.XX and an port ZZ. > > > 5) Please send this packet. > > > etc... > > > > > > Please check drivers/net/wireless/intel/iwlwifi/mei/sap.h for the > > > full protocol specification. > > > > > > Arbitration is not the only purpose of iwlmei and SAP. SAP also > > > allows to maintain the AMT's functionality even when the OS owns > > > the device. To connect to AMT, one needs to initiate an HTTP > > > connection to port 16992. iwlmei will listen to the Rx path and > > > forward (through SAP) to the CSME firmware the data it got. Then, > > > the embedded HTTP server in the chipset will reply to the request > > > and send a SAP notification to ask iwlmei to send the reply. > > > This way, AMT running on the CSME can still work. > > > > > > In practice this means that all the use cases quoted above (KVM, > > > remote IDE device, etc...) will work even when the OS uses the > > > WLAN device. > > > > > > How to disable all this? > > > --------------------------- > > > iwlmei won't be able to do anything if the CSME's networking stack > > > is not enabled. By default, CSME's networking stack is disabled (this > > > is a BIOS setting). > > > In case the CSME's networking stack is disabled, iwlwifi will just > > > get access to the device because there is no contention with any other > > > actor and, hence, no arbitration is needed. > > > > > > In this patch, I only add the iwlmei driver. Integration with > > > iwlwifi will be implemented in the next one. > > > > > > Co-Developed-by: Ayala Beker > > > Signed-off-by: Emmanuel Grumbach > > > > s-o-b missing from Ayala, same problem also in other patches in this > > patchset. > > > > https://www.kernel.org/doc/html/latest/process/submitting-patches.html#when-to-use-acked-by-cc-and-co-developed-by > > > > I fixed all the comments and pushed to a branch in our tree to get a > 0-day run on it. > One question though: there is currently a (small) diff between > iwlwifi-next and wireless-driver-next that makes this series conflict. > This is because of a fix that was applied on wireless-drivers-next > directly and Luca hasn't merged your tree back to his yet. > I can send v7 on either code base you like. > I think 0-day tests iwlwifi patches against iwlwifi-next but I am not sure. > Luca is on vacation until next week. > > Any option you'll choose will be fine by me. Just let me know. The build was successful and I tested the changes, they work. Did you plan to apply this before the merge window? If yes, I'll rebase on top of your -next tree and send v7.