ppc: Enable full Xen build
PATCH v6 3/4 xen/ppc: Add stub function and symbol definitions
In reply to Shawn AnastasioAdd stub function and symbol definitions required by common code. If the file that the definition is supposed to be located in doesn't already exist yet, temporarily place its definition in the new stubs.c
---
v6: No changes.
v5: No changes.
v4: No changes.
v3:
- (stubs.c) Drop ack_none hook definition
v2:
- Use BUG_ON("unimplemented") instead of BUG() for unimplemented functions to make searching easier.
- (mm-radix.c) Drop total_pages definition
- (mm-radix.c) Move __read_mostly from after variable name to before it in declaration of frametable_base_pdx
- (setup.c) Fix include order
- (stubs.c) Drop stub .end hw_irq_controller hook
xen/arch/ppc/Makefile | 1 + xen/arch/ppc/mm-radix.c | 42 +++++ xen/arch/ppc/setup.c | 8 + xen/arch/ppc/stubs.c | 339 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 390 insertions(+) create mode 100644 xen/arch/ppc/stubs.c
xen/arch/ppc/Makefile +1 -0
@@ -4,6 +4,7 @@ obj-$(CONFIG_EARLY_PRINTK) += early_printk.init.o obj-y += mm-radix.o obj-y += opal.o obj-y += setup.o +obj-y += stubs.o obj-y += tlb-radix.o $(TARGET): $(TARGET)-syms
xen/arch/ppc/mm-radix.c +42 -0
45 lines not on this page · raw message
xen/arch/ppc/setup.c +8 -0
@@ -1,5 +1,8 @@/* SPDX-License-Identifier: GPL-2.0-or-later */ #include <xen/init.h> +#include <xen/lib.h> +#include <xen/mm.h> +#include <public/version.h> #include <asm/boot.h> #include <asm/early_printk.h> #include <asm/mm.h>
@@ -33,3 +36,8 @@ void __init noreturn start_xen(unsigned long r3, unsigned long r4,unreachable (); } + +void arch_get_xen_caps (xen_capabilities_info_t *info) +{ +BUG_ON ("unimplemented" ); +}
xen/arch/ppc/stubs.c new file +339 -0
339 lines not on this page · raw message
--
2.30.2
PATCH v6 4/4 xen/ppc: Enable full Xen build
In reply to Shawn AnastasioBring ppc's Makefile and arch.mk in line with arm and x86 to disable the build overrides and enable the full Xen build.
--- xen/arch/ppc/Makefile | 16 +++++++++++++++- xen/arch/ppc/arch.mk | 3 --- 2 files changed, 15 insertions(+), 4 deletions(-)
xen/arch/ppc/Makefile +15 -1
@@ -11,10 +11,24 @@ $(TARGET): $(TARGET)-syms cp -f $< $@ $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds - $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) -o $@ + $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \ + $(objtree)/common/symbols-dummy.o -o $(dot-target).0 + $(NM) -pa --format=sysv $(dot-target).0 \ + | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \ + > $(dot-target).0.S + $(MAKE) $(build)=$(@D) $(dot-target).0.o + $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< \ + $(dot-target).0.o -o $(dot-target).1 + $(NM) -pa --format=sysv $(dot-target).1 \ + | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \ + > $(dot-target).1.S + $(MAKE) $(build)=$(@D) $(dot-target).1.o + $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \ + $(dot-target).1.o -o $@ $(NM) -pa --format=sysv $@ \ | $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \ > [email protected] + rm -f $(@D)/.$(@F).[0-9]* $(obj)/xen.lds: $(src)/xen.lds.S FORCE $(call if_changed_dep,cpp_lds_S)
xen/arch/ppc/arch.mk +0 -3
@@ -7,6 +7,3 @@ CFLAGS += -m64 -mlittle-endian -mcpu=$(ppc-march-y) CFLAGS += -mstrict-align -mcmodel=medium -mabi=elfv2 -fPIC -mno-altivec -mno-vsx -msoft-float LDFLAGS += -m elf64lppc - -# TODO: Drop override when more of the build is working -override ALL_OBJS-y = arch/$(SRCARCH)/built_in.o common/libfdt/built_in.o lib/built_in.o
Signature · 1 line
2.30.2
PATCH v6 1/4 xen/ppc: Implement bitops.h
In reply to Shawn AnastasioImplement bitops.h, based on Linux's implementation as of commit 5321d1b1afb9a17302c6cec79f0cbf823eb0d3fc. Though it is based off of Linux's implementation, this code diverges significantly in a number of ways:
- Bitmap entries changed to 32-bit words to match X86 and Arm on Xen
- PPC32-specific code paths dropped
- Formatting completely re-done to more closely line up with Xen. Including 4 space indentation.
- Use GCC's __builtin_popcount* for hweight* implementation
---
v6:
- Fix spacing of line-continuing backslashes in DEFINE_*OP macros
- Drop unused prefix parameter from DEFINE_*OP macros
- Reformat argument list in calls to test_and_{set,clear}_bits.
v5:
- Switch lingering ulong bitop parameters/return values to uint.
v4:
- Mention __builtin_popcount impelmentation of hweight* in message
- Change type of BITOP_MASK expression from unsigned long to unsigned int
- Fix remaining underscore-prefixed macro params/vars
- Fix line wrapping in test_and_clear_bit{,s}
- Change type of test_and_clear_bits' pointer parameter from void * to unsigned int *. This was already done for other functions but missed here.
- De-macroize test_and_set_bits.
- Fix formatting of ffs{,l} macro's unary operators
- Drop extra blank in ffz() macro definition
v3:
- Fix style of inline asm blocks.
- Fix underscore-prefixed macro parameters/variables
- Use __builtin_popcount for hweight* implementation
- Update C functions to use proper Xen coding style
v2:
- Clarify changes from Linux implementation in commit message
- Use PPC_ATOMIC_{ENTRY,EXIT}_BARRIER macros from <asm/memory.h> instead of hardcoded "sync" instructions in inline assembly blocks.
- Fix macro line-continuing backslash spacing
- Fix hard-tab usage in find_*_bit C functions.
xen/arch/ppc/include/asm/bitops.h | 332 +++++++++++++++++++++++++++++- 1 file changed, 329 insertions(+), 3 deletions(-)
xen/arch/ppc/include/asm/bitops.h +329 -3
@@ -1,9 +1,335 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* +* Adapted from Linux's arch/powerpc/include/asm/bitops.h. +* +* Merged version by David Gibson <[email protected]>. +* Based on ppc64 versions by: Dave Engebretsen, Todd Inglett, Don +* Reed, Pat McCarthy, Peter Bergner, Anton Blanchard. They +* originally took it from the ppc32 code. +*/ #ifndef _ASM_PPC_BITOPS_H#define _ASM_PPC_BITOPS_H +#include <asm/memory.h> + +#define __set_bit (n, p) set_bit(n, p) +#define __clear_bit (n, p) clear_bit(n, p) + +#define BITOP_BITS_PER_WORD 32 +#define BITOP_MASK (nr) (1U << ((nr) % BITOP_BITS_PER_WORD)) +#define BITOP_WORD (nr) ((nr) / BITOP_BITS_PER_WORD) +#define BITS_PER_BYTE 8 +/* PPC bit number conversion */ -#define PPC_BITLSHIFT (be) (BITS_PER_LONG - 1 - (be)) -#define PPC_BIT (bit) (1UL << PPC_BITLSHIFT(bit)) -#define PPC_BITMASK (bs, be) ((PPC_BIT(bs) - PPC_BIT(be)) | PPC_BIT(bs)) +#define PPC_BITLSHIFT (be) (BITS_PER_LONG - 1 - (be)) +#define PPC_BIT (bit) (1UL << PPC_BITLSHIFT(bit)) +#define PPC_BITMASK (bs, be) ((PPC_BIT(bs) - PPC_BIT(be)) | PPC_BIT(bs)) + +/* Macro for generating the ***_bits() functions */ +#define DEFINE_BITOP (fn, op) \ +static inline void fn(unsigned int mask, \ + volatile unsigned int *p_) \ +{ \ + unsigned int old; \ + unsigned int *p = (unsigned int *)p_; \ + asm volatile ( "1: lwarx %0,0,%3,0\n" \ + #op "%I2 %0,%0,%2\n" \ + "stwcx. %0,0,%3\n" \ + "bne- 1b\n" \ + : "=&r" (old), "+m" (*p) \ + : "rK" (mask), "r" (p) \ + : "cc", "memory" ); \ +} + +DEFINE_BITOP(set_bits, or) +DEFINE_BITOP(change_bits, xor) + +#define DEFINE_CLROP (fn) \ +static inline void fn(unsigned int mask, volatile unsigned int *p_) \ +{ \ + unsigned int old; \ + unsigned int *p = (unsigned int *)p_; \ + asm volatile ( "1: lwarx %0,0,%3,0\n" \ + "andc %0,%0,%2\n" \ + "stwcx. %0,0,%3\n" \ + "bne- 1b\n" \ + : "=&r" (old), "+m" (*p) \ + : "r" (mask), "r" (p) \ + : "cc", "memory" ); \ +} + +DEFINE_CLROP (clear_bits) + +static inline void set_bit(int nr, volatile void *addr) +{ +set_bits (BITOP_MASK (nr), (volatile unsigned int *)addr +BITOP_WORD (nr)); +} +static inline void clear_bit (int nr,volatile void *addr) +{ +clear_bits (BITOP_MASK (nr), (volatile unsigned int *)addr +BITOP_WORD (nr)); +} + +/** +* test_bit - Determine whether a bit is set +* @nr: bit number to test +* @addr: Address to start counting from +*/ +static inline int test_bit (int nr,const volatile void *addr) +{ +const volatile unsigned int *p = addr; +return 1 & (p[BITOP_WORD (nr)] >> (nr & (BITOP_BITS_PER_WORD -1 ))); +} + +static inline unsigned int test_and_clear_bits ( +unsigned int mask, +volatile unsigned int *p) +{ +unsigned int old, t; + + asmvolatile (PPC_ATOMIC_ENTRY_BARRIER +"1: lwarx %0,0,%3,0\n" +"andc %1,%0,%2\n" +"stwcx. %1,0,%3\n" +"bne- 1b\n" +PPC_ATOMIC_EXIT_BARRIER + :"=&r" (old),"=&r" (t) + :"r" (mask),"r" (p) + :"cc" ,"memory" ); + +return (old & mask); +} + +static inline int test_and_clear_bit (unsigned int nr, +volatile void *addr) +{ +return test_and_clear_bits ( +BITOP_MASK (nr), + (volatile unsigned int *)addr +BITOP_WORD (nr)) !=0 ; +} + +static inline unsigned int test_and_set_bits ( +unsigned int mask, +volatile unsigned int *p) +{ +unsigned int old, t; + + asmvolatile (PPC_ATOMIC_ENTRY_BARRIER +"1: lwarx %0,0,%3,0\n" +"or%I2 %1,%0,%2\n" +"stwcx. %1,0,%3\n" +"bne- 1b\n" +PPC_ATOMIC_EXIT_BARRIER + :"=&r" (old),"=&r" (t) + :"rK" (mask),"r" (p) + :"cc" ,"memory" ); + +return (old & mask); +} + +static inline int test_and_set_bit (unsigned int nr,volatile void *addr) +{ +return test_and_set_bits ( +BITOP_MASK (nr), + (volatile unsigned int *)addr +BITOP_WORD (nr)) !=0 ; +} + +/** +* __test_and_set_bit - Set a bit and return its old value +* @nr: Bit to set +* @addr: Address to count from +* +* This operation is non-atomic and can be reordered. +* If two examples of this operation race, one can appear to succeed +* but actually fail. You must protect multiple accesses with a lock. +*/ +static inline int __test_and_set_bit (int nr,volatile void *addr) +{ +unsigned int mask =BITOP_MASK (nr); +volatile unsigned int *p = ((volatile unsigned int *)addr) +BITOP_WORD (nr); +unsigned int old = *p; + + *p = old | mask; +return (old & mask) !=0 ; +} + +/** +* __test_and_clear_bit - Clear a bit and return its old value +* @nr: Bit to clear +* @addr: Address to count from +* +* This operation is non-atomic and can be reordered. +* If two examples of this operation race, one can appear to succeed +* but actually fail. You must protect multiple accesses with a lock. +*/ +static inline int __test_and_clear_bit (int nr,volatile void *addr) +{ +unsigned int mask =BITOP_MASK (nr); +volatile unsigned int *p = ((volatile unsigned int *)addr) +BITOP_WORD (nr); +unsigned int old = *p; + + *p = old & ~mask; +return (old & mask) !=0 ; +} + +#define flsl (x) generic_flsl(x) +#define fls (x) generic_fls(x) +#define ffs (x) ({ unsigned int t_ = (x); fls(t_ & -t_); }) +#define ffsl (x) ({ unsigned long t_ = (x); flsl(t_ & -t_); }) + +/* Based on linux/include/asm-generic/bitops/ffz.h */ +/* +* ffz - find first zero in word. +* @word: The word to search +* +* Undefined if no zero exists, so code should check against ~0UL first. +*/ +#define ffz (x) __ffs(~(x)) + +/** +* hweightN - returns the hamming weight of a N-bit word +* @x: the word to weigh +* +* The Hamming Weight of a number is the total number of bits set in it. +*/ +#define hweight64 (x) __builtin_popcountll(x) +#define hweight32 (x) __builtin_popcount(x) +#define hweight16 (x) __builtin_popcount((uint16_t)(x)) +#define hweight8 (x) __builtin_popcount((uint8_t)(x)) + +/* Based on linux/include/asm-generic/bitops/builtin-__ffs.h */ +/** +* __ffs - find first bit in word. +* @word: The word to search +* +* Undefined if no bit exists, so code should check against 0 first. +*/ +static always_inline unsigned long __ffs (unsigned long word) +{ +return __builtin_ctzl (word); +} + +/** +* find_first_set_bit - find the first set bit in @word +* @word: the word to search +* +* Returns the bit-number of the first set bit (first bit being 0). +* The input must *not* be zero. +*/ +#define find_first_set_bit (x) (ffsl(x) - 1) + +/* +* Find the first set bit in a memory region. +*/ +static inline unsigned long find_first_bit (const unsigned long *addr, +unsigned long size) +{ +const unsigned long *p = addr; +unsigned long result =0 ; +unsigned long tmp; + +while ( size & ~(BITS_PER_LONG -1 ) ) + { +if ( (tmp = *(p++)) ) + goto found; + result +=BITS_PER_LONG ; + size -=BITS_PER_LONG ; + } +if ( !size ) +return result; + + tmp = (*p) & (~0UL >> (BITS_PER_LONG - size)); +if ( tmp ==0UL )/* Are any bits set? */ +return result + size;/* Nope. */ + found: +return result +__ffs (tmp); +} + +static inline unsigned long find_next_bit (const unsigned long *addr, +unsigned long size, +unsigned long offset) +{ +const unsigned long *p = addr +BITOP_WORD (offset); +unsigned long result = offset & ~(BITS_PER_LONG -1 ); +unsigned long tmp; + +if ( offset >= size ) +return size; + size -= result; + offset %=BITS_PER_LONG ; +if ( offset ) + { + tmp = *(p++); + tmp &= (~0UL << offset); +if ( size <BITS_PER_LONG ) + goto found_first; +if ( tmp ) + goto found_middle; + size -=BITS_PER_LONG ; + result +=BITS_PER_LONG ; + } +while ( size & ~(BITS_PER_LONG -1 ) ) + { +if ( (tmp = *(p++)) ) + goto found_middle; + result +=BITS_PER_LONG ; + size -=BITS_PER_LONG ; + } +if ( !size ) +return result; + tmp = *p; + + found_first: + tmp &= (~0UL >> (BITS_PER_LONG - size)); +if ( tmp ==0UL )/* Are any bits set? */ +return result + size;/* Nope. */ + found_middle: +return result +__ffs (tmp); +} + +/* +* This implementation of find_{first,next}_zero_bit was stolen from +* Linus' asm-alpha/bitops.h. +*/ +static inline unsigned long find_next_zero_bit (const unsigned long *addr, +unsigned long size, +unsigned long offset) +{ +const unsigned long *p = addr +BITOP_WORD (offset); +unsigned long result = offset & ~(BITS_PER_LONG -1 ); +unsigned long tmp; + +if ( offset >= size ) +return size; + size -= result; + offset %=BITS_PER_LONG ; +if ( offset ) + { + tmp = *(p++); + tmp |= ~0UL >> (BITS_PER_LONG - offset); +if ( size <BITS_PER_LONG ) + goto found_first; +if ( ~tmp ) + goto found_middle; + size -=BITS_PER_LONG ; + result +=BITS_PER_LONG ; + } +while ( size & ~(BITS_PER_LONG -1 ) ) + { +if ( ~(tmp = *(p++)) ) + goto found_middle; + result +=BITS_PER_LONG ; + size -=BITS_PER_LONG ; + } +if ( !size ) +return result; + tmp = *p; + + found_first: + tmp |= ~0UL << size; +if ( tmp == ~0UL )/* Are any bits zero? */ +return result + size;/* Nope. */ + found_middle: +return result +ffz (tmp); +}#endif /* _ASM_PPC_BITOPS_H */
--
2.30.2
PATCH v6 2/4 xen/ppc: Define minimal stub headers required for full build
In reply to Shawn AnastasioAdditionally, change inclusion of asm/ headers to corresponding xen/ ones throughout arch/ppc now that they work.
---
v6: No changes.
v5:
- Drop vm_event.h in favor of asm-generic variant
- (numa.h) Fix lingering reference to Arm
v4:
- (device.h) Fix underscore prefixes in DT_DEVICE_START macro
- (mm.h) Fix padding blanks in newly added *_to_* macros
- (mm.h) Drop inaccurate comment for virt_to_mfn/mfn_to_virt. The implementation of these macros remains unchanged.
- (mm.h) s/zero/NULL/g in comment of page_info::v::inuse::domain
- (mm.h) Use uint<N>_t instead of u<N> types in struct page_info
- (p2m.h) Drop ARM-specific p2m_type_t enumerations
- (system.h) Fix hard tabs in xchg() macro
- (system.h) Add missing '\n' in build_xchg inline assembly before PPC_ATOMIC_EXIT_BARRIER.
- (system.h) Fix formatting of switch statements.
- (system.h) Fix formatting of cmpxchg() macro.
- (system.h) Fix formatting of mb/rmb/wmb macros
- (system.h) Drop dead !CONFIG_SMP definition of smp memory barriers
- (system.h) Replace hand-coded asm memory barriers w/ barrier()
- (time.h) Fix overly-long definition of force_update_vcpu_system_time
v3:
- Drop procarea.h
- Add SPDX headers to all headers touched or added by this patch
- (altp2m.h) Use ASSERT_UNREACHABLE for function that is meant to stay unimplemented
- (current.h) Consistently use plain C types in struct cpu_info
- (current.h) Fix formatting of inline asm in get_cpu_info()
- (device.h) Drop unnecessary DEVICE_GIC enumeration inherited from ARM
- (div64.h) Drop underscore-prefixed macro variables, fix formatting
- (domain.h) Drop unnecessary space after cast in guest_mode()
- (guest_access.h) Clean up line wrapping of functions w/ many parameters
- (guest_atomics.h) Avoid overly-long stub macros
- (grant_table.h) Add include guard + SPDX
- (hypercall.h) Add include guard + SPDX
- (mem_access.h) Add include guard + SPDX
- (mm.h) BUG_ON("unimplemented") for mfn_to_gfn/set_gpfn_from_mfn
- (mm.h) Define PDX_GROUP_SHIFT in terms of XEN_PT_SHIFT_LVL_3
- (monitor.h) BUG_ON("unimplemented") for arch_monitor_get_capabilities
- (system.h) Fix formatting of inline assembly + macros
- (time.h) Fix too-deep indentation
v2:
- Use BUG_ON("unimplemented") instead of BUG() for unimplemented functions to make searching easier.
- (altp2m.h) Drop Intel license in favor of an SPDX header
- (altp2m.h) Drop <xen/sched.h> include in favor of <xen/bug.h> and forward declarations of struct domain and struct vcpu.
- (bug.h) Add TODO comments above BUG and BUG_FRAME implementations
- (desc.h) Drop desc.h
- (mm.h) Drop <asm/config.h> include
- (mm.h) Drop PGC_static definition
- (mm.h) Drop max_page definition
- (mm.h/mm-radix.c) Drop total_pages definition
- (monitor.h) Drop <xen/sched.h> and <public/domctl.h> includes in favor of just <xen/errno.h>
- (page.h) Drop PAGE_ALIGN definition
- (percpu.h) Drop <xen/types.h> include
- (procarea.h) Drop license text in favor of SPDX header
- (procarea.h) Drop unnecessary forward declarations and <xen/types.h> include
- (processor.h) Fix macro parameter naming (drop leading underscore)
- (processor.h) Add explanation comment to cpu_relax()
- (regs.h) Drop stray hunk adding <xen/types.h> include
- (system.h) Drop license text in favor of SPDX header
- (system.h) Drop <xen/config.h> include
- (opal.c) Drop stray hunk changing opal.c includes
xen/arch/ppc/Kconfig | 1 + xen/arch/ppc/include/asm/Makefile | 2 + xen/arch/ppc/include/asm/altp2m.h | 25 +++ xen/arch/ppc/include/asm/bug.h | 9 + xen/arch/ppc/include/asm/cache.h | 2 + xen/arch/ppc/include/asm/config.h | 10 + xen/arch/ppc/include/asm/cpufeature.h | 10 + xen/arch/ppc/include/asm/current.h | 43 ++++ xen/arch/ppc/include/asm/delay.h | 12 ++ xen/arch/ppc/include/asm/device.h | 53 +++++ xen/arch/ppc/include/asm/div64.h | 14 ++ xen/arch/ppc/include/asm/domain.h | 47 +++++ xen/arch/ppc/include/asm/event.h | 36 ++++ xen/arch/ppc/include/asm/flushtlb.h | 24 +++ xen/arch/ppc/include/asm/grant_table.h | 5 + xen/arch/ppc/include/asm/guest_access.h | 68 +++++++ xen/arch/ppc/include/asm/guest_atomics.h | 23 +++ xen/arch/ppc/include/asm/hardirq.h | 19 ++ xen/arch/ppc/include/asm/hypercall.h | 5 + xen/arch/ppc/include/asm/io.h | 16 ++ xen/arch/ppc/include/asm/iocap.h | 8 + xen/arch/ppc/include/asm/iommu.h | 8 + xen/arch/ppc/include/asm/irq.h | 33 +++ xen/arch/ppc/include/asm/mem_access.h | 5 + xen/arch/ppc/include/asm/mm.h | 243 ++++++++++++++++++++++- xen/arch/ppc/include/asm/monitor.h | 43 ++++ xen/arch/ppc/include/asm/nospec.h | 15 ++ xen/arch/ppc/include/asm/numa.h | 26 +++ xen/arch/ppc/include/asm/p2m.h | 95 +++++++++ xen/arch/ppc/include/asm/page.h | 18 ++ xen/arch/ppc/include/asm/paging.h | 7 + xen/arch/ppc/include/asm/pci.h | 7 + xen/arch/ppc/include/asm/percpu.h | 24 +++ xen/arch/ppc/include/asm/processor.h | 10 + xen/arch/ppc/include/asm/random.h | 9 + xen/arch/ppc/include/asm/setup.h | 6 + xen/arch/ppc/include/asm/smp.h | 18 ++ xen/arch/ppc/include/asm/softirq.h | 8 + xen/arch/ppc/include/asm/spinlock.h | 15 ++ xen/arch/ppc/include/asm/system.h | 219 +++++++++++++++++++- xen/arch/ppc/include/asm/time.h | 23 +++ xen/arch/ppc/include/asm/xenoprof.h | 0 xen/arch/ppc/mm-radix.c | 2 +- xen/arch/ppc/tlb-radix.c | 2 +- xen/include/public/hvm/save.h | 2 + xen/include/public/pmu.h | 2 + xen/include/public/xen.h | 2 + 47 files changed, 1270 insertions(+), 4 deletions(-) create mode 100644 xen/arch/ppc/include/asm/Makefile create mode 100644 xen/arch/ppc/include/asm/altp2m.h create mode 100644 xen/arch/ppc/include/asm/cpufeature.h create mode 100644 xen/arch/ppc/include/asm/current.h create mode 100644 xen/arch/ppc/include/asm/delay.h create mode 100644 xen/arch/ppc/include/asm/device.h create mode 100644 xen/arch/ppc/include/asm/div64.h create mode 100644 xen/arch/ppc/include/asm/domain.h create mode 100644 xen/arch/ppc/include/asm/event.h create mode 100644 xen/arch/ppc/include/asm/flushtlb.h create mode 100644 xen/arch/ppc/include/asm/grant_table.h create mode 100644 xen/arch/ppc/include/asm/guest_access.h create mode 100644 xen/arch/ppc/include/asm/guest_atomics.h create mode 100644 xen/arch/ppc/include/asm/hardirq.h create mode 100644 xen/arch/ppc/include/asm/hypercall.h create mode 100644 xen/arch/ppc/include/asm/io.h create mode 100644 xen/arch/ppc/include/asm/iocap.h create mode 100644 xen/arch/ppc/include/asm/iommu.h create mode 100644 xen/arch/ppc/include/asm/irq.h create mode 100644 xen/arch/ppc/include/asm/mem_access.h create mode 100644 xen/arch/ppc/include/asm/monitor.h create mode 100644 xen/arch/ppc/include/asm/nospec.h create mode 100644 xen/arch/ppc/include/asm/numa.h create mode 100644 xen/arch/ppc/include/asm/p2m.h create mode 100644 xen/arch/ppc/include/asm/paging.h create mode 100644 xen/arch/ppc/include/asm/pci.h create mode 100644 xen/arch/ppc/include/asm/percpu.h create mode 100644 xen/arch/ppc/include/asm/random.h create mode 100644 xen/arch/ppc/include/asm/setup.h create mode 100644 xen/arch/ppc/include/asm/smp.h create mode 100644 xen/arch/ppc/include/asm/softirq.h create mode 100644 xen/arch/ppc/include/asm/spinlock.h create mode 100644 xen/arch/ppc/include/asm/time.h create mode 100644 xen/arch/ppc/include/asm/xenoprof.h
xen/arch/ppc/Kconfig +1 -0
@@ -1,6 +1,7 @@ config PPC def_bool y select HAS_DEVICE_TREE + select HAS_PDX config PPC64 def_bool y
xen/arch/ppc/include/asm/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +generic-y += vm_event.h
xen/arch/ppc/include/asm/altp2m.h new file +25 -0
@@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_PPC_ALTP2M_H__ +#define __ASM_PPC_ALTP2M_H__ + +#include <xen/bug.h> + +struct domain ; +struct vcpu ; + +/* Alternate p2m on/off per domain */ +static inline bool altp2m_active (const struct domain *d) +{ +/* Not implemented on PPC. */ +return false; +} + +/* Alternate p2m VCPU */ +static inline uint16_t altp2m_vcpu_idx (const struct vcpu *v) +{ +/* Not implemented on PPC, should not be reached. */ +ASSERT_UNREACHABLE (); +return 0 ; +} + +#endif /* __ASM_PPC_ALTP2M_H__ */
xen/arch/ppc/include/asm/bug.h +9 -0
@@ -4,6 +4,7 @@#define _ASM_PPC_BUG_H#include <xen/stringify.h> +#include <asm/processor.h> /* * Power ISA guarantees that an instruction consisting of all zeroes is
@@ -15,4 +16,12 @@#define BUG_FN_REG r0 +/* TODO: implement this properly */ +#define BUG () do { \ + die(); \ +} while (0) + +/* TODO: implement this properly */ +#define BUG_FRAME (type, line, ptr, second_frame, msg) do { } while (0) +#endif /* _ASM_PPC_BUG_H */
xen/arch/ppc/include/asm/cache.h +2 -0
@@ -3,4 +3,6 @@#ifndef _ASM_PPC_CACHE_H#define _ASM_PPC_CACHE_H +#define __read_mostly __section(".data.read_mostly") +#endif /* _ASM_PPC_CACHE_H */
xen/arch/ppc/include/asm/config.h +10 -0
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ #ifndef __PPC_CONFIG_H__#define __PPC_CONFIG_H__
@@ -41,6 +42,15 @@#define XEN_VIRT_START _AC(0xc000000000000000, UL) +#define VMAP_VIRT_START (XEN_VIRT_START + GB(1)) +#define VMAP_VIRT_SIZE GB(1) + +#define FRAMETABLE_VIRT_START (XEN_VIRT_START + GB(32)) +#define FRAMETABLE_SIZE GB(32) +#define FRAMETABLE_NR (FRAMETABLE_SIZE / sizeof(*frame_table)) + +#define HYPERVISOR_VIRT_START XEN_VIRT_START +#define SMP_CACHE_BYTES (1 << 6)#define STACK_ORDER 0
xen/arch/ppc/include/asm/cpufeature.h new file +10 -0
@@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_PPC_CPUFEATURE_H__ +#define __ASM_PPC_CPUFEATURE_H__ + +static inline int cpu_nr_siblings (unsigned int cpu) +{ +return 1 ; +} + +#endif /* __ASM_PPC_CPUFEATURE_H__ */
xen/arch/ppc/include/asm/current.h new file +43 -0
43 lines not on this page · raw message
xen/arch/ppc/include/asm/delay.h new file +12 -0
@@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_PPC_DELAY_H__ +#define __ASM_PPC_DELAY_H__ + +#include <xen/lib.h> + +static inline void udelay (unsigned long usecs) +{ +BUG_ON ("unimplemented" ); +} + +#endif /* __ASM_PPC_DELAY_H__ */
xen/arch/ppc/include/asm/device.h new file +53 -0
53 lines not on this page · raw message
xen/arch/ppc/include/asm/div64.h new file +14 -0
@@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_PPC_DIV64_H__ +#define __ASM_PPC_DIV64_H__ + +#include <xen/types.h> + +#define do_div (n, base) ({ \ + uint32_t base_ = (base); \ + uint32_t rem_ = (uint64_t)(n) % base_; \ + (n) = (uint64_t)(n) / base_; \ + rem_; \ +}) + +#endif /* __ASM_PPC_DIV64_H__ */
xen/arch/ppc/include/asm/domain.h new file +47 -0
47 lines not on this page · raw message
xen/arch/ppc/include/asm/event.h new file +36 -0
@@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_PPC_EVENT_H__ +#define __ASM_PPC_EVENT_H__ + +#include <xen/lib.h> + +/* TODO: implement */ +static inline void vcpu_kick (struct vcpu *v) {BUG_ON ("unimplemented" ); } +static inline void vcpu_mark_events_pending (struct vcpu *v) {BUG_ON ("unimplemented" ); } +static inline void vcpu_update_evtchn_irq (struct vcpu *v) {BUG_ON ("unimplemented" ); } +static inline void vcpu_block_unless_event_pending (struct vcpu *v) {BUG_ON ("unimplemented" ); } + +static inline int vcpu_event_delivery_is_enabled (struct vcpu *v) +{ +BUG_ON ("unimplemented" ); +return 0 ; +} + +/* No arch specific virq definition now. Default to global. */ +static inline bool arch_virq_is_global (unsigned int virq) +{ +return true; +} + +static inline int local_events_need_delivery (void ) +{ +BUG_ON ("unimplemented" ); +return 0 ; +} + +static inline void local_event_delivery_enable (void ) +{ +BUG_ON ("unimplemented" ); +} + +#endif /* __ASM_PPC_EVENT_H__ */
xen/arch/ppc/include/asm/flushtlb.h new file +24 -0
@@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_PPC_FLUSHTLB_H__ +#define __ASM_PPC_FLUSHTLB_H__ + +#include <xen/cpumask.h> + +/* +* Filter the given set of CPUs, removing those that definitely flushed their +* TLB since @page_timestamp. +*/ +/* XXX lazy implementation just doesn't clear anything.... */ +static inline void tlbflush_filter (cpumask_t *mask,uint32_t page_timestamp) {} + +#define tlbflush_current_time () (0) + +static inline void page_set_tlbflush_timestamp (struct page_info *page) +{ + page->tlbflush_timestamp =tlbflush_current_time (); +} + +/* Flush specified CPUs' TLBs */ +void arch_flush_tlb_mask (const cpumask_t *mask); + +#endif /* __ASM_PPC_FLUSHTLB_H__ */
xen/arch/ppc/include/asm/grant_table.h new file +5 -0
@@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_PPC_GRANT_TABLE_H__ +#define __ASM_PPC_GRANT_TABLE_H__ + +#endif /* __ASM_PPC_GRANT_TABLE_H__ */
xen/arch/ppc/include/asm/guest_access.h new file +68 -0
68 lines not on this page · raw message
xen/arch/ppc/include/asm/guest_atomics.h new file +23 -0
@@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_PPC_GUEST_ATOMICS_H__ +#define __ASM_PPC_GUEST_ATOMICS_H__ + +#include <xen/lib.h> + +/* TODO: implement */ +#define unimplemented_guest_bit_op (d, nr, p) ({ \ + (void)(d); \ + (void)(nr); \ + (void)(p); \ + BUG_ON("unimplemented"); \ + false; \ +}) + +#define guest_test_bit (d, nr, p) unimplemented_guest_bit_op(d, nr, p) +#define guest_clear_bit (d, nr, p) unimplemented_guest_bit_op(d, nr, p) +#define guest_set_bit (d, nr, p) unimplemented_guest_bit_op(d, nr, p) +#define guest_test_and_set_bit (d, nr, p) unimplemented_guest_bit_op(d, nr, p) +#define guest_test_and_clear_bit (d, nr, p) unimplemented_guest_bit_op(d, nr, p) +#define guest_test_and_change_bit (d, nr, p) unimplemented_guest_bit_op(d, nr, p) + +#endif /* __ASM_PPC_GUEST_ATOMICS_H__ */
xen/arch/ppc/include/asm/hardirq.h new file +19 -0
@@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_PPC_HARDIRQ_H__ +#define __ASM_PPC_HARDIRQ_H__ + +#include <xen/cache.h> + +typedef struct { +unsigned long __softirq_pending; +unsigned int __local_irq_count; +} __cacheline_aligned irq_cpustat_t; + +#include <xen/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ + +#define in_irq () (local_irq_count(smp_processor_id()) != 0) + +#define irq_enter () (local_irq_count(smp_processor_id())++) +#define irq_exit () (local_irq_count(smp_processor_id())--) + +#endif /* __ASM_PPC_HARDIRQ_H__ */
xen/arch/ppc/include/asm/hypercall.h new file +5 -0
@@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_PPC_HYPERCALL_H__ +#define __ASM_PPC_HYPERCALL_H__ + +#endif /* __ASM_PPC_HYPERCALL_H__ */
xen/arch/ppc/include/asm/io.h new file +16 -0
@@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_PPC_IO_H__ +#define __ASM_PPC_IO_H__ + +#include <xen/lib.h> + +/* TODO */ +#define readb (c) ({ (void)(c); BUG_ON("unimplemented"); 0; }) +#define readw (c) ({ (void)(c); BUG_ON("unimplemented"); 0; }) +#define readl (c) ({ (void)(c); BUG_ON("unimplemented"); 0; }) + +#define writeb (v,c) ({ (void)(v); (void)(c); BUG_ON("unimplemented"); }) +#define writew (v,c) ({ (void)(v); (void)(c); BUG_ON("unimplemented"); }) +#define writel (v,c) ({ (void)(v); (void)(c); BUG_ON("unimplemented"); }) + +#endif /* __ASM_PPC_IO_H__ */
xen/arch/ppc/include/asm/iocap.h new file +8 -0
@@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_PPC_IOCAP_H__ +#define __ASM_PPC_IOCAP_H__ + +#define cache_flush_permitted (d) \ + (!rangeset_is_empty((d)->iomem_caps)) + +#endif /* __ASM_PPC_IOCAP_H__ */
xen/arch/ppc/include/asm/iommu.h new file +8 -0
@@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_PPC_IOMMU_H__ +#define __ASM_PPC_IOMMU_H__ + +struct arch_iommu { +}; + +#endif /* __ASM_PPC_IOMMU_H__ */
xen/arch/ppc/include/asm/irq.h new file +33 -0
@@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_PPC_IRQ_H__ +#define __ASM_PPC_IRQ_H__ + +#include <xen/lib.h> +#include <xen/device_tree.h> +#include <public/device_tree_defs.h> + +/* TODO */ +#define nr_irqs 0U +#define nr_static_irqs 0 +#define arch_hwdom_irqs (domid) 0U + +#define domain_pirq_to_irq (d, pirq) (pirq) + +struct arch_pirq { +}; + +struct arch_irq_desc { +unsigned int type; +}; + +static inline void arch_move_irqs (struct vcpu *v) +{ +BUG_ON ("unimplemented" ); +} + +static inline int platform_get_irq (const struct dt_device_node *device,int index) +{ +BUG_ON ("unimplemented" ); +} + +#endif /* __ASM_PPC_IRQ_H__ */
xen/arch/ppc/include/asm/mem_access.h new file +5 -0
@@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_PPC_MEM_ACCESS_H__ +#define __ASM_PPC_MEM_ACCESS_H__ + +#endif /* __ASM_PPC_MEM_ACCESS_H__ */
xen/arch/ppc/include/asm/mm.h +242 -1
258 lines not on this page · raw message
xen/arch/ppc/include/asm/monitor.h new file +43 -0
43 lines not on this page · raw message
xen/arch/ppc/include/asm/nospec.h new file +15 -0
@@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* From arch/arm/include/asm/nospec.h. */ +#ifndef __ASM_PPC_NOSPEC_H__ +#define __ASM_PPC_NOSPEC_H__ + +static inline bool evaluate_nospec (bool condition) +{ +return condition; +} + +static inline void block_speculation (void ) +{ +} + +#endif /* __ASM_PPC_NOSPEC_H__ */
xen/arch/ppc/include/asm/numa.h new file +26 -0
@@ -0,0 +1,26 @@ +#ifndef __ASM_PPC_NUMA_H__ +#define __ASM_PPC_NUMA_H__ + +#include <xen/types.h> +#include <xen/mm.h> + +typedef uint8_t nodeid_t ; + +/* Fake one node for now. See also node_online_map. */ +#define cpu_to_node (cpu) 0 +#define node_to_cpumask (node) (cpu_online_map) + +/* +* TODO: make first_valid_mfn static when NUMA is supported on PPC, this +* is required because the dummy helpers are using it. +*/ +extern mfn_t first_valid_mfn; + +/* XXX: implement NUMA support */ +#define node_spanned_pages (nid) (max_page - mfn_x(first_valid_mfn)) +#define node_start_pfn (nid) (mfn_x(first_valid_mfn)) +#define __node_distance (a, b) (20) + +#define arch_want_default_dmazone () (false) + +#endif /* __ASM_PPC_NUMA_H__ */
xen/arch/ppc/include/asm/p2m.h new file +95 -0
95 lines not on this page · raw message
xen/arch/ppc/include/asm/page.h +18 -0
@@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ #ifndef _ASM_PPC_PAGE_H#define _ASM_PPC_PAGE_H
@@ -36,6 +37,9 @@#define PTE_XEN_RO (PTE_XEN_BASE | PTE_EAA_READ)#define PTE_XEN_RX (PTE_XEN_BASE | PTE_EAA_READ | PTE_EAA_EXECUTE) +/* TODO */ +#define PAGE_HYPERVISOR 0 +/* * Radix Tree layout for 64KB pages: *
@@ -178,4 +182,18 @@ struct prtb_entry {void tlbie_all (void ); +static inline void invalidate_icache (void ) +{ +BUG_ON ("unimplemented" ); +} + +#define clear_page (page) memset(page, 0, PAGE_SIZE) +#define copy_page (dp, sp) memcpy(dp, sp, PAGE_SIZE) + +/* TODO: Flush the dcache for an entire page. */ +static inline void flush_page_to_ram (unsigned long mfn,bool sync_icache) +{ +BUG_ON ("unimplemented" ); +} +#endif /* _ASM_PPC_PAGE_H */
xen/arch/ppc/include/asm/paging.h new file +7 -0
@@ -0,0 +1,7 @@ +#ifndef __ASM_PPC_PAGING_H__ +#define __ASM_PPC_PAGING_H__ + +#define paging_mode_translate (d) (1) +#define paging_mode_external (d) (1) + +#endif /* __ASM_PPC_PAGING_H__ */
xen/arch/ppc/include/asm/pci.h new file +7 -0
@@ -0,0 +1,7 @@ +#ifndef __ASM_PPC_PCI_H__ +#define __ASM_PPC_PCI_H__ + +struct arch_pci_dev { +}; + +#endif /* __ASM_PPC_PCI_H__ */
xen/arch/ppc/include/asm/percpu.h new file +24 -0
@@ -0,0 +1,24 @@ +#ifndef __PPC_PERCPU_H__ +#define __PPC_PERCPU_H__ + +#ifndef __ASSEMBLY__ + +extern char __per_cpu_start[], __per_cpu_data_end[]; +extern unsigned long __per_cpu_offset[NR_CPUS ]; +void percpu_init_areas (void ); + +#define smp_processor_id () 0/* TODO: Fix this */ + +#define per_cpu (var, cpu) \ + (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) +#define this_cpu (var) \ + (*RELOC_HIDE(&per_cpu__##var, smp_processor_id())) + +#define per_cpu_ptr (var, cpu) \ + (*RELOC_HIDE(var, __per_cpu_offset[cpu])) +#define this_cpu_ptr (var) \ + (*RELOC_HIDE(var, smp_processor_id())) + +#endif + +#endif /* __PPC_PERCPU_H__ */
xen/arch/ppc/include/asm/processor.h +10 -0
@@ -110,6 +110,10 @@/* Macro to adjust thread priority for hardware multithreading */ #define HMT_very_low () asm volatile ( "or %r31, %r31, %r31" ) +/* TODO: This isn't correct */ +#define cpu_to_core (cpu) (0) +#define cpu_to_socket (cpu) (0) +/* * User-accessible registers: most of these need to be saved/restored * for every nested Xen invocation.
@@ -178,6 +182,12 @@ static inline void noreturn die(void)HMT_very_low (); } +/* +* Implemented on pre-POWER10 by setting HMT to low then to medium using +* the special OR forms. See HMT_very_low above. +*/ +#define cpu_relax () asm volatile ( "or %r1, %r1, %r1; or %r2, %r2, %r2" ) +#endif /* __ASSEMBLY__ */ #endif /* _ASM_PPC_PROCESSOR_H */
xen/arch/ppc/include/asm/random.h new file +9 -0
@@ -0,0 +1,9 @@ +#ifndef __ASM_PPC_RANDOM_H__ +#define __ASM_PPC_RANDOM_H__ + +static inline unsigned int arch_get_random (void ) +{ +return 0 ; +} + +#endif /* __ASM_PPC_RANDOM_H__ */
xen/arch/ppc/include/asm/setup.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef __ASM_PPC_SETUP_H__ +#define __ASM_PPC_SETUP_H__ + +#define max_init_domid (0) + +#endif /* __ASM_PPC_SETUP_H__ */
xen/arch/ppc/include/asm/smp.h new file +18 -0
@@ -0,0 +1,18 @@ +#ifndef __ASM_SMP_H +#define __ASM_SMP_H + +#include <xen/cpumask.h> +#include <xen/percpu.h> + +DECLARE_PER_CPU (cpumask_var_t, cpu_sibling_mask); +DECLARE_PER_CPU (cpumask_var_t, cpu_core_mask); + +#define cpu_is_offline (cpu) unlikely(!cpu_online(cpu)) + +/* +* Do we, for platform reasons, need to actually keep CPUs online when we +* would otherwise prefer them to be off? +*/ +#define park_offline_cpus false + +#endif
xen/arch/ppc/include/asm/softirq.h new file +8 -0
@@ -0,0 +1,8 @@ +#ifndef __ASM_PPC_SOFTIRQ_H__ +#define __ASM_PPC_SOFTIRQ_H__ + +#define NR_ARCH_SOFTIRQS 0 + +#define arch_skip_send_event_check (cpu) 0 + +#endif /* __ASM_PPC_SOFTIRQ_H__ */
xen/arch/ppc/include/asm/spinlock.h new file +15 -0
@@ -0,0 +1,15 @@ +#ifndef __ASM_SPINLOCK_H +#define __ASM_SPINLOCK_H + +#define arch_lock_acquire_barrier () smp_mb() +#define arch_lock_release_barrier () smp_mb() + +#define arch_lock_relax () cpu_relax() +#define arch_lock_signal () +#define arch_lock_signal_wmb () \ +({ \ + smp_wmb(); \ + arch_lock_signal(); \ +}) + +#endif /* __ASM_SPINLOCK_H */
xen/arch/ppc/include/asm/system.h +218 -1
224 lines not on this page · raw message
xen/arch/ppc/include/asm/time.h new file +23 -0
@@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_PPC_TIME_H__ +#define __ASM_PPC_TIME_H__ + +#include <xen/lib.h> +#include <asm/processor.h> +#include <asm/regs.h> + +struct vcpu ; + +/* TODO: implement */ +static inline void force_update_vcpu_system_time (struct vcpu *v) { +BUG_ON ("unimplemented" ); +} + +typedef unsigned long cycles_t ; + +static inline cycles_t get_cycles (void ) +{ +return mfspr (SPRN_TBRL ); +} + +#endif /* __ASM_PPC_TIME_H__ */
xen/arch/ppc/include/asm/xenoprof.h new file +0 -0
xen/arch/ppc/mm-radix.c +1 -1
@@ -1,13 +1,13 @@/* SPDX-License-Identifier: GPL-2.0-or-later */ #include <xen/init.h> #include <xen/kernel.h> +#include <xen/mm.h> #include <xen/types.h> #include <xen/lib.h> #include <asm/bitops.h> #include <asm/byteorder.h> #include <asm/early_printk.h> -#include <asm/mm.h> #include <asm/page.h> #include <asm/processor.h> #include <asm/regs.h>
xen/arch/ppc/tlb-radix.c +1 -1
@@ -5,9 +5,9 @@* * Copyright 2015-2016, Aneesh Kumar K.V, IBM Corporation. */ +#include <xen/bitops.h> #include <xen/stringify.h> -#include <asm/bitops.h> #include <asm/msr.h> #include <asm/processor.h>
xen/include/public/hvm/save.h +2 -0
@@ -89,6 +89,8 @@ DECLARE_HVM_SAVE_TYPE(END, 0, struct hvm_save_end);#include "../arch-x86/hvm/save.h" #elif defined(__arm__) || defined(__aarch64__)#include "../arch-arm/hvm/save.h" +#elif defined(__powerpc64__) +#include "../arch-ppc.h" #else #error "unsupported architecture"#endif
xen/include/public/pmu.h +2 -0
@@ -11,6 +11,8 @@#include "arch-x86/pmu.h" #elif defined (__arm__) || defined (__aarch64__)#include "arch-arm.h" +#elif defined (__powerpc64__) +#include "arch-ppc.h" #else #error "Unsupported architecture"#endif
xen/include/public/xen.h +2 -0
@@ -16,6 +16,8 @@#include "arch-x86/xen.h" #elif defined(__arm__) || defined (__aarch64__)#include "arch-arm.h" +#elif defined(__powerpc64__) +#include "arch-ppc.h" #else #error "Unsupported architecture"#endif
--
2.30.2
v6 cover ppc: Enable full Xen build
Hello all,
This patch series performs all of the additions necessary to drop the build overrides for PPC and enable the full Xen build. Except in cases where compatibile implementations already exist (e.g. bitops.h), the newly added definitions are simple, unimplemented stubs that just call BUG_ON("unimplemented").
Thanks,
Shawn
Shawn Anastasio (4):
xen/ppc: Implement bitops.h
xen/ppc: Define minimal stub headers required for full build xen/ppc: Add stub function and symbol definitions xen/ppc: Enable full Xen build
xen/arch/ppc/Kconfig | 1 + xen/arch/ppc/Makefile | 17 +- xen/arch/ppc/arch.mk | 3 - xen/arch/ppc/include/asm/Makefile | 2 + xen/arch/ppc/include/asm/altp2m.h | 25 ++ xen/arch/ppc/include/asm/bitops.h | 332 +++++++++++++++++++++- xen/arch/ppc/include/asm/bug.h | 9 + xen/arch/ppc/include/asm/cache.h | 2 + xen/arch/ppc/include/asm/config.h | 10 + xen/arch/ppc/include/asm/cpufeature.h | 10 + xen/arch/ppc/include/asm/current.h | 43 +++ xen/arch/ppc/include/asm/delay.h | 12 + xen/arch/ppc/include/asm/device.h | 53 ++++ xen/arch/ppc/include/asm/div64.h | 14 + xen/arch/ppc/include/asm/domain.h | 47 ++++ xen/arch/ppc/include/asm/event.h | 36 +++ xen/arch/ppc/include/asm/flushtlb.h | 24 ++ xen/arch/ppc/include/asm/grant_table.h | 5 + xen/arch/ppc/include/asm/guest_access.h | 68 +++++ xen/arch/ppc/include/asm/guest_atomics.h | 23 ++ xen/arch/ppc/include/asm/hardirq.h | 19 ++ xen/arch/ppc/include/asm/hypercall.h | 5 + xen/arch/ppc/include/asm/io.h | 16 ++ xen/arch/ppc/include/asm/iocap.h | 8 + xen/arch/ppc/include/asm/iommu.h | 8 + xen/arch/ppc/include/asm/irq.h | 33 +++ xen/arch/ppc/include/asm/mem_access.h | 5 + xen/arch/ppc/include/asm/mm.h | 243 +++++++++++++++- xen/arch/ppc/include/asm/monitor.h | 43 +++ xen/arch/ppc/include/asm/nospec.h | 15 + xen/arch/ppc/include/asm/numa.h | 26 ++ xen/arch/ppc/include/asm/p2m.h | 95 +++++++ xen/arch/ppc/include/asm/page.h | 18 ++ xen/arch/ppc/include/asm/paging.h | 7 + xen/arch/ppc/include/asm/pci.h | 7 + xen/arch/ppc/include/asm/percpu.h | 24 ++ xen/arch/ppc/include/asm/processor.h | 10 + xen/arch/ppc/include/asm/random.h | 9 + xen/arch/ppc/include/asm/setup.h | 6 + xen/arch/ppc/include/asm/smp.h | 18 ++ xen/arch/ppc/include/asm/softirq.h | 8 + xen/arch/ppc/include/asm/spinlock.h | 15 + xen/arch/ppc/include/asm/system.h | 219 ++++++++++++++- xen/arch/ppc/include/asm/time.h | 23 ++ xen/arch/ppc/include/asm/xenoprof.h | 0 xen/arch/ppc/mm-radix.c | 44 ++- xen/arch/ppc/setup.c | 8 + xen/arch/ppc/stubs.c | 339 +++++++++++++++++++++++ xen/arch/ppc/tlb-radix.c | 2 +- xen/include/public/hvm/save.h | 2 + xen/include/public/pmu.h | 2 + xen/include/public/xen.h | 2 + 52 files changed, 2004 insertions(+), 11 deletions(-) create mode 100644 xen/arch/ppc/include/asm/Makefile create mode 100644 xen/arch/ppc/include/asm/altp2m.h create mode 100644 xen/arch/ppc/include/asm/cpufeature.h create mode 100644 xen/arch/ppc/include/asm/current.h create mode 100644 xen/arch/ppc/include/asm/delay.h create mode 100644 xen/arch/ppc/include/asm/device.h create mode 100644 xen/arch/ppc/include/asm/div64.h create mode 100644 xen/arch/ppc/include/asm/domain.h create mode 100644 xen/arch/ppc/include/asm/event.h create mode 100644 xen/arch/ppc/include/asm/flushtlb.h create mode 100644 xen/arch/ppc/include/asm/grant_table.h create mode 100644 xen/arch/ppc/include/asm/guest_access.h create mode 100644 xen/arch/ppc/include/asm/guest_atomics.h create mode 100644 xen/arch/ppc/include/asm/hardirq.h create mode 100644 xen/arch/ppc/include/asm/hypercall.h create mode 100644 xen/arch/ppc/include/asm/io.h create mode 100644 xen/arch/ppc/include/asm/iocap.h create mode 100644 xen/arch/ppc/include/asm/iommu.h create mode 100644 xen/arch/ppc/include/asm/irq.h create mode 100644 xen/arch/ppc/include/asm/mem_access.h create mode 100644 xen/arch/ppc/include/asm/monitor.h create mode 100644 xen/arch/ppc/include/asm/nospec.h create mode 100644 xen/arch/ppc/include/asm/numa.h create mode 100644 xen/arch/ppc/include/asm/p2m.h create mode 100644 xen/arch/ppc/include/asm/paging.h create mode 100644 xen/arch/ppc/include/asm/pci.h create mode 100644 xen/arch/ppc/include/asm/percpu.h create mode 100644 xen/arch/ppc/include/asm/random.h create mode 100644 xen/arch/ppc/include/asm/setup.h create mode 100644 xen/arch/ppc/include/asm/smp.h create mode 100644 xen/arch/ppc/include/asm/softirq.h create mode 100644 xen/arch/ppc/include/asm/spinlock.h create mode 100644 xen/arch/ppc/include/asm/time.h create mode 100644 xen/arch/ppc/include/asm/xenoprof.h create mode 100644 xen/arch/ppc/stubs.c
--
2.30.2
Re: [PATCH v6 1/4] xen/ppc: Implement bitops.h
In reply to Shawn AnastasioQuoted 11 lines · Shawn Anastasio
Implement
bitops.h, based on Linux's implementation as of commit5321d1b1afb9a17302c6cec79f0cbf823eb0d3fc. Though it is based off of Linux's implementation, this code diverges significantly in a number of ways:
- Bitmap entries changed to 32-bit words to match X86 and Arm on Xen
- PPC32-specific code paths dropped
- Formatting completely re-done to more closely line up with Xen. Including 4 space indentation.
- Use GCC's __builtin_popcount* for hweight* implementationSigned-off-by Shawn Anastasio <[email protected]>
Quoted 3 lines · Shawn Anastasio
Shawn Anastasio (4):
xen/ppc: Implementbitops.h
xen/ppc: Define minimal stub headers required for full build
Compilation fails after applying this.
Quoted 1 line
xen/ppc: Add stub function and symbol definitions
Continuing nevertheless, linking fails after this.
Quoted 1 line
xen/ppc: Enable full Xen build
Things build okay for me when the full series is applied. Generally we wouldn't deliberately break the build between any two patches; doing so may be okay here (except I guest CI's build-each-commit would be upset), but I'll do so only upon explicit request (and with no-one else objecting).
Jan
Quoted 9 lines · Jan Beulich
Quoted 3 lines · Shawn Anastasio
Shawn Anastasio (4):
xen/ppc: Implementbitops.h
xen/ppc: Define minimal stub headers required for full buildCompilation fails after applying this.
Quoted 1 line
xen/ppc: Add stub function and symbol definitions
Quoted 9 lines
Continuing nevertheless, linking fails after this.
Quoted 1 line
xen/ppc: Enable full Xen build
Things build okay for me when the full series is applied. Generally we wouldn't deliberately break the build between any two patches; doing so may be okay here (except I guest CI's build-each-commit would be upset), but I'll do so only upon explicit request (and with no-one else objecting).
Sorry about that. Going forward I'll take more care to ensure that partially-applied series still build correctly. For this series though, if you could make an exception it would be appreciated.
Quoted 1 line
Jan
Thanks,
Shawn
Quoted 21 lines · Shawn Anastasio
Quoted 9 lines · Jan Beulich
Quoted 3 lines · Shawn Anastasio
Shawn Anastasio (4):
xen/ppc: Implementbitops.h
xen/ppc: Define minimal stub headers required for full buildCompilation fails after applying this.
Quoted 1 line
xen/ppc: Add stub function and symbol definitions
Quoted 9 lines
Continuing nevertheless, linking fails after this.
Quoted 1 line
xen/ppc: Enable full Xen build
Things build okay for me when the full series is applied. Generally we wouldn't deliberately break the build between any two patches; doing so may be okay here (except I guest CI's build-each-commit would be upset), but I'll do so only upon explicit request (and with no-one else objecting).
Quoted 3 lines
Sorry about that. Going forward I'll take more care to ensure that partially-applied series still build correctly. For this series though, if you could make an exception it would be appreciated.
What would be the reason for the exception?
We don't want to follow the rules just for the rules' sake, but the rule is there for a reason: primarily to keep bisection working. Not sure of osstest is testing the PPC build yet, but if it were, then this sort of thing would make it more difficult for the automatic bisector to find regressions in other parts of the code. Having non-building patches can also confuse "archaeologists" -- people a few years hence who are trying to understand what the code does.
Is there a reason that this series would be particularly difficult to reorganize in a way that would keep it building? (Haven't looked at it in detail.)
-George
Quoted 38 lines · George Dunlap
Quoted 21 lines · Shawn Anastasio
Quoted 9 lines · Jan Beulich
Quoted 3 lines · Shawn Anastasio
Shawn Anastasio (4):
xen/ppc: Implementbitops.h
xen/ppc: Define minimal stub headers required for full buildCompilation fails after applying this.
Quoted 1 line
xen/ppc: Add stub function and symbol definitions
Quoted 9 lines
Continuing nevertheless, linking fails after this.
Quoted 1 line
xen/ppc: Enable full Xen build
Things build okay for me when the full series is applied. Generally we wouldn't deliberately break the build between any two patches; doing so may be okay here (except I guest CI's build-each-commit would be upset), but I'll do so only upon explicit request (and with no-one else objecting).
Quoted 3 lines
Sorry about that. Going forward I'll take more care to ensure that partially-applied series still build correctly. For this series though, if you could make an exception it would be appreciated.
What would be the reason for the exception?
We don't want to follow the rules just for the rules' sake, but the rule is there for a reason: primarily to keep bisection working. Not sure of osstest is testing the PPC build yet, but if it were, then this sort of thing would make it more difficult for the automatic bisector to find regressions in other parts of the code. Having non-building patches can also confuse "archaeologists" -- people a few years hence who are trying to understand what the code does.
Quoted 3 lines
Is there a reason that this series would be particularly difficult to reorganize in a way that would keep it building? (Haven't looked at it in detail.)
Sorry, didn't notice that Jan had said it "might be okay here". Jan, don't count this as an objection.
-George
Quoted 39 lines · George Dunlap
Quoted 38 lines · George Dunlap
Quoted 21 lines · Shawn Anastasio
Quoted 9 lines · Jan Beulich
Quoted 3 lines · Shawn Anastasio
Shawn Anastasio (4):
xen/ppc: Implementbitops.h
xen/ppc: Define minimal stub headers required for full buildCompilation fails after applying this.
Quoted 1 line
xen/ppc: Add stub function and symbol definitions
Quoted 9 lines
Continuing nevertheless, linking fails after this.
Quoted 1 line
xen/ppc: Enable full Xen build
Things build okay for me when the full series is applied. Generally we wouldn't deliberately break the build between any two patches; doing so may be okay here (except I guest CI's build-each-commit would be upset), but I'll do so only upon explicit request (and with no-one else objecting).
Quoted 3 lines
Sorry about that. Going forward I'll take more care to ensure that partially-applied series still build correctly. For this series though, if you could make an exception it would be appreciated.
What would be the reason for the exception?
We don't want to follow the rules just for the rules' sake, but the rule is there for a reason: primarily to keep bisection working. Not sure of osstest is testing the PPC build yet, but if it were, then this sort of thing would make it more difficult for the automatic bisector to find regressions in other parts of the code. Having non-building patches can also confuse "archaeologists" -- people a few years hence who are trying to understand what the code does.
Quoted 6 lines
Quoted 3 lines
Is there a reason that this series would be particularly difficult to reorganize in a way that would keep it building? (Haven't looked at it in detail.)
Sorry, didn't notice that Jan had said it "might be okay here". Jan, don't count this as an objection.
Just to mention it (besides the fact that I did the commits already before your reply) - at this stage I'm not sure bisection of PPC alone is particularly important, yet. Hence why I said "might be okay".
Jan