Subject: Re: linux-next: manual merge of the kvm-arm tree with the kvm tree

From: Stephen Rothwell <[email-masked]>
Date: Sun, 9 Aug 2020 18:54:36 +1000

Hi all,

On Mon, 13 Jul 2020 14:39:35 +1000 Stephen Rothwell <[email-masked]> wrote:
> 
> Today's linux-next merge of the kvm-arm tree got conflicts in:
> 
>   arch/arm64/include/asm/kvm_coproc.h
>   arch/arm64/kvm/handle_exit.c
> 
> between commit:
> 
>   74cc7e0c35c1 ("KVM: arm64: clean up redundant 'kvm_run' parameters")
> 
> from the kvm tree and commits:
> 
>   6b33e0d64f85 ("KVM: arm64: Drop the target_table[] indirection")
>   750ed5669380 ("KVM: arm64: Remove the target table")
>   3a949f4c9354 ("KVM: arm64: Rename HSR to ESR")
> 
> from the kvm-arm tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 
> diff --cc arch/arm64/include/asm/kvm_coproc.h
> index 454373704b8a,147f3a77e6a5..000000000000
> --- a/arch/arm64/include/asm/kvm_coproc.h
> +++ b/arch/arm64/include/asm/kvm_coproc.h
> @@@ -19,20 -19,12 +19,12 @@@ struct kvm_sys_reg_table 
>   	size_t num;
>   };
>   
> - struct kvm_sys_reg_target_table {
> - 	struct kvm_sys_reg_table table64;
> - 	struct kvm_sys_reg_table table32;
> - };
> - 
> - void kvm_register_target_sys_reg_table(unsigned int target,
> - 				       struct kvm_sys_reg_target_table *table);
> - 
>  -int kvm_handle_cp14_load_store(struct kvm_vcpu *vcpu, struct kvm_run *run);
>  -int kvm_handle_cp14_32(struct kvm_vcpu *vcpu, struct kvm_run *run);
>  -int kvm_handle_cp14_64(struct kvm_vcpu *vcpu, struct kvm_run *run);
>  -int kvm_handle_cp15_32(struct kvm_vcpu *vcpu, struct kvm_run *run);
>  -int kvm_handle_cp15_64(struct kvm_vcpu *vcpu, struct kvm_run *run);
>  -int kvm_handle_sys_reg(struct kvm_vcpu *vcpu, struct kvm_run *run);
>  +int kvm_handle_cp14_load_store(struct kvm_vcpu *vcpu);
>  +int kvm_handle_cp14_32(struct kvm_vcpu *vcpu);
>  +int kvm_handle_cp14_64(struct kvm_vcpu *vcpu);
>  +int kvm_handle_cp15_32(struct kvm_vcpu *vcpu);
>  +int kvm_handle_cp15_64(struct kvm_vcpu *vcpu);
>  +int kvm_handle_sys_reg(struct kvm_vcpu *vcpu);
>   
>   #define kvm_coproc_table_init kvm_sys_reg_table_init
>   void kvm_sys_reg_table_init(void);
> diff --cc arch/arm64/kvm/handle_exit.c
> index 1df3beafd73f,98ab33139982..000000000000
> --- a/arch/arm64/kvm/handle_exit.c
> +++ b/arch/arm64/kvm/handle_exit.c
> @@@ -87,9 -87,9 +87,9 @@@ static int handle_no_fpsimd(struct kvm_
>    * world-switches and schedule other host processes until there is an
>    * incoming IRQ or FIQ to the VM.
>    */
>  -static int kvm_handle_wfx(struct kvm_vcpu *vcpu, struct kvm_run *run)
>  +static int kvm_handle_wfx(struct kvm_vcpu *vcpu)
>   {
> - 	if (kvm_vcpu_get_hsr(vcpu) & ESR_ELx_WFx_ISS_WFE) {
> + 	if (kvm_vcpu_get_esr(vcpu) & ESR_ELx_WFx_ISS_WFE) {
>   		trace_kvm_wfx_arm64(*vcpu_pc(vcpu), true);
>   		vcpu->stat.wfe_exit_stat++;
>   		kvm_vcpu_on_spin(vcpu, vcpu_mode_priv(vcpu));
> @@@ -114,12 -115,11 +114,12 @@@
>    * guest and host are using the same debug facilities it will be up to
>    * userspace to re-inject the correct exception for guest delivery.
>    *
>  - * @return: 0 (while setting run->exit_reason), -1 for error
>  + * @return: 0 (while setting vcpu->run->exit_reason), -1 for error
>    */
>  -static int kvm_handle_guest_debug(struct kvm_vcpu *vcpu, struct kvm_run *run)
>  +static int kvm_handle_guest_debug(struct kvm_vcpu *vcpu)
>   {
>  +	struct kvm_run *run = vcpu->run;
> - 	u32 hsr = kvm_vcpu_get_hsr(vcpu);
> + 	u32 esr = kvm_vcpu_get_esr(vcpu);
>   	int ret = 0;
>   
>   	run->exit_reason = KVM_EXIT_DEBUG;
> @@@ -144,12 -144,12 +144,12 @@@
>   	return ret;
>   }
>   
>  -static int kvm_handle_unknown_ec(struct kvm_vcpu *vcpu, struct kvm_run *run)
>  +static int kvm_handle_unknown_ec(struct kvm_vcpu *vcpu)
>   {
> - 	u32 hsr = kvm_vcpu_get_hsr(vcpu);
> + 	u32 esr = kvm_vcpu_get_esr(vcpu);
>   
> - 	kvm_pr_unimpl("Unknown exception class: hsr: %#08x -- %s\n",
> - 		      hsr, esr_get_class_string(hsr));
> + 	kvm_pr_unimpl("Unknown exception class: esr: %#08x -- %s\n",
> + 		      esr, esr_get_class_string(esr));
>   
>   	kvm_inject_undefined(vcpu);
>   	return 1;
> @@@ -237,12 -237,11 +237,12 @@@ static int handle_trap_exceptions(struc
>    * Return > 0 to return to guest, < 0 on error, 0 (and set exit_reason) on
>    * proper exit to userspace.
>    */
>  -int handle_exit(struct kvm_vcpu *vcpu, struct kvm_run *run,
>  -		       int exception_index)
>  +int handle_exit(struct kvm_vcpu *vcpu, int exception_index)
>   {
>  +	struct kvm_run *run = vcpu->run;
>  +
>   	if (ARM_SERROR_PENDING(exception_index)) {
> - 		u8 hsr_ec = ESR_ELx_EC(kvm_vcpu_get_hsr(vcpu));
> + 		u8 esr_ec = ESR_ELx_EC(kvm_vcpu_get_esr(vcpu));
>   
>   		/*
>   		 * HVC/SMC already have an adjusted PC, which we need

This is now a conflict between the kvm-arm tree and Linus' tree.

-- 
Cheers,
Stephen Rothwell