Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ARM64 for gvisor #63

Open
kevin-zhaoshuai opened this issue May 30, 2018 · 9 comments
Open

Support ARM64 for gvisor #63

kevin-zhaoshuai opened this issue May 30, 2018 · 9 comments

Comments

@kevin-zhaoshuai
Copy link

@kevin-zhaoshuai kevin-zhaoshuai commented May 30, 2018

Currently just support amd64, could we support for ARM64?
What do we need to do for this support? I can help to work on it.

@prattmic

This comment has been minimized.

Copy link
Member

@prattmic prattmic commented May 30, 2018

We don't have any immediate plans to port to additional architectures. It is certainly feasible (as shown below), but certainly requires a lot of work and is something we want to do very carefully to avoid adding unnecessary complexity and technical debt.

Porting to a new architecture requires several steps:

  1. Porting/creating a platform compatible with the arch. The ptrace platform would be fairly simple to port. The kvm platform would be much more complex.
  2. Porting AMD64-specific assembly/host syscalls. There are several AMD64 assembly files (mostly with names _amd64.s) that obviously need ports. There may also be places where we make direct syscalls with syscall.Syscall where the syscall semantics are slightly different on a new arch.
  3. Adding a new syscall table.
  4. Adding support for the new arch throughout sentry internal system call, signal, etc handling. A lot of this is in the arch package, though that package is in need of refactoring. There are also several kernel structures that differ between arches (struct pt_regs is an obvious example). Many of these are in abi/linux, but others we still use directly from the syscall package (they should be moved to abi/linux). This is the hardest part, as there are still many unanswered questions around how to do all of this cleanly.
@kevin-zhaoshuai

This comment has been minimized.

Copy link
Author

@kevin-zhaoshuai kevin-zhaoshuai commented May 31, 2018

@prattmic Really Thanks for clarifying.
In that case I think it is not a very easy work, I will talk with my workmate inside arm to discuss the development work.

@lubinsz

This comment has been minimized.

Copy link

@lubinsz lubinsz commented Oct 10, 2018

@prattmic We have enabled ptrace platform on Arm64 platform. Later, we will deliver the patches.
Please see following as reference:

root@entos1:/go/src/github.com/google/gvisor# uname -p
aarch64
root@entos1:/go/src/github.com/google/gvisor# docker run --runtime=runsc hello-world
W1010 17:46:16.510561 30359 x:0] Could not parse /proc/cpuinfo, it is empty or does not contain cpu MHz
W1010 17:46:16.537007 30370 x:0] Could not parse /proc/cpuinfo, it is empty or does not contain cpu MHz
W1010 17:46:16.556919 30370 x:0] Could not parse /proc/cpuinfo, it is empty or does not contain cpu MHz

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:

  1. The Docker client contacted the Docker daemon.
  2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (arm64v8)
  3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
  4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/

@prattmic

This comment has been minimized.

Copy link
Member

@prattmic prattmic commented Oct 10, 2018

Wow, that's great! I didn't realize anyone was working on this. I look forward to seeing the changes.

@amscanne

This comment has been minimized.

Copy link
Collaborator

@amscanne amscanne commented Oct 10, 2018

Amazing! Is there a public branch somewhere on github? We'd love to help the patches land, and it might be useful to have some early high-level guidance.

@everflux

This comment has been minimized.

Copy link

@everflux everflux commented Feb 21, 2019

Any chance to try this out already?

gvisor-bot added a commit that referenced this issue Jul 18, 2019
syscall.POLL is not supported on arm64, using syscall.PPOLL
to support both the x86 and arm64. refs #63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I2c81a063d3ec4e7e6b38fe62f17a0924977f505e
FUTURE_COPYBARA_INTEGRATE_REVIEW=#543 from xiaobo55x:master ba59826
PiperOrigin-RevId: 258865332
gvisor-bot added a commit that referenced this issue Jul 18, 2019
syscall.POLL is not supported on arm64, using syscall.PPOLL
to support both the x86 and arm64. refs #63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I2c81a063d3ec4e7e6b38fe62f17a0924977f505e
FUTURE_COPYBARA_INTEGRATE_REVIEW=#543 from xiaobo55x:master ba59826
PiperOrigin-RevId: 258865332
gvisor-bot added a commit that referenced this issue Jul 19, 2019
syscall.POLL is not supported on arm64, using syscall.PPOLL
to support both the x86 and arm64. refs #63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I2c81a063d3ec4e7e6b38fe62f17a0924977f505e
FUTURE_COPYBARA_INTEGRATE_REVIEW=#543 from xiaobo55x:master ba59826
PiperOrigin-RevId: 258865332
gvisor-bot added a commit that referenced this issue Jul 19, 2019
syscall.POLL is not supported on arm64, using syscall.PPOLL
to support both the x86 and arm64. refs #63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I2c81a063d3ec4e7e6b38fe62f17a0924977f505e
FUTURE_COPYBARA_INTEGRATE_REVIEW=#543 from xiaobo55x:master ba59826
PiperOrigin-RevId: 258865332
gvisor-bot added a commit that referenced this issue Jul 19, 2019
syscall.POLL is not supported on arm64, using syscall.PPOLL
to support both the x86 and arm64. refs #63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I2c81a063d3ec4e7e6b38fe62f17a0924977f505e
FUTURE_COPYBARA_INTEGRATE_REVIEW=#543 from xiaobo55x:master ba59826
PiperOrigin-RevId: 258865332
gvisor-bot added a commit that referenced this issue Jul 19, 2019
syscall.POLL is not supported on arm64, using syscall.PPOLL
to support both the x86 and arm64. refs #63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I2c81a063d3ec4e7e6b38fe62f17a0924977f505e
FUTURE_COPYBARA_INTEGRATE_REVIEW=#543 from xiaobo55x:master ba59826
PiperOrigin-RevId: 258865332
gvisor-bot added a commit that referenced this issue Jul 27, 2019
syscall.POLL is not supported on arm64, using syscall.PPOLL
to support both the x86 and arm64. refs #63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I2c81a063d3ec4e7e6b38fe62f17a0924977f505e
FUTURE_COPYBARA_INTEGRATE_REVIEW=#543 from xiaobo55x:master ba59826
PiperOrigin-RevId: 258865332
gvisor-bot added a commit that referenced this issue Jul 30, 2019
syscall.POLL is not supported on arm64, using syscall.PPOLL
to support both the x86 and arm64. refs #63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I2c81a063d3ec4e7e6b38fe62f17a0924977f505e
FUTURE_COPYBARA_INTEGRATE_REVIEW=#543 from xiaobo55x:master ba59826
PiperOrigin-RevId: 258865332
gvisor-bot added a commit that referenced this issue Jul 30, 2019
syscall.POLL is not supported on arm64, using syscall.PPOLL
to support both the x86 and arm64. refs #63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I2c81a063d3ec4e7e6b38fe62f17a0924977f505e
FUTURE_COPYBARA_INTEGRATE_REVIEW=#543 from xiaobo55x:master ba59826
PiperOrigin-RevId: 258865332
gvisor-bot added a commit that referenced this issue Jul 30, 2019
syscall.POLL is not supported on arm64, using syscall.PPOLL
to support both the x86 and arm64. refs #63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I2c81a063d3ec4e7e6b38fe62f17a0924977f505e
COPYBARA_INTEGRATE_REVIEW=#543 from xiaobo55x:master ba59826
PiperOrigin-RevId: 260752049
xiaobo55x added a commit to xiaobo55x/gvisor that referenced this issue Aug 5, 2019
syscall.EPOLLET has been defined with different values on amd64 and
arm64(-0x80000000 on amd64, and 0x80000000 on arm64), while unix.EPOLLET
has been unified this value to 0x80000000(golang/go#5328). ref google#63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: Id97d075c4e79d86a2ea3227ffbef02d8b00ffbb8
xiaobo55x added a commit to xiaobo55x/gvisor that referenced this issue Aug 5, 2019
syscall.EPOLLET has been defined with different values on amd64 and
arm64(-0x80000000 on amd64, and 0x80000000 on arm64), while unix.EPOLLET
has been unified this value to 0x80000000(golang/go#5328). ref google#63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: Id97d075c4e79d86a2ea3227ffbef02d8b00ffbb8
xiaobo55x added a commit to xiaobo55x/gvisor that referenced this issue Aug 5, 2019
syscall.EPOLLET has been defined with different values on amd64 and
arm64(-0x80000000 on amd64, and 0x80000000 on arm64), while unix.EPOLLET
has been unified this value to 0x80000000(golang/go#5328). ref google#63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: Id97d075c4e79d86a2ea3227ffbef02d8b00ffbb8
gvisor-bot added a commit that referenced this issue Aug 6, 2019
syscall.EPOLLET has been defined with different values on amd64 and
arm64(-0x80000000 on amd64, and 0x80000000 on arm64), while unix.EPOLLET
has been unified this value to 0x80000000(golang/go#5328). ref #63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: Id97d075c4e79d86a2ea3227ffbef02d8b00ffbb8
FUTURE_COPYBARA_INTEGRATE_REVIEW=#653 from xiaobo55x:dev 83fdb77
PiperOrigin-RevId: 261977864
gvisor-bot added a commit that referenced this issue Aug 6, 2019
syscall.EPOLLET has been defined with different values on amd64 and
arm64(-0x80000000 on amd64, and 0x80000000 on arm64), while unix.EPOLLET
has been unified this value to 0x80000000(golang/go#5328). ref #63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: Id97d075c4e79d86a2ea3227ffbef02d8b00ffbb8
FUTURE_COPYBARA_INTEGRATE_REVIEW=#653 from xiaobo55x:dev 83fdb77
PiperOrigin-RevId: 261977864
gvisor-bot added a commit that referenced this issue Aug 6, 2019
syscall.EPOLLET has been defined with different values on amd64 and
arm64(-0x80000000 on amd64, and 0x80000000 on arm64), while unix.EPOLLET
has been unified this value to 0x80000000(golang/go#5328). ref #63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: Id97d075c4e79d86a2ea3227ffbef02d8b00ffbb8
FUTURE_COPYBARA_INTEGRATE_REVIEW=#653 from xiaobo55x:dev 83fdb77
PiperOrigin-RevId: 261977864
gvisor-bot added a commit that referenced this issue Aug 7, 2019
syscall.EPOLLET has been defined with different values on amd64 and
arm64(-0x80000000 on amd64, and 0x80000000 on arm64), while unix.EPOLLET
has been unified this value to 0x80000000(golang/go#5328). ref #63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: Id97d075c4e79d86a2ea3227ffbef02d8b00ffbb8
FUTURE_COPYBARA_INTEGRATE_REVIEW=#653 from xiaobo55x:dev 83fdb77
PiperOrigin-RevId: 261977864
gvisor-bot added a commit that referenced this issue Oct 14, 2019
These syscalls were changed in the amd64 file around the time the arm64 PR was
sent out, so their changes got lost.

Updates #63

PiperOrigin-RevId: 274592435
gvisor-bot added a commit that referenced this issue Oct 14, 2019
These syscalls were changed in the amd64 file around the time the arm64 PR was
sent out, so their changes got lost.

Updates #63

PiperOrigin-RevId: 274592435
gvisor-bot added a commit that referenced this issue Oct 14, 2019
These syscalls were changed in the amd64 file around the time the arm64 PR was
sent out, so their changes got lost.

Updates #63

PiperOrigin-RevId: 274592435
gvisor-bot added a commit that referenced this issue Oct 16, 2019
These syscalls were changed in the amd64 file around the time the arm64 PR was
sent out, so their changes got lost.

Updates #63

PiperOrigin-RevId: 274592435
gvisor-bot added a commit that referenced this issue Oct 16, 2019
These syscalls were changed in the amd64 file around the time the arm64 PR was
sent out, so their changes got lost.

Updates #63

PiperOrigin-RevId: 275114194
@wtfismyip

This comment has been minimized.

Copy link

@wtfismyip wtfismyip commented Feb 10, 2020

I'm willing to test this out if/when its ready.

@majek

This comment has been minimized.

Copy link
Contributor

@majek majek commented Feb 10, 2020

Ok, so I don't really care much about KVM support on arm64 at this point, but I would love to be able to test ptrace on arm64. I would appreciate if we could bring gvisor runsc cross-compile to the stage that it produces a binary, which I can run, and then complain about :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
9 participants
You can’t perform that action at this time.