From owner-freebsd-virtualization@freebsd.org Tue Mar 1 10:44:44 2016 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B5BFABD1C4 for ; Tue, 1 Mar 2016 10:44:44 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from phabric-backend.rbsd.freebsd.org (unknown [IPv6:2607:fc50:2000:101::1bb:73]) by mx1.freebsd.org (Postfix) with ESMTP id 87ED0105E for ; Tue, 1 Mar 2016 10:44:44 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by phabric-backend.rbsd.freebsd.org (Postfix, from userid 1346) id 7E7EE33228FF; Tue, 1 Mar 2016 10:44:44 +0000 (UTC) Date: Tue, 1 Mar 2016 10:44:44 +0000 To: freebsd-virtualization@freebsd.org From: "mav (Alexander Motin)" Reply-to: D5473+333+79492675d52ac1ab@reviews.freebsd.org Subject: [Differential] [Commented On] D5473: ATA/ATAPI6 device emulation in bhyve Message-ID: X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: Thread-Topic: D5473: ATA/ATAPI6 device emulation in bhyve X-Herald-Rules: none X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: Precedence: bulk In-Reply-To: References: Thread-Index: ZmQ1YjBmNDNhNWVhZDYwNjJmNTU3Y2FmMjRkIFbVcpw= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2016 10:44:44 -0000 mav added a comment. In https://reviews.freebsd.org/D5473#117346, @iateaca wrote: > The motivation is to run older versions of operating systems such as FreeBSD 4 which does not have AHCI drivers. > What do you mean by code duplication ? I think only the ATAPI CDROM logic could be common but the current implementation from AHCI can not be used with the ATA data strcutures. If we want to achive this, I think a redesign of AHCI ATAPI is required too. I personally see quite little sense in supporting so old legacy guests. I agree that there can be "some cases", but I am not sure they worth the time spent and code size growth. Other then legacy guests support this code does not give us anything useful -- legacy ATA will be by definition much slower and less functional then its AHCI counterpart. It will require dozens of emulated register accesses per I/O, comparing to only several for AHCI, and won't support command queuing. Though obviously nice and clean unified implementation would look better. In your patch you are one more time reimplementing some subsets of ATA and ATAPI commands handling, already done much wider for AHCI. It would be much better to have single device emulation code, interfacing with different controller code parts. But it would also take much more time (you are rigth that it would require existing code redesign), for the same little reason, so I am not sure how good is that idea. It needs investigation. REVISION DETAIL https://reviews.freebsd.org/D5473 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: iateaca, grehan, neel, tychon, mav Cc: freebsd-virtualization-list