<div dir="ltr"><span class="gmail-il">Reviewed</span>-<span class="gmail-il">by</span>: <span name="Caz Yokoyama" class="gmail-gD" style="font-family:"Google Sans",Roboto,RobotoDraft,Helvetica,Arial,sans-serif;white-space:nowrap;color:rgb(31,31,31);font-size:0.875rem;font-weight:bold;display:inline;vertical-align:top;line-height:20px"><span style="vertical-align:top">Caz Yokoyama</span></span><span style="color:rgb(95,99,104);font-family:"Google Sans",Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:0.75rem;font-weight:inherit;white-space:nowrap"> </span><span class="gmail-go" style="font-family:"Google Sans",Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:0.75rem;font-weight:inherit;white-space:nowrap;vertical-align:top;color:rgb(94,94,94)"><span aria-hidden="true"><</span><a href="mailto:caz@caztech.com">caz@caztech.com</a><span aria-hidden="true">></span></span><div><span class="gmail-go" style="font-family:"Google Sans",Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:0.75rem;font-weight:inherit;white-space:nowrap;vertical-align:top;color:rgb(94,94,94)"><span aria-hidden="true">Better to be safe.</span></span></div><div><span class="gmail-go" style="font-family:"Google Sans",Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:0.75rem;font-weight:inherit;white-space:nowrap;vertical-align:top;color:rgb(94,94,94)"><span aria-hidden="true"><br></span></span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 15, 2022 at 1:40 PM Lucas De Marchi <<a href="mailto:lucas.demarchi@intel.com">lucas.demarchi@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">DSMBASE register is defined so BDSM bitfield contains the bits 63 to 20<br>
of the base address of stolen. For the supported platforms bits 0-19 are<br>
zero but that may not be true in future. Add the missing mask.<br>
<br>
Signed-off-by: Lucas De Marchi <<a href="mailto:lucas.demarchi@intel.com" target="_blank">lucas.demarchi@intel.com</a>><br>
<br>
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c<br>
index 42f4769bb4ac..c34065fe2ecc 100644<br>
--- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c<br>
+++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c<br>
@@ -814,7 +814,7 @@ i915_gem_stolen_lmem_setup(struct drm_i915_private *i915, u16 type,<br>
return ERR_PTR(-ENXIO);<br>
<br>
/* Use DSM base address instead for stolen memory */<br>
- dsm_base = intel_uncore_read64(uncore, GEN12_DSMBASE);<br>
+ dsm_base = intel_uncore_read64(uncore, GEN12_DSMBASE) & GEN12_BDSM_MASK;<br>
if (IS_DG1(uncore->i915)) {<br>
lmem_size = pci_resource_len(pdev, GEN12_LMEM_BAR);<br>
if (WARN_ON(lmem_size < dsm_base))<br>
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h<br>
index 1a9bd829fc7e..0301874c76ba 100644<br>
--- a/drivers/gpu/drm/i915/i915_reg.h<br>
+++ b/drivers/gpu/drm/i915/i915_reg.h<br>
@@ -7953,6 +7953,7 @@ enum skl_power_gate {<br>
<br>
#define GEN12_GSMBASE _MMIO(0x108100)<br>
#define GEN12_DSMBASE _MMIO(0x1080C0)<br>
+#define GEN12_BDSM_MASK GENMASK(63, 20)<br>
<br>
#define XEHP_CLOCK_GATE_DIS _MMIO(0x101014)<br>
#define SGSI_SIDECLK_DIS REG_BIT(17)<br>
<br>
-- <br>
b4 0.10.0-dev-bbe61<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>-caz, caz at caztech dot com, 503-six one zero - five six nine nine(m)<br></div></div></div></div></div></div></div></div></div></div></div>