[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [IA64] use of max_addr= & command line



# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID 9c0123c8a1b4de9414001876a262428ca61dc34c
# Parent  edbfa36f2451db0778133285bb427ec355d941bb
[IA64] use of max_addr= & command line

Use 'max_addr' option to limit the amount of physical memory.  The
default is 4G (the same as the previous hard limit).  The hard-coded
limit is removed.  dom0_command_line now contains the cmdline for
dom0 linux.  saved_command_line now contains the cmdline for Xen (it
is used in Xen).

Signed-off-by: Tristan Gingold <tristan.gingold@xxxxxxxx>

diff -r edbfa36f2451 -r 9c0123c8a1b4 xen/arch/ia64/linux-xen/efi.c
--- a/xen/arch/ia64/linux-xen/efi.c     Thu Mar 16 19:02:39 2006
+++ b/xen/arch/ia64/linux-xen/efi.c     Thu Mar 16 19:06:48 2006
@@ -42,7 +42,12 @@
 struct efi efi;
 EXPORT_SYMBOL(efi);
 static efi_runtime_services_t *runtime;
+#ifdef XEN
+// this is a temporary hack to avoid CONFIG_VIRTUAL_MEM_MAP
+static unsigned long mem_limit = ~0UL, max_addr = 0x100000000;
+#else
 static unsigned long mem_limit = ~0UL, max_addr = ~0UL;
+#endif
 
 #define efi_call_virt(f, args...)      (*(f))(args)
 
@@ -329,8 +334,6 @@
                if (running_on_sim && md->type != EFI_CONVENTIONAL_MEMORY)
                        continue;
 }
-// this is a temporary hack to avoid CONFIG_VIRTUAL_MEM_MAP
-               if (md->phys_addr >= 0x100000000) continue;
 #endif
                /*
                 * granule_addr is the base of md's first granule.
diff -r edbfa36f2451 -r 9c0123c8a1b4 xen/arch/ia64/linux-xen/setup.c
--- a/xen/arch/ia64/linux-xen/setup.c   Thu Mar 16 19:02:39 2006
+++ b/xen/arch/ia64/linux-xen/setup.c   Thu Mar 16 19:06:48 2006
@@ -384,6 +384,9 @@
        *cmdline_p = __va(ia64_boot_param->command_line);
 #ifndef XEN
        strlcpy(saved_command_line, *cmdline_p, COMMAND_LINE_SIZE);
+#else
+       early_cmdline_parse(cmdline_p);
+       cmdline_parse(*cmdline_p);
 #endif
 
        efi_init();
@@ -414,10 +417,6 @@
        }
 #endif
 
-#ifdef XEN
-       early_cmdline_parse(cmdline_p);
-       cmdline_parse(*cmdline_p);
-#endif
        if (early_console_setup(*cmdline_p) == 0)
                mark_bsp_online();
 
diff -r edbfa36f2451 -r 9c0123c8a1b4 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Thu Mar 16 19:02:39 2006
+++ b/xen/arch/ia64/xen/domain.c        Thu Mar 16 19:06:48 2006
@@ -26,6 +26,7 @@
 #include <asm/processor.h>
 #include <asm/desc.h>
 #include <asm/hw_irq.h>
+#include <asm/setup.h>
 //#include <asm/mpspec.h>
 #include <xen/irq.h>
 #include <xen/event.h>
@@ -36,7 +37,6 @@
 #include <xen/elf.h>
 //#include <asm/page.h>
 #include <asm/pgalloc.h>
-#include <asm/dma.h>   /* for MAX_DMA_ADDRESS */
 
 #include <asm/asm-offsets.h>  /* for IA64_THREAD_INFO_SIZE */
 
@@ -49,6 +49,7 @@
 #include <asm/pal.h>
 #include <asm/vhpt.h>
 #include <public/hvm/ioreq.h>
+#include <public/arch-ia64.h>
 #include <asm/tlbflush.h>
 #include <asm/regionreg.h>
 
@@ -415,7 +416,7 @@
 {
        struct domain *d = v->domain;
        struct pt_regs *regs;
-       extern char saved_command_line[];
+       extern char dom0_command_line[];
 
 #ifdef CONFIG_DOMAIN0_CONTIGUOUS
        if (d == dom0) start_pc += dom0_start;
@@ -439,24 +440,27 @@
        if (VMX_DOMAIN(v)) {
                vmx_init_all_rr(v);
                if (d == dom0)
-//                 VCPU(v,vgr[12]) = dom_fw_setup(d,saved_command_line,256L);
-                   regs->r28 = dom_fw_setup(d,saved_command_line,256L);
+                   regs->r28 = dom_fw_setup(d,dom0_command_line,
+                                            COMMAND_LINE_SIZE);
                /* Virtual processor context setup */
                VCPU(v, vpsr) = IA64_PSR_BN;
                VCPU(v, dcr) = 0;
        } else {
                init_all_rr(v);
                if (d == dom0) 
-                   regs->r28 = dom_fw_setup(d,saved_command_line,256L);
+                   regs->r28 = dom_fw_setup(d,dom0_command_line,
+                                            COMMAND_LINE_SIZE);
                else {
                    regs->ar_rsc |= (2 << 2); /* force PL2/3 */
                    if (*d->arch.cmdline == '\0') {
 #define DEFAULT_CMDLINE "nomca nosmp xencons=tty0 console=tty0 root=/dev/hda1"
-                       regs->r28 = dom_fw_setup(d,DEFAULT_CMDLINE,256L);
+                       regs->r28 = dom_fw_setup(d,DEFAULT_CMDLINE,
+                                                sizeof (DEFAULT_CMDLINE));
                        printf("domU command line defaulted to"
                                DEFAULT_CMDLINE "\n");
                    }
-                   else regs->r28 = dom_fw_setup(d,d->arch.cmdline,256L);
+                   else regs->r28 = dom_fw_setup(d,d->arch.cmdline, 
+                                                 IA64_COMMAND_LINE_SIZE);
                }
                VCPU(v, banknum) = 1;
                VCPU(v, metaphysical_mode) = 1;
@@ -645,12 +649,13 @@
 
 #ifdef CONFIG_DOMAIN0_CONTIGUOUS
        if (d == dom0) {
+               pte_t pteval;
                if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
                        //printk("lookup_domain_mpa: bad dom0 mpaddr 
0x%lx!\n",mpaddr);
                        //printk("lookup_domain_mpa: 
start=0x%lx,end=0x%lx!\n",dom0_start,dom0_start+dom0_size);
                        mpafoo(mpaddr);
                }
-               pte_t pteval = pfn_pte(mpaddr >> PAGE_SHIFT,
+               pteval = pfn_pte(mpaddr >> PAGE_SHIFT,
                        __pgprot(__DIRTY_BITS | _PAGE_PL_2 | _PAGE_AR_RWX));
                pte = &pteval;
                return *(unsigned long *)pte;
diff -r edbfa36f2451 -r 9c0123c8a1b4 xen/arch/ia64/xen/xensetup.c
--- a/xen/arch/ia64/xen/xensetup.c      Thu Mar 16 19:02:39 2006
+++ b/xen/arch/ia64/xen/xensetup.c      Thu Mar 16 19:06:48 2006
@@ -27,6 +27,7 @@
 unsigned long xenheap_phys_end;
 
 char saved_command_line[COMMAND_LINE_SIZE];
+char dom0_command_line[COMMAND_LINE_SIZE];
 
 struct vcpu *idle_vcpu[NR_CPUS];
 
@@ -119,11 +120,12 @@
 void early_cmdline_parse(char **cmdline_p)
 {
     char *guest_cmd;
-    char *split = "--";
+    static const char * const split = "--";
 
     if (*cmdline_p == NULL) {
        *cmdline_p = &null[0];
        saved_command_line[0] = '\0';
+       dom0_command_line[0] = '\0';
        return;
     }
 
@@ -138,7 +140,8 @@
        while (*guest_cmd == ' ') guest_cmd++;
     }
 
-    strlcpy(saved_command_line, guest_cmd, COMMAND_LINE_SIZE);
+    strlcpy(saved_command_line, *cmdline_p, COMMAND_LINE_SIZE);
+    strlcpy(dom0_command_line, guest_cmd, COMMAND_LINE_SIZE);
     return;
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.