Re: [Intel-gfx] [PATCH] drm/i915: Handle msr read failure gracefully

2017-07-26 Thread Chris Wilson
Quoting Chris Wilson (2017-07-26 09:39:31) > Quoting Gabriel Krisman Bertazi (2017-07-26 06:30:16) > > When reading the i915_energy_uJ debugfs file, it tries to fetch > > MSR_RAPL_POWER_UNIT, which might not be available, like in a vm > > environment, causing the exception shown below. > > > > We

Re: [Intel-gfx] [PATCH] drm/i915: Handle msr read failure gracefully

2017-07-26 Thread Chris Wilson
Quoting Gabriel Krisman Bertazi (2017-07-26 06:30:16) > Chris Wilson writes: > > > Quoting Gabriel Krisman Bertazi (2017-07-25 19:19:22) > >> power = (power & 0x1f00) >> 8; > >> units = 100 / (1 << power); /* convert to uJ */ > >> power = I915_READ(MCH_SECP_NRG_STTS);

Re: [Intel-gfx] [PATCH] drm/i915: Handle msr read failure gracefully

2017-07-25 Thread Gabriel Krisman Bertazi
Chris Wilson writes: > Quoting Gabriel Krisman Bertazi (2017-07-25 19:19:22) >> power = (power & 0x1f00) >> 8; >> units = 100 / (1 << power); /* convert to uJ */ >> power = I915_READ(MCH_SECP_NRG_STTS); > > Just after this is a useless cast. Though it will be neater to

Re: [Intel-gfx] [PATCH] drm/i915: Handle msr read failure gracefully

2017-07-25 Thread Chris Wilson
Quoting Gabriel Krisman Bertazi (2017-07-25 19:19:22) > When reading the i915_energy_uJ debugfs file, it tries to fetch > MSR_RAPL_POWER_UNIT, which might not be available, like in a vm > environment, causing the exception shown below. > > We can easily prevent it by doing a rdmsrl_safe read inste

[Intel-gfx] [PATCH] drm/i915: Handle msr read failure gracefully

2017-07-25 Thread Gabriel Krisman Bertazi
When reading the i915_energy_uJ debugfs file, it tries to fetch MSR_RAPL_POWER_UNIT, which might not be available, like in a vm environment, causing the exception shown below. We can easily prevent it by doing a rdmsrl_safe read instead, which will handle the exception, allowing us to abort the de