From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.92.40.39]) by mx.groups.io with SMTP id smtpd.web08.1447.1603392920376785910 for ; Thu, 22 Oct 2020 11:55:20 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@outlook.com header.s=selector1 header.b=CC39a2vn; spf=pass (domain: outlook.com, ip: 40.92.40.39, mailfrom: spbrogan@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NmtRgbfRnVG1TFvqipUuUFlGtRIrUPasQKijaGWLrJakhkr1GbijOYn1JPK7g3eVcGs4jK/wkkBByZc7Y3FCetW4Qhh4ZpStijzqO7+VaSs/MaM1dX7iS0FHVZ50No/Dk2VflPQT8bVkiE5gIyp3Zz1jwXEE17pN7HVKb4VVDYXrI56IUsD8tOo6H+ea/vPp36h7f51YzRWzvhCab1i+5J+NoB7Nw4kc1a+vq9EZ9V/ywGKv0Rhq9Emmv0KFKPhXjwjl8Kh9rH8g9Y6zaFe2ZDi+APh7BS4W1Ke9MowNC9PkXDv0CTC37uowmmmsjicSClqhykddWNoeaY7gIRWnaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+m2U2QHpeApY4SqCOJ8kpqbBT2yr0Dr1ONOZvLz8Os8=; b=LdE+gp2e9sQPNX+RZMPg4HbV/mMx09aw2x4COtmHcytE4aQOB2973PM81LLG0ZcFE/Q2D5bxFmeNE9XpL2qLSlFAP61VcmOLJY805Ta+g3kSyWlJ8aSHkoc9gKb9PXE1bLjPL9/osog0n/7wxJYtP7nxVXbb4aEB5hkj6f88rx5ezGVYzgCUgYg+XuLI0ZDuOsxAk4OciHlH0TILFny6mAJNAcD0kbZNGX6HwTGLvWQHaDExOdnAAzmmfssGY06KMlqPaZJwR51srB0tXf5QGtKiPBJDEwu207BCkV0N3P/oAbfjavhAY47IYGKV+jTPtHrf3YhJW1PmXj8o0XRRoA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+m2U2QHpeApY4SqCOJ8kpqbBT2yr0Dr1ONOZvLz8Os8=; b=CC39a2vnVw9xiDUqgsZgK+waIRQH/5st+TZFCxJ7ThTWSWJAmCy772UtCOoQE1/or3j9ECIpK75fwpuVTbvPMH9Bzvd6IJMozMH37Jd2f4TUkymVp3K1aGK2uTazdbJQlxPPgg590U/0cCV5BuMVh7OwXrirjYxh7ltEaSS1vayN5PUOBRJ4Oka154B1rEwr3hYTcGRxCvlkurCdfHpCOducIin/y7iEB5R6c3mjJWTUEmecOziVNtwwT5WvHiiBck1ghwU7hFur3IngEeTiujQh5j7CpHlzjV7waW8VrVi4tsjnOMVDIT7Pl4cao4RHbQUGQrwxvhGAHVZDiU4ddA== Received: from DM6NAM10FT021.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::4f) by DM6NAM10HT073.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::451) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Thu, 22 Oct 2020 18:55:19 +0000 Received: from BN8PR07MB6962.namprd07.prod.outlook.com (2a01:111:e400:7e86::41) by DM6NAM10FT021.mail.protection.outlook.com (2a01:111:e400:7e86::475) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Thu, 22 Oct 2020 18:55:19 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:4A9F000874E1D4EC67D89567BD01227BBF5A40EAB22ACCA5816820F36EE6413F;UpperCasedChecksum:95A33C197747B8AB923D377A5E4FD751A4E040A9E41182BE74B26E867D21B458;SizeAsReceived:8522;Count:45 Received: from BN8PR07MB6962.namprd07.prod.outlook.com ([fe80::b1be:f3e4:f6e:66c3]) by BN8PR07MB6962.namprd07.prod.outlook.com ([fe80::b1be:f3e4:f6e:66c3%5]) with mapi id 15.20.3477.028; Thu, 22 Oct 2020 18:55:18 +0000 To: "devel@edk2.groups.io" , discuss@edk2.groups.io From: "Sean" Subject: OVMF/QEMU shell based unit tests and writing to a virtual disk Message-ID: Date: Thu, 22 Oct 2020 11:55:16 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 X-TMN: [uCWNAQnTwD2e9CgkJq6sgHPs6E4rIbEN] X-ClientProxiedBy: MW2PR2101CA0010.namprd21.prod.outlook.com (2603:10b6:302:1::23) To BN8PR07MB6962.namprd07.prod.outlook.com (2603:10b6:408:d6::11) Return-Path: spbrogan@outlook.com X-Microsoft-Original-Message-ID: <25f09b88-5fbb-b2f8-0de9-536f5939fcdd@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.2.78] (50.47.113.221) by MW2PR2101CA0010.namprd21.prod.outlook.com (2603:10b6:302:1::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.4 via Frontend Transport; Thu, 22 Oct 2020 18:55:18 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 45 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: d45815c3-4362-476b-033a-08d876bc052e X-MS-TrafficTypeDiagnostic: DM6NAM10HT073: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H4e2G0ny/Upwv2NqVazMficELvTMRG0i2TmQys7wkYHuy2uzJbtmgEV0QD00cfYQPe3QioX9Eqr/+rHbMolfvtLu+hwPEVpu1JwOzBmAWQXD80ws9Y9Dyi0xH6Ug/pZIe9+/jnW9hHJQGwsv02Cs9QJT+0NOBxQu4g2ryPigsncJFRB9bOXP1hBq7iih+CTyzSEzrgmFeBIeRUlkyDQVsf8hUdkbPIi1f6RZAXKAiJbaLcJE+0kCWBKG3BqIj946 X-MS-Exchange-AntiSpam-MessageData: 3g9dQLCz4Zmu6KjGNMKGpur1rLibB0Yn7HyGoGKhaKyzDFvBB7INKrgty2dQBMCanoXR8TwRFtwBmwsUA/ry+8U6TPoV+JiqnBd++l+pxhGs+YodCjn6GxFm1YtICAGgxJg+La0Pw9R0IjE4jTIXHQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d45815c3-4362-476b-033a-08d876bc052e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2020 18:55:18.8245 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DM6NAM10FT021.eop-nam10.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM10HT073 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Laszlo and others familiar with QEMU, I am trying to write automation that boots QEMU/OVMF and then runs EFI applications and those efi applications then use the UEFI shell apis to write back to the disk their state. I am seeing very inconsistent results with sometimes it working fine while other times the disk contents are invalid. If i run multiple tests it seems like the first two work while the 3rd seems to start failing but overall it seems random. Failing means: Disk contents corrupted but present. Disk contents wrong size (short). Files that show written in UEFI shell never show up on host. I am trying to determine if this is a known limitation with QEMU or a bug i need to track down in the unit test code. My setup: This is on a Windows 10 x64 host. I am running current 5.1 version of QEMU. My script creates a folder in the Windows NTFS file system. Copies the EFI executables and startup.nsh files to it. Then starts QEMU with the following additional parameter. -drive file=fat:rw:{VirtualDrive},format=raw,media=disk VirtualDrive is the Windows file path of the said mentioned folder. If interested you should be able to reproduce the results by pulling my branch and/or you can review the above. You can see the operations here: PR: https://github.com/microsoft/mu_tiano_platforms/pull/1 My Branch: https://github.com/spbrogan/mu_tiano_platforms/tree/personal/sebrogan/shellunittests Or if interested you can reproduce it by following steps defined here: https://github.com/spbrogan/mu_tiano_platforms/blob/personal/sebrogan/shellunittests/Platforms/QemuQ35Pkg/Docs/building.md and more details here https://github.com/spbrogan/mu_tiano_platforms/blob/personal/sebrogan/shellunittests/Platforms/QemuQ35Pkg/Plugins/QemuRunner/ReadMe.md After building qemu with the right parameters for your environment you can run --flashonly MARK_STARTUP_NSH=TRUE RUN_UNIT_TESTS=TRUE For example in my environment it looks like stuart_build -c Platforms\QemuQ35Pkg\PlatformBuild.py TOOL_CHAIN_TAG=VS2019 --flashonly RUN_UNIT_TESTS=TRUE MAKE_STARTUP_NSH=TRUE Anyway if i recall correctly last year when we talked briefly about automation there was some concern that this would happen. Any information and/or ideas would be greatly appreciated. Thanks Sean