xen/arm: compile and run xl
v2 cover xen/arm: compile and run xl
Hi all,
this small patch series contains the changes necessary to compile and run xl on ARM. Xl can be used to create VMs.
The first two patches are hypervisor changes, while the last two are libxc and libxli multiarch fixes.
Changes in v2:
- rebased on 77d3a1db3196b1b5864469f8d3f41d496800c795;
- cpu_khz is khz while cntfrq is hz: take care of the conversion;
- move the xc_dom_gnttab_hvm_seed changes into the libxc patch.
Stefano Stabellini (4):
xen: move XEN_SYSCTL_physinfo, XEN_SYSCTL_numainfo and XEN_SYSCTL_topologyinfo to common code xen/arm: implement gnttab_create_shared_page and gnttab_shared_gmfn
libxc: fixes for the ARM platform
xen/arm: compile and run libxl/xl
tools/libxc/xc_core_arm.h | 2 + tools/libxc/xc_core_x86.h | 5 ++ tools/libxc/xc_dom.h | 6 +-- tools/libxc/xc_dom_arm.c | 19 ++++-- tools/libxc/xc_dom_boot.c | 23 +++---- tools/libxl/libxl_dom.c | 54 ++-------------- tools/libxl/libxl_x86.c | 48 ++++++++++++++ xen/arch/arm/domain.c | 3 + xen/arch/arm/mm.c | 3 + xen/arch/arm/setup.c | 2 +- xen/arch/arm/sysctl.c | 2 + xen/arch/arm/time.c | 10 ++-- xen/arch/x86/sysctl.c | 123 +++---------------------------------- xen/common/sysctl.c | 109 ++++++++++++++++++++++++++++++++ xen/include/asm-arm/domain.h | 1 + xen/include/asm-arm/grant_table.h | 13 +++- xen/include/asm-arm/mm.h | 3 + xen/include/xen/sched.h | 2 + 18 files changed, 234 insertions(+), 194 deletions(-)
Cheers,
Stefano
PATCH v2 1/4 xen: move XEN_SYSCTL_physinfo, XEN_SYSCTL_numainfo and XEN_SYSCTL_topologyinfo to common code
Move XEN_SYSCTL_physinfo, XEN_SYSCTL_numainfo and XEN_SYSCTL_topologyinfo from x86/sysctl.c to common/sysctl.c.
The implementation of XEN_SYSCTL_physinfo is mostly generic but needs to fill in few arch specific details: introduce arch_do_physinfo to do that.
The implementation of XEN_SYSCTL_physinfo relies on two global
variables: total_pages and cpu_khz. Make them available on ARM.
Implement node_spanned_pages and __node_distance on ARM, assuming 1 numa node for now.
Changes in v2:
- cpu_khz is khz while cntfrq is hz: take care of the conversion;
- rebased on 77d3a1db3196b1b5864469f8d3f41d496800c795.
--- xen/arch/arm/mm.c | 1 + xen/arch/arm/setup.c | 2 +- xen/arch/arm/sysctl.c | 2 + xen/arch/arm/time.c | 10 ++-- xen/arch/x86/sysctl.c | 123 +++------------------------------------------ xen/common/sysctl.c | 109 ++++++++++++++++++++++++++++++++++++++++ xen/include/asm-arm/mm.h | 3 + xen/include/xen/sched.h | 2 + 8 files changed, 132 insertions(+), 120 deletions(-)
xen/arch/arm/mm.c +1 -0
@@ -58,6 +58,7 @@ unsigned long frametable_base_mfn __read_mostly;unsigned long frametable_virt_end__read_mostly ;unsigned long max_page; +unsigned long total_pages;extern char __init_begin[], __init_end[];
xen/arch/arm/setup.c +1 -1
@@ -119,7 +119,7 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) ram_start = early_info.mem.bank[0 ].start; ram_size = early_info.mem.bank[0 ].size; ram_end = ram_start + ram_size; - ram_pages = ram_size >>PAGE_SHIFT ; + total_pages = ram_pages = ram_size >>PAGE_SHIFT ;/* * Calculate the sizes for the heaps using these constraints:
xen/arch/arm/sysctl.c +2 -0
@@ -12,6 +12,8 @@#include <xen/errno.h> #include <public/sysctl.h> +void arch_do_physinfo (xen_sysctl_physinfo_t *pi) { } +long arch_do_sysctl (struct xen_sysctl *sysctl,XEN_GUEST_HANDLE_PARAM (xen_sysctl_t) u_sysctl) {
xen/arch/arm/time.c +5 -5
@@ -43,16 +43,16 @@ uint64_t __read_mostly boot_count;/* For fine-grained timekeeping, we use the ARM "Generic Timer", a * register-mapped time source in the SoC. */ -static uint32_t __read_mostly cntfrq;/* Ticks per second */ +unsigned long __read_mostly cpu_khz;/* CPU clock frequency in kHz. */ /*static inline*/ s_time_t ticks_to_ns (uint64_t ticks) { -return muldiv64 (ticks,SECONDS (1 ), cntfrq); +return muldiv64 (ticks,SECONDS (1 ),1000 * cpu_khz); }/*static inline*/ uint64_t ns_to_ticks (s_time_t ns) { -return muldiv64 (ns, cntfrq,SECONDS (1 )); +return muldiv64 (ns,1000 * cpu_khz,SECONDS (1 )); }/* TODO: On a real system the firmware would have set the frequency in
@@ -93,9 +93,9 @@ int __init init_xen_time(void)if ( (READ_CP32 (ID_PFR1 ) &ID_PFR1_GT_MASK ) != ID_PFR1_GT_v1 )panic ("CPU does not support the Generic Timer v1 interface.\n" ); - cntfrq =READ_CP32 (CNTFRQ ); + cpu_khz =READ_CP32 (CNTFRQ ) /1000 ; boot_count =READ_CP64 (CNTPCT ); -printk ("Using generic timer at %" PRIu32" Hz\n" , cntfrq); +printk ("Using generic timer at %lu KHz\n" , cpu_khz);return 0 ; }
xen/arch/x86/sysctl.c +9 -114
135 lines not on this page · raw message
xen/common/sysctl.c +109 -0
115 lines not on this page · raw message
xen/include/asm-arm/mm.h +3 -0
@@ -136,6 +136,9 @@ extern unsigned long frametable_base_mfn;extern unsigned long max_page;extern unsigned long total_pages; +/* XXX: implement NUMA support */ +#define node_spanned_pages (nid) (total_pages) +#define __node_distance (a, b) (20)/* Boot-time pagetable setup */ extern void setup_pagetables (unsigned long boot_phys_offset,paddr_t xen_paddr);
xen/include/xen/sched.h +2 -0
@@ -748,6 +748,8 @@ extern void dump_runq(unsigned char key);#define num_cpupool_cpus (c) cpumask_weight((c)->cpu_valid) +void arch_do_physinfo (xen_sysctl_physinfo_t *pi); +#endif /* __SCHED_H__ */ /*
Signature · 1 line
1.7.2.5
Re: [PATCH v2 1/4] xen: move XEN_SYSCTL_physinfo, XEN_SYSCTL_numainfo and XEN_SYSCTL_topologyinfo to common code
xen/arch/arm/time.c int __init init_xen_time(void) · line 96
Quoted 6 lines · Stefano Stabellini
@ -93,9 +93,9 @@ int
__initinit_xen_time(void)if ( (READ_CP32(ID_PFR1) & ID_PFR1_GT_MASK) != ID_PFR1_GT_v1 ) panic("CPU does not support the Generic Timer v1 interface.\n");xen/arch/arm/time.c +1
-1- cntfrq =READ_CP32 (CNTFRQ ); + cpu_khz =READ_CP32 (CNTFRQ ) /1000 ;
Does the loss of precision here matter in practice? Would we be better off sticking with cntfrq and doing the divide in arch_do_physinfo?
xen/include/asm-arm/mm.h extern unsigned long frametable_base_mfn; · line 141
Quoted 11 lines
xen/include/asm-arm/mm.h +3
-0@@ -136,6 +136,9 @@ extern unsigned long frametable_base_mfn;extern unsigned long max_page;extern unsigned long total_pages; +/* XXX: implement NUMA support */ +#define node_spanned_pages (nid) (total_pages) +#define __node_distance (a, b) (20)
Please put these in asm-arm/numa.h
Re: [PATCH v2 1/4] xen: move XEN_SYSCTL_physinfo, XEN_SYSCTL_numainfo and XEN_SYSCTL_topologyinfo to common code
Quoted 10 lines · Ian Campbell
xen/arch/arm/time.c int __init init_xen_time(void) · line 96
Quoted 6 lines · Stefano Stabellini
@ -93,9 +93,9 @@ int
__initinit_xen_time(void)if ( (READ_CP32(ID_PFR1) & ID_PFR1_GT_MASK) != ID_PFR1_GT_v1 ) panic("CPU does not support the Generic Timer v1 interface.\n");xen/arch/arm/time.c +1
-1- cntfrq =READ_CP32 (CNTFRQ ); + cpu_khz =READ_CP32 (CNTFRQ ) /1000 ;Does the loss of precision here matter in practice? Would we be better off sticking with cntfrq and doing the divide in
arch_do_physinfo?
We need to export cpu_khz anyway because it is exported in xen/include/xen/time.h.
We can only decide to keep an additional internal cntfrq variable. However I don't think that we need to worry about it practice. After all khz have been enough on x86 for all these years..
Quoted 6 lines
Quoted 6 lines
xen/include/asm-arm/mm.h +0
-0@@ -136,6 +136,9 @@ extern unsigned long frametable_base_mfn;
Quoted 7 lines
xen/include/asm-arm/mm.h extern unsigned long frametable_base_mfn; · line 141
Quoted 5 lines
xen/include/asm-arm/mm.h +3
-0extern unsigned long max_page;extern unsigned long total_pages; +/* XXX: implement NUMA support */ +#define node_spanned_pages (nid) (total_pages) +#define __node_distance (a, b) (20)Please put these in
asm-arm/numa.h
OK
PATCH v2 2/4 xen/arm: implement gnttab_create_shared_page and gnttab_shared_gmfn
In reply to Stefano StabelliniIntroduce a simple pfn array, grant_table_gpfn, to keep track of the grant table pages mapped in guest gpfn space.
--- xen/arch/arm/domain.c | 3 +++ xen/arch/arm/mm.c | 2 ++ xen/include/asm-arm/domain.h | 1 + xen/include/asm-arm/grant_table.h | 13 +++++++++++-- 4 files changed, 17 insertions(+), 2 deletions(-)
xen/arch/arm/domain.c +3 -0
@@ -6,6 +6,7 @@#include <xen/wait.h> #include <xen/errno.h> #include <xen/bitops.h> +#include <xen/grant_table.h> #include <asm/current.h> #include <asm/regs.h>
@@ -328,11 +329,13 @@ struct domain *alloc_domain_struct(void) d =alloc_xenheap_pages (0 ,0 );if ( d !=NULL )clear_page (d); + d->arch.grant_table_gpfn =xmalloc_array (xen_pfn_t, max_nr_grant_frames);return d; }void free_domain_struct (struct domain *d) { +xfree (d->arch.grant_table_gpfn);free_xenheap_page (d); }
xen/arch/arm/mm.c +2 -0
@@ -579,6 +579,8 @@ static int xenmem_add_to_physmap_one(if ( idx <nr_grant_frames (d->grant_table) ) mfn =virt_to_mfn (d->grant_table->shared_raw[idx]); } + + d->arch.grant_table_gpfn[idx] = gpfn;spin_unlock (&d->grant_table->lock);break ;
xen/include/asm-arm/domain.h +1 -0
@@ -39,6 +39,7 @@ struct arch_domain {struct p2m_domain p2m;struct hvm_domain hvm_domain; +xen_pfn_t *grant_table_gpfn;struct {/*
xen/include/asm-arm/grant_table.h +11 -2
@@ -15,8 +15,6 @@ int replace_grant_host_mapping(unsigned long gpaddr, unsigned long mfn, unsigned long new_gpaddr, unsigned int flags);void gnttab_mark_dirty (struct domain *d,unsigned long l);#define gnttab_create_status_page (d, t, i) do {} while (0) -#define gnttab_create_shared_page (d, t, i) do {} while (0) -#define gnttab_shared_gmfn (d, t, i) (0)#define gnttab_status_gmfn (d, t, i) (0)#define gnttab_release_host_mappings (domain) 1static inline int replace_grant_supported (void )
@@ -24,6 +22,17 @@ static inline int replace_grant_supported(void) return 1; } +#define gnttab_create_shared_page (d, t, i) \ + do { \ + share_xen_page_with_guest( \ + virt_to_page((char *)(t)->shared_raw[i]), \ + (d), XENSHARE_writable); \ + } while ( 0 ) + +#define gnttab_shared_gmfn (d, t, i) \ + ( ((i >= nr_grant_frames(d->grant_table)) && \ + (i < max_nr_grant_frames)) ? 0 : (d->arch.grant_table_gpfn[i])) +#endif /* __ASM_GRANT_TABLE_H__ */ /* * Local variables:
Signature · 1 line
1.7.2.5
Re: [PATCH v2 2/4] xen/arm: implement gnttab_create_shared_page and gnttab_shared_gmfn
Quoted 4 lines · Stefano Stabellini
Introduce a simple pfn array,
grant_table_gpfn, to keep track of the grant table pages mapped in guest gpfn space.Signed-off-by Stefano Stabellini <[email protected]>
Quoted 89 lines
--- xen/arch/arm/domain.c | 3 +++ xen/arch/arm/mm.c | 2 ++ xen/include/asm-arm/domain.h | 1 + xen/include/asm-arm/grant_table.h | 13 +++++++++++-- 4 files changed, 17 insertions(+), 2 deletions(-)xen/arch/arm/domain.c +3
-0@@ -6,6 +6,7 @@#include <xen/wait.h> #include <xen/errno.h> #include <xen/bitops.h> +#include <xen/grant_table.h> #include <asm/current.h> #include <asm/regs.h> @@ -328,11 +329,13 @@ struct domain *alloc_domain_struct(void) d =alloc_xenheap_pages (0 ,0 );if ( d !=NULL )clear_page (d); + d->arch.grant_table_gpfn =xmalloc_array (xen_pfn_t, max_nr_grant_frames);return d; }void free_domain_struct (struct domain *d) { +xfree (d->arch.grant_table_gpfn);free_xenheap_page (d); }xen/arch/arm/mm.c +2
-0@@ -579,6 +579,8 @@ static int xenmem_add_to_physmap_one(if ( idx <nr_grant_frames (d->grant_table) ) mfn =virt_to_mfn (d->grant_table->shared_raw[idx]); } + + d->arch.grant_table_gpfn[idx] = gpfn;spin_unlock (&d->grant_table->lock);break ;xen/include/asm-arm/domain.h +1
-0@@ -39,6 +39,7 @@ struct arch_domain {struct p2m_domain p2m;struct hvm_domain hvm_domain; +xen_pfn_t *grant_table_gpfn;struct {/* xen/include/asm-arm/grant_table.h +11
-2@@ -15,8 +15,6 @@ int replace_grant_host_mapping(unsigned long gpaddr, unsigned long mfn, unsigned long new_gpaddr, unsigned int flags);void gnttab_mark_dirty (struct domain *d,unsigned long l);#define gnttab_create_status_page (d, t, i) do {} while (0) -#define gnttab_create_shared_page (d, t, i) do {} while (0) -#define gnttab_shared_gmfn (d, t, i) (0)#define gnttab_status_gmfn (d, t, i) (0)#define gnttab_release_host_mappings (domain) 1static inline int replace_grant_supported (void )@@ -24,6 +22,17 @@ static inline int replace_grant_supported(void) return 1; } +#define gnttab_create_shared_page (d, t, i) \ + do { \ + share_xen_page_with_guest( \ + virt_to_page((char *)(t)->shared_raw[i]), \ + (d), XENSHARE_writable); \ + } while ( 0 ) + +#define gnttab_shared_gmfn (d, t, i) \ + ( ((i >= nr_grant_frames(d->grant_table)) && \ + (i < max_nr_grant_frames)) ? 0 : (d->arch.grant_table_gpfn[i])) +#endif /* __ASM_GRANT_TABLE_H__ */ /* * Local variables:
PATCH v2 3/4 libxc: fixes for the ARM platform
In reply to Stefano StabelliniMake xc_dom_feature_translated an arch-dependent function.
alloc_magic_pages: save console and xenstore pfn's in xc_dom_image.alloc_magic_pages: set HVM_PARAM_CONSOLE_EVTCHN and HVM_PARAM_STORE_EVTCHN hvm_params using the event channels allocated by the toolstack.
Call xc_dom_gnttab_hvm_seed instead of xc_dom_gnttab_seed in xc_dom_gnttab_init for autotranslated guests.
Changes on v2:
- add xc_dom_gnttab_init changes.
--- tools/libxc/xc_core_arm.h | 2 ++ tools/libxc/xc_core_x86.h | 5 +++++ tools/libxc/xc_dom.h | 6 +----- tools/libxc/xc_dom_arm.c | 19 ++++++++++++------- tools/libxc/xc_dom_boot.c | 23 ++++++++++------------- 5 files changed, 30 insertions(+), 25 deletions(-)
tools/libxc/xc_core_arm.h +2 -0
@@ -33,6 +33,8 @@ struct xc_core_arch_context { (0)#define xc_core_arch_context_dump (xch, arch_ctxt, args, dump_rtn) (0) +#define xc_dom_feature_translated (dom) (1) +int xc_core_arch_gpfn_may_present (struct xc_core_arch_context *arch_ctxt,unsigned long pfn);
tools/libxc/xc_core_x86.h +5 -0
@@ -34,6 +34,11 @@ struct xc_core_arch_context { (0)#define xc_core_arch_context_dump (xch, arch_ctxt, args, dump_rtn) (0) +static inline int xc_dom_feature_translated (struct xc_dom_image *dom) +{ +return elf_xen_feature_get (XENFEAT_auto_translated_physmap, dom->f_active); +} +int xc_core_arch_gpfn_may_present (struct xc_core_arch_context *arch_ctxt,unsigned long pfn);
tools/libxc/xc_dom.h +1 -5
@@ -15,6 +15,7 @@*/ #include <xen/libelf/libelf.h> +#include <xc_core.h> #define INVALID_P2M_ENTRY ((xen_pfn_t)-1)
@@ -312,11 +313,6 @@ static inline void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,return (ptr ? (ptr + offset) :NULL ); } -static inline int xc_dom_feature_translated (struct xc_dom_image *dom) -{ -return elf_xen_feature_get (XENFEAT_auto_translated_physmap, dom->f_active); -} -static inline xen_pfn_t xc_dom_p2m_host (struct xc_dom_image *dom,xen_pfn_t pfn) {if (dom->shadow_enabled)
tools/libxc/xc_dom_arm.c +12 -7
@@ -51,7 +51,7 @@ static int setup_pgtables_arm(struct xc_dom_image *dom)static int alloc_magic_pages (struct xc_dom_image *dom) {int rc, i; -xen_pfn_t store_pfn, console_pfn, p2m[NR_MAGIC_PAGES ]; +xen_pfn_t p2m[NR_MAGIC_PAGES ];DOMPRINTF_CALLED (dom->xch);
@@ -64,15 +64,20 @@ static int alloc_magic_pages(struct xc_dom_image *dom)if ( rc <0 )return rc; - console_pfn = dom->rambase_pfn + dom->total_pages +CONSOLE_PFN_OFFSET ; - store_pfn = dom->rambase_pfn + dom->total_pages +XENSTORE_PFN_OFFSET ; + dom->console_pfn = dom->rambase_pfn + dom->total_pages +CONSOLE_PFN_OFFSET ; + dom->xenstore_pfn = dom->rambase_pfn + dom->total_pages +XENSTORE_PFN_OFFSET ; -xc_clear_domain_page (dom->xch, dom->guest_domid, console_pfn); -xc_clear_domain_page (dom->xch, dom->guest_domid, store_pfn); +xc_clear_domain_page (dom->xch, dom->guest_domid, dom->console_pfn); +xc_clear_domain_page (dom->xch, dom->guest_domid, dom->xenstore_pfn);xc_set_hvm_param (dom->xch, dom->guest_domid,HVM_PARAM_CONSOLE_PFN , - console_pfn); + dom->console_pfn);xc_set_hvm_param (dom->xch, dom->guest_domid,HVM_PARAM_STORE_PFN , - store_pfn); + dom->xenstore_pfn); +/* allocated by toolstack */ +xc_set_hvm_param (dom->xch, dom->guest_domid,HVM_PARAM_CONSOLE_EVTCHN , + dom->console_evtchn); +xc_set_hvm_param (dom->xch, dom->guest_domid,HVM_PARAM_STORE_EVTCHN , + dom->xenstore_evtchn);return 0 ; }
tools/libxc/xc_dom_boot.c +10 -13
@@ -416,19 +416,16 @@ int xc_dom_gnttab_hvm_seed(xc_interface *xch, domid_t domid,int xc_dom_gnttab_init (struct xc_dom_image *dom) { -xen_pfn_t console_gmfn; -xen_pfn_t xenstore_gmfn; -int autotranslated; - - autotranslated =xc_dom_feature_translated (dom); - console_gmfn = autotranslated ? - dom->console_pfn :xc_dom_p2m_host (dom, dom->console_pfn); - xenstore_gmfn = autotranslated ? - dom->xenstore_pfn :xc_dom_p2m_host (dom, dom->xenstore_pfn); - -return xc_dom_gnttab_seed (dom->xch, dom->guest_domid, - console_gmfn, xenstore_gmfn, - dom->console_domid, dom->xenstore_domid); +if (xc_dom_feature_translated (dom) ) { +return xc_dom_gnttab_hvm_seed (dom->xch, dom->guest_domid, + dom->console_pfn, dom->xenstore_pfn, + dom->console_domid, dom->xenstore_domid); + }else { +return xc_dom_gnttab_seed (dom->xch, dom->guest_domid, +xc_dom_p2m_host (dom, dom->console_pfn), +xc_dom_p2m_host (dom, dom->xenstore_pfn), + dom->console_domid, dom->xenstore_domid); + } }/*
Signature · 1 line
1.7.2.5
Re: [PATCH v2 3/4] libxc: fixes for the ARM platform
Quoted 7 lines · Stefano Stabellini
Make
xc_dom_feature_translatedan arch-dependent function.
alloc_magic_pages: save console and xenstore pfn's inxc_dom_image.alloc_magic_pages: setHVM_PARAM_CONSOLE_EVTCHNandHVM_PARAM_STORE_EVTCHNhvm_paramsusing the event channels allocated by the toolstack.
Quoted 8 lines
Call
xc_dom_gnttab_hvm_seedinstead ofxc_dom_gnttab_seedinxc_dom_gnttab_initfor autotranslated guests.Changes on v2:
- addxc_dom_gnttab_initchanges.Signed-off-by Stefano Stabellini <[email protected]>
Re: [PATCH v2 3/4] libxc: fixes for the ARM platform
Quoted 12 lines · Ian Campbell
Quoted 11 lines · Stefano Stabellini
Make
xc_dom_feature_translatedan arch-dependent function.
alloc_magic_pages: save console and xenstore pfn's inxc_dom_image.alloc_magic_pages: setHVM_PARAM_CONSOLE_EVTCHNandHVM_PARAM_STORE_EVTCHNhvm_paramsusing the event channels allocated by the toolstack.Call
xc_dom_gnttab_hvm_seedinstead ofxc_dom_gnttab_seedinxc_dom_gnttab_initfor autotranslated guests.
Quoted 6 lines
Quoted 4 lines
Changes on v2:
- addxc_dom_gnttab_initchanges.Signed-off-by Stefano Stabellini <[email protected]>Acked-by Ian Campbell <[email protected]>
This change broke the x86_64 build (at least, presumalby 32 too)
gcc -O1 -fno-omit-frame-pointer -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -D__XEN_TOOLS__ -MMD -MF .xc_core.o.d -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -fno-optimize-sibling-calls -D_GNU_SOURCE -I../../xen/common/libelf -Werror -Wmissing-prototypes -I. -I/local/scratch/ianc/devel/arm/xen-unstable/tools/libxc/../../tools/include -pthread -c -o xc_core.o xc_core.c
cc1: warnings being treated as errors
In file included from xc_core.h:154,
from xc_core.c:66:
xc_core_x86.h: In function ‘xc_dom_feature_translated’:
xc_core_x86.h:39: error: implicit declaration of function ‘elf_xen_feature_get’
xc_core_x86.h:39: error: dereferencing pointer to incomplete type
In file included from xc_dom.h:18,
from xc_core.c:67:
/local/scratch/ianc/devel/arm/xen-unstable/tools/libxc/../../tools/include/xen/libelf/libelf.h: At top level:
/local/scratch/ianc/devel/arm/xen-unstable/tools/libxc/../../tools/include/xen/libelf/libelf.h:266: error: static declaration of ‘elf_xen_feature_get’ follows non-static declaration xc_core_x86.h:39: note: previous implicit declaration of ‘elf_xen_feature_get’ was here
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
PATCH v2 4/4 xen/arm: compile and run libxl/xl
In reply to Stefano StabelliniMove tsc, rtc, memmap_limit, localtime and shadow settings from libxl__build_pre to libxl__arch_domain_create.
Get the console and xenstore pfn's from struct xc_dom_image for autotranslated guests.
Changes in v2:
- move the xc_dom_gnttab_hvm_seed changes into the libxc patch.
--- tools/libxl/libxl_dom.c | 54 ++++++---------------------------------------- tools/libxl/libxl_x86.c | 48 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 47 deletions(-)
tools/libxl/libxl_dom.c +7 -47
@@ -202,9 +202,7 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid, libxl_domain_build_info *info, libxl__domain_build_state *state) {libxl_ctx *ctx =libxl__gc_owner (gc); -int tsc_mode;char *xs_domid, *con_domid; -uint32_t rtc_timeoffset;xc_domain_max_vcpus (ctx->xch, domid, info->max_vcpus);
@@ -233,49 +231,6 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,libxl_set_vcpuaffinity_all (ctx, domid, info->max_vcpus, &info->cpumap);xc_domain_setmaxmem (ctx->xch, domid, info->target_memkb +LIBXL_MAXMEM_CONSTANT ); -if (info->type ==LIBXL_DOMAIN_TYPE_PV ) -xc_domain_set_memmap_limit (ctx->xch, domid, - (info->max_memkb + info->u.pv.slack_memkb)); -switch (info->tsc_mode) { -case LIBXL_TSC_MODE_DEFAULT : - tsc_mode =0 ; -break ; -case LIBXL_TSC_MODE_ALWAYS_EMULATE : - tsc_mode =1 ; -break ; -case LIBXL_TSC_MODE_NATIVE : - tsc_mode =2 ; -break ; -case LIBXL_TSC_MODE_NATIVE_PARAVIRT : - tsc_mode =3 ; -break ; -default : -abort (); - } -xc_domain_set_tsc_info (ctx->xch, domid, tsc_mode,0 ,0 ,0 ); -if (libxl_defbool_val (info->disable_migrate)) -xc_domain_disable_migrate (ctx->xch, domid); - - rtc_timeoffset = info->rtc_timeoffset; -if (libxl_defbool_val (info->localtime)) { -time_t t; -struct tm *tm; - - t =time (NULL ); - tm =localtime (&t); - - rtc_timeoffset += tm->tm_gmtoff; - } - -if (rtc_timeoffset) -xc_domain_set_time_offset (ctx->xch, domid, rtc_timeoffset); - -if (info->type ==LIBXL_DOMAIN_TYPE_HVM ) { -unsigned long shadow; - shadow = (info->shadow_memkb +1023 ) /1024 ; -xc_shadow_control (ctx->xch, domid,XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION ,NULL ,0 , &shadow,0 ,NULL ); - } - xs_domid =xs_read (ctx->xsh,XBT_NULL ,"/tool/xenstored/domid" ,NULL ); state->store_domid = xs_domid ?atoi (xs_domid) :0 ;free (xs_domid);
@@ -443,8 +398,13 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid, goto out; } - state->console_mfn =xc_dom_p2m_host (dom, dom->console_pfn); - state->store_mfn =xc_dom_p2m_host (dom, dom->xenstore_pfn); +if (xc_dom_feature_translated (dom)) { + state->console_mfn = dom->console_pfn; + state->store_mfn = dom->xenstore_pfn; + }else { + state->console_mfn =xc_dom_p2m_host (dom, dom->console_pfn); + state->store_mfn =xc_dom_p2m_host (dom, dom->xenstore_pfn); + }libxl__file_reference_unmap (&state->pv_kernel);libxl__file_reference_unmap (&state->pv_ramdisk);
tools/libxl/libxl_x86.c +48 -0
54 lines not on this page · raw message
Signature · 1 line
1.7.2.5
Re: [PATCH v2 4/4] xen/arm: compile and run libxl/xl
Quoted 6 lines · Stefano Stabellini
tools/libxl/libxl_x86.c +6
-0+switch (d_config->b_info.tsc_mode) { +case LIBXL_TSC_MODE_DEFAULT : + tsc_mode =0 ; +break ; +case LIBXL_TSC_MODE_ALWAYS_EMULATE : + tsc_mode =1 ;
tools/libxl/libxl_x86.c int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config, · line 275
Quoted 10 lines
tools/libxl/libxl_x86.c +10
-0+break ; +case LIBXL_TSC_MODE_NATIVE : + tsc_mode =2 ; +break ; +case LIBXL_TSC_MODE_NATIVE_PARAVIRT : + tsc_mode =3 ; +break ; +default : +abort (); + }
This is a very verbose way to write tsc_mode = d_config->b_info.tsc_mode since the enum has the same values, but since this is code motion and since I probably wrote the original: