Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1832913imm; Mon, 3 Sep 2018 10:35:48 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYVtNPXyZFaD63QsHqLM0uLGTP2Dl82tVA6Hx6K6yM6Jr8nL6u3mpzrVmpOXE+amsBRajBr X-Received: by 2002:aa7:83cd:: with SMTP id j13-v6mr30406862pfn.236.1535996148119; Mon, 03 Sep 2018 10:35:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535996148; cv=none; d=google.com; s=arc-20160816; b=Qi1LCzhHE6sJ+cf0Wh3J3oH5M8SGx/9JmYR+a0bp/7EXXUxXnEbEeCHUltyV96bR9f xfvkTyKN0r6iUYtVbP//F5YL7/lgJ1rfnjI/hnlNmWKdnD9bra6CN4G6vaxLkGCPY+Ne OJaHSZJqjAvfsJ1Yt2q75Z59bSO11a+b4S4VViDyWlFHQSs/4VjL5J8RgJeZD4Lf5Bsz yMU3Xbc+uAIqtLXRv/8ZL1Kiyw7zw4G+dnnmOJ97j25zECwnUrPYIJoNqyenSnyCw8/m +vZuYGD00f/jfZEJX4bGBKCKlp6SplOicc2PMBCTMR1laVDV8samRVOdNCbCBzUgwX9a LIWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=imVc+dwEBFoH7wIrD1tvXVzcnqKUt3n9I9LkGI38At0=; b=RTlbLniJhFIPbkSCFsYgtrsLMHZ/a57q5yIQiIgx9A8gw/yvX732PgpEh2ouxPzjvF MFv4GBJtsCqx+xgrYYxTyjd0VDM9Kx5b7LZ0Fggwt1fhKuIeArffqwrdrlu2RY2pu3N/ 2dcYI/QTuWNvYHr5ToAyqg9ZqMYcV+1hJe+nb4cEmdVTC7K2ooq78YAvtYq9oe39uqQo WKHAns4porapHtMzdLXh4HPV5AQAwwuO45LTnCOACWv4YuVhTglCh/34Pr85LqzbmdbB jPLFnnLb3gJ3PGtI3qPoEQ34wjDt1+WOFHohdMFY1+Dxd+qDpl6aj7CqdWalad/+Zaxj n4qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m24-v6si406461pls.497.2018.09.03.10.35.32; Mon, 03 Sep 2018 10:35:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731394AbeICVzi (ORCPT + 99 others); Mon, 3 Sep 2018 17:55:38 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47776 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728335AbeICVzi (ORCPT ); Mon, 3 Sep 2018 17:55:38 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 93BDED18; Mon, 3 Sep 2018 17:34:27 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Daniele Ceraolo Spurio , Joonas Lahtinen , Paulo Zanoni , Rodrigo Vivi Subject: [PATCH 4.18 047/123] x86/gpu: reserve ICLs graphics stolen memory Date: Mon, 3 Sep 2018 18:56:31 +0200 Message-Id: <20180903165721.453010260@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165719.499675257@linuxfoundation.org> References: <20180903165719.499675257@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paulo Zanoni commit db0c8d8b031d2b5960f6407f7f2ca20e97e00605 upstream. ICL changes the registers and addresses to 64 bits. I also briefly looked at implementing an u64 version of the PCI config read functions, but I concluded this wouldn't be trivial, so it's not worth doing it for a single user that can't have any racing problems while reading the register in two separate operations. v2: - Scrub the development (non-public) changelog (Joonas). - Remove the i915.ko bits so this can be easily backported in order to properly avoid stolen memory even on machines without i915.ko (Joonas). - CC stable for the reasons above. Issue: VIZ-9250 CC: stable@vger.kernel.org Cc: Ingo Molnar Cc: H. Peter Anvin Cc: x86@kernel.org Cc: Daniele Ceraolo Spurio Cc: Joonas Lahtinen Signed-off-by: Paulo Zanoni Fixes: 412310019a20 ("drm/i915/icl: Add initial Icelake definitions.") Reviewed-by: Joonas Lahtinen Acked-by: Ingo Molnar Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20180504203252.28048-1-paulo.r.zanoni@intel.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/early-quirks.c | 18 ++++++++++++++++++ include/drm/i915_drm.h | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c @@ -338,6 +338,18 @@ static resource_size_t __init gen3_stole return bsm & INTEL_BSM_MASK; } +static resource_size_t __init gen11_stolen_base(int num, int slot, int func, + resource_size_t stolen_size) +{ + u64 bsm; + + bsm = read_pci_config(num, slot, func, INTEL_GEN11_BSM_DW0); + bsm &= INTEL_BSM_MASK; + bsm |= (u64)read_pci_config(num, slot, func, INTEL_GEN11_BSM_DW1) << 32; + + return bsm; +} + static resource_size_t __init i830_stolen_size(int num, int slot, int func) { u16 gmch_ctrl; @@ -498,6 +510,11 @@ static const struct intel_early_ops chv_ .stolen_size = chv_stolen_size, }; +static const struct intel_early_ops gen11_early_ops __initconst = { + .stolen_base = gen11_stolen_base, + .stolen_size = gen9_stolen_size, +}; + static const struct pci_device_id intel_early_ids[] __initconst = { INTEL_I830_IDS(&i830_early_ops), INTEL_I845G_IDS(&i845_early_ops), @@ -529,6 +546,7 @@ static const struct pci_device_id intel_ INTEL_CFL_IDS(&gen9_early_ops), INTEL_GLK_IDS(&gen9_early_ops), INTEL_CNL_IDS(&gen9_early_ops), + INTEL_ICL_11_IDS(&gen11_early_ops), }; struct resource intel_graphics_stolen_res __ro_after_init = DEFINE_RES_MEM(0, 0); --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h @@ -95,7 +95,9 @@ extern struct resource intel_graphics_st #define I845_TSEG_SIZE_512K (2 << 1) #define I845_TSEG_SIZE_1M (3 << 1) -#define INTEL_BSM 0x5c +#define INTEL_BSM 0x5c +#define INTEL_GEN11_BSM_DW0 0xc0 +#define INTEL_GEN11_BSM_DW1 0xc4 #define INTEL_BSM_MASK (-(1u << 20)) #endif /* _I915_DRM_H_ */