Bug 9603 - Do not try to disable kvmclock if it was not enabled
Summary: Do not try to disable kvmclock if it was not enabled
Status: NEW
Alias: None
Product: Anolis OS 8
Classification: Anolis OS
Component: kernel - anck-5.10 (show other bugs) kernel - anck-5.10
Version: ---
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: maqiao_mq
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-30 13:54 UTC by ymm
Modified: 2024-07-30 14:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ymm inspur_group 2024-07-30 13:54:31 UTC
Description of problem:


    x86/kvm: Do not try to disable kvmclock if it was not enabled

    kvm_guest_cpu_offline() tries to disable kvmclock regardless if it is
    present in the VM. It leads to write to a MSR that doesn't exist on some
    configurations, namely in TDX guest:

            unchecked MSR access error: WRMSR to 0x12 (tried to write 0x0000000000000000)
            at rIP: 0xffffffff8110687c (kvmclock_disable+0x1c/0x30)

    kvmclock enabling is gated by CLOCKSOURCE and CLOCKSOURCE2 KVM paravirt
    features.

    Do not disable kvmclock if it was not enabled.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 1 小龙 admin 2024-07-30 14:06:02 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/3562