some questions about SMP?
some questions about SMP?
I am implementing the drivers so that the kernel supports several processors:
1- I did the search in the bios area (EBDA) and found the entry _MP_ (floating pointer structure), I did the checksum, ok
2- Then I got the PCMP (configuration table), I did the checksum, ok
3- I identified the IO PIC inputs and processors.
4- When I read in the configuration table, the field belonging to the address of the local APICs, I get that this address is
in 0xFEE00000, which is consistent with what the BIOS says that the addresses for this type of device are above 0xC0000000.
This memory location is virtual?
Before starting to work with IO-APIC, should I get a physical page and assign it to this virtual address?
1- I did the search in the bios area (EBDA) and found the entry _MP_ (floating pointer structure), I did the checksum, ok
2- Then I got the PCMP (configuration table), I did the checksum, ok
3- I identified the IO PIC inputs and processors.
4- When I read in the configuration table, the field belonging to the address of the local APICs, I get that this address is
in 0xFEE00000, which is consistent with what the BIOS says that the addresses for this type of device are above 0xC0000000.
This memory location is virtual?
Before starting to work with IO-APIC, should I get a physical page and assign it to this virtual address?
Re: some questions about SMP?
That is a physical address. It must be mapped as present, writeable, and non-cacheable somewhere.
Re: some questions about SMP?
Also, have you read the MP specification? The xv6 source code really helped me out as well.
Re: some questions about SMP?
Nexos,
If I have the QUEMU configured with only 256MB of RAM, how is it possible to allocate such a memory location above the physical memory, or am I doing something wrong?
If I have the QUEMU configured with only 256MB of RAM, how is it possible to allocate such a memory location above the physical memory, or am I doing something wrong?
Re: some questions about SMP?
This address is not RAM. Instead, it points to the LAPIC registers. It is called memory mapped because the firmware (to be precise, the chipset) maps this address to the LAPICs registers. Physical address are not necessarily RAM. They can also point to ROM (the BIOS is mapped to memory, yet is on ROM), a hardware device (PCI BARs and the APICs), or video ram(i.e. 0xB8000 points to VGA RAM, not system RAM). This is very important to understand when dealing with device management.
Re: some questions about SMP?
Ok, thank you very much, I am already reviewing the xv6 code, I hope to clarify some doubts.
Re: some questions about SMP?
To see more about why the APIC addresses can exist so high in memory read https://en.wikipedia.org/wiki/Memory-mapped_I/O
Re: some questions about SMP?
Ok, really the address decoder takes care of all this, I had not thought of it that way for this address, really my question is nonsense.
Re: some questions about SMP?
Nexos,
You have tested your implementation with the bochs, because when I do the virtual memory allocation in the kernel directory, it tells me
PANIC (APIC write with len = 1 (should be 4)), disable the cache for this page, I even got the address via
of the rdmsr instructions to check the addresses with those of the bios and they are the same. Will it be an emulator problem?
the same with quemu.
You have tested your implementation with the bochs, because when I do the virtual memory allocation in the kernel directory, it tells me
PANIC (APIC write with len = 1 (should be 4)), disable the cache for this page, I even got the address via
of the rdmsr instructions to check the addresses with those of the bios and they are the same. Will it be an emulator problem?
the same with quemu.
Re: some questions about SMP?
Did you set the cache disable bit in the PTE when mapping it (it is bit 5)?
Re: some questions about SMP?
Yes, (PG_CACHE_DISABLED 0x00000010)
Re: some questions about SMP?
Thank you very much for the help.
- Attachments
-
- rev.rar
- (7.25 KiB) Downloaded 132 times
Re: some questions about SMP?
My APIC driver is at https://github.com/Nexware-Project/NexO ... on/Lapic.c
Re: some questions about SMP?
The APIC memory base should be a u32 and it should have the volatile keyword. It should work then.