Re: Getting ACRN to work


Shuo A Liu
 

Hi Dubravko,

 

I learned from Fei that one of his patch(merged, for security) might impact PCIe devices in SOS, could you please help check if your HV include it?

 

commit 65ed6c3529de8b3f3d890e95a7d816afba7bf379

Author: Li Fei1 <fei1.li@...>

Date:   Thu Dec 5 22:51:06 2019 +0800

 

    hv: vpci: trap PCIe ECAM access for SOS

 

    SOS will use PCIe ECAM access PCIe external configuration space. HV should trap this

    access for security(Now pre-launched VM doesn't want to support PCI ECAM; post-launched

    VM trap PCIe ECAM access in DM).

    Besides, update PCIe MMCONFIG region to be owned by hypervisor and expose and pass through

    platform hide PCI devices by BIOS to SOS.

 

    Tracked-On: #3475

    Signed-off-by: Li Fei1 <fei1.li@...>

 

You can have a quick try to revert it firstly if it is included.

 

Thanks

shuo

From: acrn-users@... <acrn-users@...> On Behalf Of Dubravko Moravski | Exor Embedded S.r.l.
Sent: Thursday, February 27, 2020 02:19
To: acrn-users@...
Subject: Re: [acrn-users] Getting ACRN to work

 

Hi Zide,

 

Thank you for explaining all the kernel and Ubuntu options. It looks like all the use cases we are interested in are covered.

 

I've got a replacement board and I'm continuing with ACRN. I've followed your instructions regarding rebuilding the kernel, in which I've enabled the Intel igb network driver we need for the I211 chip.
The new kernel mostly works, however igb driver doesn't (and we really need the network):

clear@clr-sos-guest~/work/acrn-kernel $ cat ../../dmesg_bad.txt | grep igb

[    3.708554] calling  igb_init_module+0x0/0x4d @ 1

[    3.709199] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.4.0-k

[    3.710159] igb: Copyright (c) 2007-2014 Intel Corporation.

[    3.802746] igb 0000:04:00.0 0000:04:00.0 (uninitialized): PCIe link lost

[    4.120516] igb 0000:04:00.0: PHY reset is blocked due to SOL/IDER session.

[    7.504456] igb 0000:04:00.0: Invalid MAC Address

[    7.505779] igb: probe of 0000:04:00.0 failed with error -5

[    7.507585] initcall igb_init_module+0x0/0x4d returned 0 after 3709354 usecs

 

The "PCIe link lost" message originates in igb_main.c, approx line 740:

u32 igb_rd32(struct e1000_hw *hw, u32 reg)

{

        struct igb_adapter *igb = container_of(hw, struct igb_adapter, hw);

        u8 __iomem *hw_addr = READ_ONCE(hw->hw_addr);

        u32 value = 0;

 

        if (E1000_REMOVED(hw_addr))

                return ~value;

 

        value = readl(&hw_addr[reg]);

 

        /* reads should not return all F's */

        if (!(~value) && (!reg || !(~readl(hw_addr)))) {

                struct net_device *netdev = igb->netdev;

                hw->hw_addr = NULL;

                netdev_err(netdev, "PCIe link lost\n");

        }

 

        return value;

}

I think readl() for PCIe devices is basically a single PCIe transfer; in other words it's already the lowest possible level, looking from the software side of things, so it doesn't look like I could do much debugging here.

 

In regular Clear Linux, the driver consistently works and there are never any link issues:

clear@clr-sos-guest~ $ sudo dmesg | grep -i igb

Password:

[    4.473282] calling  igb_init_module+0x0/0x1000 [igb] @ 317

[    4.473306] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.6.0-k

[    4.473307] igb: Copyright (c) 2007-2014 Intel Corporation.

[    4.519304] igb 0000:04:00.0: added PHC on eth0

[    4.519307] igb 0000:04:00.0: Intel(R) Gigabit Ethernet Network Connection

[    4.519310] igb 0000:04:00.0: eth0: (PCIe:2.5Gb/s:Width x1) 00:30:d8:05:55:84

[    4.519314] igb 0000:04:00.0: eth0: PBA No: FFFFFF-0FF

[    4.519316] igb 0000:04:00.0: Using MSI-X interrupts. 2 rx queue(s), 2 tx queue(s)

[    4.519418] initcall igb_init_module+0x0/0x1000 [igb] returned 0 after 33714 usecs

[    5.390826] igb 0000:04:00.0 enp4s0: renamed from eth0

[    8.766862] igb 0000:04:00.0 enp4s0: igb: enp4s0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX

So is there some setting in ACRN that can affect PCIe communication, that I need to adjust for (external) PCIe devices?

 

Also with my ACRN-kernel, the mouse works but the cursor is invisible. In regular Clear Linux with 'native' kernel, with the same file system and GUI and system settings, the mouse works and the cursor is visible.

 

Best regards,

Dubravko

 

 

 

Dubravko Moravski

SW engineering

Exor Embedded S.r.l.

p:

+38 512455659  m: +38 5915402413

a:

Slavonska avenija, 50, Zagreb, Croatia, 10000

w:

exorint.com 

 

 Prima di stampare pensa ai costi ambientali. Please consider the environment before printing this email.

Privacy


From: acrn-users@... <acrn-users@...> on behalf of Chen, Zide via Lists.Projectacrn.Org <zide.chen=intel.com@...>
Sent: Friday, February 21, 2020 5:41 PM
To: acrn-users@... <acrn-users@...>
Subject: Re: [acrn-users] Getting ACRN to work

 

Hi Dubravko,

 

Yes, Service OS kernel can be acrn-kernel only because it has some ACRN specific modules. But UOS kernel doesn’t have such limitation, though normally we build UOS kernel from the same source with different config (kernel_config_uos).

 

You can run Ubuntu rootfs + acrn-kernel for SOS:

https://projectacrn.github.io/latest/tutorials/using_ubuntu_as_sos.html

 

And “real” Ubuntu as UOS:

https://projectacrn.github.io/latest/tutorials/running_ubun_as_user_vm.html

 

Best Regards,

Zide

 

 

From: acrn-users@... <acrn-users@...> On Behalf Of Dubravko Moravski | Exor Embedded S.r.l.
Sent: Friday, February 21, 2020 7:49 AM
To: acrn-users@...
Subject: Re: [acrn-users] Getting ACRN to work

 

Hi Zide,

 

I've noticed that for Service OS kernel, you've provided a link to a dedicated repository. I've had a meeting today and was asked to ask the experts on the mailing list to please clarify:

  • Is the dedicated SOS kernel the only one that will work with ACRN?
  • Does UOS also use a special kernel?
  • Related to the previous questions: we would like to use Ubuntu for both SOS and UOS, because many of our customers are familiar with it. Is that possible? If it's not possible to simply use such a distribution right away, is there a well-defined API or some other kind of interface in ACRN-specific kernels, that we could port to other kernels?

Best regards,

Dubravko

 

 

Dubravko Moravski

SW engineering

Exor Embedded S.r.l.

p:

+38 512455659  m: +38 5915402413

a:

Slavonska avenija, 50, Zagreb, Croatia, 10000

w:

exorint.com 

 

 Prima di stampare pensa ai costi ambientali. Please consider the environment before printing this email.

Privacy


From: acrn-users@... <acrn-users@...> on behalf of Dubravko Moravski | Exor Embedded S.r.l. via Lists.Projectacrn.Org <dubravko.moravski=exorembedded.net@...>
Sent: Thursday, February 20, 2020 4:06 PM
To: acrn-users@... <acrn-users@...>
Subject: Re: [acrn-users] Getting ACRN to work

 

Hi Zide,

 

I've managed to download the kernel as instructed, enable the required Ethernet driver, and compile the kernel.

 

Today when I wanted to test it, my board has died, for no particular reason. Hardware team thinks it's not repairable. I'll have to wait a couple of days at least until I get another one.

 

Best regards,

Dubravko

 

 

Dubravko Moravski

SW engineering

Exor Embedded S.r.l.

p:

+38 512455659  m: +38 5915402413

a:

Slavonska avenija, 50, Zagreb, Croatia, 10000

w:

exorint.com 

 

 Prima di stampare pensa ai costi ambientali. Please consider the environment before printing this email.

Privacy


From: acrn-users@... <acrn-users@...> on behalf of Chen, Zide via Lists.Projectacrn.Org <zide.chen=intel.com@...>
Sent: Wednesday, February 19, 2020 5:27 PM
To: acrn-users@... <acrn-users@...>
Subject: Re: [acrn-users] Getting ACRN to work

 

Hi Dubravko,

I assume x2apic is working for you now since you can mount rootfs. Then you may treat the Ethernet driver issue just like
it on the native Linux, for example, /lib/modules/ matches kernel version 'uname -r'? driver module exists? etc.

You may compile your own kernel like this:

$ git clone https://github.com/projectacrn/acrn-kernel.git
$ cd acrn-kernel
$ cp kernel_config_uefi_sos .config
$ make menuconfig
$ make

Best Regards,
Zide

Join {acrn-users@lists.projectacrn.org to automatically receive all group messages.