Re: [RFC PATCH 7/8] ARM: vmlinux.lds: Setup physical load address not virtual
|[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
On 06/18/2012 09:02 PM, Nicolas Pitre wrote:
On Mon, 18 Jun 2012, Michal Simek wrote:2012/6/18 Nicolas Pitre<nicolas.pitre@xxxxxxxxxx>On Mon, 18 Jun 2012, Michal Simek wrote:Setup correct virtual and physical address in ELF LOAD section.We are moving to a single kernel binary for multiple targets, including targets with different physical load addresses. The kernel code figures out at run time what the actual physical address is when CONFIG_ARM_PATCH_PHYS_VIRT is set which is the default these days. In other words, we don't know the physical offset at build time in that case and CONFIG_PHYS_OFFSET is simply not defined.ok. good to know and nice features. In that case I expect that you are using any binary format and you copy it to memory and run it. Code find out where it runs and based on that setup things.Exact.
ok. One more question about this feature. What is the alignment for it? I mean I have done the similar feature for Xilinx ppc440 and alignment depends on MMU TLB size.
(BTW: This is very interesting for me to implement it on Microblaze. Can you point me to that kernel code part? or any doc?)You could have a look at https://wiki.ubuntu.com/Specs/ARMSingleKernel, especially the section "Optimized virt_to_phys() with a runtime determined PHYS_OFFSET". Then the following commits should be of interest: 72a20e22f4 "ARM: P2V: eliminate head.S use of PHYS_OFFSET for !XIP_KERNEL" dc21af99fa "ARM: P2V: introduce phys_to_virt/virt_to_phys runtime patching"
ok. Thanks will look at it.
But can you do it with elf?No.
Please correct me if I am wrong IRC ARM Qemu uses zImage but it is no problem to use elf file. For this case Qemu elf loader also uses physical addresses from ELF and also entry point.If you want to use the ELF image, then you need to hardcode the physical memory location in its header, and that's something we want to get away from because it prevents a single kernel binary image from being used on different targets with different memory layouts. Same issue with u-Boot's legacy uImage format.
And are you able to get these information away from ELF? Or you just need to set it up to any default value. I would expect to 0x0.
I haven't played with CONFIG_ARM_PATCH_PHYS_VIRT option but what is elf entry point for this case?For the kernel image itself it is the kernel virtual address.
Is it used somewhere? Or is it just setup to virtual address and no code use it? I mean that kernel virtual entry point. I expect that if CONFIG_ARM_PATCH_PHYS_VIRT=y then CONFIG_PHYS_OFFSET is not setup Then LOAD_OFFSET should be equal to CONFIG_PAGE_OFFSET.
For the relocatable zImage decompressor wrapper it is 0.
ok. Thanks, Michal -- Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Other Archives] [Linux Kernel Newbies] [Linux Driver Development] [Fedora Kernel] [Linux Kernel Testers] [Linux SH] [Linux Omap] [Linux Kbuild] [Linux Tape] [Linux Input] [Linux Kernel Janitors] [Linux Kernel Packagers] [Linux Doc] [Linux Man Pages] [Linux API] [Linux Memory Management] [Linux Modules] [Linux Standards] [Kernel Announce] [Netdev] [Git] [Linux PCI] Linux CAN Development [Linux I2C] [Linux RDMA] [Linux NUMA] [Netfilter] [Netfilter Devel] [SELinux] [Bugtraq] [FIO] [Linux Perf Users] [Linux Serial] [Linux PPP] [Linux ISDN] [Linux Next] [Kernel Stable Commits] [Linux Tip Commits] [Kernel MM Commits] [Linux Security Module] [AutoFS] [Filesystem Development] [Ext3 Filesystem] [Linux bcache] [Ext4 Filesystem] [Linux BTRFS] [Linux CEPH Filesystem] [Linux XFS] [XFS] [Linux NFS] [Linux CIFS] [Ecryptfs] [Linux NILFS] [Linux Cachefs] [Reiser FS] [Initramfs] [Linux FB Devel] [Linux OpenGL] [DRI Devel] [Fastboot] [Linux RT Users] [Linux RT Stable] [eCos] [Corosync] [Linux Clusters] [LVS Devel] [Hot Plug] [Linux Virtualization] [KVM] [KVM PPC] [KVM ia64] [Linux Containers] [Linux Hexagon] [Linux Cgroups] [Util Linux] [Wireless] [Linux Bluetooth] [Bluez Devel] [Ethernet Bridging] [Embedded Linux] [Barebox] [Linux MMC] [Linux IIO] [Sparse] [Smatch] [Linux Arch] [x86 Platform Driver] [Linux ACPI] [Linux IBM ACPI] [LM Sensors] [CPU Freq] [Linux Power Management] [Linmodems] [Linux DCCP] [Linux SCTP] [ALSA Devel] [Linux USB] [Linux PA RISC] [Linux Samsung SOC] [MIPS Linux] [IBM S/390 Linux] [ARM Linux] [ARM Kernel] [ARM MSM] [Tegra Devel] [Sparc Linux] [Linux Security] [Linux Sound] [Linux Media] [Video 4 Linux] [Linux IRDA Users] [Linux for the blind] [Linux RAID] [Linux ATA RAID] [Device Mapper] [Linux SCSI] [SCSI Target Devel] [Linux SCSI Target Infrastructure] [Linux IDE] [Linux SMP] [Linux AXP] [Linux Alpha] [Linux M68K] [Linux ia64] [Linux 8086] [Linux x86_64] [Linux Config] [Linux Apps] [Linux MSDOS] [Linux X.25] [Linux Crypto] [DM Crypt] [Linux Trace Users] [Linux Btrace] [Linux Watchdog] [Utrace Devel] [Linux C Programming] [Linux Assembly] [Dash] [DWARVES] [Hail Devel] [Linux Kernel Debugger] [Linux gcc] [Gcc Help] [X.Org] [Wine]
[Older Kernel Discussion] [Yosemite National Park Forum] [Large Format Photos] [Gimp] [Yosemite Photos] [Stuff]