cputlb: fix watchpoints handling
Cleanup commit e554861766d9ae84dd5720baa4869f4ed711506f have changed code_address calculation in the tlb_set_page function in case of access to a page with a watchpoint. This caused QEMU segfault in the xtensa test_break unit test. Fix it by moving code_address assignment above memory_region_section_get_iotlb call. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
		
							parent
							
								
									ad37ad5b25
								
							
						
					
					
						commit
						56eb21e158
					
				
							
								
								
									
										4
									
								
								cputlb.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								cputlb.c
									
									
									
									
									
								
							@ -272,10 +272,10 @@ void tlb_set_page(CPUArchState *env, target_ulong vaddr,
 | 
				
			|||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        addend = 0;
 | 
					        addend = 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    iotlb = memory_region_section_get_iotlb(env, section, vaddr, paddr, prot,
 | 
					 | 
				
			||||||
                                            &address);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    code_address = address;
 | 
					    code_address = address;
 | 
				
			||||||
 | 
					    iotlb = memory_region_section_get_iotlb(env, section, vaddr, paddr, prot,
 | 
				
			||||||
 | 
					                                            &address);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    index = (vaddr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
 | 
					    index = (vaddr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
 | 
				
			||||||
    env->iotlb[mmu_idx][index] = iotlb - vaddr;
 | 
					    env->iotlb[mmu_idx][index] = iotlb - vaddr;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user