From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BFDAA31A053; Mon, 13 Apr 2026 11:47:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776080871; cv=none; b=Fsx/srttiydpUG2G/6zfY0uYJRK6IWV1qngzeWrDDqBoeGvNNMW5hvxI0HumLWcuxyroIwN9vYW6VXLTFnlTIbc4evJPnPHj76ShJJsQIwbFdZit9YAUTs2Kuy/RxMVefd7KmTYytkWAIkgrW/Hbz3RxRCPoP0vFsPHYcsfno4w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776080871; c=relaxed/simple; bh=aeU2+j127oURWfr5UJVcdLFt+DQWuAvQ6fLNBiXsn0A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kY14scaHvAMkE/0skqxb8OZRm5Jp/iVa0N8slf4oMXIlL/7zUUHCqxT8W37FfphnfVKquTu1YPVvElp4EvBNdTjmctfqDUPLUe+XOVErhwo/WcDZ1kshj4NKYjIpuW90LnFQvUpSeHoplFoq1UW6Ng4ws1QAedMSyJxqyiOtnps= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=JAJih579; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="JAJih579" Received: from [192.168.0.106] (unknown [49.205.253.198]) by linux.microsoft.com (Postfix) with ESMTPSA id DCF5320B7001; Mon, 13 Apr 2026 04:47:43 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com DCF5320B7001 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1776080870; bh=ZmW9qHrrNAcfztbJPZlZq0MvOI4dcjMtr4X3leEAtg4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=JAJih579xlgOCRGq6eu03iWt/8vu3PufifW1GO5hqErVwiCZiNlmHCCQQ3GgGfmY6 2NxZAlZP7Pxak6tl8945JvIANDuERrATzkCBEQuvIEFspMafzZ00xQZVz7rxFimv7M mVUXg9r8DX8Pf0yMHztGGzHXr0NzHy58Qh2sVvQk= Message-ID: Date: Mon, 13 Apr 2026 17:17:39 +0530 Precedence: bulk X-Mailing-List: linux-arch@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 06/11] Drivers: hv: Make sint vector architecture neutral in MSHV_VTL To: Michael Kelley , "K . Y . Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "x86@kernel.org" , "H . Peter Anvin" , Arnd Bergmann , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Marc Zyngier , Timothy Hayes , Lorenzo Pieralisi , mrigendrachaubey , "ssengar@linux.microsoft.com" , "linux-hyperv@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-arch@vger.kernel.org" , "linux-riscv@lists.infradead.org" References: <20260316121241.910764-1-namjain@linux.microsoft.com> <20260316121241.910764-7-namjain@linux.microsoft.com> Content-Language: en-US From: Naman Jain In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/1/2026 10:27 PM, Michael Kelley wrote: > From: Naman Jain Sent: Monday, March 16, 2026 5:13 AM >> >> Generalize Synthetic interrupt source vector (sint) to use >> vmbus_interrupt variable instead, which automatically takes care of >> architectures where HYPERVISOR_CALLBACK_VECTOR is not present (arm64). > > Sashiko AI raised an interesting question about the startup timing -- > whether the vmbus_platform_driver_probe() is guaranteed to have > set vmbus_interrupt before the VTL functions below run and use it. > What causes the mshv_vtl.ko module to be loaded, and hence run > mshv_vtl_init()? There is no race condition here. The init ordering guarantees that vmbus_interrupt is always set before mshv_vtl_synic_enable_regs() reads it. The call chain for setting vmbus_interrupt: subsys_initcall(hv_acpi_init) [level 4] -> platform_driver_register(&vmbus_platform_driver) and so on. The call chain for reading vmbus_interrupt: module_init(mshv_vtl_init) [level 6] -> hv_vtl_setup_synic() -> cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, ..., mshv_vtl_alloc_context, ...) -> mshv_vtl_alloc_context() -> mshv_vtl_synic_enable_regs() -> sint.vector = vmbus_interrupt do_initcalls() processes sections in order 0 through 7, so hv_acpi_init() (level 4) is guaranteed to complete before mshv_vtl_init() (level 6) runs. Regarding memory leak on cpu offline/online or module load/unload- it is beyond the scope of this series, I will fix it separately. I may need some more time in addressing comments on rest of the patches. Please bear with me. Regards, Naman > >> >> Signed-off-by: Roman Kisel >> Signed-off-by: Naman Jain >> --- >> drivers/hv/mshv_vtl_main.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/hv/mshv_vtl_main.c b/drivers/hv/mshv_vtl_main.c >> index b607b6e7e121..91517b45d526 100644 >> --- a/drivers/hv/mshv_vtl_main.c >> +++ b/drivers/hv/mshv_vtl_main.c >> @@ -234,7 +234,7 @@ static void mshv_vtl_synic_enable_regs(unsigned int cpu) >> union hv_synic_sint sint; >> >> sint.as_uint64 = 0; >> - sint.vector = HYPERVISOR_CALLBACK_VECTOR; >> + sint.vector = vmbus_interrupt; >> sint.masked = false; >> sint.auto_eoi = hv_recommend_using_aeoi(); >> >> @@ -753,7 +753,7 @@ static void mshv_vtl_synic_mask_vmbus_sint(void *info) >> const u8 *mask = info; >> >> sint.as_uint64 = 0; >> - sint.vector = HYPERVISOR_CALLBACK_VECTOR; >> + sint.vector = vmbus_interrupt; >> sint.masked = (*mask != 0); >> sint.auto_eoi = hv_recommend_using_aeoi(); >> >> -- >> 2.43.0 >> > > Assuming there's no timing problem vs. the VMBus driver, > > Reviewed-by: Michael Kelley