Skip to content

Commit d812f7c

Browse files
mike-travissuryasaimadhu
authored andcommitted
x86/platform/uv: Update NMI Handler for UV5
Update NMI handler for UV5 hardware. A platform register changed, and UV5 only uses one of the two NMI methods used on previous hardware. Signed-off-by: Mike Travis <[email protected]> Signed-off-by: Steve Wahl <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Dimitri Sivanich <[email protected]> Acked-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3123109 commit d812f7c

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

arch/x86/platform/uv/uv_nmi.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,10 @@ static inline bool uv_nmi_action_is(const char *action)
244244
/* Setup which NMI support is present in system */
245245
static void uv_nmi_setup_mmrs(void)
246246
{
247+
bool new_nmi_method_only = false;
248+
247249
/* First determine arch specific MMRs to handshake with BIOS */
248-
if (UVH_EVENT_OCCURRED0_EXTIO_INT0_MASK) {
250+
if (UVH_EVENT_OCCURRED0_EXTIO_INT0_MASK) { /* UV2,3,4 setup */
249251
uvh_nmi_mmrx = UVH_EVENT_OCCURRED0;
250252
uvh_nmi_mmrx_clear = UVH_EVENT_OCCURRED0_ALIAS;
251253
uvh_nmi_mmrx_shift = UVH_EVENT_OCCURRED0_EXTIO_INT0_SHFT;
@@ -255,26 +257,25 @@ static void uv_nmi_setup_mmrs(void)
255257
uvh_nmi_mmrx_req = UVH_BIOS_KERNEL_MMR_ALIAS_2;
256258
uvh_nmi_mmrx_req_shift = 62;
257259

258-
} else if (UVH_EVENT_OCCURRED1_EXTIO_INT0_MASK) {
260+
} else if (UVH_EVENT_OCCURRED1_EXTIO_INT0_MASK) { /* UV5+ setup */
259261
uvh_nmi_mmrx = UVH_EVENT_OCCURRED1;
260262
uvh_nmi_mmrx_clear = UVH_EVENT_OCCURRED1_ALIAS;
261263
uvh_nmi_mmrx_shift = UVH_EVENT_OCCURRED1_EXTIO_INT0_SHFT;
262264
uvh_nmi_mmrx_type = "OCRD1-EXTIO_INT0";
263265

264-
uvh_nmi_mmrx_supported = UVH_EXTIO_INT0_BROADCAST;
265-
uvh_nmi_mmrx_req = UVH_BIOS_KERNEL_MMR_ALIAS_2;
266-
uvh_nmi_mmrx_req_shift = 62;
266+
new_nmi_method_only = true; /* Newer nmi always valid on UV5+ */
267+
uvh_nmi_mmrx_req = 0; /* no request bit to clear */
267268

268269
} else {
269-
pr_err("UV:%s:cannot find EVENT_OCCURRED*_EXTIO_INT0\n",
270-
__func__);
270+
pr_err("UV:%s:NMI support not available on this system\n", __func__);
271271
return;
272272
}
273273

274274
/* Then find out if new NMI is supported */
275-
if (likely(uv_read_local_mmr(uvh_nmi_mmrx_supported))) {
276-
uv_write_local_mmr(uvh_nmi_mmrx_req,
277-
1UL << uvh_nmi_mmrx_req_shift);
275+
if (new_nmi_method_only || uv_read_local_mmr(uvh_nmi_mmrx_supported)) {
276+
if (uvh_nmi_mmrx_req)
277+
uv_write_local_mmr(uvh_nmi_mmrx_req,
278+
1UL << uvh_nmi_mmrx_req_shift);
278279
nmi_mmr = uvh_nmi_mmrx;
279280
nmi_mmr_clear = uvh_nmi_mmrx_clear;
280281
nmi_mmr_pending = 1UL << uvh_nmi_mmrx_shift;

0 commit comments

Comments
 (0)