Replace all the host paths with a prefix sysroot directory, it defaults
to be empty, but can be overridden by the variable set in
environment(make -e) or being passed to make command.
Tracked-On: #1307
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
In order to sync the compiler options with devicemode and enable options
to harden software.
Tracked-On: #1122
Signed-off-by: Yan, Like <like.yan@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
This commit fixes several compiler warnings before enabling compiler
options to harden software by:
- increase name[] size to avoid string truncation;
- add parentheses around assignment as compiler suggests.
Tracked-On: #1122
Signed-off-by: Yan, Like <like.yan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Update the Makefiel to sync the compiler options with devicemode
and enable options to harden software.
Tracked-On: #1122
Signed-off-by: Yan, Like <like.yan@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
This commit fixes several compiler warnings before enabling compiler
options to harden software by:
- remove unused variables;
- add parentheses around assignment as compiler suggests;
- print warning if format string is truncated.
Tracked-On: #1122
Signed-off-by: Yan, Like <like.yan@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
Update the Makefiel to sync the compiler options with devicemode
and enable options to harden software.
Tracked-On: #1122
Signed-off-by: Yan, Like <like.yan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
- Print warning if string truncated to avoid the warning generated
by -Wformat-truncation by GCC 7.0 and newer version;
- fixed strncpy size.
Tracked-On: #1122
Signed-off-by: Yan, Like <like.yan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
As a system service, acrnd will launch UOS, that must be done
after all required services and conditions are ready, such as
acrnprobe, weston, etc.
Tracked-On: #1278
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
This patch is to sync the compiler options as the Makefile of device model.
Tracked-On: #1122
Signed-off-by: CHEN Gang <gang.c.chen@intel.com>
Reviewed-by: Zhi Jin <zhi.jin@intel.com>
Reviewed-by: Liu, Xinwu <xinwu.liu@intel.com>
This patch is to fix some compiler warnings before enabling the flag to make
compiler warning as compiler error.
The warning message is like:
ignoring return value of ‘write’, declared with attribute warn_unused_result.
Tracked-On: #1122
Signed-off-by: CHEN Gang <gang.c.chen@intel.com>
Reviewed-by: Zhi Jin <zhi.jin@intel.com>
Reviewed-by: Liu, Xinwu <xinwu.liu@intel.com>
This patch is to exclude crashlog tool for release version.
Tracked-On: #1024
Signed-off-by: CHEN Gang <gang.c.chen@intel.com>
Reviewed-by: Zhi Jin <zhi.jin@intel.com>
Acked-by: Zhang Di <di.zhang@intel.com>
Acrnprobe is using SHA to generate ids for events. These ids are only used
to index events, not for cryptographic purpose.
This patch unify the generating algorithm of short and long ids to
SHA256.
Tracked-On: #1024
Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Reviewed-by: Zhi Jin <zhi.jin@intel.com>
Acked-by: Chen Gang <gang.c.chen@intel.com>
Wait for targeting VM stopping before starting it again
Tracked-On: projectacrn/acrn-hypervisor#926
Signed-off-by: Yan, Like <like.yan@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
Remove the unnecessary "current" field when store/load timer list.
Tracked-On: #927
Signed-off-by: Yan, Like <like.yan@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
This commit reworked the resume flow:
- generate RSN_RTC wakeup reason to resume_vm();
- clear timer_list in memory once it's saved to fs;
- wakeup the suspended VMs only if wakeup by ignition button.
Tracked-On: #927
Signed-off-by: Yan, Like <like.yan@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
There is no need to wakeup SOS in advance since UOS wakeup time is
not required to be that exact.
Tracked-On: #927
Signed-off-by: Yan, Like <like.yan@intel.com>
Reviewed-by: Liu Yuan <yuan1.liu@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
To be sure acrn debug tools are position independent
and executable.
Tracked-On: #1122
Signed-off-by: wenshelx <wenshengx.wang@intel.com>
Acked-by: CHEN Gang <gang.c.chen@intel.com>
Acked-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
'err' may be used uninitialized and be dereferenced NULL.
This commit fix the reported issue via initializing 'err' to 0, and return 'err'
at the end of the func.
Tracked-On: #1157
Signed-off-by: Yan, Like <like.yan@intel.com>
This patch is to correct the path of usercrash-wrapper.
Tracked-On: #1024
Signed-off-by: CHEN Gang <gang.c.chen@intel.com>
Reviewed-by: Zhi Jin <zhi.jin@intel.com>
Acked-by: Zhang Di <di.zhang@intel.com>
This patch adds the usercrash client in the pipe of core_pattern
without affecting default core_pattern program.
In acrnprobe_prepare.sh, core_pattern will be set as usercrash-wrapper
with all of the arguments, which parses the parameters of the default
core_pattern program and the usercrash client, and then invokes them
separately.
Tracked-On: #1024
Signed-off-by: CHEN Gang <gang.c.chen@intel.com>
Reviewed-by: Zhi Jin <zhi.jin@intel.com>
Reviewed-by: xiaojin2 <xiaojing.liu@intel.com>
Acked-by: Zhang Di <di.zhang@intel.com>
To be sure hypervisor and DM are position independent
and executable.
Tracked-On: #1122
Signed-off-by: wenshelx <wenshengx.wang@intel.com>
Acked-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
The doc build process copies files using script/extract-content.py from
outside of the doc/ folder (specifically content in the tools/ folders).
The script was not copying graphviz directive files. This has been
fixed and the embedded graphviz directives are not (properly) stored in
separate image/*.dot files.
Note the extract-content.py file is derived from the Zephyr project.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
This document explains all fields in acrnprobe.xml.
User could use it to control acrnprobe's behavior and configure their
own events.
Tracked-On: #1024
Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Reviewed-by: David B. Kinder <david.b.kinder@intel.com>
Acked-by: Chen Gang <gang.c.chen@intel.com>
Acked-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
This commit eliminates several compiler warnings via:
- added 'const' quilifier to the 1st argument of send_msg();
- added 'const' quilifier to vm ops functions.
Signed-off-by: Yan, Like <like.yan@intel.com>
This patch is to improve the way of updating the core_pattern content
in the shell script, since the previous configuration in core_pattern
will block coredumpctl.
This patch adds an inspection before changing the content of
core_pattern.
Signed-off-by: CHEN Gang <gang.c.chen@intel.com>
Reviewed-by: Zhi Jin <zhi.jin@intel.com>
Reviewed-by: xiaojin2 <xiaojing.liu@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Acked-by: Zhang Di <di.zhang@intel.com>
get_sos_wakeup_reason() runs into error branch without any error, so
no wakeup reason will be returend.
Acked-by: Yan Like <like.yan@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
DM need to know wakeup reason when resume the VM, so
vm_resume(char *name) is updated to vm_resume(char *name, unsigned reason),
in acrn_vm_ops.c
Acked-by: Yan Like <like.yan@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Originally, we don't format the output of analyser well. It is hard to read the
result.
This patch make every entry of the result align with the corresponding title to
make it easier for users to read.
Without patch:
Event NR_Exit NR_Exit/Sec Time Consumed(cycles) Time Percentage
VMEXIT_INTERRUPT_WINDOW 78090 130.15 40 0.01
VMEXIT_CR_ACCESS 0 0.00 0 0.00
VMEXIT_APICV_ACCESS 0 0.00 0 0.00
VMEXIT_EXCEPTION_OR_NMI 0 0.00 0 0.00
VMEXIT_RDTSC 0 0.00 0 0.00
...
Vector Count NR_Exit/Sec
0x000000f0 82337 137.23
0x000000ef 247713 412.85
With patch:
Event NR_Exit NR_Exit/Sec Time Consumed(cycles) Time percentage
VMEXIT_APICV_WRITE 13352 22.25 14331304 0.00
VMEXIT_WRMSR 309085 515.14 241166212 0.02
VMEXIT_INTERRUPT_WINDOW 78090 130.15 76841734 0.01
...
Vector Count NR_Exit/Sec
0x000000f0 82337 137.23
0x000000ef 247713 412.85
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Yan, Like <like.yan@intel.com>
This patch add "[-t interval] [-h]" which support by acrnlog now to usage.
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Reviewed-by: Like Yan <like.yan@intel.com>
Option "-r" has been removed by commit 3d6ff0e (tools: acrntrace: save trace
data file under current dir by default). But leaves something unused in optstring
and README.rst.
This patch remove thest related things.
BTW, this patch refine the usage output to print [-t max_time].
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Acked-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Like Yan <like.yan@intel.com>
The changes include:
1. modify the outparam only in successful cases.
2. return -1 instead of a errno-style value if error happens.
3. check return value of strrchr.
Tracked-On: #971
Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Acked-by: Chen Gang <gang.c.chen@intel.com>
This patch changes vm resuming condition from VM_STARTED to VM_PAUSED
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Reviewed-by: Yuhong Tao <yuhong.tao@intel.com>
Reviewed-by: Like Yan <like.yan@intel.com>
This patch resolves vm state mismatch between vm and acrnd
which causes vm resuming failure
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Reviewed-by: Yuhong Tao <yuhong.tao@intel.com>
Reviewed-by: Like Yan <like.yan@intel.com>
This patch resolves acrnd does not notify vm stop state(suspend/shutdown) to
cbc_lifecycle after SOS enters suspend/shutdown, that causes cbc_lifecycle
cannot trigger SOS suspend/shutdown flow.
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Reviewed-by: Like Yan <like.yan@intel.com>
The issue is "acrnctl list" command always returns error with "no vmname
provided" information.
The rootcause is that vmname is an invalid parameter, which does not contain
any vm information.
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Reviewed-by: Yuhong Tao <yuhong.tao@intel.com>
Reviewed-by: Like Yan <like.yan@intel.com>
As first step to separate misc folder into github/intel/ioc-cbc-tools we
need let acrn create devel package. This package will let ioc-cbc-tools
use acrn manager interface API to control lifecycle.
The Clear Linux autospec script will *detect* /usr/include/acrn/*.h and
thus help us create the devel package. This devel pacakge will be in the
build_req for ioc-cbc-tools autospec.
Signed-off-by: Alek Du <alek.du@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Like Yan <like.yan@intel.com>
This patch is to fix the build warning with gcc8.1.1. Most of them are
warnings for buffer overflow from snprintf and strncpy.
Signed-off-by: CHEN Gang <gang.c.chen@intel.com>
Reviewed-by: Zhi Jin <zhi.jin@intel.com>
Reviewed-by: Liu, Xinwu <xinwu.liu@intel.com>
Reviewed-by: xiaojin2 <xiaojing.liu@intel.com>
Two packages are needed in compiling environment with replacing commands
fdisk and debugfs.
On clear linux, they belong to os-core-dev.
Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Acked-by: Chen Gang <gang.c.chen@intel.com>
Acked-by: Yang Ailin <ailin.yang@intel.com>
Replace debugfs with api in loop.c.
There is no functional change.
Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Acked-by: Chen Gang <gang.c.chen@intel.com>
Use api in loop.c to replace fdisk and losetup.
There is no functional change.
Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Acked-by: Chen Gang <gang.c.chen@intel.com>
This patch impletement apis with libext2fs, which are for dumping and
reading files or dirs in extfs.
Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Acked-by: Chen Gang <gang.c.chen@intel.com>
This patch adds new apis to replace commands losetup and fdisk.
Main changes include:
1. impletement apis to operate loop devices directly.
2. impletement apis to get partition information from image file.
Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Acked-by: Chen Gang <gang.c.chen@intel.com>
Current implementation save trace data files on tmpfs by default, acrntrace
would use up all the physical mem, which can affect system functioning.
This commit changes default location for trace data file to current dir, and
removes the codes for space reservation, which is not necessary.
Signed-off-by: Yan, Like <like.yan@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
Made the titles consistent across the tools (some had capital letters).
Fixed heading levels in acrnctl/acrnd doc (had two H1 headings).
Changed a text-based drawing to use graphviz.
Some general grammar tweaks as well.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
acrn-manager message structure has a flexible member
payload[0], that risks to out-of-boundary memory access,
and usage of uninitialized variable.
And the req/ack message pairs has various types, which
extend mngr_msg. mngr_send_msg() requires programmer cast
the type of input messages to struct mngr_msg, that is
inconvenient.
We replace payload[0] with an union, which contains all
payload data. So that type cast for mngr_send_msg() is no
longer needed. And we can avoid potential out-of-boundary
memory accessing and using of uninitialized variable
Acked-by: Yan Like <like.yan@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
$(OUT_DIR)/acrm_mngr.h miss dependence of ./acrm_mngr.h, that can
cause build problems.
DM & SOS-LCS are built with $(OUT_DIR)/acrm_mngr.h, which is a
copy of tools/acrn-manager/acrm_mngr.h. So when
tools/acrn-manager/acrm_mngr.h is modified, $(OUT_DIR)/acrm_mngr.h
should be updated too.
Acked-by: Yan Like <like.yan@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>