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 58847C433ED for ; Sat, 10 Apr 2021 11:31:03 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9FB7560241 for ; Sat, 10 Apr 2021 11:31:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FB7560241 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eik.bme.hu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lVBpN-0005zj-6Y for qemu-devel@archiver.kernel.org; Sat, 10 Apr 2021 07:31:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVBnc-00059Z-P8 for qemu-devel@nongnu.org; Sat, 10 Apr 2021 07:29:12 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:36721) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVBnZ-00009X-Jh for qemu-devel@nongnu.org; Sat, 10 Apr 2021 07:29:11 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 4571E746358; Sat, 10 Apr 2021 13:29:03 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 1DFA4746357; Sat, 10 Apr 2021 13:29:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zero.eik.bme.hu (Postfix) with ESMTP id 1C059746354; Sat, 10 Apr 2021 13:29:03 +0200 (CEST) Date: Sat, 10 Apr 2021 13:29:03 +0200 (CEST) From: BALATON Zoltan To: Howard Spoelstra Subject: Re: Mac OS real USB device support issue In-Reply-To: Message-ID: <8827217c-8fee-7845-045-16ff9622d90@eik.bme.hu> References: <967C172F-B708-40A2-862E-9948F0844133@gmail.com> <725920c9-c990-d35a-4958-4df0c45c62@eik.bme.hu> <0429B873-DD42-4769-BCDF-25A7720D9C44@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Received-SPF: pass client-ip=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Programmingkid , QEMU devel list , Gerd Hoffmann Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Sat, 10 Apr 2021, Howard Spoelstra wrote: > On Fri, Apr 9, 2021 at 9:37 PM Programmingkid wrote: >> Have you tried the proposed changes yet for libusb? > > Hi, > > Yes, I experimented with the current libusb from brew, the latest > libusb code from github and a patched version based on that. I > couldn't get a flash drive passed through with any of them. Running as > root made no difference. My Mojave host doesn't allow unloading the > kext loaded for the flash drive where Sierra allowed that, but then > that should be handled by the patches. > > I'll link to the latest libusb and the patched version plus the > patches. I guess it will not work on your host, but you might be able > to persuade qemu to use them by using > install_name_tool -change /usr/local/opt/libusb/lib/libusb-1.0.0.dylib > @executable_path/libusb-1.0.0-latest.dylib qemu-system-ppc > > I'll also include the patches, libusb is easily built. > https://surfdrive.surf.nl/files/index.php/s/Qs0rtTVe2qIudw4/download I think you (John and Gerd) found that detecting if a kernel driver is attached does not seem to work so it does not even get to unloading what these patches are about I think. So you first need to debug and fix libusb_kernel_driver_active() so the unloading function is called at all. I don't know how that's done on macOS but maybe querying the IO registry somehow that should have all info about devices and IOKit drivers. Regards, BALATON Zoltan