Bug 9569 - LoongArch: fix build error: error: conflicting types for 'kvm_own_pmu'
Summary: LoongArch: fix build error: error: conflicting types for 'kvm_own_pmu'
Status: NEW
Alias: None
Product: ANCK 6.6 Dev
Classification: ANCK
Component: virt (show other bugs) virt
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: maqiao
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-23 14:51 UTC by gaosong
Modified: 2024-07-23 16:07 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gaosong loongson_group 2024-07-23 14:51:53 UTC
Description of problem:

build error:

/home1/gaosong/code/anolis/cloud-kernel/arch/loongarch/kvm/vcpu.c:233:13: error: conflicting types for 'kvm_own_pmu'; have 'void(struct kvm_vcpu *)'
  233 | static void kvm_own_pmu(struct kvm_vcpu *vcpu)
      |             ^~~~~~~~~~~
In file included from /home1/gaosong/code/anolis/cloud-kernel/arch/loongarch/include/asm/kvm_csr.h:12,
                 from /home1/gaosong/code/anolis/cloud-kernel/arch/loongarch/kvm/trace.h:10,
                 from /home1/gaosong/code/anolis/cloud-kernel/arch/loongarch/kvm/vcpu.c:14:
/home1/gaosong/code/anolis/cloud-kernel/arch/loongarch/include/asm/kvm_vcpu.h:78:5: note: previous declaration of 'kvm_own_pmu' with type 'int(struct kvm_vcpu *)'
   78 | int kvm_own_pmu(struct kvm_vcpu *vcpu);
      |     ^~~~~~~~~~~
/home1/gaosong/code/anolis/cloud-kernel/arch/loongarch/kvm/vcpu.c:1236:5: error: conflicting types for 'kvm_own_pmu'; have 'int(struct kvm_vcpu *)'
 1236 | int kvm_own_pmu(struct kvm_vcpu *vcpu)
      |     ^~~~~~~~~~~
/home1/gaosong/code/anolis/cloud-kernel/arch/loongarch/kvm/vcpu.c:233:13: note: previous definition of 'kvm_own_pmu' with type 'void(struct kvm_vcpu *)'
  233 | static void kvm_own_pmu(struct kvm_vcpu *vcpu)
      |             ^~~~~~~~~~~
/home1/gaosong/code/anolis/cloud-kernel/arch/loongarch/kvm/vcpu.c: In function 'kvm_own_pmu':
/home1/gaosong/code/anolis/cloud-kernel/arch/loongarch/kvm/vcpu.c:1248:33: error: 'KVM_LARCH_PERF' undeclared (first use in this function); did you mean 'KVM_LARCH_LSX'?
 1248 |         vcpu->arch.aux_inuse |= KVM_LARCH_PERF;
      |                                 ^~~~~~~~~~~~~~
      |                                 KVM_LARCH_LSX


.....

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 1 gaosong loongson_group 2024-07-23 14:55:09 UTC
This bug from [1](bug 9537)
[1] https://bugzilla.openanolis.cn/show_bug.cgi?id=9537
Comment 2 小龙 admin 2024-07-23 16:07:03 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/3535