From nobody Wed Jun 07 08:24:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QbgPZ5DLKz4bFPV; Wed, 7 Jun 2023 08:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QbgPZ4Qhvz3QVR; Wed, 7 Jun 2023 08:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686126290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HsH3mbogkLC6MR+2svuL5Y0XWWhG7yqU/3+7Uf0rxPc=; b=Wejgl6SwvzQ3v+RRGLmjsIFmE6AjEvnsh5gW3hk9Xq1JT+KpahSsBqw8f0IBCiojyEVs4V q2/MR/d37VoQ7Jl1DqJKSV8wvNGzzwAgSbAoRteGiT0RZkI/L7cN5VSZ4sFAntEcY/72Ut C3hJwV2fHXzJml+xK0r2IENgOdRTJRUfkjWsDNqSMRMHIV4GugcujYxZx/vsfEAZzkgjrg lo396wN8pzj3s5ZtcQDegkjgTy4R2kb/XkrNXYkiXDj7j+56OhblVmWpVuA6GHRfuMmtLo spEz0VSjrYkNuMPyU09uIE5b8qjwuYYZorSpBrfJaA3klEWk4hTwcvl8PVKbsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686126290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HsH3mbogkLC6MR+2svuL5Y0XWWhG7yqU/3+7Uf0rxPc=; b=LlQCLJUR/O5ucvGRGQnlk5HFmPAsK3aNwuKGV5vKxCicic7m2muecsVpu4dV7uAnv8nQ14 UOFtaI1W3X4jgUJHqhXAfdZcxHM940q7f2UZohZGcUp9o9ofFxUPmJaxPbx/HUdpzDyBfa cwinlaSiY3g1tjfbnIwANvvUgXdz/ixXqhytzOempg7HoyzI+pS8vCOqk1qxRAAW4OXU4G fZTQaKAT7YhO2Z0WPm/50E/v502YN94fEMDqyzEG09E36i8jRzP5UDGgkEip+Irb4lPRlm t7noffdZBEf1W1M13v7Wq5bzO/v7tt51F1AlhJpKd25RCMASGSSj5Gm4rOiq1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686126290; a=rsa-sha256; cv=none; b=OJ5fmPAqxUDU5wrY6zms7xWFHfxgXGcqHYhitGxbTKfQMlCrl2GgGiCumHOP5JZoLb4Um8 Ad972LoWA34An4cE1l6ak4PCvj+Uq8fdM1+IutVxPvAo0zpQH5QyZvOa3GYdTHcs2zIytg Ygk6Lmz0IUZKDldUKakfFH9QTvnDRyyW2TTY3E+asPNNQNe9qsW0ocUjOm1x7dZ5oyAuUu iFgMTZ17m951yiXp4CqXY3Qgs2JRCWLC0CTvfEmRozIuKlLYSXH8k1faJscpc2YZQ5IZmQ Y6TsH157TAsVFOWTCA1Im0WAn5SZ3vDUsZNO1gUCoF1zcuvfvgUx/fnauy0Uhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QbgPZ3W8bz14RB; Wed, 7 Jun 2023 08:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3578Oorv084278; Wed, 7 Jun 2023 08:24:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3578OoJF084277; Wed, 7 Jun 2023 08:24:50 GMT (envelope-from git) Date: Wed, 7 Jun 2023 08:24:50 GMT Message-Id: <202306070824.3578OoJF084277@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wei Hu Subject: git: 4f8c634de09f - main - arm64 Hyper-V: enable Hyper-V SMP for ARM64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: whu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f8c634de09ffa2583306821e235f6f92104e729 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=4f8c634de09ffa2583306821e235f6f92104e729 commit 4f8c634de09ffa2583306821e235f6f92104e729 Author: Wei Hu AuthorDate: 2023-06-07 08:03:59 +0000 Commit: Wei Hu CommitDate: 2023-06-07 08:24:13 +0000 arm64 Hyper-V: enable Hyper-V SMP for ARM64 Vmbus_synic_setup() is invoked via vmbus_intrhook -> vmbus_doattach -> smp_rendezvous. On !EARLY_AP_STARTUP (e.g., aarch64), SMP isn't functional in intrhooks and smp_rendezvous() will just call vmbus_synic_setup() on the boot processor. There's nothing that will initialize the pcpu data on every other AP. To fix it we need to use SI_SUB_SMP for vmbus_doattach(). With this patch the vmbus interrupt should work on all arm64 cpus on HyperV. Reported by: kevans Reviewed by: kevans, whu Tested by: Souradeep Chakrabarti Obtained from: Souradeep Chakrabarti Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D40279 --- sys/dev/hyperv/vmbus/vmbus.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c index ae4c466d98d9..cc37d84ff151 100644 --- a/sys/dev/hyperv/vmbus/vmbus.c +++ b/sys/dev/hyperv/vmbus/vmbus.c @@ -114,7 +114,7 @@ static uint32_t vmbus_get_vcpu_id_method(device_t bus, device_t dev, int cpu); static struct taskqueue *vmbus_get_eventtq_method(device_t, device_t, int); -#if defined(EARLY_AP_STARTUP) || defined(__aarch64__) +#if defined(EARLY_AP_STARTUP) static void vmbus_intrhook(void *); #endif @@ -1482,7 +1482,7 @@ vmbus_event_proc_dummy(struct vmbus_softc *sc __unused, int cpu __unused) { } -#if defined(EARLY_AP_STARTUP) || defined(__aarch64__) +#if defined(EARLY_AP_STARTUP) static void vmbus_intrhook(void *xsc) @@ -1495,7 +1495,7 @@ vmbus_intrhook(void *xsc) config_intrhook_disestablish(&sc->vmbus_intrhook); } -#endif /* EARLY_AP_STARTUP aarch64 */ +#endif /* EARLY_AP_STARTUP */ static int vmbus_attach(device_t dev) @@ -1511,22 +1511,13 @@ vmbus_attach(device_t dev) */ vmbus_sc->vmbus_event_proc = vmbus_event_proc_dummy; -#if defined(EARLY_AP_STARTUP) || defined(__aarch64__) +#if defined(EARLY_AP_STARTUP) /* * Defer the real attach until the pause(9) works as expected. */ vmbus_sc->vmbus_intrhook.ich_func = vmbus_intrhook; vmbus_sc->vmbus_intrhook.ich_arg = vmbus_sc; config_intrhook_establish(&vmbus_sc->vmbus_intrhook); -#else /* !EARLY_AP_STARTUP */ - /* - * If the system has already booted and thread - * scheduling is possible indicated by the global - * cold set to zero, we just call the driver - * initialization directly. - */ - if (!cold) - vmbus_doattach(vmbus_sc); #endif /* EARLY_AP_STARTUP and aarch64 */ return (0); @@ -1572,7 +1563,7 @@ vmbus_detach(device_t dev) return (0); } -#if !defined(EARLY_AP_STARTUP) && !defined(__aarch64__) +#if !defined(EARLY_AP_STARTUP) static void vmbus_sysinit(void *arg __unused) @@ -1582,14 +1573,7 @@ vmbus_sysinit(void *arg __unused) if (vm_guest != VM_GUEST_HV || sc == NULL) return; - /* - * If the system has already booted and thread - * scheduling is possible, as indicated by the - * global cold set to zero, we just call the driver - * initialization directly. - */ - if (!cold) - vmbus_doattach(sc); + vmbus_doattach(sc); } /* * NOTE: