From mboxrd@z Thu Jan 1 00:00:00 1970
From: bugzilla-daemon@bugzilla.kernel.org
Subject: [Bug 107561] 4.2 breaks PCI passthrough in QEMU/KVM
Date: Sat, 21 Nov 2015 10:03:23 +0000
Message-ID:
References:
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
To: kvm@vger.kernel.org
Return-path:
Received: from mail.kernel.org ([198.145.29.136]:45054 "EHLO mail.kernel.org"
rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
id S1751512AbbKUKD1 (ORCPT );
Sat, 21 Nov 2015 05:03:27 -0500
Received: from mail.kernel.org (localhost [127.0.0.1])
by mail.kernel.org (Postfix) with ESMTP id 2202C205E3
for ; Sat, 21 Nov 2015 10:03:26 +0000 (UTC)
Received: from bugzilla2.web.kernel.org (bugzilla2.web.kernel.org [172.20.200.52])
by mail.kernel.org (Postfix) with ESMTP id 1A50220573
for ; Sat, 21 Nov 2015 10:03:25 +0000 (UTC)
In-Reply-To:
Sender: kvm-owner@vger.kernel.org
List-ID:
https://bugzilla.kernel.org/show_bug.cgi?id=107561
schefister@gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |schefister@gmail.com
--- Comment #4 from schefister@gmail.com ---
I narrowed it down earlier to "simplify kvm_mtrr_get_guest_memory_type".
Actually this was the commit to break it, but it is only a small part of the
feauture set implementing vMTRR. To my knowledge 4.1.x versions didn't have
this code set at all. It was introduced in 4.2.
What kvm_mtrr_get_guest_memory_type() does is basically decides what cache type
to use (Uncachable, Write-Back, or Write-Through) based on the function
mtrr_for_each_mem_type(). This kvm_mtrr_get_guest_memory_type function is only
called by vmx_get_mt_mask. This is all related to how the hardware is set up
regarding IOMMU, MMIO, VT-d and EPT andress translation.
For experimenting purposes I simply modified kvm_mtrr_get_guest_memory_type to
always return MTRR_TYPE_WRBACK and that fixed the issue. Guest boots correctly.
Although I know, that hardcoding Write-back mode is not a viable long-term
solution. It seems as the new function (in 4.2 and onward) does not return the
proper cache type in case of pci passthrough configurations.
I would also like to point out, that
https://bugzilla.kernel.org/show_bug.cgi?id=107921 may be related. The other
bug mentions very similar hardware to mine, and issues started the same time
(upgrading to 4.2.x) with a pci passthrough configuration.
--
You are receiving this mail because:
You are watching the assignee of the bug.