From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: [kvm-unit-tests PATCH v4 09/17] powerpc/ppc64: ppc-ify makefiles and linker script Date: Wed, 17 Feb 2016 12:45:08 +1100 Message-ID: <20160217014507.GB5239@voom.redhat.com> References: <1455544166-19766-1-git-send-email-drjones@redhat.com> <1455544166-19766-10-git-send-email-drjones@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="p4qYPpj5QlsIQJ0K" Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, thuth@redhat.com, dgibson@redhat.com, agraf@suse.de, lvivier@redhat.com, pbonzini@redhat.com To: Andrew Jones Return-path: Received: from ozlabs.org ([103.22.144.67]:44715 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756583AbcBQGuW (ORCPT ); Wed, 17 Feb 2016 01:50:22 -0500 Content-Disposition: inline In-Reply-To: <1455544166-19766-10-git-send-email-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: --p4qYPpj5QlsIQJ0K Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 15, 2016 at 02:49:18PM +0100, Andrew Jones wrote: > Signed-off-by: Andrew Jones > Reviewed-by: Thomas Huth > Tested-by: Laurent Vivier > --- > powerpc/Makefile.common | 40 ++++++++++------------------------------ > powerpc/Makefile.ppc64 | 15 +++++++-------- > powerpc/flat.lds | 14 ++++++++++---- > 3 files changed, 27 insertions(+), 42 deletions(-) >=20 > diff --git a/powerpc/Makefile.common b/powerpc/Makefile.common > index dd3a0ca327d06..13b828ab171d6 100644 > --- a/powerpc/Makefile.common > +++ b/powerpc/Makefile.common > @@ -1,17 +1,15 @@ > # > -# arm common makefile > +# powerpc common makefile > # > # Authors: Andrew Jones > # > =20 > ifeq ($(LOADADDR),) > - # qemu mach-virt default load address > - LOADADDR =3D 0x40000000 > + LOADADDR =3D 0x0 I was trying to check what LOADADDR means, to see if this was correct, but it appears it isn't actually being used yet. Otherwise, Reviewed-by: David Gibson > endif > =20 > tests-common =3D \ > - $(TEST_DIR)/selftest.flat \ > - $(TEST_DIR)/spinlock-test.flat > + $(TEST_DIR)/selftest.elf > =20 > all: test_cases > =20 > @@ -30,38 +28,21 @@ include scripts/asm-offsets.mak > cflatobjs +=3D lib/util.o > cflatobjs +=3D lib/alloc.o > cflatobjs +=3D lib/devicetree.o > -cflatobjs +=3D lib/virtio.o > -cflatobjs +=3D lib/virtio-mmio.o > -cflatobjs +=3D lib/chr-testdev.o > -cflatobjs +=3D lib/arm/io.o > -cflatobjs +=3D lib/arm/setup.o > -cflatobjs +=3D lib/arm/mmu.o > -cflatobjs +=3D lib/arm/bitops.o > -cflatobjs +=3D lib/arm/psci.o > -cflatobjs +=3D lib/arm/smp.o > - > -libeabi =3D lib/arm/libeabi.a > -eabiobjs =3D lib/arm/eabi_compat.o > +cflatobjs +=3D lib/powerpc/io.o > =20 > libgcc :=3D $(shell $(CC) $(machine) --print-libgcc-file-name) > start_addr :=3D $(shell printf "%x\n" $$(( $(phys_base) + $(kernel_offse= t) ))) > =20 > -FLATLIBS =3D $(libcflat) $(LIBFDT_archive) $(libgcc) $(libeabi) > +FLATLIBS =3D $(libcflat) $(LIBFDT_archive) $(libgcc) > %.elf: LDFLAGS =3D $(CFLAGS) -nostdlib > -%.elf: %.o $(FLATLIBS) arm/flat.lds > +%.elf: %.o $(FLATLIBS) powerpc/flat.lds > $(CC) $(LDFLAGS) -o $@ \ > - -Wl,-T,arm/flat.lds,--build-id=3Dnone,-Ttext=3D$(start_addr) \ > + -Wl,-T,powerpc/flat.lds,--build-id=3Dnone,-Ttext=3D$(start_addr) \ > $(filter %.o, $^) $(FLATLIBS) > =20 > -%.flat: %.elf > - $(OBJCOPY) -O binary $^ $@ > - > -$(libeabi): $(eabiobjs) > - $(AR) rcs $@ $^ > - > -arm_clean: libfdt_clean asm_offsets_clean > - $(RM) $(TEST_DIR)/*.{o,flat,elf} $(libeabi) $(eabiobjs) \ > - $(TEST_DIR)/.*.d lib/arm/.*.d > +powerpc_clean: libfdt_clean asm_offsets_clean > + $(RM) $(TEST_DIR)/*.{o,elf} \ > + $(TEST_DIR)/.*.d lib/powerpc/.*.d > =20 > ################################################################## > =20 > @@ -70,4 +51,3 @@ generated_files =3D $(asm-offsets) > test_cases: $(generated_files) $(tests-common) $(tests) > =20 > $(TEST_DIR)/selftest.elf: $(cstart.o) $(TEST_DIR)/selftest.o > -$(TEST_DIR)/spinlock-test.elf: $(cstart.o) $(TEST_DIR)/spinlock-test.o > diff --git a/powerpc/Makefile.ppc64 b/powerpc/Makefile.ppc64 > index 0b0761c729c7c..95bf6772d65ed 100644 > --- a/powerpc/Makefile.ppc64 > +++ b/powerpc/Makefile.ppc64 > @@ -1,20 +1,19 @@ > # > -# arm64 makefile > +# ppc64 makefile > # > # Authors: Andrew Jones > # > bits =3D 64 > -ldarch =3D elf64-littleaarch64 > -kernel_offset =3D 0x80000 > +ldarch =3D elf64-powerpc > +kernel_offset =3D 0x0 > =20 > cstart.o =3D $(TEST_DIR)/cstart64.o > -cflatobjs +=3D lib/arm64/processor.o > -cflatobjs +=3D lib/arm64/spinlock.o > +cflatobjs +=3D lib/ppc64/spinlock.o > =20 > -# arm64 specific tests > +# ppc64 specific tests > tests =3D > =20 > include $(TEST_DIR)/Makefile.common > =20 > -arch_clean: arm_clean > - $(RM) lib/arm64/.*.d > +arch_clean: powerpc_clean > + $(RM) lib/ppc64/.*.d > diff --git a/powerpc/flat.lds b/powerpc/flat.lds > index efdf5d7109ffb..84087057c0ce2 100644 > --- a/powerpc/flat.lds > +++ b/powerpc/flat.lds > @@ -4,6 +4,8 @@ SECTIONS > .text : { *(.init) *(.text) *(.text.*) } > . =3D ALIGN(64K); > etext =3D .; > + .opd : { *(.opd) } > + . =3D ALIGN(16); > .data : { > *(.data) > } > @@ -11,16 +13,20 @@ SECTIONS > .rodata : { *(.rodata) } > . =3D ALIGN(16); > .bss : { *(.bss) } > + . =3D ALIGN(256); > + /* > + * tocptr is tocbase + 32K, allowing toc offsets to be +-32K > + */ > + tocptr =3D . + 32K; > + .got : { *(.toc) *(.got) } > . =3D ALIGN(64K); > edata =3D .; > . +=3D 64K; > . =3D ALIGN(64K); > /* > - * stack depth is 16K for arm and PAGE_SIZE for arm64, see THREAD_SI= ZE > - * sp must be 16 byte aligned for arm64, and 8 byte aligned for arm > - * sp must always be strictly less than the true stacktop > + * stackptr set with initial stack frame (64 bytes) preallocated > */ > - stackptr =3D . - 16; > + stackptr =3D . - 64; > stacktop =3D .; > } > =20 --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --p4qYPpj5QlsIQJ0K Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWw9CjAAoJEGw4ysog2bOSzZQP+wZj4jWO3ZrdptWuI/cEDBql v1Z2mF8ddBYUU0LDTrLWT+jL/h1iC27ZtaP4PiVIy3sqxQjLTfqo9n3ktwyEJdn+ qsvPew/Ijy4o9hNNzVKt5SuUz3K+EyBE6lTronLa19jBRuqS/Aux6zxcwlsH/QrX t6zSmfNCe6z8N2UAUKWUXx2mbXb6IBLUCHHocK8GaJ8r55xXKAVRX2C13kePHHct 4tKT2elt+v3159JERE1EWDeRLZGJ7L+0f3EqKbzeyH2EmtlVn9Fyktpoy+k5+TQ7 AlZVPKcRJxEVewgjl2rlaVNBqi6FeAx4Np7ATACO1iU0ulPc4VQg6+G4GP5W6m2+ ESoPp8XKyuv8sp7r9KEyBpirbwD4nHDfpMQ8gZMaoeXYSNegA1e3SPTDbLA9Xw0r Zz/MepZ7qMcVq2tPERYhV2u6lthMa54ZZXJlD1vp5e+5w5cmqfW1KoGsR9WJ525x SeeDVlH7Yw6BL/hqFqh5lPKHIt6d5gEC7RwHw+SLnpQ/Y7F5zD4Yl81sA1NnyQvt JpdvnFzxZ9xbZFozzgg8Y+BQr3GBp/R+IyZ+dpCb+9e+ikK8i8uRENYmBwg3cK3+ /YTVyZgF9+hO69SO5C4TE09ajyHrJRfwdLEXHvq1JGsH3iUArH9JeGWRk6TqYLBG pbkSPuBtKh1OHordkx/O =+3JR -----END PGP SIGNATURE----- --p4qYPpj5QlsIQJ0K--