PPC: KVM: Fix BAT put
In the sregs API, upper and lower 32bit segments of the BAT registers are swapped when doing a set. Since we need to support old kernels out there, don't bother to fix it in the kernel, but instead work around the problem in QEMU by swapping on put. Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
		
							parent
							
								
									fb37c3029c
								
							
						
					
					
						commit
						ef8beb0e94
					
				| @ -493,10 +493,11 @@ int kvm_arch_put_registers(CPUPPCState *env, int level) | |||||||
| 
 | 
 | ||||||
|         /* Sync BATs */ |         /* Sync BATs */ | ||||||
|         for (i = 0; i < 8; i++) { |         for (i = 0; i < 8; i++) { | ||||||
|             sregs.u.s.ppc32.dbat[i] = ((uint64_t)env->DBAT[1][i] << 32) |             /* Beware. We have to swap upper and lower bits here */ | ||||||
|                 | env->DBAT[0][i]; |             sregs.u.s.ppc32.dbat[i] = ((uint64_t)env->DBAT[0][i] << 32) | ||||||
|             sregs.u.s.ppc32.ibat[i] = ((uint64_t)env->IBAT[1][i] << 32) |                 | env->DBAT[1][i]; | ||||||
|                 | env->IBAT[0][i]; |             sregs.u.s.ppc32.ibat[i] = ((uint64_t)env->IBAT[0][i] << 32) | ||||||
|  |                 | env->IBAT[1][i]; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         ret = kvm_vcpu_ioctl(env, KVM_SET_SREGS, &sregs); |         ret = kvm_vcpu_ioctl(env, KVM_SET_SREGS, &sregs); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Alexander Graf
						Alexander Graf