memory: assign MemoryRegionOps to all regions
This allows to remove the checks on section->readonly. Simply, write accesses to ROM will not be considered "direct" and will go through mr->ops without any special intervention. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
		
							parent
							
								
									d197063fcf
								
							
						
					
					
						commit
						2cdfcf272d
					
				
							
								
								
									
										3
									
								
								memory.c
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								memory.c
									
									
									
									
									
								
							@ -788,7 +788,8 @@ void memory_region_init(MemoryRegion *mr,
 | 
				
			|||||||
                        const char *name,
 | 
					                        const char *name,
 | 
				
			||||||
                        uint64_t size)
 | 
					                        uint64_t size)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    mr->ops = NULL;
 | 
					    mr->ops = &unassigned_mem_ops;
 | 
				
			||||||
 | 
					    mr->opaque = NULL;
 | 
				
			||||||
    mr->parent = NULL;
 | 
					    mr->parent = NULL;
 | 
				
			||||||
    mr->size = int128_make64(size);
 | 
					    mr->size = int128_make64(size);
 | 
				
			||||||
    if (size == UINT64_MAX) {
 | 
					    if (size == UINT64_MAX) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user