From nobody Mon Feb 9 10:12:28 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1604406489; cv=none; d=zohomail.com; s=zohoarc; b=bSum8HgxpjhzzBngn3qvS0YJqG0qHsSFubsE7glv+Sst1WPs8XkdagnT9sf8mpPx397I3t+8d2jfH3ZvJtlAoJCvkMs27pVaw3ZOU3EpaJ94HCaiI/mBkhTa33rQNpDtbC6cjOEbaBR1B7MtuwV4bjeI1caGZlK0tjgKp34Kecs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604406489; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rP3/XDH4zf/zOw2g8Z35KWAofF433S4LbieeVtZ77xw=; b=NKSGKLw5OVnq6yxczk08V1fdgU+1wk9AWxLDxdDFnuhJXhbXG3fdzGQg6fOzdYFzImUo4fLazSPtOrbZYiUD62zkeWKFL+hkM5ogMdnFrgSIjHaPtLCZU71hBwY1J5/GNmupZ6WY+nJAhKCi5YbBAsbC4vjJoOtbvLsejNbOSus= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1604406489605382.55361060274674; Tue, 3 Nov 2020 04:28:09 -0800 (PST) Received: from localhost ([::1]:44152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZvQ0-0000M0-Ak for importer@patchew.org; Tue, 03 Nov 2020 07:28:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZvIP-0008UR-Hi for qemu-devel@nongnu.org; Tue, 03 Nov 2020 07:20:17 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:2325) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZvIJ-00086B-Od for qemu-devel@nongnu.org; Tue, 03 Nov 2020 07:20:17 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CQTPd0hTZzkcWD; Tue, 3 Nov 2020 20:20:05 +0800 (CST) Received: from localhost (10.174.184.155) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Tue, 3 Nov 2020 20:19:59 +0800 From: Jiahui Cen To: Subject: [PATCH v9 7/8] unit-test: Add testcase for pxb Date: Tue, 3 Nov 2020 20:01:56 +0800 Message-ID: <20201103120157.2286-8-cenjiahui@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201103120157.2286-1-cenjiahui@huawei.com> References: <20201103120157.2286-1-cenjiahui@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.174.184.155] X-CFilter-Loop: Reflected Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=45.249.212.190; envelope-from=cenjiahui@huawei.com; helo=szxga04-in.huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/03 04:56:56 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: xieyingtai@huawei.com, peter.maydell@linaro.org, Jiahui Cen , berrange@redhat.com, mst@redhat.com, xiexiangyou@huawei.com, shannon.zhaosl@gmail.com, miaoyubo@huawei.com, imammedo@redhat.com, lersek@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Yubo Miao Add testcase for pxb to make sure the ACPI table is correct for guest. Signed-off-by: Yubo Miao Signed-off-by: Jiahui Cen --- tests/qtest/bios-tables-test.c | 58 ++++++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index f23a5335a8..64a9a772ee 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -671,12 +671,21 @@ static void test_acpi_one(const char *params, test_da= ta *data) * TODO: convert '-drive if=3Dpflash' to new syntax (see e33763be7= cd3) * when arm/virt boad starts to support it. */ - args =3D g_strdup_printf("-machine %s %s -accel tcg -nodefaults -n= ographic " - "-drive if=3Dpflash,format=3Draw,file=3D%s,readonly " - "-drive if=3Dpflash,format=3Draw,file=3D%s,snapshot=3Don -cdro= m %s %s", - data->machine, data->tcg_only ? "" : "-accel kvm", - data->uefi_fl1, data->uefi_fl2, data->cd, params ? params : ""= ); - + if (data->cd) { + args =3D g_strdup_printf("-machine %s %s -accel tcg " + "-nodefaults -nographic " + "-drive if=3Dpflash,format=3Draw,file=3D%s,readonly " + "-drive if=3Dpflash,format=3Draw,file=3D%s,snapshot=3Don -= cdrom %s %s", + data->machine, data->tcg_only ? "" : "-accel kvm", + data->uefi_fl1, data->uefi_fl2, data->cd, params ? params = : ""); + } else { + args =3D g_strdup_printf("-machine %s %s -accel tcg " + "-nodefaults -nographic " + "-drive if=3Dpflash,format=3Draw,file=3D%s,readonly " + "-drive if=3Dpflash,format=3Draw,file=3D%s,snapshot=3Don %= s", + data->machine, data->tcg_only ? "" : "-accel kvm", + data->uefi_fl1, data->uefi_fl2, params ? params : ""); + } } else { args =3D g_strdup_printf("-machine %s %s -accel tcg " "-net none -display none %s " @@ -1176,6 +1185,40 @@ static void test_acpi_virt_tcg_numamem(void) =20 } =20 +#ifdef CONFIG_PXB +static void test_acpi_virt_tcg_pxb(void) +{ + test_data data =3D { + .machine =3D "virt", + .tcg_only =3D true, + .uefi_fl1 =3D "pc-bios/edk2-aarch64-code.fd", + .uefi_fl2 =3D "pc-bios/edk2-arm-vars.fd", + .ram_start =3D 0x40000000ULL, + .scan_len =3D 128ULL * 1024 * 1024, + }; + /* + * While using -cdrom, the cdrom would auto plugged into pxb-pcie, + * the reason is the bus of pxb-pcie is also root bus, it would lead + * to the error only PCI/PCIE bridge could plug onto pxb. + * Therefore,thr cdrom is defined and plugged onto the scsi controller + * to solve the conflicts. + */ + data.variant =3D ".pxb"; + test_acpi_one(" -device pcie-root-port,chassis=3D1,id=3Dpci.1" + " -device virtio-scsi-pci,id=3Dscsi0,bus=3Dpci.1" + " -drive file=3D" + "tests/data/uefi-boot-images/bios-tables-test.aarch64.is= o.qcow2," + "if=3Dnone,media=3Dcdrom,id=3Ddrive-scsi0-0-0-1,readonly= =3Don" + " -device scsi-cd,bus=3Dscsi0.0,scsi-id=3D0," + "drive=3Ddrive-scsi0-0-0-1,id=3Dscsi0-0-0-1,bootindex=3D= 1" + " -cpu cortex-a57" + " -device pxb-pcie,bus_nr=3D128", + &data); + + free_test_data(&data); +} +#endif + static void test_acpi_tcg_acpi_hmat(const char *machine) { test_data data; @@ -1287,6 +1330,9 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/virt", test_acpi_virt_tcg); qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem); qtest_add_func("acpi/virt/memhp", test_acpi_virt_tcg_memhp); +#ifdef CONFIG_PXB + qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb); +#endif } ret =3D g_test_run(); boot_sector_cleanup(disk); --=20 2.19.1