ARM: Slim down dummy.S
v2 cover ARM: Slim down dummy.S
Defines a few stubs and disables some as yet unsupported core features.
Early on there's a couple of unrelated cleanups.
Patch against current unstable. #6 and #9 touch common code.
Changes since v1:
- make PoD stubs proper functions instead of #defines
- define need_iommu as 0 instead of littering common code with #if
- stub donate_page but leave tmem enabled.
- rebased against latest unstable tree
Ian.
PATCH v2 1/12 arm: add a missing local-vars comment
--- xen/arch/arm/kernel.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
xen/arch/arm/kernel.c +9 -0
@@ -194,3 +194,12 @@ void kernel_load(struct kernel_info *info) { info->load (info); } + +/* +* Local variables: +* mode: C +* c-set-style: "BSD" +* c-basic-offset: 4 +* indent-tabs-mode: nil +* End: +*/
Signature · 1 line
1.7.2.5
PATCH v2 2/12 arm: define some more cp15 registers
In reply to Ian CampbellComplete the set of cache flush and add processor feature registers. Print the latter on boot for debug.
--- xen/arch/arm/setup.c | 17 +++++++++++++++++ xen/include/asm-arm/cpregs.h | 18 ++++++++++++++++++ 2 files changed, 35 insertions(+), 0 deletions(-)
xen/arch/arm/setup.c +17 -0
@@ -64,6 +64,20 @@ static void __init init_idle_domain(void)/* TODO: setup_idle_pagetable(); */ } +static void processor_id (void ) +{ +printk ("Processor Features: %08x %08x\n" , +READ_CP32 (ID_PFR0 ),READ_CP32 (ID_PFR0 )); +printk ("Debug Features: %08x\n" ,READ_CP32 (ID_DFR0 )); +printk ("Auxiliary Features: %08x\n" ,READ_CP32 (ID_AFR0 )); +printk ("Memory Model Features: %08x %08x %08x %08x\n" , +READ_CP32 (ID_MMFR0 ),READ_CP32 (ID_MMFR1 ), +READ_CP32 (ID_MMFR2 ),READ_CP32 (ID_MMFR3 )); +printk ("ISA Features: %08x %08x %08x %08x %08x %08x\n" , +READ_CP32 (ID_ISAR0 ),READ_CP32 (ID_ISAR1 ),READ_CP32 (ID_ISAR2 ), +READ_CP32 (ID_ISAR3 ),READ_CP32 (ID_ISAR4 ),READ_CP32 (ID_ISAR5 )); +} +static void __init setup_mm (unsigned long dtb_paddr,size_t dtb_size) {paddr_t ram_start;
@@ -185,7 +199,10 @@ void __init start_xen(unsigned long boot_phys_offset,*/ WRITE_CP32 (0x80002558 ,VTCR );isb (); +processor_id (); +softirq_init (); +tasklet_subsys_init ();init_IRQ ();
xen/include/asm-arm/cpregs.h +18 -0
@@ -93,6 +93,18 @@/* CP15 CR0: CPUID and Cache Type Registers */ #define ID_PFR0 p15,0,c0,c1,0/* Processor Feature Register 0 */ #define ID_PFR1 p15,0,c0,c1,1/* Processor Feature Register 1 */ +#define ID_DFR0 p15,0,c0,c1,2/* Debug Feature Register 0 */ +#define ID_AFR0 p15,0,c0,c1,3/* Auxiliary Feature Register 0 */ +#define ID_MMFR0 p15,0,c0,c1,4/* Memory Model Feature Register 0 */ +#define ID_MMFR1 p15,0,c0,c1,5/* Memory Model Feature Register 1 */ +#define ID_MMFR2 p15,0,c0,c1,6/* Memory Model Feature Register 2 */ +#define ID_MMFR3 p15,0,c0,c1,7/* Memory Model Feature Register 3 */ +#define ID_ISAR0 p15,0,c0,c2,0/* ISA Feature Register 0 */ +#define ID_ISAR1 p15,0,c0,c2,1/* ISA Feature Register 1 */ +#define ID_ISAR2 p15,0,c0,c2,2/* ISA Feature Register 2 */ +#define ID_ISAR3 p15,0,c0,c2,3/* ISA Feature Register 3 */ +#define ID_ISAR4 p15,0,c0,c2,4/* ISA Feature Register 4 */ +#define ID_ISAR5 p15,0,c0,c2,5/* ISA Feature Register 5 */ #define CCSIDR p15,1,c0,c0,0/* Cache Size ID Registers */ #define CLIDR p15,1,c0,c0,1/* Cache Level ID Register */ #define CSSELR p15,2,c0,c0,0/* Cache Size Selection Register */
@@ -134,7 +146,11 @@#define ICIALLUIS p15,0,c7,c1,0/* Invalidate all instruction caches to PoU inner shareable */ #define BPIALLIS p15,0,c7,c1,6/* Invalidate entire branch predictor array inner shareable */ #define ICIALLU p15,0,c7,c5,0/* Invalidate all instruction caches to PoU */ +#define ICIMVAU p15,0,c7,c5,1/* Invalidate instruction caches by MVA to PoU */ #define BPIALL p15,0,c7,c5,6/* Invalidate entire branch predictor array */ +#define BPIMVA p15,0,c7,c5,7/* Invalidate MVA from branch predictor array */ +#define DCIMVAC p15,0,c7,c6,1/* Invalidate data cache line by MVA to PoC */ +#define DCISW p15,0,c7,c2,1/* Invalidate data cache line by set/way */ #define ATS1CPR p15,0,c7,c8,0/* Address Translation Stage 1. Non-Secure Kernel Read */ #define ATS1CPW p15,0,c7,c8,1/* Address Translation Stage 1. Non-Secure Kernel Write */ #define ATS1CUR p15,0,c7,c8,2/* Address Translation Stage 1. Non-Secure User Read */
@@ -144,6 +160,8 @@#define ATS12NSOUR p15,0,c7,c8,6/* Address Translation Stage 1+2 Non-Secure User Read */ #define ATS12NSOUW p15,0,c7,c8,7/* Address Translation Stage 1+2 Non-Secure User Write */ #define DCCMVAC p15,0,c7,c10,1/* Clean data or unified cache line by MVA to PoC */ +#define DCCSW p15,0,c7,c10,2/* Clean data cache line by set/way */ +#define DCCMVAU p15,0,c7,c11,1/* Clean data cache line by MVA to PoU */ #define DCCISW p15,0,c7,c14,2/* Clean and invalidate data cache line by set/way */ #define ATS1HR p15,4,c7,c8,0/* Address Translation Stage 1 Hyp. Read */ #define ATS1HW p15,4,c7,c8,1/* Address Translation Stage 1 Hyp. Write */
Signature · 1 line
1.7.2.5
PATCH v2 3/12 arm: align some register bit definitions
In reply to Ian CampbellProbably got de-hard-tabbed at some point.
--- xen/include/asm-arm/processor.h | 80 +++++++++++++++++++------------------- 1 files changed, 40 insertions(+), 40 deletions(-)
xen/include/asm-arm/processor.h +40 -40
@@ -17,12 +17,12 @@#define PSR_MODE_UND 0x1b#define PSR_MODE_SYS 0x1f -#define PSR_THUMB (1<<5)/* Thumb Mode enable */ -#define PSR_FIQ_MASK (1<<6)/* Fast Interrupt mask */ -#define PSR_IRQ_MASK (1<<7)/* Interrupt mask */ -#define PSR_ABT_MASK (1<<8)/* Asynchronous Abort mask */ -#define PSR_BIG_ENDIAN (1<<9)/* Big Endian Mode */ -#define PSR_JAZELLE (1<<24)/* Jazelle Mode */ +#define PSR_THUMB (1<<5)/* Thumb Mode enable */ +#define PSR_FIQ_MASK (1<<6)/* Fast Interrupt mask */ +#define PSR_IRQ_MASK (1<<7)/* Interrupt mask */ +#define PSR_ABT_MASK (1<<8)/* Asynchronous Abort mask */ +#define PSR_BIG_ENDIAN (1<<9)/* Big Endian Mode */ +#define PSR_JAZELLE (1<<24)/* Jazelle Mode */ /* TTBCR Translation Table Base Control Register */ #define TTBCR_N_MASK 0x07
@@ -35,56 +35,56 @@/* SCTLR System Control Register. */ /* HSCTLR is a subset of this. */ #define SCTLR_TE (1<<30) -#define SCTLR_AFE (1<<29) -#define SCTLR_TRE (1<<28) -#define SCTLR_NMFI (1<<27) +#define SCTLR_AFE (1<<29) +#define SCTLR_TRE (1<<28) +#define SCTLR_NMFI (1<<27)#define SCTLR_EE (1<<25)#define SCTLR_VE (1<<24) -#define SCTLR_U (1<<22) +#define SCTLR_U (1<<22)#define SCTLR_FI (1<<21) -#define SCTLR_WXN (1<<19) +#define SCTLR_WXN (1<<19)#define SCTLR_HA (1<<17)#define SCTLR_RR (1<<14) -#define SCTLR_V (1<<13) -#define SCTLR_I (1<<12) -#define SCTLR_Z (1<<11) +#define SCTLR_V (1<<13) +#define SCTLR_I (1<<12) +#define SCTLR_Z (1<<11)#define SCTLR_SW (1<<10) -#define SCTLR_B (1<<7) -#define SCTLR_C (1<<2) -#define SCTLR_A (1<<1) -#define SCTLR_M (1<<0) +#define SCTLR_B (1<<7) +#define SCTLR_C (1<<2) +#define SCTLR_A (1<<1) +#define SCTLR_M (1<<0)#define SCTLR_BASE 0x00c50078 -#define HSCTLR_BASE 0x30c51878 +#define HSCTLR_BASE 0x30c51878/* HCR Hyp Configuration Register */ -#define HCR_TGE (1<<27) -#define HCR_TVM (1<<26) +#define HCR_TGE (1<<27) +#define HCR_TVM (1<<26)#define HCR_TTLB (1<<25) -#define HCR_TPU (1<<24) -#define HCR_TPC (1<<23) -#define HCR_TSW (1<<22) -#define HCR_TAC (1<<21) -#define HCR_TIDCP (1<<20) -#define HCR_TSC (1<<19) +#define HCR_TPU (1<<24) +#define HCR_TPC (1<<23) +#define HCR_TSW (1<<22) +#define HCR_TAC (1<<21) +#define HCR_TIDCP (1<<20) +#define HCR_TSC (1<<19)#define HCR_TID3 (1<<18)#define HCR_TID2 (1<<17)#define HCR_TID1 (1<<16)#define HCR_TID0 (1<<15) -#define HCR_TWE (1<<14) -#define HCR_TWI (1<<13) -#define HCR_DC (1<<12) -#define HCR_BSU_MASK (3<<10) -#define HCR_FB (1<<9) -#define HCR_VA (1<<8) -#define HCR_VI (1<<7) -#define HCR_VF (1<<6) -#define HCR_AMO (1<<5) -#define HCR_IMO (1<<4) -#define HCR_FMO (1<<3) -#define HCR_PTW (1<<2) +#define HCR_TWE (1<<14) +#define HCR_TWI (1<<13) +#define HCR_DC (1<<12) +#define HCR_BSU_MASK (3<<10) +#define HCR_FB (1<<9) +#define HCR_VA (1<<8) +#define HCR_VI (1<<7) +#define HCR_VF (1<<6) +#define HCR_AMO (1<<5) +#define HCR_IMO (1<<4) +#define HCR_FMO (1<<3) +#define HCR_PTW (1<<2)#define HCR_SWIO (1<<1) -#define HCR_VM (1<<0) +#define HCR_VM (1<<0)#define HSR_EC_WFI_WFE 0x01#define HSR_EC_CP15_32 0x03
Signature · 1 line
1.7.2.5
PATCH v2 4/12 arm: remove some unnecessary symbols from dummy.S
In reply to Ian CampbellCorrect the comment on the DUMMY macro.
--- xen/arch/arm/dummy.S | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-)
xen/arch/arm/dummy.S +1 -7
@@ -1,8 +1,6 @@ -/* Nothing is mapped at 1G, for the moment */ #define DUMMY(x) \ .globl x; \ -x: .word 0xe7f000f0 -/* x: mov r0, #0x40000000 ; str r0, [r0]; b x */ +x: .word 0xe7f000f0 /* Undefined instruction */ #define NOP(x) \ .globl x; \
@@ -35,15 +33,11 @@ DUMMY(get_page); DUMMY(get_page_type); DUMMY(gmfn_to_mfn); DUMMY(gnttab_clear_flag); -DUMMY(gnttab_host_mapping_get_page_type); DUMMY(gnttab_mark_dirty); DUMMY(hypercall_create_continuation); DUMMY(iommu_map_page); DUMMY(iommu_unmap_page); DUMMY(is_iomem_page); -DUMMY(local_event_delivery_enable); -DUMMY(local_events_need_delivery); -DUMMY(machine_to_phys_mapping_valid); DUMMY(max_page); DUMMY(node_online_map); DUMMY(nr_irqs_gsi);
Signature · 1 line
1.7.2.5
PATCH v2 5/12 arm: Add stub functions instead of using DUMMY
In reply to Ian CampbellAdds stubs for arch domctl and sysctl plus vcpu_op and memory_op.
--- xen/arch/arm/Makefile | 2 ++ xen/arch/arm/domain.c | 5 +++++ xen/arch/arm/domctl.c | 27 +++++++++++++++++++++++++++ xen/arch/arm/dummy.S | 4 ---- xen/arch/arm/mm.c | 5 +++++ xen/arch/arm/sysctl.c | 29 +++++++++++++++++++++++++++++ 6 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 xen/arch/arm/domctl.c create mode 100644 xen/arch/arm/sysctl.c
xen/arch/arm/Makefile +2 -0
@@ -4,6 +4,8 @@ obj-y += dummy.o obj-y += early_printk.o obj-y += entry.o obj-y += domain.o +obj-y += domctl.o +obj-y += sysctl.o obj-y += domain_build.o obj-y += gic.o obj-y += io.o
xen/arch/arm/domain.c +5 -0
@@ -255,6 +255,11 @@ void arch_dump_domain_info(struct domain *d) { } +long arch_do_vcpu_op (int cmd,struct vcpu *v,XEN_GUEST_HANDLE (void ) arg) +{ +return -ENOSYS ; +} +void arch_dump_vcpu_info (struct vcpu *v) { }
xen/arch/arm/domctl.c new file +27 -0
@@ -0,0 +1,27 @@ +/****************************************************************************** +* Arch-specific domctl.c +* +* Copyright (c) 2012, Citrix Systems +*/ + +#include <xen/config.h> +#include <xen/types.h> +#include <xen/lib.h> +#include <xen/errno.h> +#include <public/domctl.h> + +long arch_do_domctl (struct xen_domctl *domctl, +XEN_GUEST_HANDLE (xen_domctl_t) u_domctl) +{ +return -ENOSYS ; +} + +/* +* Local variables: +* mode: C +* c-set-style: "BSD" +* c-basic-offset: 4 +* tab-width: 4 +* indent-tabs-mode: nil +* End: +*/
xen/arch/arm/dummy.S +0 -4
@@ -8,12 +8,8 @@ x: mov pc, lr DUMMY(alloc_pirq_struct); DUMMY(alloc_vcpu_guest_context); -DUMMY(arch_do_domctl); -DUMMY(arch_do_sysctl); -DUMMY(arch_do_vcpu_op); DUMMY(arch_get_info_guest); DUMMY(arch_get_xen_caps); -DUMMY(arch_memory_op); DUMMY(arch_set_info_guest); DUMMY(arch_vcpu_reset); DUMMY(create_grant_host_mapping);
xen/arch/arm/mm.c +5 -0
@@ -320,6 +320,11 @@ void arch_dump_shared_mem_info(void) { } +long arch_memory_op (int op,XEN_GUEST_HANDLE (void ) arg) +{ +return -ENOSYS ; +} +/* * Local variables: * mode: C
xen/arch/arm/sysctl.c new file +29 -0
@@ -0,0 +1,29 @@ +/****************************************************************************** +* Arch-specific sysctl.c +* +* System management operations. For use by node control stack. +* +* Copyright (c) 2012, Citrix Systems +*/ + +#include <xen/config.h> +#include <xen/types.h> +#include <xen/lib.h> +#include <xen/errno.h> +#include <public/sysctl.h> + +long arch_do_sysctl (struct xen_sysctl *sysctl, +XEN_GUEST_HANDLE (xen_sysctl_t) u_sysctl) +{ +return -ENOSYS ; +} + +/* +* Local variables: +* mode: C +* c-set-style: "BSD" +* c-basic-offset: 4 +* tab-width: 4 +* indent-tabs-mode: nil +* End: +*/
Signature · 1 line
1.7.2.5
PATCH v2 6/12 PM: only include XEN_SYSCTL_{get_pmstat, pm_op} if HAVE_ACPI
In reply to Ian CampbellThese hypercalls are currently ACPI specific and implemented in xen/drivers/acpi which is not implemented on ARM.
--- xen/Rules.mk | 1 + xen/arch/arm/dummy.S | 2 -- xen/common/sysctl.c | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-)
xen/Rules.mk +1 -0
@@ -50,6 +50,7 @@ CFLAGS-$(crash_debug) += -DCRASH_DEBUG CFLAGS-$(perfc) += -DPERF_COUNTERS CFLAGS-$(perfc_arrays) += -DPERF_ARRAYS CFLAGS-$(lock_profile) += -DLOCK_PROFILE +CFLAGS-$(HAS_ACPI) += -DHAS_ACPI CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER ifneq ($(max_phys_cpus),)
xen/arch/arm/dummy.S +0 -2
@@ -16,13 +16,11 @@ DUMMY(create_grant_host_mapping); DUMMY(__cpu_die); DUMMY(__cpu_disable); DUMMY(__cpu_up); -DUMMY(do_get_pm_info); DUMMY(domain_get_maximum_gpfn); DUMMY(domain_relinquish_resources); DUMMY(domain_set_time_offset); DUMMY(dom_cow); DUMMY(donate_page); -DUMMY(do_pm_op); DUMMY(flush_tlb_mask); DUMMY(free_vcpu_guest_context); DUMMY(get_page);
xen/common/sysctl.c +2 -0
@@ -224,6 +224,7 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl) }break ; +#ifdef HAS_ACPI case XEN_SYSCTL_get_pmstat: { ret =xsm_get_pmstat ();
@@ -259,6 +260,7 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl) } }break ; +#endif case XEN_SYSCTL_page_offline_op: {
Signature · 1 line
1.7.2.5
Re: [PATCH 06/12] PM: only include XEN_SYSCTL_{get_pmstat, pm_op} if HAVE_ACPI
Quoted 4 lines · Ian Campbell
These hypercalls are currently ACPI specific and implemented in xen/drivers/acpi which is not implemented on ARM.
Signed-off-by Ian Campbell <[email protected]>
Quoted 57 lines
--- xen/Rules.mk | 1 + xen/arch/arm/dummy.S | 2 -- xen/common/sysctl.c | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-)xen/Rules.mk +1
-0@@ -50,6 +50,7 @@ CFLAGS-$(crash_debug) += -DCRASH_DEBUG CFLAGS-$(perfc) += -DPERF_COUNTERS CFLAGS-$(perfc_arrays) += -DPERF_ARRAYS CFLAGS-$(lock_profile) += -DLOCK_PROFILE +CFLAGS-$(HAS_ACPI) += -DHAS_ACPI CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER ifneq ($(max_phys_cpus),)xen/arch/arm/dummy.S +0
-2@@ -16,13 +16,11 @@ DUMMY(create_grant_host_mapping); DUMMY(__cpu_die); DUMMY(__cpu_disable); DUMMY(__cpu_up); -DUMMY(do_get_pm_info); DUMMY(domain_get_maximum_gpfn); DUMMY(domain_relinquish_resources); DUMMY(domain_set_time_offset); DUMMY(dom_cow); DUMMY(donate_page); -DUMMY(do_pm_op); DUMMY(flush_tlb_mask); DUMMY(free_vcpu_guest_context); DUMMY(get_page);xen/common/sysctl.c +2
-0@@ -224,6 +224,7 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl) }break ; +#ifdef HAS_ACPI case XEN_SYSCTL_get_pmstat: { ret =xsm_get_pmstat ();@@ -259,6 +260,7 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl) } }break ; +#endif case XEN_SYSCTL_page_offline_op: {
PATCH v2 7/12 arm: provide dummy version of steal_page for tmem.
In reply to Ian CampbellThis is how IA64 does it.
--- xen/arch/arm/dummy.S | 1 - xen/arch/arm/mm.c | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletions(-)
xen/arch/arm/dummy.S +0 -1
@@ -20,7 +20,6 @@ DUMMY(domain_get_maximum_gpfn); DUMMY(domain_relinquish_resources); DUMMY(domain_set_time_offset); DUMMY(dom_cow); -DUMMY(donate_page); DUMMY(flush_tlb_mask); DUMMY(free_vcpu_guest_context); DUMMY(get_page);
xen/arch/arm/mm.c +6 -0
@@ -325,6 +325,12 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)return -ENOSYS ; } +int donate_page (struct domain *d,struct page_info *page,unsigned int memflags) +{ +ASSERT (0 ); +return -ENOSYS ; +} +/* * Local variables: * mode: C
Signature · 1 line
1.7.2.5
PATCH v2 8/12 arm: Implement arch_get_xen_caps
In reply to Ian CampbellTBD: correct arch name for this string. Should be "xen-" / "hvm-" or something else given the hybrid model we are using on ARM?
--- xen/arch/arm/dummy.S | 1 - xen/arch/arm/mm.c | 1 + xen/arch/arm/setup.c | 12 ++++++++++++ 3 files changed, 13 insertions(+), 1 deletions(-)
xen/arch/arm/dummy.S +0 -1
@@ -9,7 +9,6 @@ x: mov pc, lr DUMMY(alloc_pirq_struct); DUMMY(alloc_vcpu_guest_context); DUMMY(arch_get_info_guest); -DUMMY(arch_get_xen_caps); DUMMY(arch_set_info_guest); DUMMY(arch_vcpu_reset); DUMMY(create_grant_host_mapping);
xen/arch/arm/mm.c +1 -0
@@ -24,6 +24,7 @@#include <xen/init.h> #include <xen/mm.h> #include <xen/preempt.h> +#include <xen/errno.h> #include <asm/page.h> #include <asm/current.h>
xen/arch/arm/setup.c +12 -0
@@ -271,6 +271,18 @@ void __init start_xen(unsigned long boot_phys_offset,reset_stack_and_jump (init_done); } +void arch_get_xen_caps (xen_capabilities_info_t *info) +{ +/* Interface name is always xen-3.0-* for Xen-3.x. */ +int major =3 , minor =0 ; +char s[32 ]; + + (*info)[0 ] ='\0' ; + +snprintf (s,sizeof (s),"xen-%d.%d-armv7l " , major, minor); +safe_strcat (*info, s); +} +/* * Local variables: * mode: C
Signature · 1 line
1.7.2.5
PATCH v2 9/12 xen: make need_iommu == 0 if !HAS_PASSTHROUGH
In reply to Ian Campbell--- xen/Rules.mk | 1 + xen/arch/arm/dummy.S | 2 -- xen/include/xen/sched.h | 6 ++++++ 3 files changed, 7 insertions(+), 2 deletions(-)
xen/Rules.mk +1 -0
@@ -51,6 +51,7 @@ CFLAGS-$(perfc) += -DPERF_COUNTERS CFLAGS-$(perfc_arrays) += -DPERF_ARRAYS CFLAGS-$(lock_profile) += -DLOCK_PROFILE CFLAGS-$(HAS_ACPI) += -DHAS_ACPI +CFLAGS-$(HAS_PASSTHROUGH) += -DHAS_PASSTHROUGH CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER ifneq ($(max_phys_cpus),)
xen/arch/arm/dummy.S +0 -2
@@ -27,8 +27,6 @@ DUMMY(gmfn_to_mfn); DUMMY(gnttab_clear_flag); DUMMY(gnttab_mark_dirty); DUMMY(hypercall_create_continuation); -DUMMY(iommu_map_page); -DUMMY(iommu_unmap_page); DUMMY(is_iomem_page); DUMMY(max_page); DUMMY(node_online_map);
xen/include/xen/sched.h +6 -0
@@ -266,8 +266,10 @@ struct domain/* Is this an HVM guest? */ bool_t is_hvm; +#ifdef HAS_PASSTHROUGH /* Does this guest need iommu mappings? */ bool_t need_iommu; +#endif /* Is this guest fully privileged (aka dom0)? */ bool_t is_privileged;/* Which guest this guest has privileges on */
@@ -687,7 +689,11 @@ void watchdog_domain_destroy(struct domain *d);#define is_hvm_vcpu (v) (is_hvm_domain(v->domain))#define is_pinned_vcpu (v) ((v)->domain->is_pinned || \ cpumask_weight((v)->cpu_affinity) == 1) +#ifdef HAS_PASSTHROUGH #define need_iommu (d) ((d)->need_iommu) +#else +#define need_iommu (d) (0) +#endif void set_vcpu_migration_delay (unsigned int delay);unsigned int get_vcpu_migration_delay (void );
Signature · 1 line
1.7.2.5
Re: [PATCH 09/12] xen: make need_iommu == 0 if !HAS_PASSTHROUGH
Quoted 1 line · Ian Campbell
Signed-off-by Ian Campbell <[email protected]>
Quoted 59 lines
--- xen/Rules.mk | 1 + xen/arch/arm/dummy.S | 2 -- xen/include/xen/sched.h | 6 ++++++ 3 files changed, 7 insertions(+), 2 deletions(-)xen/Rules.mk +1
-0@@ -51,6 +51,7 @@ CFLAGS-$(perfc) += -DPERF_COUNTERS CFLAGS-$(perfc_arrays) += -DPERF_ARRAYS CFLAGS-$(lock_profile) += -DLOCK_PROFILE CFLAGS-$(HAS_ACPI) += -DHAS_ACPI +CFLAGS-$(HAS_PASSTHROUGH) += -DHAS_PASSTHROUGH CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER ifneq ($(max_phys_cpus),)xen/arch/arm/dummy.S +0
-2@@ -27,8 +27,6 @@ DUMMY(gmfn_to_mfn); DUMMY(gnttab_clear_flag); DUMMY(gnttab_mark_dirty); DUMMY(hypercall_create_continuation); -DUMMY(iommu_map_page); -DUMMY(iommu_unmap_page); DUMMY(is_iomem_page); DUMMY(max_page); DUMMY(node_online_map);xen/include/xen/sched.h +6
-0@@ -266,8 +266,10 @@ struct domain/* Is this an HVM guest? */ bool_t is_hvm; +#ifdef HAS_PASSTHROUGH /* Does this guest need iommu mappings? */ bool_t need_iommu; +#endif /* Is this guest fully privileged (aka dom0)? */ bool_t is_privileged;/* Which guest this guest has privileges on */ @@ -687,7 +689,11 @@ void watchdog_domain_destroy(struct domain *d);#define is_hvm_vcpu (v) (is_hvm_domain(v->domain))#define is_pinned_vcpu (v) ((v)->domain->is_pinned || \ cpumask_weight((v)->cpu_affinity) == 1) +#ifdef HAS_PASSTHROUGH #define need_iommu (d) ((d)->need_iommu) +#else +#define need_iommu (d) (0) +#endif void set_vcpu_migration_delay (unsigned int delay);unsigned int get_vcpu_migration_delay (void );
PATCH v2 10/12 arm: stub out PoD related p2m functions
In reply to Ian Campbell--- xen/arch/arm/dummy.S | 2 -- xen/arch/arm/p2m.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-)
xen/arch/arm/dummy.S +0 -2
@@ -31,8 +31,6 @@ DUMMY(is_iomem_page); DUMMY(max_page); DUMMY(node_online_map); DUMMY(nr_irqs_gsi); -DUMMY(p2m_pod_decrease_reservation); -DUMMY(guest_physmap_mark_populate_on_demand); DUMMY(page_get_owner_and_reference); DUMMY(page_is_ram_type); DUMMY(per_cpu__cpu_core_mask);
xen/arch/arm/p2m.c +14 -0
@@ -18,6 +18,20 @@ void p2m_load_VTTBR(struct domain *d)isb ();/* Ensure update is visible */ } +int guest_physmap_mark_populate_on_demand (struct domain *d, +unsigned long gfn, +unsigned int order) +{ +return -ENOSYS ; +} + +int p2m_pod_decrease_reservation (struct domain *d, +xen_pfn_t gpfn, +unsigned int order) +{ +return -ENOSYS ; +} +static int p2m_create_entry (struct domain *d,lpae_t *entry) {
Signature · 1 line
1.7.2.5
PATCH v2 11/12 arm: define max_page
In reply to Ian Campbell--- xen/arch/arm/dummy.S | 1 - xen/arch/arm/mm.c | 2 ++ xen/arch/arm/setup.c | 2 ++ 3 files changed, 4 insertions(+), 1 deletions(-)
xen/arch/arm/dummy.S +0 -1
@@ -28,7 +28,6 @@ DUMMY(gnttab_clear_flag); DUMMY(gnttab_mark_dirty); DUMMY(hypercall_create_continuation); DUMMY(is_iomem_page); -DUMMY(max_page); DUMMY(node_online_map); DUMMY(nr_irqs_gsi); DUMMY(page_get_owner_and_reference);
xen/arch/arm/mm.c +2 -0
@@ -43,6 +43,8 @@ unsigned long xenheap_virt_end;unsigned long frametable_base_mfn;unsigned long frametable_virt_end; +unsigned long max_page; +/* Map a 4k page in a fixmap entry */ void set_fixmap (unsigned map,unsigned long mfn,unsigned attributes) {
xen/arch/arm/setup.c +2 -0
@@ -32,6 +32,7 @@#include <xen/softirq.h> #include <xen/keyhandler.h> #include <xen/cpu.h> +#include <xen/pfn.h> #include <asm/page.h> #include <asm/current.h> #include <asm/setup.h>
@@ -141,6 +142,7 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) pfn_to_paddr(xenheap_mfn_start + xenheap_pages + domheap_pages));setup_frametable_mappings (ram_start, ram_end); + max_page =PFN_DOWN (ram_end);/* Add xenheap memory that was not already added to the boot allocator. */
Signature · 1 line
1.7.2.5
PATCH v2 12/12 arm: Group remaining dummy symbols somewhat according to functionality
In reply to Ian CampbellMakes it easier to see what needs to be done.
--- xen/arch/arm/dummy.S | 69 +++++++++++++++++++++++++++++-------------------- 1 files changed, 41 insertions(+), 28 deletions(-)
xen/arch/arm/dummy.S +41 -28
@@ -6,48 +6,61 @@ x: .word 0xe7f000f0 /* Undefined instruction */ .globl x; \ x: mov pc, lr +/* SMP support */ +DUMMY(__cpu_die); +DUMMY(__cpu_disable); +DUMMY(__cpu_up); +DUMMY(per_cpu__cpu_core_mask); +DUMMY(per_cpu__cpu_sibling_mask); +DUMMY(node_online_map); +DUMMY(smp_send_state_dump); +DUMMY(__per_cpu_offset); + +/* PIRQ support */ DUMMY(alloc_pirq_struct); +DUMMY(nr_irqs_gsi); +DUMMY(pirq_guest_bind); +DUMMY(pirq_guest_unbind); +DUMMY(pirq_set_affinity); + +/* VCPU */ DUMMY(alloc_vcpu_guest_context); DUMMY(arch_get_info_guest); DUMMY(arch_set_info_guest); DUMMY(arch_vcpu_reset); +DUMMY(free_vcpu_guest_context); +DUMMY(sync_vcpu_execstate); +NOP(update_vcpu_system_time); +DUMMY(vcpu_mark_events_pending); +DUMMY(vcpu_show_execution_state); + +/* Page Reference & Type Maintenance */ +DUMMY(get_page); +DUMMY(get_page_type); +DUMMY(page_get_owner_and_reference); +DUMMY(put_page); +DUMMY(put_page_type); + +/* Grant Tables */ DUMMY(create_grant_host_mapping); -DUMMY(__cpu_die); -DUMMY(__cpu_disable); -DUMMY(__cpu_up); +DUMMY(gnttab_clear_flag); +DUMMY(gnttab_mark_dirty); +DUMMY(is_iomem_page); +DUMMY(replace_grant_host_mapping); +DUMMY(steal_page); + +/* Page Offlining */ +DUMMY(page_is_ram_type); + +/* Other */ DUMMY(domain_get_maximum_gpfn); DUMMY(domain_relinquish_resources); DUMMY(domain_set_time_offset); DUMMY(dom_cow); DUMMY(flush_tlb_mask); -DUMMY(free_vcpu_guest_context); -DUMMY(get_page); -DUMMY(get_page_type); DUMMY(gmfn_to_mfn); -DUMMY(gnttab_clear_flag); -DUMMY(gnttab_mark_dirty); DUMMY(hypercall_create_continuation); -DUMMY(is_iomem_page); -DUMMY(node_online_map); -DUMMY(nr_irqs_gsi); -DUMMY(page_get_owner_and_reference); -DUMMY(page_is_ram_type); -DUMMY(per_cpu__cpu_core_mask); -DUMMY(per_cpu__cpu_sibling_mask); -DUMMY(__per_cpu_offset); -DUMMY(pirq_guest_bind); -DUMMY(pirq_guest_unbind); -DUMMY(pirq_set_affinity); -DUMMY(put_page); -DUMMY(put_page_type); -DUMMY(replace_grant_host_mapping); DUMMY(send_timer_event); DUMMY(share_xen_page_with_privileged_guests); -DUMMY(smp_send_state_dump); -DUMMY(steal_page); -DUMMY(sync_vcpu_execstate); DUMMY(__udelay); -NOP(update_vcpu_system_time); -DUMMY(vcpu_mark_events_pending); -DUMMY(vcpu_show_execution_state); DUMMY(wallclock_time);
Signature · 1 line
1.7.2.5
Quoted 5 lines · Ian Campbell
Defines a few stubs and disables some as yet unsupported core features.
Early on there's a couple of unrelated cleanups.
Patch against current unstable. #6 and #9 touch common code.
For the ARM parts: Acked-by: Tim Deegan <[email protected]>
Quoted 11 lines · Ian Campbell
Defines a few stubs and disables some as yet unsupported core features.
Early on there's a couple of unrelated cleanups.
Patch against current unstable. #6 and #9 touch common code.
Changes since v1:
- make PoD stubs proper functions instead of #defines
- defineneed_iommuas 0 instead of littering common code with #if
- stubdonate_pagebut leave tmem enabled.
- rebased against latest unstable tree
ack
Quoted 11 lines · Ian Campbell
Defines a few stubs and disables some as yet unsupported core features.
Early on there's a couple of unrelated cleanups.
Patch against current unstable. #6 and #9 touch common code.
Changes since v1:
- make PoD stubs proper functions instead of #defines
- defineneed_iommuas 0 instead of littering common code with #if
- stubdonate_pagebut leave tmem enabled.
- rebased against latest unstable tree
Committed with Acks from Tim & Stefano dfor the ARM bits and Keir for the non-ARM bits.
Thanks,
Ian.