diff options
author | Christoffer Dall <c.dall@virtualopensystems.com> | 2012-06-03 14:17:48 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-06-06 08:24:00 -0400 |
commit | a737f256bf14adf94920aa70d150ab4dcd145109 (patch) | |
tree | d3c167e7c526299f06ceedbca16e3f61515d139c /arch | |
parent | 4ae57b6cfe67d12c9ba340cf172dc4e38a651ec5 (diff) |
KVM: Cleanup the kvm_print functions and introduce pr_XX wrappers
Introduces a couple of print functions, which are essentially wrappers
around standard printk functions, with a KVM: prefix.
Functions introduced or modified are:
- kvm_err(fmt, ...)
- kvm_info(fmt, ...)
- kvm_debug(fmt, ...)
- kvm_pr_unimpl(fmt, ...)
- pr_unimpl(vcpu, fmt, ...) -> vcpu_unimpl(vcpu, fmt, ...)
Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/svm.c | 6 | ||||
-rw-r--r-- | arch/x86/kvm/vmx.c | 2 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 54 |
3 files changed, 31 insertions, 31 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index f75af406b268..7a418783259d 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -3185,8 +3185,8 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) | |||
3185 | break; | 3185 | break; |
3186 | case MSR_IA32_DEBUGCTLMSR: | 3186 | case MSR_IA32_DEBUGCTLMSR: |
3187 | if (!boot_cpu_has(X86_FEATURE_LBRV)) { | 3187 | if (!boot_cpu_has(X86_FEATURE_LBRV)) { |
3188 | pr_unimpl(vcpu, "%s: MSR_IA32_DEBUGCTL 0x%llx, nop\n", | 3188 | vcpu_unimpl(vcpu, "%s: MSR_IA32_DEBUGCTL 0x%llx, nop\n", |
3189 | __func__, data); | 3189 | __func__, data); |
3190 | break; | 3190 | break; |
3191 | } | 3191 | } |
3192 | if (data & DEBUGCTL_RESERVED_BITS) | 3192 | if (data & DEBUGCTL_RESERVED_BITS) |
@@ -3205,7 +3205,7 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) | |||
3205 | case MSR_VM_CR: | 3205 | case MSR_VM_CR: |
3206 | return svm_set_vm_cr(vcpu, data); | 3206 | return svm_set_vm_cr(vcpu, data); |
3207 | case MSR_VM_IGNNE: | 3207 | case MSR_VM_IGNNE: |
3208 | pr_unimpl(vcpu, "unimplemented wrmsr: 0x%x data 0x%llx\n", ecx, data); | 3208 | vcpu_unimpl(vcpu, "unimplemented wrmsr: 0x%x data 0x%llx\n", ecx, data); |
3209 | break; | 3209 | break; |
3210 | default: | 3210 | default: |
3211 | return kvm_set_msr_common(vcpu, ecx, data); | 3211 | return kvm_set_msr_common(vcpu, ecx, data); |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index f78662ec8677..eeeb4a25aed6 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -4549,7 +4549,7 @@ static int handle_cr(struct kvm_vcpu *vcpu) | |||
4549 | break; | 4549 | break; |
4550 | } | 4550 | } |
4551 | vcpu->run->exit_reason = 0; | 4551 | vcpu->run->exit_reason = 0; |
4552 | pr_unimpl(vcpu, "unhandled control register: op %d cr %d\n", | 4552 | vcpu_unimpl(vcpu, "unhandled control register: op %d cr %d\n", |
4553 | (int)(exit_qualification >> 4) & 3, cr); | 4553 | (int)(exit_qualification >> 4) & 3, cr); |
4554 | return 0; | 4554 | return 0; |
4555 | } | 4555 | } |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index f12a52408cda..a01a4241bc6b 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -1437,8 +1437,8 @@ static int set_msr_hyperv_pw(struct kvm_vcpu *vcpu, u32 msr, u64 data) | |||
1437 | break; | 1437 | break; |
1438 | } | 1438 | } |
1439 | default: | 1439 | default: |
1440 | pr_unimpl(vcpu, "HYPER-V unimplemented wrmsr: 0x%x " | 1440 | vcpu_unimpl(vcpu, "HYPER-V unimplemented wrmsr: 0x%x " |
1441 | "data 0x%llx\n", msr, data); | 1441 | "data 0x%llx\n", msr, data); |
1442 | return 1; | 1442 | return 1; |
1443 | } | 1443 | } |
1444 | return 0; | 1444 | return 0; |
@@ -1470,8 +1470,8 @@ static int set_msr_hyperv(struct kvm_vcpu *vcpu, u32 msr, u64 data) | |||
1470 | case HV_X64_MSR_TPR: | 1470 | case HV_X64_MSR_TPR: |
1471 | return kvm_hv_vapic_msr_write(vcpu, APIC_TASKPRI, data); | 1471 | return kvm_hv_vapic_msr_write(vcpu, APIC_TASKPRI, data); |
1472 | default: | 1472 | default: |
1473 | pr_unimpl(vcpu, "HYPER-V unimplemented wrmsr: 0x%x " | 1473 | vcpu_unimpl(vcpu, "HYPER-V unimplemented wrmsr: 0x%x " |
1474 | "data 0x%llx\n", msr, data); | 1474 | "data 0x%llx\n", msr, data); |
1475 | return 1; | 1475 | return 1; |
1476 | } | 1476 | } |
1477 | 1477 | ||
@@ -1551,15 +1551,15 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data) | |||
1551 | data &= ~(u64)0x100; /* ignore ignne emulation enable */ | 1551 | data &= ~(u64)0x100; /* ignore ignne emulation enable */ |
1552 | data &= ~(u64)0x8; /* ignore TLB cache disable */ | 1552 | data &= ~(u64)0x8; /* ignore TLB cache disable */ |
1553 | if (data != 0) { | 1553 | if (data != 0) { |
1554 | pr_unimpl(vcpu, "unimplemented HWCR wrmsr: 0x%llx\n", | 1554 | vcpu_unimpl(vcpu, "unimplemented HWCR wrmsr: 0x%llx\n", |
1555 | data); | 1555 | data); |
1556 | return 1; | 1556 | return 1; |
1557 | } | 1557 | } |
1558 | break; | 1558 | break; |
1559 | case MSR_FAM10H_MMIO_CONF_BASE: | 1559 | case MSR_FAM10H_MMIO_CONF_BASE: |
1560 | if (data != 0) { | 1560 | if (data != 0) { |
1561 | pr_unimpl(vcpu, "unimplemented MMIO_CONF_BASE wrmsr: " | 1561 | vcpu_unimpl(vcpu, "unimplemented MMIO_CONF_BASE wrmsr: " |
1562 | "0x%llx\n", data); | 1562 | "0x%llx\n", data); |
1563 | return 1; | 1563 | return 1; |
1564 | } | 1564 | } |
1565 | break; | 1565 | break; |
@@ -1574,8 +1574,8 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data) | |||
1574 | thus reserved and should throw a #GP */ | 1574 | thus reserved and should throw a #GP */ |
1575 | return 1; | 1575 | return 1; |
1576 | } | 1576 | } |
1577 | pr_unimpl(vcpu, "%s: MSR_IA32_DEBUGCTLMSR 0x%llx, nop\n", | 1577 | vcpu_unimpl(vcpu, "%s: MSR_IA32_DEBUGCTLMSR 0x%llx, nop\n", |
1578 | __func__, data); | 1578 | __func__, data); |
1579 | break; | 1579 | break; |
1580 | case MSR_IA32_UCODE_REV: | 1580 | case MSR_IA32_UCODE_REV: |
1581 | case MSR_IA32_UCODE_WRITE: | 1581 | case MSR_IA32_UCODE_WRITE: |
@@ -1671,8 +1671,8 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data) | |||
1671 | case MSR_K7_EVNTSEL2: | 1671 | case MSR_K7_EVNTSEL2: |
1672 | case MSR_K7_EVNTSEL3: | 1672 | case MSR_K7_EVNTSEL3: |
1673 | if (data != 0) | 1673 | if (data != 0) |
1674 | pr_unimpl(vcpu, "unimplemented perfctr wrmsr: " | 1674 | vcpu_unimpl(vcpu, "unimplemented perfctr wrmsr: " |
1675 | "0x%x data 0x%llx\n", msr, data); | 1675 | "0x%x data 0x%llx\n", msr, data); |
1676 | break; | 1676 | break; |
1677 | /* at least RHEL 4 unconditionally writes to the perfctr registers, | 1677 | /* at least RHEL 4 unconditionally writes to the perfctr registers, |
1678 | * so we ignore writes to make it happy. | 1678 | * so we ignore writes to make it happy. |
@@ -1681,8 +1681,8 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data) | |||
1681 | case MSR_K7_PERFCTR1: | 1681 | case MSR_K7_PERFCTR1: |
1682 | case MSR_K7_PERFCTR2: | 1682 | case MSR_K7_PERFCTR2: |
1683 | case MSR_K7_PERFCTR3: | 1683 | case MSR_K7_PERFCTR3: |
1684 | pr_unimpl(vcpu, "unimplemented perfctr wrmsr: " | 1684 | vcpu_unimpl(vcpu, "unimplemented perfctr wrmsr: " |
1685 | "0x%x data 0x%llx\n", msr, data); | 1685 | "0x%x data 0x%llx\n", msr, data); |
1686 | break; | 1686 | break; |
1687 | case MSR_P6_PERFCTR0: | 1687 | case MSR_P6_PERFCTR0: |
1688 | case MSR_P6_PERFCTR1: | 1688 | case MSR_P6_PERFCTR1: |
@@ -1693,8 +1693,8 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data) | |||
1693 | return kvm_pmu_set_msr(vcpu, msr, data); | 1693 | return kvm_pmu_set_msr(vcpu, msr, data); |
1694 | 1694 | ||
1695 | if (pr || data != 0) | 1695 | if (pr || data != 0) |
1696 | pr_unimpl(vcpu, "disabled perfctr wrmsr: " | 1696 | vcpu_unimpl(vcpu, "disabled perfctr wrmsr: " |
1697 | "0x%x data 0x%llx\n", msr, data); | 1697 | "0x%x data 0x%llx\n", msr, data); |
1698 | break; | 1698 | break; |
1699 | case MSR_K7_CLK_CTL: | 1699 | case MSR_K7_CLK_CTL: |
1700 | /* | 1700 | /* |
@@ -1720,7 +1720,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data) | |||
1720 | /* Drop writes to this legacy MSR -- see rdmsr | 1720 | /* Drop writes to this legacy MSR -- see rdmsr |
1721 | * counterpart for further detail. | 1721 | * counterpart for further detail. |
1722 | */ | 1722 | */ |
1723 | pr_unimpl(vcpu, "ignored wrmsr: 0x%x data %llx\n", msr, data); | 1723 | vcpu_unimpl(vcpu, "ignored wrmsr: 0x%x data %llx\n", msr, data); |
1724 | break; | 1724 | break; |
1725 | case MSR_AMD64_OSVW_ID_LENGTH: | 1725 | case MSR_AMD64_OSVW_ID_LENGTH: |
1726 | if (!guest_cpuid_has_osvw(vcpu)) | 1726 | if (!guest_cpuid_has_osvw(vcpu)) |
@@ -1738,12 +1738,12 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data) | |||
1738 | if (kvm_pmu_msr(vcpu, msr)) | 1738 | if (kvm_pmu_msr(vcpu, msr)) |
1739 | return kvm_pmu_set_msr(vcpu, msr, data); | 1739 | return kvm_pmu_set_msr(vcpu, msr, data); |
1740 | if (!ignore_msrs) { | 1740 | if (!ignore_msrs) { |
1741 | pr_unimpl(vcpu, "unhandled wrmsr: 0x%x data %llx\n", | 1741 | vcpu_unimpl(vcpu, "unhandled wrmsr: 0x%x data %llx\n", |
1742 | msr, data); | 1742 | msr, data); |
1743 | return 1; | 1743 | return 1; |
1744 | } else { | 1744 | } else { |
1745 | pr_unimpl(vcpu, "ignored wrmsr: 0x%x data %llx\n", | 1745 | vcpu_unimpl(vcpu, "ignored wrmsr: 0x%x data %llx\n", |
1746 | msr, data); | 1746 | msr, data); |
1747 | break; | 1747 | break; |
1748 | } | 1748 | } |
1749 | } | 1749 | } |
@@ -1846,7 +1846,7 @@ static int get_msr_hyperv_pw(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata) | |||
1846 | data = kvm->arch.hv_hypercall; | 1846 | data = kvm->arch.hv_hypercall; |
1847 | break; | 1847 | break; |
1848 | default: | 1848 | default: |
1849 | pr_unimpl(vcpu, "Hyper-V unhandled rdmsr: 0x%x\n", msr); | 1849 | vcpu_unimpl(vcpu, "Hyper-V unhandled rdmsr: 0x%x\n", msr); |
1850 | return 1; | 1850 | return 1; |
1851 | } | 1851 | } |
1852 | 1852 | ||
@@ -1877,7 +1877,7 @@ static int get_msr_hyperv(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata) | |||
1877 | data = vcpu->arch.hv_vapic; | 1877 | data = vcpu->arch.hv_vapic; |
1878 | break; | 1878 | break; |
1879 | default: | 1879 | default: |
1880 | pr_unimpl(vcpu, "Hyper-V unhandled rdmsr: 0x%x\n", msr); | 1880 | vcpu_unimpl(vcpu, "Hyper-V unhandled rdmsr: 0x%x\n", msr); |
1881 | return 1; | 1881 | return 1; |
1882 | } | 1882 | } |
1883 | *pdata = data; | 1883 | *pdata = data; |
@@ -2030,10 +2030,10 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata) | |||
2030 | if (kvm_pmu_msr(vcpu, msr)) | 2030 | if (kvm_pmu_msr(vcpu, msr)) |
2031 | return kvm_pmu_get_msr(vcpu, msr, pdata); | 2031 | return kvm_pmu_get_msr(vcpu, msr, pdata); |
2032 | if (!ignore_msrs) { | 2032 | if (!ignore_msrs) { |
2033 | pr_unimpl(vcpu, "unhandled rdmsr: 0x%x\n", msr); | 2033 | vcpu_unimpl(vcpu, "unhandled rdmsr: 0x%x\n", msr); |
2034 | return 1; | 2034 | return 1; |
2035 | } else { | 2035 | } else { |
2036 | pr_unimpl(vcpu, "ignored rdmsr: 0x%x\n", msr); | 2036 | vcpu_unimpl(vcpu, "ignored rdmsr: 0x%x\n", msr); |
2037 | data = 0; | 2037 | data = 0; |
2038 | } | 2038 | } |
2039 | break; | 2039 | break; |
@@ -4116,7 +4116,7 @@ static unsigned long emulator_get_cr(struct x86_emulate_ctxt *ctxt, int cr) | |||
4116 | value = kvm_get_cr8(vcpu); | 4116 | value = kvm_get_cr8(vcpu); |
4117 | break; | 4117 | break; |
4118 | default: | 4118 | default: |
4119 | vcpu_printf(vcpu, "%s: unexpected cr %u\n", __func__, cr); | 4119 | kvm_err("%s: unexpected cr %u\n", __func__, cr); |
4120 | return 0; | 4120 | return 0; |
4121 | } | 4121 | } |
4122 | 4122 | ||
@@ -4145,7 +4145,7 @@ static int emulator_set_cr(struct x86_emulate_ctxt *ctxt, int cr, ulong val) | |||
4145 | res = kvm_set_cr8(vcpu, val); | 4145 | res = kvm_set_cr8(vcpu, val); |
4146 | break; | 4146 | break; |
4147 | default: | 4147 | default: |
4148 | vcpu_printf(vcpu, "%s: unexpected cr %u\n", __func__, cr); | 4148 | kvm_err("%s: unexpected cr %u\n", __func__, cr); |
4149 | res = -1; | 4149 | res = -1; |
4150 | } | 4150 | } |
4151 | 4151 | ||