From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::244; helo=mail-it0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5A4512034C085 for ; Wed, 25 Oct 2017 13:08:03 -0700 (PDT) Received: by mail-it0-x244.google.com with SMTP id f187so2597203itb.1 for ; Wed, 25 Oct 2017 13:11:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Vpnb2gRYMHppFtpB06rMrriS8xCDVrYCmkmCtMT0Yrw=; b=GRNQojhQdQjxtAbTNb34yQsqhNDt9FKK4vHntw5Fpj+iYvIH0Amamyr5xATVL0bfKf 65yWgLclo6VDO2f5gORxUa9ufbHOBwcJhvCS2dCZGnonml7SdCbkpBU8oIpYElHdJmHR rfP8Kj3l5MxzOEmZfsk+3tiDESkWynYTKxuRk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Vpnb2gRYMHppFtpB06rMrriS8xCDVrYCmkmCtMT0Yrw=; b=CFKTytO5VEhNIDixLBPsMCpZgpdE7bCgevTLSkxziSgp/qxJo/50OlmwHahqmYI4Fk qj5XzJdrX7OAh1OkoGXzg6ORyWA4mBR5mI4vQOlkHXhAquo7Upbj12lESGhOEILnKwix 11tyUr6h0phOsjbfIGIP9bC6ky8krMdJwYZHCMCZ5fv5hRblxC8gFwq2akDBFEq0mwbJ KyyLBx3gZEfXVUKB66tQYOAf5f8xqQ4VYv66xr4GDMareJBZEe8Al0FRGLscpVK9NpH2 2WTO21ZiOgBhN3D6vNBXpcReEqqgafFhsMyJf7uQQYbzRw+idsY5l+M/sTpSBqAAC35I 4m2g== X-Gm-Message-State: AMCzsaUNAGe4SoC9iTs3bfsI0OZg80EuiRO3OIElbjP6qwt5/639Ur/G qlEsBwIiT3QjRvk6w+GZ7VNDBNrvIZGJ2gqpazjxMg== X-Google-Smtp-Source: ABhQp+TgbuGzrW3vxYG0LxTVC0QL2aiuxzMu8A7im6cmI6W1RI8jDGEHgk4S6zFzTwvUgg7VXQ9w4pOEFo8cJcQIN8c= X-Received: by 10.36.233.133 with SMTP id f127mr3646202ith.34.1508962308192; Wed, 25 Oct 2017 13:11:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.131.167 with HTTP; Wed, 25 Oct 2017 13:11:47 -0700 (PDT) In-Reply-To: <5bf829cb-4517-a579-ba7c-745c4ee89147@redhat.com> References: <20170907224116.895-1-lersek@redhat.com> <20170907224116.895-4-lersek@redhat.com> <5bf829cb-4517-a579-ba7c-745c4ee89147@redhat.com> From: Ard Biesheuvel Date: Wed, 25 Oct 2017 21:11:47 +0100 Message-ID: To: Laszlo Ersek Cc: Eric Dong , Star Zeng , edk2-devel-01 , Jiewen Yao , Brijesh Singh Subject: Re: [PATCH 03/10] MdeModulePkg/AtaAtapiPassThru: disable the device at ExitBootServices() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Oct 2017 20:08:03 -0000 Content-Type: text/plain; charset="UTF-8" On 25 October 2017 at 16:26, Laszlo Ersek wrote: > Hi Star, Eric, > > On 09/08/17 00:41, Laszlo Ersek wrote: >> The AtaAtapiPassThru driver maps three system memory regions for Bus >> Master Common Buffer operation on the following call path, if the >> controller has PCI_CLASS_MASS_STORAGE_SATADPA class code: >> >> AtaAtapiPassThruStart() >> EnumerateAttachedDevice() >> AhciModeInitialization() >> AhciCreateTransferDescriptor() >> >> The device is disabled (including Bus Master DMA) when the controller is >> unbound, in AtaAtapiPassThruStop(). Then the regions are unmapped. >> >> The former step should also be done when we exit the boot services, and >> the OS gains ownership of system memory. >> >> Cc: Ard Biesheuvel >> Cc: Brijesh Singh >> Cc: Eric Dong >> Cc: Jiewen Yao >> Cc: Star Zeng >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Laszlo Ersek >> --- >> MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h | 6 ++ >> MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c | 59 +++++++++++++++++++- >> 2 files changed, 64 insertions(+), 1 deletion(-) > > this patch -- that is, commit 6fb8ddd36bde > ("MdeModulePkg/AtaAtapiPassThru: disable the device at > ExitBootServices()", 2017-09-03) -- has caused a performance regression > in OVMF, in booting Windows installer ISOs from emulated IDE CD-ROMs. > > Interestingly, the performance regression only affects the "traditional" > IDE controller of the "pc" (i440fx) machine type of QEMU; it does not > affect the AHCI/SATA controller of the "q35" machine type. Does it make any difference if you only disable memory decoding and bus mastering, but leave I/O port decoding enabled?