[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] libxc/PM: correct (not just) error handling in xc_get_cpufreq_para()
- To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jason Andryuk <jason.andryuk@xxxxxxx>
- Date: Mon, 7 Apr 2025 16:36:20 -0400
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rWAC3/iDV14JOgClU2ZYFqE3Nz+XQbJNT637iEKRIO0=; b=QwWezsvnDE7wyTUONVHyL+LBU2ekiONEAgLi2rwdx1IptQu7bhob27J/OVSH/rQZjuhqyLMqF10m0NXVqZjZ8BhntIi8z/vTdv9m1hmYPlJDkl1BHEFFLtibunu0gHoEd/d+wPpHEqB5NP9UgwQD70Qwe+nKMLw6MYPssJ3Hw5df++lXUiZnGArhriYDQ18UOMJVLgoIcFst2cPkOHn8QfRNqBwuPoETz1iy+FZsBIIJBjqHKVOHpk6XTUP4rzMac7pZUwiVcgSGhsSqC1KeTtd5lDqhfRufa9ACWl235CUDDuKRABTlHMKQ65GaQPU3CzMuk4JBIHlQcAPLBv5JSQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ew9ddP/j/ixPD+qXe2/bI00pff6Sj1+I0akRor4ty1bO/2c09fOBoO1gGqwMHvhI4Na2uV86G8hwG5lAuNJbbtlDSertj+SYMNWvbU4Lx+0aYH3edtGwpgpsnGAVVK3agR5XDzRe4TSOxHQ79/sDqat3Ee7pZm3q3nW8cPydGlrsNHW+EB41rAZMDOXq7/B1NklvLH5PayY+GOec3cSRIfEnSkx7j4TAai+zB6loNE4ht8M2K0z1xEjNx/AhiJns6L4JvoOnj2PKw7awkzL11wzcnD1q+Be7UGjGVj4r6hNUnjgtn2fIVF91UW+5AeL8TcthukLekDIWIoCN51KYdQ==
- Cc: Anthony Perard <anthony@xxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
- Delivery-date: Mon, 07 Apr 2025 20:36:47 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 2025-03-27 09:32, Jan Beulich wrote:
From their introduction all xc_hypercall_bounce_pre() uses, when they
failed, would properly cause exit from the function including cleanup,
yet without informing the caller of the failure. Purge the unlock_1
label for being both pointless and mis-named.
An earlier attempt to switch to the usual split between return value and
errno wasn't quite complete.
HWP work made the cleanup of the "available governors" array
conditional, neglecting the fact that the condition used may not be the
condition that was used to allocate the buffer (as the structure field
is updated upon getting back EAGAIN). Throughout the function, use the
local variable being introduced to address that.
Fixes: 4513025a8790 ("libxc: convert sysctl interfaces over to hypercall
buffers")
Amends: 73367cf3b4b4 ("libxc: Fix xc_pm API calls to return negative error and stash
error in errno")
Fixes: 31e264c672bc ("pmstat&xenpm: Re-arrage for cpufreq union")
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>
This fixes the currently broken logic with has_num, so I think it's a
good change.
I think the gov_num==0 no longer happens with HWP because it registers a
governor:
return cpufreq_register_governor(&cpufreq_gov_hwp);
Unfortunately, I no longer have an HWP-capable system to verify.
Regards,
Jason
|