Page MenuHomeFreeBSD

Bring in the start of the arm64 kernel.
ClosedPublic

Authored by andrew on Apr 1 2015, 6:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 23, 12:39 AM
Unknown Object (File)
Sat, Mar 23, 12:01 AM
Unknown Object (File)
Thu, Feb 29, 4:55 PM
Unknown Object (File)
Feb 16 2024, 5:28 AM
Unknown Object (File)
Feb 1 2024, 8:19 AM
Unknown Object (File)
Jan 26 2024, 11:58 AM
Unknown Object (File)
Jan 26 2024, 11:58 AM
Unknown Object (File)
Jan 26 2024, 11:58 AM
Subscribers

Details

Summary

This is only the minimum set of files needed to boot in qemu. As such it is
missing a few things.

The bus_dma code is currently only stub functions with a full implementation from the development tree to follow.

The gic driver has been copied as the interrupt framework is different. It is expected the two drivers will be merged by the arm intrng project, however this will need to be imported into the tree and support for arm64 would need to be added.

This includes code developed by myself, SemiHalf, Ed Maste, and Robin Randhawa from ARM. This has been funded by the FreeBSD Foundation, with early development by myself in my spare time with assistance from Robin.

Test Plan

This boots to multi-user in qemu, however the userland changes are not fully
in svn so may need to be built from git.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

andrew retitled this revision from to Bring in the arm64 kernel.
andrew updated this object.
andrew edited the test plan for this revision. (Show Details)
andrew added reviewers: ARM, emaste.

I have created a copy of the gic driver as we have a slightly different KPI. I expect arm64 will use intrng when it's ready.

sys/arm/arm/devmap.c
48 ↗(On Diff #4578)

We're using arm/arm/devmap.c on aarch64?

sys/arm/arm/generic_timer.c
104 ↗(On Diff #4578)

This set of changes (for get/set_el*) could be done separately. IT looks self contained. If you want.

sys/arm64/arm64/busdma_machdep.c
20

fun times, eh?

sys/arm64/arm64/sys_machdep.c
57

Should we return EOPNOTSUPP here?

sys/arm64/include/bus_dma.h
33

It isn't clear that this qualifies for copyright protection...

sys/arm64/include/clock.h
32

Ditto

sys/arm64/include/smp.h
32

ditto on copyright.

sys/arm64/include/trap.h
32

ditto

sys/conf/files.arm64
3–4

ah, interesting... surprised more isn't shared...

sys/conf/options.arm64
2

Why is this needed?

sys/dev/uart/uart_cpu_fdt.c
45 ↗(On Diff #4578)

Why only arm?

sys/arm64/arm64/in_cksum.c
2

This one's on the list for de-duplication

sys/arm64/arm64/sys_machdep.c
3–4

Probably a new copyright here

sys/arm64/include/bus_dma.h
33

Yeah - the x86 pass-through headers state

/*-
 * This file is in the public domain.
 */
/* $FreeBSD$ */

but I'm not even sure I'd put that message in.

For reference, commits to sys/ in the arm64-dev git branch come from:

  1 arg@semihalf.com
  1 br@bsdpad.com
  1 cognet@FreeBSD.org
  1 imp@FreeBSD.org
  5 robin.randhawa@arm.com
 10 emaste@freebsd.org
 10 tn@semihalf.com
 13 mst@semihalf.com
 63 zbb@semihalf.com
106 andrew@fubar.geek.nz
165 andrew@FreeBSD.org

Some of the Semihalf work comes in with this merge (e.g. kernel debugger changes), although I expect they will commit the bulk of their ThunderX changes themselves in mid-April.

Still, when this goes into HEAD I think we ought to put a small reference to the development process in the commit message, along with a short acknowledgement of the contributors to the changes in the commit (which will be a subset of those above). Do you have an easy way to grab that?

I'd think something like

This change includes my work from the FreeBSD SVN projects/arm64 branch
in addition to work done by myself and others in the arm64-dev branch in
the FreeBSDFoundation/freebsd Github repository.

Most of this change is my work but I would like to acknowledge the
contributions of:
...
...

which might be adjusted over time of course if we split pieces out into individual commits. You may want to reference that you did the initial work (in the SVN arm64 branch) as a volunteer, too - up to you.

sys/arm/arm/devmap.c
48 ↗(On Diff #4578)

Yes, for pmap_mapdev

sys/arm/arm/generic_timer.c
104 ↗(On Diff #4578)

Done

sys/arm64/arm64/busdma_machdep.c
20

This will come in in a future review. We don't call them in qemu so I'm holding off importing them.

sys/conf/options.arm64
2

So we can have "cpu ARM64" in GENERIC

sys/dev/uart/uart_cpu_fdt.c
45 ↗(On Diff #4578)

Nathan thinks the file shouldn't exist. It looks like it was only needed for fdtbus_bs_tag. It also exists on mips, so I'll change it to !aarch64.

andrew edited edge metadata.

Various updates based on review, and things I've found.

Fix the uart driver, check we will return from signals with the correct cpsr state

  • Probably commit sys/arm/arm/devmap.c separately
sys/arm64/arm64/autoconf.c
3–7

does this apply still?

60–69

are all these headers needed?

104

EOL whitespace (here and many spots)

sys/arm64/arm64/busdma_machdep.c
19–20

mention these in the commit message, something like "implementation for stub functions are in progress on the development branch and will follow in a future merge."

sys/arm64/arm64/gic.c
2–9

also be sure to make a reference to the reason we have a (temporary) copy of gic for arm64

sys/arm64/arm64/pmap.c
3–16

What is left from other archs?

sys/arm64/arm64/stack_machdep.c
3–4

this (c) doesn't apply for the current stub implementation

sys/arm64/arm64/sys_machdep.c
3–4

old (c) doesn't apply for this new stub implementation

sys/arm64/include/atomic.h
172 ↗(On Diff #4656)

should probably commit these atomic.h changes independently, any time now

sys/arm64/include/bus_dma.h
3–4

this trivial pass-through implementation should probably not have a (c) statement

sys/arm64/include/db_machdep.h
3–5

this most likely does not apply; this is all new

sys/arm64/include/kdb.h
3–4

this does not apply for new stub implementations

sys/arm64/include/param.h
120–121 ↗(On Diff #4656)

should this change go in now too?

sys/conf/Makefile.arm64
2–6

previous (c) may not apply

24

bogus?

27–28

should @ go away?

sys/arm64/arm64/pmap.c
3–16

Quite a lot. Most of my changes are due to the differences in pagetable format, the logic is still similar.

Update based on feedback. Split out the devmap change to D2249.

andrew retitled this revision from Bring in the arm64 kernel to Bring in the start of the arm64 kernel..Apr 7 2015, 4:15 PM
andrew updated this object.

I've updated the proposed commit message, feel free to suggest changes.

In D2199#17, @andrew wrote:

I've updated the proposed commit message, feel free to suggest changes.

Proposed message looks fine, note though that Semihalf doesn't use camel case.

Seems reasonable to me to bring this to HEAD in this state. @imp any other comments? I think inadvertently copied copyright statements are now cleaned up other than perhaps Makefile.arm64.

sys/arm/arm/devmap.c
2–3 ↗(On Diff #4656)

ignore this file now, moved to other review and that confused Phabricator

sys/arm64/arm64/pmap.c
21–22

If applied to existing code should be the "Portions of" text.

sys/arm64/arm64/bcopy.c
1–3
sys/arm64/arm64/busdma_machdep.c
69

No newline

sys/arm64/arm64/dump_machdep.c
2–3

Stub implementation, should not have old (C)

sys/arm64/arm64/elf_machdep.c
2–5

new stub impl

sys/arm64/arm64/elf_machdep.c
2–5

This is from sys/sparc64/sparc64/elf_machdep.c, with the relocation code removed.

Update based on comments, etc.

Fix a duplicate license, and add myself and the FreeBSD Foundation to
elf_machdep.c, it is copied from the sparc64 version.

andrew updated this revision to Diff 4804.

Closed by commit rS281494 (authored by @andrew).