From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web12.12971.1651509336494431066 for ; Mon, 02 May 2022 09:35:36 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=muD903yU; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: prapal@linux.microsoft.com) Received: from [192.168.68.144] (072-191-074-059.res.spectrum.com [72.191.74.59]) by linux.microsoft.com (Postfix) with ESMTPSA id AD0E220E97CA for ; Mon, 2 May 2022 09:35:35 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com AD0E220E97CA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1651509335; bh=kG5U/DllzAUugm591Czg6IFrjPs5FKmFNnePDJZBJmg=; h=Date:Subject:From:To:Reply-To:References:In-Reply-To:From; b=muD903yUuHon0I8G76Cz5CIwgwao12P/Ryq0/RmxrSmmeb/2mqX1DXtyMbAExohPI PZ5QRmWsDY/9zTrX2dfgMeH3nLe387W9C2fEMZCJSXCqD2hV2bLXUGLqU0T7hquKxU ZUTaTJvDkoIe1Q+uzchkXgsjjOZdBalnEa40lvw0= Message-ID: <3a7d5d93-4d22-05a6-5b17-7d40ff91b841@linux.microsoft.com> Date: Mon, 2 May 2022 11:35:39 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [edk2-devel] vTPM support in cloud-Hypervisor in aarch64 From: "Praveen K Paladugu" To: devel@edk2.groups.io Reply-To: devel@edk2.groups.io References: <16E9DB2F22253A83.7308@groups.io> In-Reply-To: <16E9DB2F22253A83.7308@groups.io> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Folks, pinging on this thread to bubble it up. I'd appreciate any pointers you can provide on this bug. On 4/27/2022 1:00 PM, Praveen K Paladugu wrote: > Folks, >=20 > I am trying to enable vTPM support in Windows Guest while using > cloud-hypervisor as the VMM and OVMF firmware from edk2 repo. >=20 > The Firmware is built with the following command: >=20 > build -a AARCH64 -t GCC5 -p ArmVirtPkg/ArmVirtCloudHv.dsc -b DEBUG \ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -D TPM2_ENABLE=3DTRUE= -D TPM2_CONFIG_ENABLE=3DTRUE \ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -D SOURCE_DEBUG_ENABL= E >=20 > Below is the FDT, I am passing to the guest/firmware from > cloud-hypervisor: >=20 > =C2=A0Printing the FDT: > =C2=A0/ > =C2=A0=C2=A0 compatible : "linux,dummy-virt " > =C2=A0=C2=A0 #address-cells : [2] > =C2=A0=C2=A0 #size-cells : [2] > =C2=A0=C2=A0 interrupt-parent : [1] > =C2=A0=C2=A0 cpus/ > =C2=A0=C2=A0=C2=A0=C2=A0 #address-cells : [1] > =C2=A0=C2=A0=C2=A0=C2=A0 #size-cells : [0] > =C2=A0=C2=A0=C2=A0=C2=A0 cpu@0/ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 device_type : "cpu" > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 compatible : "arm,arm-v8 " > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 reg : [0] > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 phandle : [6] > =C2=A0=C2=A0=C2=A0=C2=A0 cpu-map/ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cluster0/ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 core0/ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 thread0/ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= cpu : [6] > =C2=A0=C2=A0 memory/ > =C2=A0=C2=A0=C2=A0=C2=A0 device_type : "memory" > =C2=A0=C2=A0=C2=A0=C2=A0 reg : [0, 40000000, 0, 80000000] > =C2=A0=C2=A0 chosen/ > =C2=A0=C2=A0=C2=A0=C2=A0 bootargs : "earlycon=3Dpl011,mmio,0x09000000" > =C2=A0=C2=A0 intc/ > =C2=A0=C2=A0=C2=A0=C2=A0 compatible : "arm,gic-v3 " > =C2=A0=C2=A0=C2=A0=C2=A0 interrupt-controller : [] > =C2=A0=C2=A0=C2=A0=C2=A0 #interrupt-cells : [3] > =C2=A0=C2=A0=C2=A0=C2=A0 reg : [0, 8FF0000, 0, 10000, 0, 8FD0000, 0, 2= 0000] > =C2=A0=C2=A0=C2=A0=C2=A0 phandle : [1] > =C2=A0=C2=A0=C2=A0=C2=A0 #address-cells : [2] > =C2=A0=C2=A0=C2=A0=C2=A0 #size-cells : [2] > =C2=A0=C2=A0=C2=A0=C2=A0 ranges : [] > =C2=A0=C2=A0=C2=A0=C2=A0 interrupts : [1, 9, 4] > =C2=A0=C2=A0=C2=A0=C2=A0 msic/ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 compatible : "arm,gic-v3-its " > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 msi-controller : [] > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 phandle : [2] > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 reg : [0, 8FB0000, 0, 20000] > =C2=A0=C2=A0 timer/ > =C2=A0=C2=A0=C2=A0=C2=A0 compatible : "arm,armv8-timer " > =C2=A0=C2=A0=C2=A0=C2=A0 always-on : [] > =C2=A0=C2=A0=C2=A0=C2=A0 interrupts : [1, D, 4, 1, E, 4, 1, B, 4, 1, A= , 4] > =C2=A0=C2=A0 pmu/ > =C2=A0=C2=A0=C2=A0=C2=A0 compatible : "arm,armv8-pmuv3 " > =C2=A0=C2=A0=C2=A0=C2=A0 interrupts : [1, 7, 104] > =C2=A0=C2=A0 apb-pclk/ > =C2=A0=C2=A0=C2=A0=C2=A0 compatible : "fixed-clock " > =C2=A0=C2=A0=C2=A0=C2=A0 #clock-cells : [0] > =C2=A0=C2=A0=C2=A0=C2=A0 clock-frequency : "\u{1}n6" > =C2=A0=C2=A0=C2=A0=C2=A0 clock-output-names : "clk24mhz" > =C2=A0=C2=A0=C2=A0=C2=A0 phandle : [3] > =C2=A0=C2=A0 psci/ > =C2=A0=C2=A0=C2=A0=C2=A0 compatible : "arm,psci-0.2 " > =C2=A0=C2=A0=C2=A0=C2=A0 method : "hvc" > =C2=A0=C2=A0 tpm@FED40000/ > =C2=A0=C2=A0=C2=A0=C2=A0 compatible : "tcg,tpm-tis-mmio " > =C2=A0=C2=A0=C2=A0=C2=A0 interrupts : [0, 2C, 1] > =C2=A0=C2=A0=C2=A0=C2=A0 reg : [0, FED40000, 0, 5000] > =C2=A0=C2=A0 pl011@9000000/ > =C2=A0=C2=A0=C2=A0=C2=A0 compatible : "arm,pl011 arm,primecell " > =C2=A0=C2=A0=C2=A0=C2=A0 reg : [0, 9000000, 0, 1000] > =C2=A0=C2=A0=C2=A0=C2=A0 clocks : [3] > =C2=A0=C2=A0=C2=A0=C2=A0 clock-names : "apb_pclk" > =C2=A0=C2=A0=C2=A0=C2=A0 interrupts : [0, B, 1] > =C2=A0=C2=A0 rtc@9010000/ > =C2=A0=C2=A0=C2=A0=C2=A0 compatible : "arm,pl031 arm,primecell " > =C2=A0=C2=A0=C2=A0=C2=A0 reg : [0, 9010000, 0, 1000] > =C2=A0=C2=A0=C2=A0=C2=A0 interrupts : [0, 8, 4] > =C2=A0=C2=A0=C2=A0=C2=A0 clocks : [3] > =C2=A0=C2=A0=C2=A0=C2=A0 clock-names : "apb_pclk" > =C2=A0=C2=A0 pl061@9020000/ > =C2=A0=C2=A0=C2=A0=C2=A0 compatible : "arm,pl061 arm,primecell " > =C2=A0=C2=A0=C2=A0=C2=A0 reg : [0, 9020000, 0, 1000] > =C2=A0=C2=A0=C2=A0=C2=A0 interrupts : [0, 9, 1] > =C2=A0=C2=A0=C2=A0=C2=A0 gpio-controller : [] > =C2=A0=C2=A0=C2=A0=C2=A0 #gpio-cells : [2] > =C2=A0=C2=A0=C2=A0=C2=A0 clocks : [3] > =C2=A0=C2=A0=C2=A0=C2=A0 clock-names : "apb_pclk" > =C2=A0=C2=A0=C2=A0=C2=A0 phandle : [4] > =C2=A0=C2=A0 gpio-keys/ > =C2=A0=C2=A0=C2=A0=C2=A0 compatible : "gpio-keys " > =C2=A0=C2=A0=C2=A0=C2=A0 #size-cells : [0] > =C2=A0=C2=A0=C2=A0=C2=A0 #address-cells : [1] > =C2=A0=C2=A0=C2=A0=C2=A0 button@1/ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 label : "GPIO Key Poweroff" > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 linux,code : [74] > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 gpios : [4, 3, 0] > =C2=A0=C2=A0 pci@30000000/ > =C2=A0=C2=A0=C2=A0=C2=A0 compatible : "pci-host-ecam-generic " > =C2=A0=C2=A0=C2=A0=C2=A0 device_type : "pci" > =C2=A0=C2=A0=C2=A0=C2=A0 ranges : [1000000, 0, 0, 0, 9050000, 0, 10000= , 2000000, 0,=20 > 10000000, 0, 10000000, 0, 20000000, 3000000, 2, 0, 2, 0, FD, 0] > =C2=A0=C2=A0=C2=A0=C2=A0 bus-range : [0, 0] > =C2=A0=C2=A0=C2=A0=C2=A0 linux,pci-domain : [0] > =C2=A0=C2=A0=C2=A0=C2=A0 #address-cells : [3] > =C2=A0=C2=A0=C2=A0=C2=A0 #size-cells : [2] > =C2=A0=C2=A0=C2=A0=C2=A0 reg : [0, 30000000, 0, 100000] > =C2=A0=C2=A0=C2=A0=C2=A0 #interrupt-cells : [1] > =C2=A0=C2=A0=C2=A0=C2=A0 interrupt-map : [] > =C2=A0=C2=A0=C2=A0=C2=A0 interrupt-map-mask : [] > =C2=A0=C2=A0=C2=A0=C2=A0 dma-coherent : [] > =C2=A0=C2=A0=C2=A0=C2=A0 msi-map : [0, 2, 0, 100] > =C2=A0=C2=A0=C2=A0=C2=A0 msi-parent : [2] >=20 >=20 > https://github.com/praveen-pk/edk2/commit/59cf5ce41ff6ad2f81273bbd55160= 747637c3cc2=20 >=20 > =C2=A0and > https://github.com/praveen-pk/edk2/commit/55e7fcc21b7aeaaae457f60f8427a= af1e2ff432c=20 >=20 >=20 > are the changes made to enable TPM support in cloud-hypervisor's recipe= . >=20 >=20 > With the above setup I am running into the following failure: >=20 > """"" >=20 > Install PPI: 6CC45765-CCE4-42FD-BC56-011AAAC6C9A8 > Install PPI: 8C9F4DE3-7B90-47EF-9308-287CECD66DE8 > Install PPI: E09F355D-DAE8-4910-B14A-92780FDCF7CB > Install PPI: 75CF14AE-3441-49DC-AA10-BB35A7BA8BAB > Loading PEIM BF7F2B0C-9F2F-4889-AB5C-12460022BE87 > add-symbol-file=20 > /root/winiot/edk2/Build/ArmVirtCloudHv-AARCH64/DEBUG_GCC5/AARCH64/OvmfP= kg/Tcg/Tcg2Config/Tcg2ConfigPei/DEBUG/Tcg2ConfigPei.dll=20 > 0xBFAC1240 >=20 > Loading PEIM at 0x000BFAC1160 EntryPoint=3D0x000BFAC2C2C Tcg2ConfigPei.= efi >=20 > Synchronous Exception at 0xBFAC312 > """" >=20 >=20 > Further debugging I noticed the Exception happens during an MmioRead.=20 > Below is the related trace: >=20 > """" > add-symbol-file=20 > /root/winiot/edk2/Build/ArmVirtCloudHv-AARCH6/DEBUG_GCC5/AARCH64/OvmfPk= g/Tcg/Tcg2Config/Tcg2ConfigPei/DEBUG/Tcg2ConfigPei.dll=20 > 0xBFAC1240 >=20 > Loading PEIM at 0x000BFAC1160 EntryPoint=3D0x000BFAC2C2C Tcg2ConfigPei.= efi >=20 > _ModuleEntryPoint > ProcessLibraryConstructorList start _ModuleEntryPoint > =C2=A0BaseDebugLibSerialPortConstructor > =C2=A0TimerConstructor > =C2=A0Tpm2DeviceLibConstructor > =C2=A0Tpm2GetPtpInterface Register =3D FED40000 > =C2=A0Tpm2IsPtpPresence Start, Reg =3D FED40000 > =C2=A0ioLibArmVirt.c MmioRead8 > =C2=A0ioLibArmVirt.c MmioRead8 > Synchronous Exception at 0xBFAC312 > """" >=20 > Any thoughts on what could be going wrong with TPM device configuration= =20 > in the firmware? I'd appreciate any inputs on this issue. >=20 --=20 Regards, Praveen K Paladugu