From nobody Tue Nov 23 16:23:16 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 621351889622; Tue, 23 Nov 2021 16:23:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hz8ZZ73Zrz3jK1; Tue, 23 Nov 2021 16:23:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from [10.0.1.4] (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 3B43124707; Tue, 23 Nov 2021 16:23:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <0d0a6a77-b2d1-d0c2-f0de-e5c97307e140@FreeBSD.org> Date: Tue, 23 Nov 2021 08:23:16 -0800 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: git: 2eb2079554f4 - main - bhyve: keep physical and virtual COMMAND reg in sync Content-Language: en-US To: =?UTF-8?Q?Corvin_K=c3=b6hne?= , Emmanuel Vadot , "src-committers@FreeBSD.org" , "dev-commits-src-all@FreeBSD.org" , "dev-commits-src-main@FreeBSD.org" References: <202111221530.1AMFUUJn079855@gitrepo.freebsd.org> <428e410d-33c1-7ff8-9689-41943db3d9c3@FreeBSD.org> <084d5b5845554221901ce4902fb878d1@beckhoff.com> From: John Baldwin In-Reply-To: <084d5b5845554221901ce4902fb878d1@beckhoff.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637684599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WS5yUPaQHcFfFZH5tb9WIQZfKuUA/f1JE0NAPVWOWME=; b=FZVD2el4QFMYFCx1TxEMZ77a2Tio7FdYho9M4IPXtXc0uvDTeTtobjY1Y/irTDNydnt9g0 5He5rzHRp7PfJYQ7wiKA3Ei0wC6cXHf3hOnjUOQs4i1xT+JQqrXJyRIrigMmBEvRE2Abpi ZGhFCXuyH8tGXxPTjaf4cDFxK39If3CSpT3tQJYOvViBC9/f56OQiOVlFlOEXMr06b9ph4 DFPKZATjucRf+Mq/wcBX7HipSju9WHr4rr5srbdAhJ7W/6I7O1NNoPMqXvYu8xiFh7xv3j 3ikNlsnz6cFLCz1SoeIu3kN/0xfk1bxiIFdm5wTGS/KEzHMqVssj1QRHUUutFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637684599; a=rsa-sha256; cv=none; b=e8PcmFlYueMusEpQ4KqPS8FPvSFZhkMGDUIbRH+eHGZjwkEiGlfXnb8FWgrFJPSruGZnV+ /hieAu51XlYjCmvREBhLuhor2I6RO1xXz0R1QhleVbQQemq1Om04c5u0R8zJ7i/nXV4sWb RTQ4m8WP/rnVJ6L6ZymGuku1uz+YfLrfcZ3xGHCvUDQZ2yQ0RtTwWjMgNT0hyCIqrX0Jlv Hpg1HEfRjntVdWSDghCfT4czhUKsULGfrXjvqlm1A/SezKqVpiymNcA1Y7cn8S7Q1tC1fg 8bI9fHucdgXQ+Y0C+KkLMa0iLbN+ksuxioZDW+rk9KFJzcpRok+O1gHznKc5Mg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On 11/23/21 1:33 AM, Corvin Köhne wrote: > Hi John, > > sry, I didn't see your patch. Seems like your patch is very similar to > mine. However, your patch goes a bit further. It initializes the > virtual cmd register with it's physical value and always enables > bus mastering. Are you still interested in working on your patch? > Otherwise, I'm going to proceed your work. Would you be able to test if that change works in your environment? I was never able to confirm that it fixed the bug I was trying to address, but I do think it is more correct. The busmastering thing is to work around Linux clearing that flag on shutdown of a guest, and I wanted to preserve other bits in the command register that weren't related to BARs, etc. > Best regards > Corvin > > Beckhoff Automation GmbH & Co. KG | Managing Director: Dipl. Phys. Hans Beckhoff > Registered office: Verl, Germany | Register court: Guetersloh HRA 7075 > > > -----Original Message----- > From: owner-src-committers@freebsd.org On Behalf Of John Baldwin > Sent: Monday, November 22, 2021 5:39 PM > To: Emmanuel Vadot ; src-committers@FreeBSD.org; dev-commits-src-all@FreeBSD.org; dev-commits-src-main@FreeBSD.org > Subject: Re: git: 2eb2079554f4 - main - bhyve: keep physical and virtual COMMAND reg in sync > > CAUTION: External Email!! > On 11/22/21 7:30 AM, Emmanuel Vadot wrote: >> The branch main has been updated by manu: >> >> URL: https://nospamproxywebp.beckhoff.com/enqsig/link?id=BCAAAABGd7m3lfMOLOIhx3uNR_1Qav4Ffx8-jQB0torD82ts_KYAAAB6IpisxfWh8bMkMeclEjKU0Ch6nC1L2luIJvUt5lrcBed-KA1fjaCNX4hB0giwbfTH9lmXLBNaYvWEJzBG4zMolRebrrQofyigX9J_GDpKhg70oqrVfjGqvjwx_ZUj9P2msAudMe2Cu6_E-1duWq9fZ0eBY0l1NvoUIIA73nJ1hrbfy1HQ0oahtUKxPE-jI2MlQiFome_pmEEyaQ3J3SkSwgFrM8YO0 >> >> commit 2eb2079554f4d54c4283410b4ee1aca549b29616 >> Author: Corvin Köhne >> AuthorDate: 2021-11-22 15:26:03 +0000 >> Commit: Emmanuel Vadot >> CommitDate: 2021-11-22 15:26:03 +0000 >> >> bhyve: keep physical and virtual COMMAND reg in sync >> >> On startup all virtual BARs are registered. >> Additionally, the encoding bit in the virtual cmd register is set. >> After that, the passthru emulation overwrites the virtual cmd register with >> the physical one. >> This could lead to a mismatch between registered BARs and the encoding >> bits in the cmd register. >> Instead of writing the physical to the virtual cmd register, >> write the virtual to the physical cmd register to solve this issue. >> >> Reviewed by: markj >> Differential Revision: https://nospamproxywebp.beckhoff.com/enqsig/link?id=BCAAAABGd7m3lfMOLOIhx3uNR_1Qav4Ffx8-jQB0torD82ts_HgAAABQYw97NGT4SSj0arxOT2yuQ75rteUz51oREvqlD-GZQnqCZI_9pzRsWsM_TIwpmksuUKgVIfsP9_sN_SFiCJKgMBnSZAbbozPmCVLjgVbdggdf0J1VCBMbgFlXVJZq0LGJOUYhyN9NsWQY5F9sqBgUDVfJaTe3qOo1 >> Sponsored by: Beckhoff Automation GmbH & Co. KG > > Humm, I wonder if my older patch that tries to handle the command register > more deterministically might have handled this. The patch tried to fix an > open bug where you can't use a XHCI controller via passthru after you have > rebooted a Linux guest. It makes this write here conditional: > > https://nospamproxywebp.beckhoff.com/enqsig/link?id=BCAAAABGd7m3lfMOLOIhx3uNR_1Qav4Ffx8-jQB0torD82ts_HgAAAAU8FxyU1LiUJoRKnyrNSRv-j2bTBQqOJi-XQmELgyevvpEPUyKQXd3ARd_uz1vH5Vvuv314xMOFWvGRH_kkVCSmv8reOEC1AS1MBzskFbKQ_hHSbMiI88hnj9-jJrJaZT3B6FG9MHp-bRv8QyGOSI19iLeQnlutkY1 > > -- > John Baldwin > -- John Baldwin