+ Hafnium mailing list (Sorry didn't notice I had replied to you directly, and not included the mailing list. Others might have useful feedback to add.)
Friedrich, Will try to come back to you on your last query ASAP.
________________________________ From: Friedrich friedrichdoku@gmail.com Sent: Sunday, February 13, 2022 6:16 PM To: Joao Alves Joao.Alves@arm.com Subject: Re: [Hafnium] How to stop linux from preventing access to serial?
Hi João,
I am still having trouble getting my kernel to run using a secure partition. For some reason, my kernel only runs when I give it access to all the devices, but if I do this Linux is unable to run. Linux gives me stage-2 page faults. Is there any way around thiss? Here is my dts file for my kernel. Is there something I can change here to make this work? f I thought there is emulation for basic hardware features like timers and interrupt controllers. How can I use them in my secure partition?
/dts-v1/;
/ {
compatible = "arm,ffa-manifest-1.0";
debug_name = "partition-manifest";
/* Properties */
ffa-version = <0x00010001>; /* 31:16 - Major, 15:0 - Minor */
uuid = <0xb4b5671e 0x4a904fe1 0xb81ffb13 0xdae1dacb>;
execution-ctx-count = <4>;
exception-level = <0>; /* S-EL1 */
execution-state = <0>; /* AARCH64 */
load-address = <0x43000000>;
entrypoint-offset = <0x0000>;
xlat-granule = <0>; /* 4KiB */
messaging-method = <0x3>; /* Direct messaging only */
device-regions {
compatible = "arm,ffa-manifest-device-regions";
uart0 {
base-address = <0x00000000 0x01c28000>;
pages-count = <1>;
attributes = <0x3>; /* read-write */
};
};
};
Best, Friedrich
On Mon, Feb 7, 2022 at 4:56 AM Joao Alves <Joao.Alves@arm.commailto:Joao.Alves@arm.com> wrote: Hi Friederich,
It seems the problem you're facing has to do with Stage 2 translation faults. The UART needs to be mapped in the S2 translation of the respective partition that tries to use it. The given platform that you're using is likely to have more than one UART device assigned with different memory regions. Each device should be assigned to only one partition/kernel. Unmapping the UART from Linux shouldn't help on its own, as you're simply refraining Linux from using the UART. Depending on how you configured your Linux partition, it might still try to access it at a certain address and hit a page fault at Stage 2 translation.
If you are using Hafnium with FF-A partitions, you can map different UART devices through the FF-A partition manifest, as shown in the following link: https://review.trustedfirmware.org/plugins/gitiles/hafnium/hafnium/+/refs/he... The support for this (I think) might depend on the version that you're currently using.
Hafnium owns a UART device, that makes (indirectly) accessible to the VMs through an HVC call. Hafnium receives the bytes to write to the UART TX buffers through the GP registers through the HVC call interface. If you're trying to log the behaviour of your partition, this might be enough, and probably the easiest option to start with. Find the HVC call function helper: https://review.trustedfirmware.org/plugins/gitiles/hafnium/hafnium/+/refs/he... You can look for uses of the referred call.
Hope this helps. Let me know if you have further questions.
Best regards, João Alves
________________________________ From: Friedrich via Hafnium <hafnium@lists.trustedfirmware.orgmailto:hafnium@lists.trustedfirmware.org> Sent: Thursday, February 3, 2022 5:59 PM To: hafnium@lists.trustedfirmware.orgmailto:hafnium@lists.trustedfirmware.org <hafnium@lists.trustedfirmware.orgmailto:hafnium@lists.trustedfirmware.org> Subject: [Hafnium] How to stop linux from preventing access to serial?
Hi,
I am working with the hafnium hypervisor. I am running Linux alongside another kernel, and I need access to the serial device UART on the other kernel. When I am trying to output serial from the other kernel, hafnium says there is a stage 2 page fault. I tried disabling the serial device in linux, but now I am getting a different result. When I load the hafnium driver, I get a page fault. For some reason, if the device is not in /proc/iomem it throws an error.
How can I use my device in my kernel and disable it in Linux. Linux is the primary VM and my kernel is the secondary VM.
Thanks, Friedrich -- Hafnium mailing list -- hafnium@lists.trustedfirmware.orgmailto:hafnium@lists.trustedfirmware.org To unsubscribe send an email to hafnium-leave@lists.trustedfirmware.orgmailto:hafnium-leave@lists.trustedfirmware.org IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.