From patchwork Mon Jul 24 12:07:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Fleytman X-Patchwork-Id: 9859317 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B6187601A1 for ; Mon, 24 Jul 2017 12:10:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6E1C281F9 for ; Mon, 24 Jul 2017 12:10:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BF152832B; Mon, 24 Jul 2017 12:10:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8C780281F9 for ; Mon, 24 Jul 2017 12:10:35 +0000 (UTC) Received: from localhost ([::1]:54566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZcC2-0002uW-Qc for patchwork-qemu-devel@patchwork.kernel.org; Mon, 24 Jul 2017 08:10:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZc9H-0001Sb-6M for qemu-devel@nongnu.org; Mon, 24 Jul 2017 08:07:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZc9E-0003iL-1l for qemu-devel@nongnu.org; Mon, 24 Jul 2017 08:07:43 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:37005) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dZc9D-0003i2-R0 for qemu-devel@nongnu.org; Mon, 24 Jul 2017 08:07:39 -0400 Received: by mail-wr0-x243.google.com with SMTP id 12so9299237wrb.4 for ; Mon, 24 Jul 2017 05:07:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=ctU1fC+dbGwVEU/S6d/GSBs202yjgNg6lBqup9FJRKs=; b=Q4aSZtLHyXC32tt7YdFTggLpJ0dhbcERAv1HxT4FanfN3pvN4phxqH/8HGAA9aqVkQ 5aF4wpHxT35D1ixoEzjnLvlI0xM/e6xWAWhV3Hnw4PONXWxl/setuuwCbJUfpbiXf9ie oDXqkNLmjTN6PVxqa2tK85FPItyHFFDgZiG1Pt5cfyIlI4Cj8IppguLaJbxlZDyHWEtX N7PXuPFXJgldE6KAi/etsV07hfuvJH9rwg4w4Nw9MzIVdJ4aXo2jjQOSh4fQ4AqGvOes XSvl2hcdSozuYGkguO/I033fMM2RS+VzLFSVcQGGi589uAcO/NvXxSuJDBW3PLZ8htpJ d0aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ctU1fC+dbGwVEU/S6d/GSBs202yjgNg6lBqup9FJRKs=; b=KSh3XOz/s3NbOW5A0eA2/NyTrCiTbKUGbhj2QE+OLCKkD2BDqP6tO4srihR98zUAY5 xlqBdwrk1brP3lyM+FpNc4oqbA0NTpU69477mWcI1DmXpKEF9rm90gem+5pLPH0CZDQO fbOQoq/9/obzN3IbVMoIOrEB0BsbRUulpy+ExigNuSkqK0aKxbP1O0n5mHxyS6O5NB9z n5FNJEl1YbRywHcPhP0ieO+advB2moawlabFJChJxt2tVJATPN8Z71BHh1SA/tnNSGb/ HCz4lIow39+1HClBSspImgF84HgAVIGF0coPtrzW9C8SB1gX3cCHiiupBu8HYuo1Hbc7 658g== X-Gm-Message-State: AIVw110pbY8Antr34VlII7bnjzZiKWOkmxl6wrZcs2oioR3zCs0uCmdZ BXRuyl2x6ydAIJ5s460= X-Received: by 10.223.139.3 with SMTP id n3mr12150729wra.249.1500898056943; Mon, 24 Jul 2017 05:07:36 -0700 (PDT) Received: from bark.daynix ([141.226.163.173]) by smtp.gmail.com with ESMTPSA id q18sm3943541wmd.44.2017.07.24.05.07.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jul 2017 05:07:36 -0700 (PDT) From: Dmitry Fleytman To: qemu-devel@nongnu.org Date: Mon, 24 Jul 2017 15:07:29 +0300 Message-Id: <20170724120729.24350-1-dmitry@daynix.com> X-Mailer: git-send-email 2.9.4 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PATCH] vfio/pci-quirks: Set non-zero GMS memory size for IGD X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Williamson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP There is a claim that GMS memory is unused however Intel Windows 10 drivers starting from V.4534 (10/7/2016) allocate extra ~4G memory when GMS size set to 0. This patch fixes this issue by seting IGD GMS memory size to minimum by changing default value of x-igd-gms device parameter. Signed-off-by: Dmitry Fleytman --- hw/vfio/pci-quirks.c | 13 +++++++++---- hw/vfio/pci.c | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index 349085e..197cb90 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -1527,10 +1527,15 @@ static void vfio_probe_igd_bar4_quirk(VFIOPCIDevice *vdev, int nr) } /* - * Assume we have no GMS memory, but allow it to be overrided by device - * option (experimental). The spec doesn't actually allow zero GMS when - * when IVD (IGD VGA Disable) is clear, but the claim is that it's unused, - * so let's not waste VM memory for it. + * There is a claim that GMS memory is unused and we want to waste for it + * as less VM memory as possible, however Intel Windows 10 drivers starting + * from V.4534 (10/7/2016) allocate extra ~4G memory when GMS size set to 0. + * The spec as well doesn't actually allow zero GMS when IVD + * (IGD VGA Disable) is clear. + * + * Therefore we set GMS memory size to minimal by default via device + * option x-igd-gms (experimental) and allow further tweaking of this + * parameter. */ gmch &= ~((gen < 8 ? 0x1f : 0xff) << (gen < 8 ? 3 : 8)); diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index d4051cb..bda07b7 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -2982,7 +2982,7 @@ static Property vfio_pci_dev_properties[] = { sub_vendor_id, PCI_ANY_ID), DEFINE_PROP_UINT32("x-pci-sub-device-id", VFIOPCIDevice, sub_device_id, PCI_ANY_ID), - DEFINE_PROP_UINT32("x-igd-gms", VFIOPCIDevice, igd_gms, 0), + DEFINE_PROP_UINT32("x-igd-gms", VFIOPCIDevice, igd_gms, 1), /* * TODO - support passed fds... is this necessary? * DEFINE_PROP_STRING("vfiofd", VFIOPCIDevice, vfiofd_name),