From: kettenis Date: Tue, 4 May 2021 12:46:28 +0000 (+0000) Subject: Add a boot hart ID check in the function that matches secondary CPUs X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f561954d8976190f0f833319a8d4ec74bc5af985;p=openbsd Add a boot hart ID check in the function that matches secondary CPUs as well. ok jsg@ --- diff --git a/sys/arch/riscv64/dev/mainbus.c b/sys/arch/riscv64/dev/mainbus.c index faa9831427f..a43d437fff8 100644 --- a/sys/arch/riscv64/dev/mainbus.c +++ b/sys/arch/riscv64/dev/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.3 2021/05/04 06:32:58 jsg Exp $ */ +/* $OpenBSD: mainbus.c,v 1.4 2021/05/04 12:46:28 kettenis Exp $ */ /* * Copyright (c) 2016 Patrick Wildt * Copyright (c) 2017 Mark Kettenis @@ -335,7 +335,7 @@ mainbus_match_secondary(struct device *parent, void *match, void *aux) struct fdt_attach_args *fa = aux; struct cfdata *cf = match; - if (fa->fa_nreg < 1) + if (fa->fa_nreg < 1 || fa->fa_reg[0].addr == boot_hart) return 0; return (*cf->cf_attach->ca_match)(parent, match, aux);