From nobody Mon Feb 9 01:30:51 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607456960; cv=none; d=zohomail.com; s=zohoarc; b=Hq/l91Qx3LeeFKWYmS5TBEZTryK9+L6hqC39EK1wcWy3n/QzUjAhdIcP+MPnPKVnX6ojlhTlziW/eq2ZoOw7zd6Ul0FQ06k5Edc2XlGAeFF0NER7lVl4790wq4cxV1AA0sd8c2MigrIltPyJUr6rjZ9EbNQZe+t2BR5TqL9n3nw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607456960; h=Content-Type: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=WHE7KFDKGldERbfBu/1KjueHDoBVCOeK90uoPSHzyjk=; b=cO0SjuDvoh4gmjE1PbXamWCCgG8EOKzytLtPoOUnhi5IEH8UYqzsAp1SiSCipPpOt40AQNgGd9JeGi8MhN1UaUAtSzQ+yjOnP0wdhewBQtR5q3jtTtFNdJdkwfQmIamJBhFmlicXiiKGjt0SwTFMEF+hxey+D5BmfBBFBiYs5D4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607456960517661.1829519783663; Tue, 8 Dec 2020 11:49:20 -0800 (PST) Received: from localhost ([::1]:58742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kmiz8-0000m3-Tb for importer@patchew.org; Tue, 08 Dec 2020 14:49:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmiku-0005FP-2h for qemu-devel@nongnu.org; Tue, 08 Dec 2020 14:34:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:26203) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kmikq-0004sT-1t for qemu-devel@nongnu.org; Tue, 08 Dec 2020 14:34:35 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-422-mKsQoEdFMIWM7laxXAv33Q-1; Tue, 08 Dec 2020 14:34:29 -0500 Received: by mail-wm1-f69.google.com with SMTP id k23so1285085wmj.1 for ; Tue, 08 Dec 2020 11:34:29 -0800 (PST) Received: from redhat.com (bzq-79-176-44-197.red.bezeqint.net. [79.176.44.197]) by smtp.gmail.com with ESMTPSA id e16sm11656976wra.94.2020.12.08.11.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Dec 2020 11:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607456071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WHE7KFDKGldERbfBu/1KjueHDoBVCOeK90uoPSHzyjk=; b=W+7ICiOIHEAOLNCvXl7LHklAMHrI/hibwe0SrDhJQR7cpfmmfLdsvv/CWILKCmckRyn0F+ Ow1uiN2AH5hqiW4mh8IC5G+EKGADX/uump06iGeOKND104BRudCGTgchT2/Csn6vF1nzMg xSBYl/dUjwhRpSAsPwdS8YrTDn89aGA= X-MC-Unique: mKsQoEdFMIWM7laxXAv33Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=WHE7KFDKGldERbfBu/1KjueHDoBVCOeK90uoPSHzyjk=; b=d9RsmMHiG53XUxvB5f+PR9RlwQ4QQDh9Z/6UaCZtRDsGxNA72M6WaFj/yY7NRdQWTc JsDflo+IAF8Vb1itJ15t+DHQRaetdEP/LRsYIJYmvc+MOTUgin7qdgQ3iRVL8e4kUMr1 eOdNH1q9+Iv694M0zcto94sTbrbhO/6LARabWVsTVUBxjh8ygwf2UYN7ifZQsmktJ2Om PR+J7plskrm/8QZpyHSqZq/DGe/DG9bXF0sjtf0z6HSCC0LB+6zU+BBaK/V1iDfupELv cE8BAkO4VglnyXU2YxEpZHUv/sA4nKl1/eR5vBbochF9yhNYz97L4dWCi0JXGtyBRVcR uRCA== X-Gm-Message-State: AOAM530li/IZMZskm6AAqVPoxnPqUk2ARCthc2yoJ/sIHmpUXRUtGFDx +CDBQ/fGGroz34pz1mZPkMbu4gdXKDb1H0iCcfD9lF/0Qo3Vq4vZ2K9C3X7wZeTDov9F+lOGuLw g5oDp/1D9QqBNMzk2MH+B+C/IlZy9zlBuZah+J4xD51iLkA+9/+tosXSkuwBu X-Received: by 2002:a05:6000:12c3:: with SMTP id l3mr25168124wrx.112.1607456067696; Tue, 08 Dec 2020 11:34:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTbu3pSILCSGpCSm8hXCrXkmDpxrYIp/i+3MUtEJuN8Fg5tJ+TUzUWmcIahX+PZ4DnU69cbQ== X-Received: by 2002:a05:6000:12c3:: with SMTP id l3mr25168099wrx.112.1607456067433; Tue, 08 Dec 2020 11:34:27 -0800 (PST) Date: Tue, 8 Dec 2020 14:34:24 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 15/66] unit-test: Add testcase for pxb Message-ID: <20201208193307.646726-16-mst@redhat.com> References: <20201208193307.646726-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20201208193307.646726-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline 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=63.128.21.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: Peter Maydell , Yubo Miao , Jiahui Cen , Igor Mammedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Transfer-Encoding: quoted-printable 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 Message-Id: <20201119014841.7298-9-cenjiahui@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- 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 MST