From 8dfcaa3d2828a113ae780da01f5f73ad64710e31 Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Fri, 12 Aug 2022 11:53:56 -0700 Subject: sys/fuchsia: update the guest system calls (#3286) zx_vcpu_* calls will re-appear in a new file, vcpu.txt. Co-authored-by: Chris Palmer --- sys/fuchsia/guest.txt | 16 ++++++++++++++++ sys/fuchsia/guests_amd64.const | 2 ++ sys/fuchsia/guests_arm64.const | 2 ++ sys/fuchsia/hypervisor_guests.txt | 18 ------------------ sys/fuchsia/hypervisor_guests_amd64.const | 2 -- sys/fuchsia/hypervisor_guests_arm64.const | 2 -- 6 files changed, 20 insertions(+), 22 deletions(-) create mode 100644 sys/fuchsia/guest.txt create mode 100644 sys/fuchsia/guests_amd64.const create mode 100644 sys/fuchsia/guests_arm64.const delete mode 100644 sys/fuchsia/hypervisor_guests.txt delete mode 100644 sys/fuchsia/hypervisor_guests_amd64.const delete mode 100644 sys/fuchsia/hypervisor_guests_arm64.const (limited to 'sys/fuchsia') diff --git a/sys/fuchsia/guest.txt b/sys/fuchsia/guest.txt new file mode 100644 index 000000000..7b49320d2 --- /dev/null +++ b/sys/fuchsia/guest.txt @@ -0,0 +1,16 @@ +# Copyright 2022 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +# See https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/vdso/guest.fidl + +include + +resource zx_guest[zx_handle] + +# The documentation does not mention any values for `options`, so we could +# express it as `const[0]`, but it might be good to test that `options` +# continues to mean nothing. +zx_guest_create(handle zx_resource, options int32, guest ptr[out, zx_guest], vmar ptr[out, zx_vmar]) + +# TODO: teach this how to use ports & keys +zx_guest_set_trap(handle zx_guest, kind int32, vaddr intptr, size int64, port_handle zx_port, key int64) diff --git a/sys/fuchsia/guests_amd64.const b/sys/fuchsia/guests_amd64.const new file mode 100644 index 000000000..a6ff852b2 --- /dev/null +++ b/sys/fuchsia/guests_amd64.const @@ -0,0 +1,2 @@ +# AUTOGENERATED FILE +ZX_HANDLE_INVALID = 0 diff --git a/sys/fuchsia/guests_arm64.const b/sys/fuchsia/guests_arm64.const new file mode 100644 index 000000000..a6ff852b2 --- /dev/null +++ b/sys/fuchsia/guests_arm64.const @@ -0,0 +1,2 @@ +# AUTOGENERATED FILE +ZX_HANDLE_INVALID = 0 diff --git a/sys/fuchsia/hypervisor_guests.txt b/sys/fuchsia/hypervisor_guests.txt deleted file mode 100644 index c41561c62..000000000 --- a/sys/fuchsia/hypervisor_guests.txt +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2018 syzkaller project authors. All rights reserved. -# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. - -include - -resource zx_guest[intptr] -resource zx_vcpu[zx_handle] - -zx_guest_create(root_resource zx_root_resource, options const[0], guest ptr[out, zx_guest], vmar ptr[out, zx_vmar]) -# TODO: teach this how to use ports & keys -zx_guest_set_trap(guest zx_guest, kind int32, vaddr intptr, len intptr, port const[ZX_HANDLE_INVALID], key int64) - -zx_vcpu_create(guest zx_guest, options int32, vaddr intptr, out ptr[out, zx_vcpu]) -# TODO: teach this about the port_packet_t struct -zx_vcpu_enter(vcpu zx_vcpu, port_packet ptr[out, zx_port_packet]) -zx_vcpu_interrupt(vcpu zx_vcpu, vector int32) -zx_vcpu_read_state(vcpu zx_vcpu, kind int32, buffer buffer[in], buflen len[buffer]) -zx_vcpu_write_state(vcpu zx_vcpu, kind int32, buffer buffer[out], buflen len[buffer]) diff --git a/sys/fuchsia/hypervisor_guests_amd64.const b/sys/fuchsia/hypervisor_guests_amd64.const deleted file mode 100644 index a6ff852b2..000000000 --- a/sys/fuchsia/hypervisor_guests_amd64.const +++ /dev/null @@ -1,2 +0,0 @@ -# AUTOGENERATED FILE -ZX_HANDLE_INVALID = 0 diff --git a/sys/fuchsia/hypervisor_guests_arm64.const b/sys/fuchsia/hypervisor_guests_arm64.const deleted file mode 100644 index a6ff852b2..000000000 --- a/sys/fuchsia/hypervisor_guests_arm64.const +++ /dev/null @@ -1,2 +0,0 @@ -# AUTOGENERATED FILE -ZX_HANDLE_INVALID = 0 -- cgit mrf-deployment