From patchwork Tue Oct 8 13:49:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 20898 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f200.google.com (mail-ye0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 04ECD24697 for ; Tue, 8 Oct 2013 13:49:49 +0000 (UTC) Received: by mail-ye0-f200.google.com with SMTP id r1sf9724067yen.7 for ; Tue, 08 Oct 2013 06:49:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=opU2GwOnhsriSSf1eFUW59b8a5DnMI1XIvj8pTj7/ws=; b=KUR3WTCMwHaBQ8S3x3Pseb2TEMWARp2godwqMyITCS7/z8MVbWi8StVl4pN/QWSQjq wU0LkTTA193M5fwuCWkvAzg5RoV/AdHeojJikgmA35hqAnl6MqvwGJQMckevxKCzJOtZ Wdhcdlln6+tFufq+nGNN3B+S89P6mA53seYDX3x7ih5Hq0O7uFj31ZLlwvWNG/SKNlHv ckom/Du1D5B316RxkXTlWZ2B3TSPNeslmjJjco08BEQbw+OqaTzIs3bAXAtwgq97JVhd tp3vSVS1Sc+xJIqrdQbew9p/npptDpdLyXlnBf8sLgQ6xX69SObKYdkZo5Gh0R5BQdPF VCVQ== X-Received: by 10.236.13.36 with SMTP id a24mr1504259yha.50.1381240188775; Tue, 08 Oct 2013 06:49:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.39.163 with SMTP id q3ls203377qek.31.gmail; Tue, 08 Oct 2013 06:49:48 -0700 (PDT) X-Received: by 10.220.209.202 with SMTP id gh10mr58706vcb.50.1381240188675; Tue, 08 Oct 2013 06:49:48 -0700 (PDT) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) by mx.google.com with ESMTPS id s17si9556943vcu.89.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Oct 2013 06:49:48 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.41 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.41; Received: by mail-vb0-f41.google.com with SMTP id g17so4398465vbg.0 for ; Tue, 08 Oct 2013 06:49:48 -0700 (PDT) X-Gm-Message-State: ALoCoQlLKeURy2yEk8swXts/Fh6oJ/7bJXqTLEFE/ktqsvDkoX4oKJ7d2l8Z1cwVBY5dqq0Jxiux X-Received: by 10.52.120.78 with SMTP id la14mr962983vdb.9.1381240188548; Tue, 08 Oct 2013 06:49:48 -0700 (PDT) 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 u4csp206677vcz; Tue, 8 Oct 2013 06:49:48 -0700 (PDT) X-Received: by 10.66.170.138 with SMTP id am10mr3658234pac.51.1381240187570; Tue, 08 Oct 2013 06:49:47 -0700 (PDT) Received: from mail-pb0-f42.google.com (mail-pb0-f42.google.com [209.85.160.42]) by mx.google.com with ESMTPS id fk10si27383992pab.58.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Oct 2013 06:49:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.42 is neither permitted nor denied by best guess record for domain of pranavkumar@linaro.org) client-ip=209.85.160.42; Received: by mail-pb0-f42.google.com with SMTP id un15so8721700pbc.1 for ; Tue, 08 Oct 2013 06:49:46 -0700 (PDT) X-Received: by 10.68.253.1 with SMTP id zw1mr2225357pbc.30.1381240186830; Tue, 08 Oct 2013 06:49:46 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id ha10sm40234559pbc.23.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Oct 2013 06:49:46 -0700 (PDT) From: Pranavkumar Sawargaonkar To: libvirt-list@redhat.com Cc: patches@linaro.org, crobinso@redhat.com, berrange@redhat.com, anup.patel@linaro.com, Pranavkumar Sawargaonkar , Anup Patel Subject: [PATCH 4/6] Implement minimal sysinfo for AArch64 platforms. Date: Tue, 8 Oct 2013 19:19:09 +0530 Message-Id: <1381240151-15060-5-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1381240151-15060-1-git-send-email-pranavkumar@linaro.org> References: <1381240151-15060-1-git-send-email-pranavkumar@linaro.org> 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.212.41 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: , Implement the bare minimal sysinfo for AArch64 platforms by reading the CPU models from /proc/cpuinfo. Signed-off-by: Anup Patel Signed-off-by: Pranavkumar Sawargaonkar --- src/util/virsysinfo.c | 3 ++- tests/sysinfodata/aarch64cpuinfo.data | 10 ++++++++++ tests/sysinfodata/aarch64sysinfo.expect | 10 ++++++++++ tests/sysinfotest.c | 14 +++++++++++++- 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 tests/sysinfodata/aarch64cpuinfo.data create mode 100644 tests/sysinfodata/aarch64sysinfo.expect diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index 0802124..1c8cae5 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -244,7 +244,7 @@ no_memory: return NULL; } -#elif defined(__arm__) +#elif defined(__arm__) || defined(__aarch64__) static int virSysinfoParseSystem(const char *base, virSysinfoDefPtr ret) { @@ -505,6 +505,7 @@ no_memory: defined(__i386__) || \ defined(__amd64__) || \ defined(__arm__) || \ + defined(__aarch64__) || \ defined(__powerpc__)) virSysinfoDefPtr virSysinfoRead(void) { diff --git a/tests/sysinfodata/aarch64cpuinfo.data b/tests/sysinfodata/aarch64cpuinfo.data new file mode 100644 index 0000000..0d63139 --- /dev/null +++ b/tests/sysinfodata/aarch64cpuinfo.data @@ -0,0 +1,10 @@ +Processor : AArch64 Processor rev 0 (aarch64) +BogoMIPS : 100.00 + +Features : fp asimd +CPU architecture: AArch64 +CPU variant : 0x0 +CPU part : 0x000 +CPU revision : 0 + +Hardware : Generic AArch64 diff --git a/tests/sysinfodata/aarch64sysinfo.expect b/tests/sysinfodata/aarch64sysinfo.expect new file mode 100644 index 0000000..518434d --- /dev/null +++ b/tests/sysinfodata/aarch64sysinfo.expect @@ -0,0 +1,10 @@ + + + 0 + AArch64 Processor rev 0 (aarch64) + + + 1 + AArch64 Processor rev 0 (aarch64) + + diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c index ba57a7a..a88328f 100644 --- a/tests/sysinfotest.c +++ b/tests/sysinfotest.c @@ -43,7 +43,7 @@ # if defined(__s390__) || defined(__s390x__) || \ defined(__powerpc__) || defined(__powerpc64__) || \ defined(__i386__) || defined(__x86_64__) || defined(__amd64__) || \ - defined(__arm__) + defined(__arm__) || defined(__aarch64__) /* from sysinfo.c */ void virSysinfoSetup(const char *decoder, @@ -179,6 +179,18 @@ test_arm(void) } VIRT_TEST_MAIN(test_arm) +# elif defined(__aarch64__) +static int +test_aarch64(void) +{ + return sysinfotest_run("aarch64 sysinfo", + NULL, + NULL, + "/sysinfodata/aarch64cpuinfo.data", + "/sysinfodata/aarch64sysinfo.expect"); +} + +VIRT_TEST_MAIN(test_aarch64) # else int main(void)