-
Notifications
You must be signed in to change notification settings - Fork 2
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
Could you make this for Galaxy A53? #4
Comments
Don't use termux, it's proot (you can understand that it's emulating fake device, not the real KVM) Thanks and hope it works for you! P/S: You open this issue right the time I'm porting KVM kernel for M20 :)) |
Sorry, because Stock ROM can't mount /system as rw, BusyBox can't be installed... Before someone made /system rw patch, I have to wait... By the way, I didn't expected that modifying just 2 files enables kvm |
I don't have busybox and I can still run Linux Deploy The only thing you need is ROOT YOUR DEVICE with Magisk |
Hmm, have you disabled UH (RKP, TIMA or sth like that)? Normally I don't know how it possible for you to get You should take a look at sleirsgoevy's work. Thanks! |
Ah! I refered to commit of this source. There's no TIMA, but I think we need to modify KVM logic To sum it up, I applied commit changes of above source to my source P.S ) I tried to apply your KVM code to my source code, but there's no KVM related folder in /arch/arm. |
I just looked into M20 source code. It seems to similar to A6 for KVM related files/folders. Sorry for broken english |
I also got difficulties in porting KVM to my M20. The I also got this situation trying to port KVM to a Note 8. The only explaination for this I can think of is somehow SBoot (Samsung's bootloader) verify the EL2 code's signature before allowing that code to jump into EL2. Not sure if that is real, but I'm RE If that really is the case, then things got much harder. We need to "patch" sboot (which is REALLY REALLY dangerous and it might brick your device) Hopefully it's not |
Yes, KVM support for ARM32 has been removed since Linux 5.x (if I remember correctly, 5.16) |
Result of porting pKVM to my A53 is boot-loop I got no errors when compiling, but result is boot-loop (I think the thing that pixel uses S2MPU is the reason for boot-loop.) Wow, this may much harder task... (Pixel 6's tensor chip and exynos 2*00, 1280 are similar, but implementation of KVM doesn't seem to compatible each other) |
I found this, and he actually setup QEMU for playing with Sboot |
Btw for some reason my bootloader ( So how tf it can lift UH to EL2? I can't think of a way to do that without ERET! |
Could you check ERET in my bootloader? I don't have any assembly related knowledge... |
May dmesg help for this...? |
Sorry for late reply, i was busy with school works :(( I was about to ask you about dmesg, but you had already send it! Thanks! I will check it |
May my phone similar to yours? |
Probably. I'm still surprised that your phone could get Wait, send me |
last_kmsg in my phone has no difference to dmesg last_kmsg : kernmess2.log P.S ) I also disabled TUI and TZDEV but it still shows error... |
Alright I found this
For some reason, kvm init successfully on CPU 0 (the startup CPU), but not on other CPU (which is said to copy the state of the first CPU) Which surprise me most is that this kernel still run UH without the need of a I also find no reference to OR maybe, maybe the UH is intergrated within EL3 itself (either it's in EL3, or it's dropped to EL2 by S-Boot). I only see "call" to UH, but to uh init code in kernel. BTW I will look at your sboot to search for RKP strings. Log message from S-Boot. It seems that UH is loaded from S-Boot directly. So I don't think we will be able to access EL2 unless some It's possible for patching I think you should try something else, like porting EDK2 to your phone, then run port your OS (write drivers or sth) to it. |
Ah, yes~ That file included in BL I think that structure of KVM, Virtualization-related things hugely changed from year 2021 |
If we are lucky, we can patch uh, then upload it to uh partition. So we patch uh to load kvm stubs from kernel, or even load the whole kernel to EL2, then boot the kernel. But I'm not sure if S-Boot will continue to boot if uh partition has been changed (This will need further RE). If it refuse to boot, you might brick your phone unless you have access to phone's hardware and restore uh. If S-Boot continues to boot even if we change uh, then it's good to go! BTW, I tried reproducing the way As you can see from the image, I tried changing I know it's hard, but maybe I can try patching uh to |
Hmm, can I ask how do you know? Like you inspect every Samsung phone or sth? Or maybe you work at Samsung? (probably not, but I still want to ask) :) |
I don't work at Samsung, but I'm just interested on KVM, native speed VM on phone. After I started to be interested in KVM, I inspected(?) S7, S20+ kernel which are my previous phone. S7, S20+ kernel are seems to be similar to A6, S8 P.S ) Sometimes I feel to sorry for that I don't have much programming knowledge... |
I think I will work on this later, since I currently have exam at school, sorry for that :( |
That's OK! |
Wait, can you check the max size of the uh partition? |
You mean.... this?
|
Yes So we got about 2 MB limit of uh code. Btw I just figure out that uh.bin is loaded as a plugin to S-Boot, which means at first it got access to EL3 level, then it use And wtf this uh is written in Rust |
LOL... Written in Rust... which made me surprise also... |
Again, there is no I looked at your phone's kernel source and found that they still use |
I updated to Android 13, and applied custom kernel (based on opensource's android 13 kernel) I edited virt.h, and removed UH, RKP, "kvm.mode=protected", ... from config file. /dev/kvm still shows! P.S ) System partition is now RW! |
Wow, but does it work? |
But this is more better than my previous phone, S20 (Snapdragon) --I'll buy latest Pixel series as my next or second phone-- |
Snapdragon SoC cannot be exploited to get KVM |
Can I exploit my tablet samsung nexus 10 to get KVM enabled ? |
It depends on your luck
|
I could try,which patch can I use ? which method ? your is ok ? |
I'm not sure. My appoarch works for some people but not for others. You might want to follow sleirsgoevy's patches instead. He also explains the working principle of this. |
@kyeon-go they use the same method of calling SMC, but with different number |
Hello to everyone, it's again me. I would like to know if,in your opinion,I can apply your patch to enable kvm on the old Samsung / Google / Chromebook based on arm32,model xe303c12 based on Exynos 5250,this one : https://github.com/quarkscript2/xe303c12_arm_linux I ask it because I'm working on the project to enable kvm on a 5.4 (main line) kernel since 1 year or so and I haven't still be able to do that. Really it has been already explained how to do that,for example on this tutorial : http://www.virtualopensystems.com/en/solutions/guides/kvm-on-chromebook/#setting-up-the-boot-medium but they used a very old kernel version,3.13 ! I want to use a newer kernel version,the last version which support kvm on arm32,that should be 5.4 and something. It makes no sense to use kernel 3.13 on a recent version of ubuntu,even because it does not work. kernel 3.13 is too old if a modern userland is used. And the patch proposed by virtual open system is the only one I know. Im forced to use it if I don't find another method. And that patch forces me to use their old and custom u-boot. Your patch if worked could be the game changer. |
I cannot see the patch, all i see is that they give us a repo pre-patched, with long commit history that i can't find which one contains (or related to) the patch, since that history also contains pulled mainstream commits. So I think you should clone their repo (https://github.com/virtualopensystems/linux-kvm-arm), diff with the original linux source (of ver 3.14, which they currently use) to see what exactly changed. Then you can pull the latest kernel source and try to apply the same mechanism on it. Good luck |
I'm not able to find the link to downlad the main line official kernel vers 3.14-rc2. Can you point me there ? thanks. Anyway I think that your plan can't work because I'm sure that the modifications I found can't be applicable to a such new kernel version like the 5.14. |
I have old kernels on kernel.org website. https://mirrors.edge.kernel.org/pub/linux/kernel/v3.x/ I can's see RC kernels, there is only 3.13, 3.14, 3.14.1, etc. So,your patch can't be applicable in any way ? |
@raspiduino So, is it okay if I change value of VMM(UH)_64BIT_CALL_SMC_MAGIC to 0xC2000480? |
Probably we have to remove things in the UH partition first (to not load Samsung Knox) WAIT: the magic code |
I'm using A536N, but latest A536U (A536USQU2AVG2) kernel is compatiable.
So I modified arch/arm64/include/asm/virt.h like this
Also I removed the string "kvm-arm.mode=protected" from CONFIG_CMDLINE
After compiled, kvm showed in /dev, but it doesn't work properly...
To compile this kernel, you need two things:
Clang 12 : https://android.googlesource.com/platform//prebuilts/clang/host/linux-x86/+archive/b669748458572622ed716407611633c5415da25c/clang-r416183b.tar.gz
Build-tools : https://android.googlesource.com/platform/prebuilts/build-tools/+archive/refs/heads/master.tar.gz
The text was updated successfully, but these errors were encountered: