Skip to content

Commit

Permalink
[feat] set phys-virt-offset as 0xffff_8000_0000_0000 for x86_64 qemu
Browse files Browse the repository at this point in the history
  • Loading branch information
hky1999 committed Dec 13, 2024
1 parent b2124ce commit 062534b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions modules/axhal/src/platform/x86_pc/multiboot.S
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,10 @@ ap_entry64:
.Ltmp_pml4:
# 0x0000_0000 ~ 0xffff_ffff
.quad .Ltmp_pdpt_low - {offset} + 0x3 # PRESENT | WRITABLE | paddr(tmp_pdpt)
.zero 8 * 510
# 0xffff_ff80_0000_0000 ~ 0xffff_ff80_ffff_ffff
.zero 8 * 255
# 0xffff_8000_0000_0000 ~ 0xffff_8000_ffff_ffff
.quad .Ltmp_pdpt_high - {offset} + 0x3 # PRESENT | WRITABLE | paddr(tmp_pdpt)
.zero 8 * 255

# FIXME: may not work on macOS using hvf as the CPU does not support 1GB page (pdpe1gb)
.Ltmp_pdpt_low:
Expand Down
10 changes: 6 additions & 4 deletions platforms/x86_64-qemu-q35.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,26 @@ phys-memory-size = "0x800_0000" # 128M
# Base physical address of the kernel image.
kernel-base-paddr = "0x20_0000"
# Base virtual address of the kernel image.
kernel-base-vaddr = "0xffff_ff80_0020_0000"
kernel-base-vaddr = "0xffff_8000_0020_0000"
# Linear mapping offset, for quick conversions between physical and virtual
# addresses.
phys-virt-offset = "0xffff_ff80_0000_0000"
phys-virt-offset = "0xffff_8000_0000_0000"
# Offset of bus address and phys address. some boards, the bus address is
# different from the physical address.
phys-bus-offset = "0"
# Kernel address space base.
kernel-aspace-base = "0xffff_ff80_0000_0000"
kernel-aspace-base = "0xffff_8000_0000_0000"
# Kernel address space size.
kernel-aspace-size = "0x0000_007f_ffff_f000"
kernel-aspace-size = "0x0000_7fff_ffff_f000"
# MMIO regions with format (`base_paddr`, `size`).
mmio-regions = [
["0xb000_0000", "0x1000_0000"], # PCI config space
["0xfe00_0000", "0xc0_0000"], # PCI devices
["0xfec0_0000", "0x1000"], # IO APIC
["0xfed0_0000", "0x1000"], # HPET
["0xfee0_0000", "0x1000"], # Local APIC
["0xc000000000", "0x4000"], # PCI devices
["0x380000000000", "0x4000"] # PCI devices
]
# VirtIO MMIO regions with format (`base_paddr`, `size`).
virtio-mmio-regions = []
Expand Down

0 comments on commit 062534b

Please sign in to comment.