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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6214EC433E4 for ; Fri, 10 Jul 2020 13:35:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4846520720 for ; Fri, 10 Jul 2020 13:35:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727827AbgGJNfp (ORCPT ); Fri, 10 Jul 2020 09:35:45 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:57178 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726820AbgGJNfl (ORCPT ); Fri, 10 Jul 2020 09:35:41 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1jttBi-004T7V-V5; Fri, 10 Jul 2020 15:35:38 +0200 Date: Fri, 10 Jul 2020 15:35:38 +0200 From: Andrew Lunn To: Vladimir Oltean Cc: Tobias Waldekranz , netdev@vger.kernel.org, f.fainelli@gmail.com, hkallweit1@gmail.com Subject: Re: MDIO Debug Interface Message-ID: <20200710133538.GF1014141@lunn.ch> References: <20200709233337.xxneb7kweayr4yis@skbuf> <20200710094517.fiaotxw2kuvosv5s@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200710094517.fiaotxw2kuvosv5s@skbuf> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > In principle there is nothing in this para-virtualization design that > would preclude a quirky quad PHY from being accessed in a > virtualization-safe mode. The main use case for PHY access in a VM is > for detecting when the link went down. Worst case, the QEMU host-side > driver could lie about the PHY ID, and could only expose the clause 22 > subset of registers that could make it compatible with genphy. I don't > think this changes the overall approach about how MDIO devices would be > virtualized with QEMU. A more generic solution might be to fully virtualize the PHY. Let the host kernel drive the PHY, and QEMU can use /sys/bus/mdio_bus/devices, and uevents sent to user space. Ioana already added support for a PHY not bound to a MAC in phylink. You would need to add a UAPI for start/stop, and maybe a couple more operations, and probably export a bit more information. This would then solve the quad PHY situation, and any other odd setups. And all the VM would require is genphy, keeping it simple. Andrew