From patchwork Fri Nov 20 18:03:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin O'Connor X-Patchwork-Id: 38933 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7C5CAB6F06 for ; Sat, 21 Nov 2009 05:05:56 +1100 (EST) Received: from localhost ([127.0.0.1]:38849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBXrl-0000Qw-KR for incoming@patchwork.ozlabs.org; Fri, 20 Nov 2009 13:05:53 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBXpx-0007wY-4X for qemu-devel@nongnu.org; Fri, 20 Nov 2009 13:04:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBXps-0007sg-SN for qemu-devel@nongnu.org; Fri, 20 Nov 2009 13:04:00 -0500 Received: from [199.232.76.173] (port=59057 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBXps-0007sa-Ir for qemu-devel@nongnu.org; Fri, 20 Nov 2009 13:03:56 -0500 Received: from imta-38.everyone.net ([216.200.145.38]:53380 helo=omta0105.mta.everyone.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NBXpr-0003PS-3n for qemu-devel@nongnu.org; Fri, 20 Nov 2009 13:03:55 -0500 Received: from dm0206.mta.everyone.net (sj1-slb03-gw2 [172.16.1.96]) by omta0105.mta.everyone.net (Postfix) with ESMTP id D56387316D0; Fri, 20 Nov 2009 10:03:52 -0800 (PST) X-Eon-Dm: dm0206 Received: by dm0206.mta.everyone.net (EON-AUTHRELAY2 - cfedc2a1) id dm0206.4b0479b1.4bf797; Fri, 20 Nov 2009 10:03:52 -0800 X-Eon-Sig: AQHOS7NLBtoIEh0OWQIAAAAD,7d207357f76d9a652e9619796a5791ea Date: Fri, 20 Nov 2009 13:03:51 -0500 From: Kevin O'Connor To: Avi Kivity Message-ID: <20091120180351.GA21458@morn.localdomain> References: <4B02A35B.10801@redhat.com> <20091118051920.GA9691@morn.localdomain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20091118051920.GA9691@morn.localdomain> User-Agent: Mutt/1.5.19 (2009-01-05) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: qemu-devel , KVM list Subject: [Qemu-devel] Re: SeaBIOS cdrom regression with Vista X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On Wed, Nov 18, 2009 at 12:19:20AM -0500, Kevin O'Connor wrote: > On Tue, Nov 17, 2009 at 03:21:31PM +0200, Avi Kivity wrote: > > qemu-kvm's switch to seabios uncovered a regression with cdrom handling. > > Vista x64 no longer recognizes the cdrom, while pc-bios still works. > > Installing works, but that uses int 13, not the native driver. Haven't > > investigated further yet. > The only things I can think of that could impact the OS recognizing a > cdrom would be: the cdrom left in an odd state (seems unlikely as the > OS usually does a full reset), ACPI differences, or int1348 errors. I've looked into this, and it looks like the cdrom is left in an odd state. At this point, I think SeaBIOS is tickling a bug outside of seabios (eg, in Vista or qemu). I would appreciate it someone with cdrom knowledge of qemu could help. Here is what I'm seeing. As reported, the following fails: qemu -hda winvista -cdrom util.iso The following also fails: qemu -hdc winvista -drive file=util.iso,media=cdrom,index=0 However, this works!? qemu -hdc winvista -drive file=util.iso,media=cdrom,index=1 And this works (both cdroms are seen): qemu -hdc winvista -drive file=util.iso,media=cdrom,index=0 -drive file=util2.iso,media=cdrom,index=1 The following also works: qemu -hda winvista -hdc someotherdrive And this works too: qemu -hdd winvista -cdrom util.iso So, basically, something is causing vista to not like the cdrom, but only when the cdrom is a master and there is no slave. Tracking this further, if I apply the patch to seabios below, I find that it still fails, but if I uncomment the first check then everything works. This leads me to believe that sending an "identify packet device" request to a non-existent slave when a cdrom is master is causing that cdrom master to not be liked by vista. SeaBIOS has a different ata drive detection mechanism than bochs - it needs it in order to work on real hardware. So, this explains why bochs bios doesn't show this issue. (Seabios tries to send an "identify packet device" and then an "identify device" command to detect a drive; bochs bios looks for a signature in the ata registers after an ata reset.) Any thoughts? -Kevin --- a/src/ata.c +++ b/src/ata.c @@ -713,9 +713,14 @@ ata_detect(void *data) last_reset_ataid = ataid; } +// if (slave) +// continue; + // check for ATAPI u16 buffer[256]; struct drive_s *drive_g = init_drive_atapi(&dummy, buffer); + if (slave) + continue; if (!drive_g) { // Didn't find an ATAPI drive - look for ATA drive. u8 st = inb(iobase1+ATA_CB_STAT);