mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 07:35:31 +00:00
ptdev: change remapping entry from virtual to physical based
currently, pass-thru devices are managed by per-vm's remapping entries which is virtual based: - MSI entry is identified by virt_bdf+msix_index - INTx entry is identified by virt_pin+vpin_src it works but it's not a good design for physical resource management, for example a physical IOAPIC pin could belong to different vm's INTx entries, the Device Model then must make sure there is no resource conflict from application's level. This patch change the design from virtual to physical based: - MSI entry is identified by phys_bdf+msix_index - INTx entry is identified by phys_pin The physical resource is directly managed in hypervisor, a miss adding entry will be found by hypervisor and return error message with failure. Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Xu, Anthony <anthony.xu@intel.com>
This commit is contained in:
@@ -76,8 +76,26 @@ uint16_t legacy_irq_to_pin[NR_LEGACY_IRQ] = {
|
||||
15, /* IRQ15*/
|
||||
};
|
||||
|
||||
static void *map_ioapic(
|
||||
uint64_t ioapic_paddr)
|
||||
uint16_t pic_ioapic_pin_map[NR_LEGACY_PIN] = {
|
||||
2, /* pin0*/
|
||||
1, /* pin1*/
|
||||
0, /* pin2*/
|
||||
3, /* pin3*/
|
||||
4, /* pin4*/
|
||||
5, /* pin5*/
|
||||
6, /* pin6*/
|
||||
7, /* pin7*/
|
||||
8, /* pin8*/
|
||||
9, /* pin9*/
|
||||
10, /* pin10*/
|
||||
11, /* pin11*/
|
||||
12, /* pin12*/
|
||||
13, /* pin13*/
|
||||
14, /* pin14*/
|
||||
15, /* pin15*/
|
||||
};
|
||||
|
||||
static void *map_ioapic(uint64_t ioapic_paddr)
|
||||
{
|
||||
/* At some point we may need to translate this paddr to a vaddr.
|
||||
* 1:1 mapping for now.
|
||||
|
||||
Reference in New Issue
Block a user