Re: [PATCH v11 2/2] Drivers: hv: Introduce mshv_vtl driver

Naman Jain
2025-11-11T10:58:37Z

On 11/11/2025 1:43 PM, Peter Zijlstra wrote:
> On Tue, Nov 11, 2025 at 12:25:54PM +0530, Naman Jain wrote:
>
>> This would have been the cleanest approach. We discussed this before and
>> unfortunately it didn't work. Please find the link to this discussion:
>>
>> https://lore.kernel.org/all/9f8007a3-f810-4b60-8942-e721cd6a32c4@linux.microsoft.com/
>>
>> To summarize above discussion, I see below compilation error with this from
>> objtool. You may have CONFIG_X86_KERNEL_IBT enabled in your workspace, which
>> would have masked this.
>
> IBT isn't the problem, the thing is running objtool on vmlinux.o vs the
> individual translation units. vmlinux.o will have that symbol, while
> your .S file doesn't.
>
>> AS arch/x86/hyperv/mshv_vtl_asm.o
>> arch/x86/hyperv/mshv_vtl_asm.o: error: objtool: static_call: can't find
>> static_call_key symbol: __SCK____mshv_vtl_return_hypercall
>
> Right, and I said you had to do that ADDRESSABLE thing. So I added a
> DECLARE_STATIC_CALL() and a static_call() in hv.c, compiled it so .s and
> stole the bits.
>
> And then you get something like the below. See symbol 5, that's the
> entry we need.
>
> # readelf -sW defconfig-build/arch/x86/hyperv/mshv_vtl_asm.o
>
> Symbol table '.symtab' contains 8 entries:
> Num: Value Size Type Bind Vis Ndx Name
> 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
> 1: 0000000000000000 8 OBJECT LOCAL DEFAULT 6 __UNIQUE_ID_addressable___SCK____mshv_vtl_return_hypercall_662.0
> 2: 0000000000000000 0 SECTION LOCAL DEFAULT 4 .noinstr.text
> 3: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND __SCT____mshv_vtl_return_hypercall
> 4: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND __x86_return_thunk
> 5: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND __SCK____mshv_vtl_return_hypercall
> 6: 0000000000000010 179 FUNC GLOBAL DEFAULT 4 __mshv_vtl_return_call
> 7: 0000000000000000 16 FUNC GLOBAL DEFAULT 4 __pfx___mshv_vtl_return_call
>
>
> ---

Thanks a lot for sharing the changes. I tested this and it works fine. I
can create a separate patch for the include/linux/* changes and add it
as the first patch in the next version of my patch series.

Please let me know if this is fine and if I can add your Signed-off-by
in that patch.

Regards,
Naman