Adding FreeBSD on ARM64 support#474
Conversation
Some OSes use "arm64" others use "aarch64"
|
@darkain, VMware has approved your signed contributor license agreement. |
claplace-vmw
left a comment
There was a problem hiding this comment.
Thank you for the contribution!
If you don't mind I'd like to have 2 small changes.
| ASSERT(n>=0 && n<ESC_BITVECTOR_SIZE); | ||
| #ifdef __GNUC__ | ||
| { | ||
| #ifdef VM_ARM_64 |
There was a problem hiding this comment.
given the x86 assembly code below, I think we'd better gate that part under VM_X86_ANY and let the arm code fall back to use the C part.
There was a problem hiding this comment.
I've done some more digging into this section of code. Only one file makes reference to this header, and the code that actually used this... was removed in 2008.
This appears to be a dead file not even doing anything other than throwing compiler errors at me, that I put that hackish #ifdef into to avoid. I think it would be best to just remove it at this point.
ef4a8b2#diff-5066e7d95c24c4e592c9eb6e82d61655014eee22eed34c379fa4c1957cbbf387
| } | ||
|
|
||
| while ((c = getopt(argc, argv, "hvV")) != -1) { | ||
| while ((c = getopt(argc, argv, "hvV")) != GETOPT_END) { |
There was a problem hiding this comment.
I had assumed that getopt return was of type "char" since it was dealing with character data. But looking further into it, both Linux and FreeBSD define it as "int", so yup, that would be the better code path here for language/OS compatibility.
|
@darkain An internal PR has been filed to track the pull request through the review process. I will coordinate with @claplace-vmw to adjust the suggested changes where necessary to work across other projects that may use common source files. I will also work with the open-vm-tools maintainer to integrate the "final" patch into the emulators/open-vm-tools project in /usr/ports. |
references to bitvector were removed back in 2008 reference: ef4a8b2#diff-5066e7d95c24c4e592c9eb6e82d61655014eee22eed34c379fa4c1957cbbf387
|
I've now validated that removing the bitvector code entirely compiles and runs just fine. |
|
As we are working to integrate you ARM changes for FreeBSD open-vm-tools into the next major release, it was noticed that the proposed asm change to modules/freebsd/vmmemctl/os.c is not correct. The os_ffz() function is to locate the first "low-order" zero bit. The ARM asm has been changed to : #elif defined(aarch64) |
|
As long as things are getting fixed up, that's awesome :) |
Updating the FreeBSD specific sections of open-vm-tools to adjust where necessary for ARM64. The FreeBSD vmballoon driver (vmmemctl.ko) will use the backdoorGcc64_arm64.c when built for ARM64. Pull request: #474
|
The code changes for this pull request have been comitted to the "devel" branch at 5c27a31 Closing this pull request. |
This adds support to open-vm-tools for FreeBSD on aarch64 / ARM64 - tested on FreeBSD 12.2-RC2
Some of these ARM64 edits may also apply to different OSes.
These edits are also based around llvm/clang, so should go through the regression testing on i386 and amd64 as well on all OSes (I'm personally not setup to do all of these tests)