mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 01:05:29 +00:00
ptp: kvm: x86: Return EOPNOTSUPP instead of ENODEV from kvm_arch_ptp_init()
The caller, ptp_kvm_init(), emits a warning if kvm_arch_ptp_init() exits
with any error which is not EOPNOTSUPP:
"fail to initialize ptp_kvm"
Replace ENODEV with EOPNOTSUPP to avoid this spurious warning,
aligning with the ARM implementation.
Fixes: a86ed2cfa1
("ptp: Don't print an error if ptp_kvm is not supported")
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://patch.msgid.link/20241203-kvm_ptp-eopnotsuppp-v2-1-d1d060f27aa6@weissschuh.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
bd0c907043
commit
5e7aa97c7a
@ -26,7 +26,7 @@ int kvm_arch_ptp_init(void)
|
|||||||
long ret;
|
long ret;
|
||||||
|
|
||||||
if (!kvm_para_available())
|
if (!kvm_para_available())
|
||||||
return -ENODEV;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
if (cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) {
|
if (cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) {
|
||||||
p = alloc_page(GFP_KERNEL | __GFP_ZERO);
|
p = alloc_page(GFP_KERNEL | __GFP_ZERO);
|
||||||
@ -46,14 +46,14 @@ int kvm_arch_ptp_init(void)
|
|||||||
|
|
||||||
clock_pair_gpa = slow_virt_to_phys(clock_pair);
|
clock_pair_gpa = slow_virt_to_phys(clock_pair);
|
||||||
if (!pvclock_get_pvti_cpu0_va()) {
|
if (!pvclock_get_pvti_cpu0_va()) {
|
||||||
ret = -ENODEV;
|
ret = -EOPNOTSUPP;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = kvm_hypercall2(KVM_HC_CLOCK_PAIRING, clock_pair_gpa,
|
ret = kvm_hypercall2(KVM_HC_CLOCK_PAIRING, clock_pair_gpa,
|
||||||
KVM_CLOCK_PAIRING_WALLCLOCK);
|
KVM_CLOCK_PAIRING_WALLCLOCK);
|
||||||
if (ret == -KVM_ENOSYS) {
|
if (ret == -KVM_ENOSYS) {
|
||||||
ret = -ENODEV;
|
ret = -EOPNOTSUPP;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user