ARM: ACPI: Fix MPIDR value in ACPI table
Use mp_affinity of ARMCPU as the CPU MPIDR instead of the CPU index. Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org> Message-id: 1446285001-7316-1-git-send-email-zhaoshenglong@huawei.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
		
							parent
							
								
									f2fbfacec0
								
							
						
					
					
						commit
						5d9c175614
					
				@ -452,13 +452,15 @@ build_madt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info,
 | 
				
			|||||||
    for (i = 0; i < guest_info->smp_cpus; i++) {
 | 
					    for (i = 0; i < guest_info->smp_cpus; i++) {
 | 
				
			||||||
        AcpiMadtGenericInterrupt *gicc = acpi_data_push(table_data,
 | 
					        AcpiMadtGenericInterrupt *gicc = acpi_data_push(table_data,
 | 
				
			||||||
                                                     sizeof *gicc);
 | 
					                                                     sizeof *gicc);
 | 
				
			||||||
 | 
					        ARMCPU *armcpu = ARM_CPU(qemu_get_cpu(i));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        gicc->type = ACPI_APIC_GENERIC_INTERRUPT;
 | 
					        gicc->type = ACPI_APIC_GENERIC_INTERRUPT;
 | 
				
			||||||
        gicc->length = sizeof(*gicc);
 | 
					        gicc->length = sizeof(*gicc);
 | 
				
			||||||
        if (guest_info->gic_version == 2) {
 | 
					        if (guest_info->gic_version == 2) {
 | 
				
			||||||
            gicc->base_address = memmap[VIRT_GIC_CPU].base;
 | 
					            gicc->base_address = memmap[VIRT_GIC_CPU].base;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        gicc->cpu_interface_number = i;
 | 
					        gicc->cpu_interface_number = i;
 | 
				
			||||||
        gicc->arm_mpidr = i;
 | 
					        gicc->arm_mpidr = armcpu->mp_affinity;
 | 
				
			||||||
        gicc->uid = i;
 | 
					        gicc->uid = i;
 | 
				
			||||||
        if (test_bit(i, cpuinfo->found_cpus)) {
 | 
					        if (test_bit(i, cpuinfo->found_cpus)) {
 | 
				
			||||||
            gicc->flags = cpu_to_le32(ACPI_GICC_ENABLED);
 | 
					            gicc->flags = cpu_to_le32(ACPI_GICC_ENABLED);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user