hvcs_get_partner_info(9)
π hvcs_get_partner_info (from the Kernel API Manual, bestie)
Okay so picture this: you're deep in the hvcs world and you need all the partner info for a vty-server adapter. That's literally this function. It's giving "collect the whole squad's info from the hypervisor" energy and honestly? Iconic. π«Ά
β¨ SYNOPSIS β¨
int hvcs_get_partner_info (uint32_t unit_address , struct list_head
*head , unsigned long *pi_buff );
π ARGUMENTS π
unit_addressβ theunit_addressof the vty-server adapter that we're fetching partner info for. Like, which adapter's partners are we talking about? This one. πheadβ an initializedlist_headpointer pointing at an empty list. This is the container you hand over so the function can drop the list of partner info it fetched from the hypervisor back to you, the caller. Empty on the way in, full of partner info on the way out. Slay. β¨pi_buffβ a page-sized buffer that you pre-allocate before calling this function. Firmware uses it as an iterator to keep track of the partner info retrieval. Heads up: the original text says "to be used to be used by firmware" β yes, the double "to be used" is fr in there, we don't fix, we report. π
πΈ DESCRIPTION πΈ
So this function returns non-zero on success β or if there's no partner info at all. That's the vibe check: non-zero = we're good, one way or another. π¦
Now, about pi_buff β the reason you gotta pre-allocate it before calling is super important, bestie: this function may be called with a spin_lock held, and kmallocing a page is not recommended as GFP_ATOMIC. So no sneaky allocating inside. Do it first. Periodt. π
Here's the layout of that buffer, and it's kinda unhinged but we roll with it:
- The first
longstores a partner unit address. - The second
longstores a partner partition ID. - Starting at
pi_buff[2]you get the 79 character Converged Location Code β which is a different size than the unsigned longs, hence the casting mumbo jumbo you see later. Not me explaining the casting mumbo jumbo π but like, that's genuinely what the docs say.
β οΈ Big one, don't skip: invocation of this function should always be followed by an invocation ofhvcs_free_partner_info, using a pointer to the SAMElist_headinstance that you passed as a parameter to this function. Same instance. Not a lookalike. Not a cousin. The same one. fr fr. π₯
π SEE ALSO π
- Kernel file
./arch/powerpc/platforms/pseries/hvcserver.c hvcs_free_partner_info(9),hvcs_register_connection(9),hvcs_free_connection(9)
That's the whole page, bestie β no cap, every last detail preserved. π This lil' slice of the Kernel API Manual lives at ./arch/powerpc/platforms/pseries and it's dated October 2026, so mark your calendars and go free those partner info lists. π§β π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms