From patchwork Fri Dec 6 14:00:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wainer dos Santos Moschetta X-Patchwork-Id: 11276673 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2A84113B6 for ; Fri, 6 Dec 2019 14:47:22 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 006AF21835 for ; Fri, 6 Dec 2019 14:47:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="A8aApw5n" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 006AF21835 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:38900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idEt6-0000Dc-WD for patchwork-qemu-devel@patchwork.kernel.org; Fri, 06 Dec 2019 09:47:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59602) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idEOL-0001T3-Lg for qemu-devel@nongnu.org; Fri, 06 Dec 2019 09:15:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1idEOK-0001Zc-DI for qemu-devel@nongnu.org; Fri, 06 Dec 2019 09:15:33 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:46173 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1idEOJ-0001Yh-Jx for qemu-devel@nongnu.org; Fri, 06 Dec 2019 09:15:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575641731; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0ygww+v1oU+33ypIhc68siMy+/iwT5tY9NlCzUkIOiA=; b=A8aApw5nNVPodUplLF5mGvlNUrTv9FBQ+p9DE7UcJuaU2GuqLVLfVZA+07E3Rs8wKSvDjt g6tyRptEfuW2QTfnPWlPfoyb7pq+E8r795XGTKMu5WWqSm2COJB0AoHzCXQBshA2LlFvAj 7yKjsgGE27nHnsfOS/3Fr7KIJ2uE2o8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-119-DQjdipU1PaOFvZ-KIQj4Mg-1; Fri, 06 Dec 2019 09:00:18 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8DEA2593AB; Fri, 6 Dec 2019 14:00:17 +0000 (UTC) Received: from virtlab501.virt.lab.eng.bos.redhat.com (virtlab501.virt.lab.eng.bos.redhat.com [10.19.152.162]) by smtp.corp.redhat.com (Postfix) with ESMTP id A059E60FC1; Fri, 6 Dec 2019 14:00:16 +0000 (UTC) From: Wainer dos Santos Moschetta To: qemu-devel@nongnu.org Subject: [PATCH 1/2] tests/acceptance: Add PVH boot test Date: Fri, 6 Dec 2019 09:00:11 -0500 Message-Id: <20191206140012.15517-2-wainersm@redhat.com> In-Reply-To: <20191206140012.15517-1-wainersm@redhat.com> References: <20191206140012.15517-1-wainersm@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: DQjdipU1PaOFvZ-KIQj4Mg-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 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: fam@euphon.net, alex.bennee@linaro.org, wrampazz@redhat.com, crosa@redhat.com, philmd@redhat.com, sgarzare@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" QEMU 4.0 onward is able to boot an uncompressed kernel image by using the x86/HVM direct boot ABI. It needs Linux >= 4.21 built with CONFIG_PVH=y. This introduces an acceptance test which checks an uncompressed Linux kernel image boots properly. Signed-off-by: Wainer dos Santos Moschetta Tested-by: Willian Rampazzo --- tests/acceptance/pvh.py | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/acceptance/pvh.py diff --git a/tests/acceptance/pvh.py b/tests/acceptance/pvh.py new file mode 100644 index 0000000000..c68489c273 --- /dev/null +++ b/tests/acceptance/pvh.py @@ -0,0 +1,48 @@ +# Copyright (c) 2019 Red Hat, Inc. +# +# Author: +# Wainer dos Santos Moschetta +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +""" +x86/HVM direct boot acceptance tests. +""" + +from avocado.utils.kernel import KernelBuild +from avocado_qemu import Test +from avocado_qemu import wait_for_console_pattern + + +class Pvh(Test): + """ + Test suite for x86/HVM direct boot feature. + + :avocado: tags=slow,arch=x86_64,machine=q35 + """ + def test_boot_vmlinux(self): + """ + Boot uncompressed kernel image. + """ + # QEMU can boot a vmlinux image for kernel >= 4.21 built + # with CONFIG_PVH=y + kernel_version = '5.4.1' + kbuild = KernelBuild(kernel_version, work_dir=self.workdir) + try: + kbuild.download() + kbuild.uncompress() + kbuild.configure(targets=['defconfig', 'kvmconfig'], + extra_configs=['CONFIG_PVH=y']) + kbuild.build() + except: + self.cancel("Unable to build vanilla kernel %s" % kernel_version) + + self.vm.set_machine('q35') + self.vm.set_console() + kernel_command_line = 'printk.time=0 console=ttyS0' + self.vm.add_args('-kernel', kbuild.vmlinux, + '-append', kernel_command_line) + self.vm.launch() + wait_for_console_pattern(self, 'Kernel command line: %s' % + kernel_command_line) From patchwork Fri Dec 6 14:00:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wainer dos Santos Moschetta X-Patchwork-Id: 11276365 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC293138D for ; Fri, 6 Dec 2019 14:07:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C1E09206DF for ; Fri, 6 Dec 2019 14:07:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bpXWIkXk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1E09206DF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:37814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idEGo-0001bM-Pi for patchwork-qemu-devel@patchwork.kernel.org; Fri, 06 Dec 2019 09:07:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48364) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idEGC-0000oX-He for qemu-devel@nongnu.org; Fri, 06 Dec 2019 09:07:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1idEG9-0006gu-Si for qemu-devel@nongnu.org; Fri, 06 Dec 2019 09:07:06 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:47889 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1idEG9-0006fV-Kj for qemu-devel@nongnu.org; Fri, 06 Dec 2019 09:07:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575641224; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uL6xgSKpIW04lcKl/oQ5qUW1xPRml+iMeURzo8n7Duk=; b=bpXWIkXk9Sg2aiT/LYF/eNws+z1vt7cCJb7sXDsc3PDLMdlOmxZcm9OTylOXkeXTM6E41J BFFTsHYjHpL5W0iCWNUJBXSVHT+0cGel0T0zDr9HalvyVqizI760A79Thj3eDXYj9CKyVa fYipGMFH/AxbpB8DDPBItwi+Pxh1YUw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-310-_sgUj_zxOxivOOt7eiW6Uw-1; Fri, 06 Dec 2019 09:00:19 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 961C81856A6C; Fri, 6 Dec 2019 14:00:18 +0000 (UTC) Received: from virtlab501.virt.lab.eng.bos.redhat.com (virtlab501.virt.lab.eng.bos.redhat.com [10.19.152.162]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0DD160FC1; Fri, 6 Dec 2019 14:00:17 +0000 (UTC) From: Wainer dos Santos Moschetta To: qemu-devel@nongnu.org Subject: [PATCH 2/2] .travis.yml: Add kernel build deps for acceptance tests Date: Fri, 6 Dec 2019 09:00:12 -0500 Message-Id: <20191206140012.15517-3-wainersm@redhat.com> In-Reply-To: <20191206140012.15517-1-wainersm@redhat.com> References: <20191206140012.15517-1-wainersm@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: _sgUj_zxOxivOOt7eiW6Uw-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 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: fam@euphon.net, alex.bennee@linaro.org, wrampazz@redhat.com, crosa@redhat.com, philmd@redhat.com, sgarzare@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" The tests/acceptance/pvh.py test builds the Linux kernel at runtime so it needs dependencies installed in the container. Current used container image misses only libelf-dev, which is then added with this change. Signed-off-by: Wainer dos Santos Moschetta --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 445b0646c1..d8fe98eb63 100644 --- a/.travis.yml +++ b/.travis.yml @@ -277,6 +277,8 @@ matrix: - python3.5-venv - tesseract-ocr - tesseract-ocr-eng + # Additional kernel build dependencies + - libelf-dev # Using newer GCC with sanitizers