1f08c3bdfSopenharmony_ci#!/bin/bash
2f08c3bdfSopenharmony_ci#
3f08c3bdfSopenharmony_ci# Test script for KVM RAS
4f08c3bdfSopenharmony_ci#
5f08c3bdfSopenharmony_ci# This program is free software; you can redistribute it and/or
6f08c3bdfSopenharmony_ci# modify it under the terms of the GNU General Public
7f08c3bdfSopenharmony_ci# License as published by the Free Software Foundation; version
8f08c3bdfSopenharmony_ci# 2.
9f08c3bdfSopenharmony_ci#
10f08c3bdfSopenharmony_ci# This program is distributed in the hope that it will be useful,
11f08c3bdfSopenharmony_ci# but WITHOUT ANY WARRANTY; without even the implied warranty of
12f08c3bdfSopenharmony_ci# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13f08c3bdfSopenharmony_ci# General Public License for more details.
14f08c3bdfSopenharmony_ci#
15f08c3bdfSopenharmony_ci# You should find a copy of v2 of the GNU General Public License somewhere
16f08c3bdfSopenharmony_ci# on your Linux system; if not, write to the Free Software Foundation,
17f08c3bdfSopenharmony_ci# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18f08c3bdfSopenharmony_ci#
19f08c3bdfSopenharmony_ci# Copyright (C) 2010, Intel Corp.
20f08c3bdfSopenharmony_ci# Author: Jiajia Zheng <jiajia.zheng@intel.com>
21f08c3bdfSopenharmony_ci#
22f08c3bdfSopenharmony_ci
23f08c3bdfSopenharmony_cikillall simple_process
24f08c3bdfSopenharmony_ci
25f08c3bdfSopenharmony_cicd GUEST_DIR
26f08c3bdfSopenharmony_ci
27f08c3bdfSopenharmony_ci./simple_process > /dev/null &
28f08c3bdfSopenharmony_ci
29f08c3bdfSopenharmony_ci./page-types -p `pidof simple_process` -LN -b anon > guest_page
30f08c3bdfSopenharmony_ciif [ -s guest_page ]; then
31f08c3bdfSopenharmony_ci	ADDR_KLOG=`awk 'NR > 3 {print "0x"$2}' guest_page | sed -n -e '1p'`
32f08c3bdfSopenharmony_ci	ADDR=`echo $ADDR_KLOG"000"`
33f08c3bdfSopenharmony_ci	echo "guest physical address is $ADDR" > guest_tmp
34f08c3bdfSopenharmony_cifi
35f08c3bdfSopenharmony_ci
36