On 19/06/2023 16:49, sai krishna Allu wrote:
Hi Ralf,

Sorry, I forgot to load the module, I have loaded now.

ubuntu@ubuntu:~/jailhouse$ sudo insmod driver/jailhouse.ko
ubuntu@ubuntu:~/jailhouse$ ls -l /dev/jailhouse
crw------- 1 root root 10, 59 Jun 19 14:45 /dev/jailhouse
ubuntu@ubuntu:~/jailhouse$ sudo jailhouse enable configs/arm64/rpi4.cell
*[ 4966.214157] jailhouse: request_mem_region failed for hypervisor memory.

Okay. Interesting. I wonder why you didn't hit that error before. Jailhouse requires reserved memory where it, as well as inmates, reside. Linux must never claim those memory areas, hence you need to reserve that memory areas at boot time.

See the comment in arch/arm64/rpi4.c:
 * Reservation via device tree: reg = <0x0 0x20000000 0x10000000>;

Did you reserve memory in your device tree?

I would recommend building a working image with jailhouse-images. There, are required patches and config tweaks are included out of the box.


  Ralf

JAILHOUSE_ENABLE: Invalid argument*
ubuntu@ubuntu:~/jailhouse$


I am getting the above error.

Regards,
Sai Krishna
On Monday, June 19, 2023 at 8:09:37 PM UTC+5:30 Ralf Ramsauer wrote:



    On 19/06/2023 16:23, sai krishna Allu wrote:
     > Hi Ralf,
     >
     > I have downloaded the master branch and given make and I have got
    the
     > following error, I fixed the error with one of the reference
    link, but
     > didn't find the /dev/jailhouse post installation
     >
     > ubuntu@ubuntu:~/jailhouse$ git branch
     > * master
     > ubuntu@ubuntu:~/jailhouse$make
     > ...
     > ...
     > ...
     >   CC      /home/ubuntu/jailhouse/configs/arm64/zynqmp-zcu102.o
     >   OBJCOPY /home/ubuntu/jailhouse/configs/arm64/zynqmp-zcu102.cell
>   DTC /home/ubuntu/jailhouse/configs/arm64/dts/inmate-amd-seattle.dtb
     >
    */home/ubuntu/jailhouse/configs/arm64/dts/inmate-amd-seattle.dts:17:54:
     > error: no include path in which to search for
     > dt-bindings/interrupt-controller/arm-gic.h
     >    17 | #include <dt-bindings/interrupt-controller/arm-gic.h>*
     >       |                                                      ^
     > make[3]: *** [scripts/Makefile.lib:286:
     > /home/ubuntu/jailhouse/configs/arm64/dts/inmate-amd-seattle.dtb]
    Error 1
     > make[2]: *** [scripts/Makefile.build:519:
     > /home/ubuntu/jailhouse/configs] Error 2
     > make[1]: *** [Makefile:1765: /home/ubuntu/jailhouse] Error 2
     > make: *** [Makefile:40: modules] Error 2
     > ubuntu@ubuntu:~/jailhouse$
     >
     > To fix the above I have followed the link
     > https://bbs.csdn.net/topics/615205697
    <https://bbs.csdn.net/topics/615205697> and changed as per instruction,
     > even I followed the earlier build from this link only. but I was not
     > able to build jailhouse-image.

    Ok, perfect.

     >
     >
     > DTC_INCLUDE    += /usr/src/linux-headers-5.4.0-1069-raspi/include
    added
     > in the file
    -->/usr/src/linux-headers-5.4.0-1011-raspi/scripts/Makefile.lib
     >
     > After that I am able to install,
     >
     > ubuntu@ubuntu:~/jailhouse$ sudo make install
     >   Building modules, stage 2.
     >   MODPOST 1 modules
     >   INSTALL /home/ubuntu/jailhouse/driver/jailhouse.ko
     > At main.c:160:
     > - SSL error:02001002:system library:fopen:No such file or directory:
     > ../crypto/bio/bss_file.c:69
     > - SSL error:2006D080:BIO routines:BIO_new_file:no such file:
     > ../crypto/bio/bss_file.c:76
     > sign-file: certs/signing_key.pem: No such file or directory
     >   DEPMOD  5.4.0-1069-raspi
     > Warning: modules_install: missing 'System.map' file. Skipping
    depmod.
     > install -m 644 hypervisor/jailhouse*.bin /lib/firmware
     > install -d -m 755 /usr/local/libexec/jailhouse
     > install -m 644 inmates/tools/arm64/*.bin
    /usr/local/libexec/jailhouse
     > install jailhouse demos/ivshmem-demo /usr/local/sbin
     > install jailhouse-config-collect jailhouse-cell-linux
     > jailhouse-cell-stats jailhouse-config-create jailhouse-config-check
     > jailhouse-hardware-check /usr/local/libexec/jailhouse
     > install -d -m 755 /usr/local/share/jailhouse
     > install -m 644 jailhouse-config-collect.tmpl root-cell-config.c.tmpl
     > /usr/local/share/jailhouse
     > install -m 644 jailhouse-completion.bash
     > /usr/share/bash-completion/completions/jailhouse
     > install -d -m 755 /usr/local/share/man/man8
     > install -m 644 jailhouse.8 jailhouse-cell.8 jailhouse-enable.8
     > /usr/local/share/man/man8
     > python3 -m pip install --upgrade --force-reinstall  .
     > Processing /home/ubuntu/jailhouse
     > Building wheels for collected packages: pyjailhouse
     >   Building wheel for pyjailhouse (setup.py) ... done
     >   Created wheel for pyjailhouse:
     > filename=pyjailhouse-0.12-py3-none-any.whl size=22795
     >
    sha256=fd9fbf5b1cf127acf8f96d31e8a5b36351a39278db948c6be3bf55021a3853bb
     >   Stored in directory:
     >
    
/tmp/pip-ephem-wheel-cache-bv5mietb/wheels/c9/70/5f/41e4b42a3693d675b8bd9bcdcb021956f8d467789b3be58740
     > Successfully built pyjailhouse
     > Installing collected packages: pyjailhouse
     > Successfully installed pyjailhouse-0.12
     > ubuntu@ubuntu:~/jailhouse$
     >
     > *but not able to get jailhouse in dev file.*

    Yeah, you need to load the jailhouse module first:

    insmod drivers/jailhouse.ko
    or
    modprobe jailhouse

    Thanks
    Ralf

     >
     > ubuntu@ubuntu:~/jailhouse$*ls -l /dev/jailhouse*
     > *ls: cannot access '/dev/jailhouse': No such file or directory*
     > ubuntu@ubuntu:~/jailhouse$
     >
     > Please suggest the correct way to install or anything else I need to
     > change or need to follow different steps to fix this issue to get
    the
     > installation success.
     >
     > Regards,
     > Sai Krishna
     >
     > On Monday, June 19, 2023 at 4:25:09 PM UTC+5:30 Ralf Ramsauer wrote:
     >
     >
     >
     > On 19/06/2023 12:23, sai krishna Allu wrote:
     > > Hi Ralf,
     > >
     > > I have attached the hypervisor.o and I have taken the dump of
     > that which
     > > is also attached too.
     > > I have below command to extract, let me know is it ok or not.
     > >
     > > ubuntu@ubuntu:~$ aarch64-linux-gnu-objdump -d
     > > jailhouse/hypervisor/hypervisor.o|tee hypervisor_dump.txt
     > >
     > > ubuntu@ubuntu:~$ cat hypervisor_dump.txt -n |grep "ffffc0203820"
     > > *3338    ffffc0203820:       f9400282        ldr     x2, [x20]*
     > > ubuntu@ubuntu:~$ vi hypervisor_dump.txt +3338
     > >       patch+0x218>
     > >  3334     ffffc0203810:       f9400282        ldr     x2, [x20]
     > >  3335     ffffc0203814:       f9400842        ldr     x2, [x2,
    #16]
     > >  3336     ffffc0203818:       8a130042        and     x2, x2, x19
     > >  3337     ffffc020381c:       f90a4002        str     x2, [x0,
     > #5248]
     > > * 3338     ffffc0203820:       f9400282        ldr     x2, [x20]*
     > >  3339     ffffc0203824:       f9400c42        ldr     x2, [x2,
    #24]
     > >  3340     ffffc0203828:       8a130053        and     x19, x2, x19
     > >  3341     ffffc020382c:       52800022        mov     w2, #0x1
     > >
     > > The instruction at ffffc0203820 means it Load x2 from contents of
     > x20
     > > register.
     > > Please suggest how to fix this.
     >
     > Keep calm, I'm still trying to figure out where the problem
    exactly is.
     >
     > Now I know the line of code, where the exception exactly happens.
    It's
     > in hypervisor/arch/arm-common/psci.c:39
     >
     > ldr x2, [x20] <- Here we likely load ctx->regs[2], and the only
    variant
     > how this could fail is that ctx points to somewhere. Here we're
    inside
     > the routine psci_emulate_cpu_on, which shouldn't even be called when
     > enabling the hypervisor. I don't know yet what could be the issue.
     >
     > Before we keep on debugging: I saw that you use Jailhouse v0.12.
     >
     > Could you please switch to the master and/or next branch of
    jailhouse,
     > and see if the error still occurs there?
     >
     > Thanks,
     > Ralf
     >
     > >
     > > Regards,
     > > Sai Krishna
     > >
     > > On Saturday, June 17, 2023 at 8:59:56 PM UTC+5:30 Ralf Ramsauer
     > wrote:
     > >
     > > Hi,
     > >
     > > On 15/06/2023 10:11, sai krishna Allu wrote:
     > > > Hi Team,
     > > >
     > > > I have Raspberry Pi 4, which is installed with Ubuntu 20.04.5
    LTS
     > > 64 bit.
     > > > after loading the jailhouse.ko file, when I gave following
     > > command I am
     > > > getting the exception.
     > > >
     > > > ubuntu@ubuntu:~/jailhouse$ sudo jailhouse enable
     > > configs/arm64/rpi4.cell
     > > >
     > > > Initializing Jailhouse hypervisor v0.12 (0-g92db71f2) on CPU 0
     > > > Code location: 0x0000ffffc0200800
     > > > Page pool usage after early setup: mem 39/994, remap 0/131072
     > > > Initializing processors:
     > > >  CPU 0...
     > > > FATAL: Unhandled HYP exception: synchronous abort from EL2
     > >
     > > Synchronous abort from EL2 means that we have a fatal error inside
     > > Jailhouse (e.g., segfault).
     > >
     > > >  pc: 0000ffffc0203820   lr: 0000ffffc020380c spsr: 800003c9
     > EL2
     > >
     > > Could you please disassemble your hypervisor binary, and see
     > where the
     > > exception exactly occurs? Do this with:
     > >
     > > aarch64-objdump -d hypervisor/hypervisor.o
     > >
     > > And see what code executes behind 0x0000ffffc0203820.
    Alternatively,
     > > you
     > > can also attach the hypervisor.o.
     > >
     > > Thanks,
     > > Ralf
     > >
     > > >  sp: 0000ffffc021ee40  esr: 00 1 0000000
     > > >  x0: 0000000084000000   x1: 0000000000000008   x2:
     > 0000000080003580
     > > >  x3: 0000ffffc020e170   x4: 0000000000000014   x5:
     > 000003ffffffffff
     > > >  x6: 0000000000000029   x7: 0000ffffc0219d30   x8:
     > 000000000000002a
     > > >  x9: 0000000000000000  x10: 0000000000000000  x11:
     > 0000000000000001
     > > > x12: 0000000000000015  x13: 0000000000000001  x14:
     > 0000ffffc0219000
     > > > x15: 0000ffffc0015040  x16: 0000ffffc020d1fc  x17:
     > ffffbcae22826688
     > > > x18: 0000000000000001  x19: 0000ffffc021e000  x20:
     > 0000ffffc0219000
     > > > x21: 0000ffffc0200000  x22: 0000ffffc0219000  x23:
     > 0000000000000000
     > > > x24: 0000000000000001  x25: 0000ffffc021e000  x26:
     > 0000ffffc021f000
     > > > x27: 0000ffffc020f000  x28: 0000ffffc0218000  x29:
     > 0000ffffc021ee40
     > > >
     > > > Hypervisor stack before exception Stopping CPU 0 (Cell:
     > > "Raspberry-Pi4")
     > > >
     > > >
     > > > Please suggest how to fix this problem.
     > > >
     > > > Regards,
     > > > Sai Krishna
     > > >
     > > > --
     > > > You received this message because you are subscribed to the
    Google
     > > > Groups "Jailhouse" group.
     > > > To unsubscribe from this group and stop receiving emails from
    it,
     > > send
     > > > an email to [email protected]
     > > > <mailto:[email protected]>.
     > > > To view this discussion on the web visit
     > > >
     > >
     >
    https://groups.google.com/d/msgid/jailhouse-dev/3e6d4f38-5938-4da0-9666-9093a0b76300n%40googlegroups.com 
<https://groups.google.com/d/msgid/jailhouse-dev/3e6d4f38-5938-4da0-9666-9093a0b76300n%40googlegroups.com> 
<https://groups.google.com/d/msgid/jailhouse-dev/3e6d4f38-5938-4da0-9666-9093a0b76300n%40googlegroups.com 
<https://groups.google.com/d/msgid/jailhouse-dev/3e6d4f38-5938-4da0-9666-9093a0b76300n%40googlegroups.com>> 
<https://groups.google.com/d/msgid/jailhouse-dev/3e6d4f38-5938-4da0-9666-9093a0b76300n%40googlegroups.com 
<https://groups.google.com/d/msgid/jailhouse-dev/3e6d4f38-5938-4da0-9666-9093a0b76300n%40googlegroups.com> 
<https://groups.google.com/d/msgid/jailhouse-dev/3e6d4f38-5938-4da0-9666-9093a0b76300n%40googlegroups.com 
<https://groups.google.com/d/msgid/jailhouse-dev/3e6d4f38-5938-4da0-9666-9093a0b76300n%40googlegroups.com>>> 
<https://groups.google.com/d/msgid/jailhouse-dev/3e6d4f38-5938-4da0-9666-9093a0b76300n%40googlegroups.com?utm_medium=email&utm_source=footer 
<https://groups.google.com/d/msgid/jailhouse-dev/3e6d4f38-5938-4da0-9666-9093a0b76300n%40googlegroups.com?utm_medium=email&utm_source=footer> 
<https://groups.google.com/d/msgid/jailhouse-dev/3e6d4f38-5938-4da0-9666-9093a0b76300n%40googlegroups.com?utm_medium=email&utm_source=footer 
<https://groups.google.com/d/msgid/jailhouse-dev/3e6d4f38-5938-4da0-9666-9093a0b76300n%40googlegroups.com?utm_medium=email&utm_source=footer>> 
<https://groups.google.com/d/msgid/jailhouse-dev/3e6d4f38-5938-4da0-9666-9093a0b76300n%40googlegroups.com?utm_medium=email&utm_source=footer 
<https://groups.google.com/d/msgid/jailhouse-dev/3e6d4f38-5938-4da0-9666-9093a0b76300n%40googlegroups.com?utm_medium=email&utm_source=footer> 
<https://groups.google.com/d/msgid/jailhouse-dev/3e6d4f38-5938-4da0-9666-9093a0b76300n%40googlegroups.com?utm_medium=email&utm_source=footer 
<https://groups.google.com/d/msgid/jailhouse-dev/3e6d4f38-5938-4da0-9666-9093a0b76300n%40googlegroups.com?utm_medium=email&utm_source=footer>>>>.
     > >
     > > --
     > > You received this message because you are subscribed to the Google
     > > Groups "Jailhouse" group.
     > > To unsubscribe from this group and stop receiving emails from it,
     > send
     > > an email to [email protected]
     > > <mailto:[email protected]>.
     > > To view this discussion on the web visit
     > >
     >
    https://groups.google.com/d/msgid/jailhouse-dev/bdaa1499-4532-423f-a59d-812557f8162an%40googlegroups.com 
<https://groups.google.com/d/msgid/jailhouse-dev/bdaa1499-4532-423f-a59d-812557f8162an%40googlegroups.com> 
<https://groups.google.com/d/msgid/jailhouse-dev/bdaa1499-4532-423f-a59d-812557f8162an%40googlegroups.com 
<https://groups.google.com/d/msgid/jailhouse-dev/bdaa1499-4532-423f-a59d-812557f8162an%40googlegroups.com>> 
<https://groups.google.com/d/msgid/jailhouse-dev/bdaa1499-4532-423f-a59d-812557f8162an%40googlegroups.com?utm_medium=email&utm_source=footer
 
<https://groups.google.com/d/msgid/jailhouse-dev/bdaa1499-4532-423f-a59d-812557f8162an%40googlegroups.com?utm_medium=email&utm_source=footer>
 
<https://groups.google.com/d/msgid/jailhouse-dev/bdaa1499-4532-423f-a59d-812557f8162an%40googlegroups.com?utm_medium=email&utm_source=footer
 
<https://groups.google.com/d/msgid/jailhouse-dev/bdaa1499-4532-423f-a59d-812557f8162an%40googlegroups.com?utm_medium=email&utm_source=footer>>>.
     >
     > --
     > You received this message because you are subscribed to the Google
     > Groups "Jailhouse" group.
     > To unsubscribe from this group and stop receiving emails from it,
    send
     > an email to [email protected]
     > <mailto:[email protected]>.
     > To view this discussion on the web visit
     >
    
https://groups.google.com/d/msgid/jailhouse-dev/60a06afd-9ddd-4304-aee5-d61d8ebeb141n%40googlegroups.com 
<https://groups.google.com/d/msgid/jailhouse-dev/60a06afd-9ddd-4304-aee5-d61d8ebeb141n%40googlegroups.com>
 
<https://groups.google.com/d/msgid/jailhouse-dev/60a06afd-9ddd-4304-aee5-d61d8ebeb141n%40googlegroups.com?utm_medium=email&utm_source=footer
 
<https://groups.google.com/d/msgid/jailhouse-dev/60a06afd-9ddd-4304-aee5-d61d8ebeb141n%40googlegroups.com?utm_medium=email&utm_source=footer>>.

--
You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/ff5f75fd-7b70-424a-ab0e-537d4242afffn%40googlegroups.com <https://groups.google.com/d/msgid/jailhouse-dev/ff5f75fd-7b70-424a-ab0e-537d4242afffn%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/c439d69b-d40e-48aa-dd34-5b72f0ec9549%40oth-regensburg.de.

Reply via email to