From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F4061FBC81; Tue, 28 Jan 2025 17:54:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738086890; cv=none; b=OFCnFlnEmrk8P+/D+K0G1k8r96RGS5Y0BWqugcJUmV4UcOnP6DJAnESYPioMUQVWTVNmf3edwy8QKuxn0ia98At+zN/s1wpfK0bK0wZAvPFzb+xQFuzpymk48nAR4CZRK2RJOvcp7hfvi/QA7MxKdpgPco+bid0C3s5BSf9sQXo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738086890; c=relaxed/simple; bh=TGjOYaYwok/GnsXlWrnv8ChOT+PEzg5Uc8rG8IdLxRc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=d9TKn/zTEkZO98HyFFttozUKz432F5do6kDKiiplRb0EgjGQcCeeztqENCxFBs0FNNDJ7F7WAY+6+pNA1G8RAhhlZITm5Nu90IAbwOBYnZmZk9sVjBj3Grs4x0uu2Cm9zoxlwW77+Sb7LGzxQxl7Sihyy9vVEWoSpPJvbqOJmtY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=saDMK8Az; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="saDMK8Az" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D466C4CEE5; Tue, 28 Jan 2025 17:54:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738086890; bh=TGjOYaYwok/GnsXlWrnv8ChOT+PEzg5Uc8rG8IdLxRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=saDMK8AzNJFAiodvdwgoafBK6DWnUTJLKesEWO+taalRcZiFPhRoyxu1B3jO5EF/h 8Xfzeo4LqFU4IB09pxw5YOr/4+nth9Q76FK4oUBiDRuxC32AoMY1peNFnw8Z1WWZgn aZ7ld1Xb5mRnXKv4OL2eXv4uaGopJmX8B1OXkBj9zB/yQ1kSgg5a4vr3ZbRgdfvNwF hOXa+l2hnYDBQwpufZnZZtHajaHoWZN/eU7o0WJHHpQld/GHJCj+62YCLx5AHwOMGo 3vM4sciacQqsOLxRZp5ASwIjdqJ/Je451AfK88wibXfkriSJuI0rCj0PZSwxJnqH5v s84T073xtKedQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Roman Kisel , Michael Kelley , Easwar Hariharan , Nuno Das Neves , Wei Liu , Sasha Levin , kys@microsoft.com, haiyangz@microsoft.com, decui@microsoft.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, linux-hyperv@vger.kernel.org Subject: [PATCH AUTOSEL 6.6 08/11] hyperv: Do not overlap the hvcall IO areas in hv_vtl_apicid_to_vp_id() Date: Tue, 28 Jan 2025 12:54:32 -0500 Message-Id: <20250128175435.1197457-8-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250128175435.1197457-1-sashal@kernel.org> References: <20250128175435.1197457-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.74 Content-Transfer-Encoding: 8bit From: Roman Kisel [ Upstream commit f285d995743269aa9f893e5e9a1065604137c1f6 ] The Top-Level Functional Specification for Hyper-V, Section 3.6 [1, 2], disallows overlapping of the input and output hypercall areas, and hv_vtl_apicid_to_vp_id() overlaps them. Use the output hypercall page of the current vCPU for the hypercall. [1] https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/hypercall-interface [2] https://github.com/MicrosoftDocs/Virtualization-Documentation/tree/main/tlfs Reported-by: Michael Kelley Closes: https://lore.kernel.org/lkml/SN6PR02MB4157B98CD34781CC87A9D921D40D2@SN6PR02MB4157.namprd02.prod.outlook.com/ Signed-off-by: Roman Kisel Reviewed-by: Easwar Hariharan Reviewed-by: Nuno Das Neves Link: https://lore.kernel.org/r/20250108222138.1623703-6-romank@linux.microsoft.com Signed-off-by: Wei Liu Message-ID: <20250108222138.1623703-6-romank@linux.microsoft.com> Signed-off-by: Sasha Levin --- arch/x86/hyperv/hv_vtl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv/hv_vtl.c index c2f78fabc865b..9fc0f54ec8d1e 100644 --- a/arch/x86/hyperv/hv_vtl.c +++ b/arch/x86/hyperv/hv_vtl.c @@ -189,7 +189,7 @@ static int hv_vtl_apicid_to_vp_id(u32 apic_id) input->partition_id = HV_PARTITION_ID_SELF; input->apic_ids[0] = apic_id; - output = (u32 *)input; + output = *this_cpu_ptr(hyperv_pcpu_output_arg); control = HV_HYPERCALL_REP_COMP_1 | HVCALL_GET_VP_ID_FROM_APIC_ID; status = hv_do_hypercall(control, input, output); -- 2.39.5