From patchwork Thu Dec 5 12:18:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 22056 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 94BAA202E0 for ; Thu, 5 Dec 2013 12:18:42 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id m1sf57727898oag.9 for ; Thu, 05 Dec 2013 04:18:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=3+dS3PVOR6ZCp0xT4aOGcI+8VaFlbFcWv6OWMgPC1gU=; b=QxnKeeIpz9eJoVKLCEFOl85pjx1TdWgGuE31/MoAPLnxY5E0Z7f5MYh1BDNAnwcfDp V3yv0dRU3KDB4jJ7cptxdK7442Y1OaHmWYhye4IcfH13wUGopEajV6nsVQf/3OJLx+eJ Q26yNGMGUnXiXjLCN0thiHmwvyLdINi8suQe3zIRHqltmA/fQ47UKNHgsUqcTkxKauRm R/4N9Ve6246a8w4PCvv9S7Ymk3WSV3iv3wInGVhHEGUwxhYtD5Rfubtt3qSSUBZD4cI0 xQ4cx8SyJLzQhgKnSTQ22zzLqRG7y+/jsCnAmsvBqBeSHGOyOUEAfKEInTWT1a8A3okH fLKQ== X-Gm-Message-State: ALoCoQn6D42R1C6agYr/BdHP/avfcfft1oMqGDfxWdIK/YM6bwguDAL0xalwBkgy0niAwIy5tGXf X-Received: by 10.50.164.198 with SMTP id ys6mr2386393igb.5.1386245921212; Thu, 05 Dec 2013 04:18:41 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.3.228 with SMTP id f4ls830513qef.85.gmail; Thu, 05 Dec 2013 04:18:41 -0800 (PST) X-Received: by 10.220.182.137 with SMTP id cc9mr44345vcb.62.1386245921081; Thu, 05 Dec 2013 04:18:41 -0800 (PST) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id th8si27253524vdc.154.2013.12.05.04.18.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 04:18:40 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id oy12so13407432veb.40 for ; Thu, 05 Dec 2013 04:18:40 -0800 (PST) X-Received: by 10.52.113.97 with SMTP id ix1mr14435162vdb.9.1386245920760; Thu, 05 Dec 2013 04:18:40 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp10395vcz; Thu, 5 Dec 2013 04:18:40 -0800 (PST) X-Received: by 10.68.224.38 with SMTP id qz6mr24568418pbc.156.1386245919598; Thu, 05 Dec 2013 04:18:39 -0800 (PST) Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by mx.google.com with ESMTPS id bt3si36076541pbb.134.2013.12.05.04.18.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 04:18:39 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.175 is neither permitted nor denied by best guess record for domain of pranavkumar@linaro.org) client-ip=209.85.192.175; Received: by mail-pd0-f175.google.com with SMTP id w10so24464539pde.20 for ; Thu, 05 Dec 2013 04:18:39 -0800 (PST) X-Received: by 10.68.29.72 with SMTP id i8mr52624282pbh.116.1386245919118; Thu, 05 Dec 2013 04:18:39 -0800 (PST) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id gh3sm144388984pbb.2.2013.12.05.04.18.35 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 04:18:38 -0800 (PST) From: Pranavkumar Sawargaonkar To: libvirt-list@redhat.com Cc: crobinso@redhat.com, berrange@redhat.com, patches@linaro.org, anup.patel@linaro.org, patches@apm.com, Pranavkumar Sawargaonkar Subject: [PATCH V2] AArch64: Porting of armv7l conditons to run qemu for aarch64. Date: Thu, 5 Dec 2013 17:48:09 +0530 Message-Id: <1386245889-18971-1-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pranavkumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , AArch64 qemu has similar behavior as armv7l, like use of mmio etc. This patch adds similar bypass checks what we have for armv7l to aarch64. E.g. we are enabling mmio transport for Nicdev. Making addDefaultUSB and addDefaultMemballoon to false etc. This patch also adds testcase to qemuxml2argvtest as suggested during review comments of V1 of same patch. Signed-off-by: Anup Patel Signed-off-by: Pranavkumar Sawargaonkar --- src/qemu/qemu_capabilities.c | 2 +- src/qemu/qemu_command.c | 8 ++-- src/qemu/qemu_domain.c | 4 ++ .../qemuxml2argv-aarch64-virt-virtio.args | 14 ++++++ .../qemuxml2argv-aarch64-virt-virtio.xml | 45 ++++++++++++++++++++ tests/qemuxml2argvtest.c | 4 ++ 6 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.xml diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index a68e555..9df3292 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2889,7 +2889,7 @@ virQEMUCapsSupportsChardev(virDomainDefPtr def, !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) return false; - if (def->os.arch != VIR_ARCH_ARMV7L) + if ((def->os.arch != VIR_ARCH_ARMV7L) && (def->os.arch != VIR_ARCH_AARCH64)) return true; /* This may not be true for all ARM machine types, but at least diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 9539be7..62a16a2 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -427,7 +427,8 @@ qemuDomainSupportsNicdev(virDomainDefPtr def, return false; /* non-virtio ARM nics require legacy -net nic */ - if (def->os.arch == VIR_ARCH_ARMV7L && + if (((def->os.arch == VIR_ARCH_ARMV7L) || + (def->os.arch == VIR_ARCH_AARCH64)) && net->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO) return false; @@ -1340,7 +1341,8 @@ static int qemuDomainAssignARMVirtioMMIOAddresses(virDomainDefPtr def, virQEMUCapsPtr qemuCaps) { - if (def->os.arch == VIR_ARCH_ARMV7L && + if (((def->os.arch == VIR_ARCH_ARMV7L) || + (def->os.arch == VIR_ARCH_AARCH64)) && (STRPREFIX(def->os.machine, "vexpress-") || STREQ(def->os.machine, "virt")) && virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO)) { @@ -1872,7 +1874,7 @@ cleanup: static bool qemuDomainSupportsPCI(virDomainDefPtr def) { - if (def->os.arch != VIR_ARCH_ARMV7L) + if ((def->os.arch != VIR_ARCH_ARMV7L) && (def->os.arch != VIR_ARCH_AARCH64)) return true; if (STREQ(def->os.machine, "versatilepb")) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 346fec3..529b367 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -727,6 +727,10 @@ qemuDomainDefPostParse(virDomainDefPtr def, addDefaultUSB = false; addDefaultMemballoon = false; break; + case VIR_ARCH_AARCH64: + addDefaultUSB = false; + addDefaultMemballoon = false; + break; case VIR_ARCH_ALPHA: case VIR_ARCH_PPC: diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args new file mode 100644 index 0000000..afd6e41 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args @@ -0,0 +1,14 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-aarch64 -S -M virt -m 1024 -smp 1 -nographic \ +-nodefconfig -nodefaults -monitor unix:/tmp/test-monitor,server,nowait \ +-boot c -kernel /aarch64.kernel -initrd /aarch64.initrd -append \ +'earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait' \ +-dtb /aarch64.dtb -device virtio-serial-device,id=virtio-serial0 -usb \ +-drive file=/aarch64.raw,if=none,id=drive-virtio-disk0 \ +-device virtio-blk-device,drive=drive-virtio-disk0,id=virtio-disk0 \ +-device virtio-net-device,vlan=0,id=net0,mac=52:54:00:09:a4:37 \ +-net user,vlan=0,name=hostnet0 -serial pty -chardev pty,id=charconsole1 \ +-device virtconsole,chardev=charconsole1,id=console1 \ +-device virtio-balloon-device,id=balloon0 \ +-object rng-random,id=rng0,filename=/dev/random \ +-device virtio-rng-device,rng=rng0 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.xml new file mode 100644 index 0000000..184b62c --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.xml @@ -0,0 +1,45 @@ + + aarch64test + 496d7ea8-9739-544b-4ebd-ef08be936e8b + 1048576 + 1048576 + 1 + + hvm + /aarch64.kernel + /aarch64.initrd + /aarch64.dtb + earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait + + + + + + + + destroy + restart + restart + + /usr/bin/qemu-system-aarch64 + + + + + + + + + + + + + + + + /dev/random + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index f9abf1b..1aec0c4 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1299,6 +1299,10 @@ mymain(void) QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB, QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE_VIRTIO_MMIO, QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM); + DO_TEST("aarch64-virt-virtio", + QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB, + QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE_VIRTIO_MMIO, + QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM); DO_TEST("kvm-pit-device", QEMU_CAPS_KVM_PIT_TICK_POLICY); DO_TEST("kvm-pit-delay", QEMU_CAPS_NO_KVM_PIT);