yashsingh1/xdaforums huggingface dataset:
[General Questions and Answers] raspiduino:
Really :)))) Did you actually get to my repo :))?

Like sleirsgoevy has said, you have to recompile the whole EDK II source with his/her patch (see his/her repo). I have compiled one already. Do you want it? If yes I will attach one here.

Edit: you edited your link so I will edit my reply :)
[General Questions and Answers] Korsunag:
Can you tell me exactly how to install this Ubuntu repository? Or is it already included in Linux Deploy?
[General Questions and Answers] Korsunag:
Yes, exactly :) I will be very grateful to you! Another thing is that I'm just starting to learn Linux, so I can ask stupid questions, for example, what is EDK II and where to put it to sleep to make it work? :)
[General Questions and Answers] raspiduino:
There are at least 3 types of "install Ubuntu" your phone I can think of.

The first one is to install it in a VM, like the project does.

The second one is to chroot it. Android is based on Linux kernel and you can chroot any other Linux based or ABI-compliant OS (like Ubuntu) on it, as long as you have root. You can do it using Linux Deploy.

The third one is to run it on proot. This is what Termux does. It require no root, but less access to hardware.

(The last one, rarely) install bare metally. You can only do this when someone find the way to modifiy/patch the bootloader to boot Linux from it.

Which one do you choose? Thanks!
[General Questions and Answers] Korsunag:
Thanks for helping me, I really appreciate it :) At the moment I have Ubuntu (armf) installed via linux-deploy. Accordingly with root access.
[General Questions and Answers] raspiduino:
Ok. Good to see it works. If you have any other questions, feel free to add them here! Thanks!
[General Questions and Answers] Korsunag:
Following your instructions, there were no problems with compiling the kernel. The kernel works with KVM. However, I still do not understand where to apply the second edk2 patch as shown in the screenshot? Maybe it's all about this?
[General Questions and Answers] raspiduino:
If you are asking how to boot Windows on that, then to boot Windows, there are much more works to do, not just patching KVM! I'm currently working on that, and if you like you can join me.

If you just want to get a working EDK II image, then tell me and I will build one for you.

Or if you want to build it from source, here are the steps.

Thanks!
[General Questions and Answers] Korsunag:
Hey! Yes, that's what I meant :) I already realized that just patching the KVM kernel would not be enough to boot the Windows arm. However, I don't know if my Linux knowledge will be enough as I am a beginner. But I will gladly join this development and do my best to finally run Windows on ARM, in particular on the Exynos processor. At the moment I have an Exynos 7880 and I'm ready to test it and I'm very interested in it :) And yes, I would like to get a ready-made EDK2 image. I will be very grateful!
[General Questions and Answers] Korsunag:
Hey! Returning to the question with edk 2, could you already lay out the finished image, so that I could test for Windows to run
[General Questions and Answers] raspiduino:
Here you are. Sorry for replying late (I was busy those days).

There are two versions as explained in the steps above.

One is `EFI_DEBUG.img` (useful for debugging). Checksum:

SHA-256: BB08462902135785F81F94C26A46EE245CDCFB54378E2F381EC74220C27CD687

Another is `EFI_RELEASE.img`. Checksum:

SHA-256: A2476A140A1D686E84F649BDAEF8DC00B50E5AA041DF510EBC497861C97A9051

Thanks!
[General Questions and Answers] Korsunag:
Hey! Many thanks! I'll test right now. I'll post all the results here.
[General Questions and Answers] Korsunag:
Hello! Thanks again for your help. There is progress, now the BIOS is loading, but this error pops up and then the download is suspended:

The code in Qemu that I enter:

qemu-system-aarch64 -M virt -enable-kvm -cpu host -smp 4 -m 768M -bios /root/EFI_DEBUG.img -device virtio-gpu-pci -device nec-usb-xhci -device usb-mouse -device usb-mouse -hda /sdcard/Download/10arm/64.vhd -vnc :2

Please tell me what this could be connected with, how to solve this error so that Windows 10 arm continues to boot? Thank you in advance!
[General Questions and Answers] raspiduino:
Some parts of KVM in kernel 3.18.91 are still buggy, especially PMU. We haven't find the way to boot Windows on KVM on the phone at least for now. I think you should try backporting KVM (kvmarm.git) into the kernel (I would recommend use the Oxygen kernel git tree, since you can use `git cherrypick` from it), and see if it works. That's what I'm doing now (here), but not finished yet.

You can still boot it without KVM, like you have already done, but the speed will be terrible.

Thanks!
[General Questions and Answers] Korsunag:
Thanks! I will keep a close eye on your releases and news. I also wanted to ask if it is possible, theoretically, to take a KVM module from the Android 13 kernel and port it directly to the kernel for Samsung Exynos processors? This news says that in Android 13 DP1 (for developers), the hypervisor with KVM is already open, and there is a video of the successful launch of Windows ARM.
[General Questions and Answers] raspiduino:
(Correct me if I am wrong)

If you mean the "binary module for KVM", I think it's impossible, since Linux has no stable ABI interface for kernel modules.

(Image source: Wikipedia)

Also, the Android 13 kernel is based on 5.x kernel, which is somewhat far from the 3.18.91, so they might use newer Linux API (which are not compatible with kernel 3.18.91, you might port it but it needs a lot of work).

The Android kernel (and their KVM) is actually based on Linux KVM module, so I think porting from kvmarm.git and Android 13 kernel source are just the same.

Again, correct me if I'm wrong.

Thanks!
[General Questions and Answers] sleirsgoevy:
Regarding Windows boot, (supposedly) the main issue preventing it from booting is inside Samsung's security monitor. CNTFRQ register is initialized to 0, while Windows would expect it to contain the timer's frequency. This register is only writable from EL3, which is somewhere we can't get without an exploit. No "port from android 13" will help here.

The EDK2 patches and a modified devicetree are required for the same reason.
[General Questions and Answers] raspiduino:
May I ask a (stupid) question?

Isn't CNTFRQ a system register? If yes, then it should be trapped and emulated in the file `arch/arm64/kvm/sys_regs.c`?

If it is trapped so it means we can modify the return result of the trap?

Thanks!
[General Questions and Answers] sleirsgoevy:
It is possible to trap it in EL0 mode, but reads of it from EL1 (guest kernel) and above always read the real value. https://developer.arm.com/documenta.../CNTFRQ-EL0--Counter-timer-Frequency-register
[General Questions and Answers] raspiduino:
Wow I have just found this patch and can you take a look at it? Thanks!

From the patch:

"It is an unfortunate situation that CNTFRQ{,_EL0} is often

misprogrammed from the firmware side, leaving it up to the kernel to

work around it. This is usually done by providing an alternative

frequency in the Device Tree.

Unfortunately, CNTFRQ is accessible from EL0, giving userspace the

wrong frequency, and potentially a different frequency per CPU, which

is definitely not what you want. A possible workaround is to trap this

into the kernel and to emulate it (together with the VDSO being

disabled), and this is what this series is achieving."
[General Questions and Answers] raspiduino:
Edit: I relied that this patch is for Linux kernel itself to fight against the misconfigured CNTFRQ and *NOT* a patch for KVM guest.
[General Questions and Answers] raspiduino:
I have loaded the Windows Kernel (ntoskrnl.exe) from Windows Arm64 to ida and saw 3 read instructions from CNTFRQ_EL0. They use MRS to read value from CNTFRQ_EL0 and write to register x8.

(3 read)

(First one in the list)

So my question is, if I change from MRS (read operation) to MSR (write operation), does it cause an exception and can we trap it in sys_regs.c?

Image of after patching:

If not, then can I change it to an invaild system register access and trap it in sys_regs.c?

Currently I'm only thinking of that solution, which will require both kvm patch and guess OS (in this case Windows) patch.

I have also though of throw away these MRS instructions and replace by directly move the 26Mhz value (like in your EDK2 patch) to the destination register, but it require 2 instructions to do this rather than 1, so not possible. (Correct me if I'm wrong)

Thanks!
[General Questions and Answers] Guan Yu:
do it support 3d acceleration?
[General Questions and Answers] raspiduino:
I'm not sure, but not likely since 3D acceleration requires GPU passthrough and Exynos 7870 doesn't have IOMMU to do this (as long as I know).
[General Questions and Answers] sleirsgoevy:
My thoughts regarding possible ways to "fix" ****dows:

1) There is probably no need to make it trap into KVM. Just patch it into an instruction that loads the right value, or a close enough estimate.

2) I think it'd be better to patch EDK2, so that it detects Windows being booted, finds those instructions in memory (very easy) and replaces it. This way you don't have to distribute patched Windows kernel (=p*racy), and it will possibly even survive updates.
[General Questions and Answers] yanzhiwei:
Have you finished?

I am also working on this use pixel6 pro. I used your EFI_DEBUG.img, but it still shows a black screen or "the guest has not initialized the display (yet)".

I will appreciate it if can you help me.
[General Questions and Answers] raspiduino:
No:))

Open the serial tab in your QEMU or use '-serial stdio' to get the serial log. It might take long to boot.

Do you know your kernel version? I did a quick Google search and found that your kernel version is 5.x. There is a guy already run Windows ARM and Linux on KVM.

See the post here: https://www.xda-developers.com/android-13-dp1-google-pixel-6-kvm-virtual-machine/amp/
[General Questions and Answers] raspiduino:
Anyway I will try my best to debug Windows ARM on my phone's KVM this summer. Thanks for taking a look at this project :)
[General Questions and Answers] yanzhiwei:
No:))

Open the serial tab in your QEMU or use '-serial stdio' to get the serial log. It might take long to boot.

Do you know your kernel version? I did a quick Google search and found that your kernel version is 5.x. There is a guy already run Windows ARM and Linux on KVM.

See the post here: https://www.xda-developers.com/android-13-dp1-google-pixel-6-kvm-virtual-machine/amp/

1. my kernel version is 5.10.107-android13-4-00023-g346e46a9a304-ab8573663

2. my command line is

3. my log is below
[General Questions and Answers] raspiduino:
Can you take a look at that link? Maybe his port of KVM may work for you
[General Questions and Answers] raspiduino:
Alright, I see what might be wrong with your work.

First, you are using Termux. Termux is a fake chroot (proot) environment, which means it cannot run KVM. If you download Termux from Google Play then it's worse (Gplay version is NOT up to date)

Secondly, you should use '-device ramfb' instead of '-device VGA'.

Have you root your device?
[General Questions and Answers] yanzhiwei:
Thanks a lot for your solution.

Yes, I have rooted my device

What should I use to replace Termux
[General Questions and Answers] raspiduino:
You can use Linux Deploy (search it on Google Play), or Kali Chroot Manager.

I would recommend Linux Deploy, since it was really easy.

Note that you need to set linux deploy user to 'root', and then enable VNC, open a terminal in VNC to set your root password with 'passwd'
[General Questions and Answers] yanzhiwei:
Does below info meaning kvm run ok？

I execute my commad by adb shell，and then su，then execute my qemu command。
[General Questions and Answers] raspiduino:
Yes (if there is no problem with kernel and KVM module implementation)
[General Questions and Answers] yanzhiwei:
I also use strace to trace the system call，I find many ioctl about KVM，I think kvm may run ok。

8722 is the pid of qemu process

I am stuck here，it's very confuse why it always shows a black screen of "the guest has not initialized the display (yet)".:ROFLMAO:
[General Questions and Answers] raspiduino:
Have you changed '-device VGA' to '-device ramfb'?
[General Questions and Answers] yanzhiwei:
I change it，but is shows a black screen without any words. below is the log
[General Questions and Answers] raspiduino:
Then it stucks? Can you enter the command 'info registers' in the QEMU monitor and see if register froze or not? Also check the CPU usage of QEMU process if it's idle or not.
[General Questions and Answers] yanzhiwei:
below is the register info，I compare register info many times ，only pc will change a little，other value is always the same。

below is the cpu info

It always use full of one cpu core(100%)
[General Questions and Answers] raspiduino:
Maybe this is a stupid idea but repeatedly type 'info registers' onto the QEMU monitor to see if the register value changes or not. If not then the code is dead somewhere
[General Questions and Answers] yanzhiwei:
I use simpleperf to find that the code is dead somewhere.

I use other phone device to do this job.

below is my cmd

but a problems happen，if I use ubuntu iso，it can run to install ubuntu。

if I use win10 iso，it will show a blue screen with

"

Recovery

Your PC/Device needs to be repaired

"

have you ever meet this issue
[General Questions and Answers] raspiduino:
Which version of Windows are you trying to install?

Note that this project itself is not completed yet. My phone just stuck at the loading screen of Windows, so you boot to that error screen is a big achivement (maybe because your phone has 5.x kernel while I has 3.x)

In my opinion, attach gdb to QEMU, see where it stucks, look for that location in some bootloader files like bootaa64.efi and find why it stucks (usually because mis-implementation of system register traps.

Or you can try the link I suggested. That guy actually booted Windows ARM on the same device as your, so his guide might help. Good luck! If you have any questions, you can post them here and I will try my best to help you. Thanks!
[General Questions and Answers] yanzhiwei:
I fail to compile qemu-system-aarch64，so I can't use gdb to debug qemu.

It is easy to compile qemu in x86 platform，but it is hard for me in arm64 platform（I only have android phone）
[General Questions and Answers] raspiduino:
I use Linux Deploy (with root) and they have precompiled qemu in the apt repo, ready for arm64 KVM and gdb

What did you compile it on?
[General Questions and Answers] yanzhiwei:
I compile it on termux + ubuntu

I use simpleperf to trace qemu process cpu hang in qemu-system-aarch64[+dffb44]，but i can't find the position on source code。

Does gdb can find it with stripped qemu-system-aarch64？
[General Questions and Answers] raspiduino:
No, that is not how you debug a VM!

You should create a gdb debug port on qemu using `-s -S` added to command line. Then, open an ARM64 gdb and run `target remote :1234` to connect to it.

Anyway you should do a google search for debuging with QEMU.

Please send me a picture of Windows VM BSOD. Thanks!
[General Questions and Answers] yanzhiwei:
thanks a lot，i will try your advice。

The below picture is BSOD
[General Questions and Answers] yanzhiwei:
I can only see that bt by gdb，the address is the same with simpleperf result。

What can I do to make the address become function name or code line

(gdb) bt

#0 0x000000013bf21030 in ?? ()

#1 0x000000013bf20860 in ?? ()
[General Questions and Answers] braxtonthenerd2:
Any support for Samsung galaxy note 8 aka greatlte I would love a KVM enabled kernel (;
[General Questions and Answers] Guan Yu:
hello but what kvm is used for
[General Questions and Answers] raspiduino:
KVM stands for Kernel Virtual Machine. It is used for virtualization to speed up virtual machines by allowing some of the guest's code to be executed directly on the host's processor.

If you wonder what virtualization is, then it is a technology to run (one or multiple) guest OS on top of host OS.
[General Questions and Answers] raspiduino:
Technically any Samsung devices with `vmm_goto_el2` are possible for enabling KVM. But the difficulties there are many different devices and each one has a different way to exploit Knox.
[General Questions and Answers] raspiduino:
Hello, can you press F8 to see what will happend? If possible, then you somehow needs to enable boot debug on Windows, then forward it to QEMU's serial port, then use windbg to debug the OS to see where it hang exactly.
[General Questions and Answers] braxtonthenerd2:
Thanks 😀
[General Questions and Answers] Guan Yu:
so will it have hardware acceleration or not?
[General Questions and Answers] raspiduino:
Yes, it will have. KVM use hardware acceleration to work
[General Questions and Answers] yanzhiwei:
when I add -no-acpi option，the BSOD disappeared，only show a black screen with BlInitializeLibrary failed 0xc0000225
[General Questions and Answers] raspiduino:
Hello, can you change the `-M virt` to `-M virt-2.12` too see if it works?
[General Questions and Answers] yanzhiwei:
It didn't work:ROFLMAO:
[General Questions and Answers] raspiduino:
Can you set up Windows Debug (https://docs.microsoft.com/en-us/wi...gger/setting-up-a-null-modem-cable-connection) and set up QEMU to output serial over network, then setup virtual serial port on a Windows machine that has Windbg, then use windbg to debug?

Searching on the Internet said that 0xc0000001 is related to hardware not working / not respoding. Maybe your KVM implementation has error OR I think the most common case some of your system register is not properly set (usually by phone's bootloader) for Windows to use.
[General Questions and Answers] JhosephRF:
Will this kernel work on galaxy J7 metal (J710MN)? If it doesn't work, could you make a compilation?
[General Questions and Answers] raspiduino:
Not really sure. I don't have that phone model. You can go get your kernel source (from Samsung Open Source page), then apply the patch kvm.patch in the exynos-kvm-patch repo (either by hand or by git apply). Then compile, root the phone, flash new kernel and see if it works.
[General Questions and Answers] JhosephRF:
In your post on Github there is a link to download the kernel with kvm support. I want to know if this kernel would work on Galaxy A6 Plus. Because this is the model available in my region, i don't know if the kernel of both smartphones are the same.
[General Questions and Answers] raspiduino:
I'm not really sure, but it worth a try.

If you buy a new A6+ phone to try this, I would recommend not to, since it might break the warranty.

If you already got one then just try it, the warranty is probably already outdated
[General Questions and Answers] JhosephRF:
There is no kernel available for this version on the Samsung Open Source website
[General Questions and Answers] raspiduino:
I think the most suitable should be the a605g kernel. Maybe a605g* models share the same kernel? I guess so
[General Questions and Answers] raspiduino:
My a6lte is broken now, so I will not have anything to test the kernel on. Good luck for you all on the development of a6lte-kvm! Thank you for joining the thread!

Probably I will get a new Samsung Phone, but I have to wait until the warranty period ended to root the device.

See you soon.
[General Questions and Answers] Ryujin96:
how did u fix the error related to "preinit_hyp_mode()" function in "init/main.c"?
[General Questions and Answers] raspiduino:
Sorry for late reply. Now I finally remember how I did it.

If you mean "the error" is the phome can boot but you cannot start KVM QEMU, then here is the answer:

- DO NOT use Termux for this kind of things. Termux use proot (fake chroot, with fake "device call" simulation). We need to use some chroot apps, like Linux Deploy (available on Google Play, also open source, so it can really changes the hardware states.

If you are using a6lte:

- After installing Linux Deploy, install a chroot environment, selecting the architecture as ARMHF, and username as "root" in the setting. Also enable VNC

- Get the shell. Run `dpkg --add-architecture arm64`. Then `apt update`. Then `apt install qemu-system-arm`

- Now you should be able to use it
[General Questions and Answers] arunkumar neelam:
Hello senior developer, have you solved running arm windows with kvm support?
[General Questions and Answers] raspiduino:
I'm not event a developer, I'm a student :)

No actually, I'm too busy (for other stuff) for backporting PMU to my kernel. If your device runs a 4.14 or 5.x or (probably not yet) 6.x kernel, and you are able to get KVM on it, then you are good to go, since these things have been claimed to have PMU and boot Windows.
[General Questions and Answers] lentas:
can you do same to galaxy s7 phone (exynos)
[General Questions and Answers] raspiduino:
I'm not sure. You can try, the instructions are available on sleirsgoevy's repo.
[General Questions and Answers] Ryujin96:
Anyone tried this limbo port on a kvm enabled kernel if this works out of the box without patching stuff? https://github.com/wasdwasd0105/limbo_tensor/releases
[Xiaomi Black Shark 2 Guides, News, & Discussion] FunkyFunny:
EDL SKW-H0(A0).zip

drive.google.com
[Xiaomi Black Shark 2 Guides, News, & Discussion] tuoiteencuoi:
tôi đang ở rom Android 10 cn tôi cần rom toàn cầu eu nhưng tôi tải lên bị lỗi ota

tôi cần giúp đỡ xin cảm ơn

MOD EDIT: @tuoiteencuoi Please post only in English according to the FORUM RULES or at least add an English translation below your foreign language(Google translator for example), translation added below:

i am on android 10 cn rom i need eu global rom but i upload error ota

i need help thanks
[Xiaomi Black Shark 2 Guides, News, & Discussion] Leeshyzin1:
tôi cần bạn giúp flash rom edl
[Xiaomi Black Shark 2 Guides, News, & Discussion] mrback007:
Thank you. I have successfully flashed on black shark 2 China version unlocked bootloader. If black shark 2 china has not unlocked bootloader, don't flash this firmware

More information about this firmware:

SKW-H0 OS00M4 - global - android 9 stock
[Xiaomi Black Shark 2 Guides, News, & Discussion] igoprikuo:
can you update this myphone has suddenly boot into edl
[Xiaomi Black Shark 2 Guides, News, & Discussion] igoprikuo:
What flash tool did u use ?
[Mogul, XV6800 General] parcou:
I have search but still cannot find a way to add an icon on the bottom tray on my verizon 6800 DCD rom 3.22? I want to put my S2P program down there for quick launch...?