Commit Graph

20 Commits

Author SHA1 Message Date
Alexander Merritt 2e10930d12 Python scripts discovering CPU IDs are off by 1
Tracked-On: #4387
Signed-off-by: Alexander Merritt <alex.merritt@intel.com>
2020-02-10 11:47:53 +08:00
Zide Chen 5f2c303a7e acrn-config: dump CPU info from /sys/devices/system/cpu/possible
/proc/cpuinfo represents online CPUs only, and the number of CPUs is
limited by the 'maxcpus' option.

/sys/devices/system/cpu/possible is a better option for our purpose
since it represents the possible CPUs that can ever be available in the
system, including the offline CPUs. And it's not limited by 'maxcpus'.

Though the Linux command line parameter nr_cpus and possible_cpus still
have impact on /sys/devices/system/cpu/possible.

Tracked-On: #3854
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-31 08:47:08 +08:00
Wei Liu 13d6b69d65 acrn-config: set DRHDx_IGNORE while no DEV_SCOPE in DRHD
Set the DRHDx_IGNORE to false even there is no DEV_SCOPE under this
DRHD.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-13 13:48:14 +08:00
Wei Liu 12a9bc29df acrn-config: add CONFIG_SERIAL_x for new board
Add CONFIG_SERIAL_x in $(borad).config, this will help to output
console log and help new board debug.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-13 13:48:14 +08:00
Vijay Dhanraj 9b44e57d27 acrn-config: Fix target xml generation issue when no
P-state scaling driver is present

There seems to be a corner case where target xml file
fails to get generated if there was no P-state scaling driver
or C-state idle driver present. This patch addresses it by
handling the file not present exception and setting a warning
as well a "not available" string to successfully generate
target xml file.

Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Tracked-On: #4199
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-09 11:28:11 +08:00
Wei Liu 0e273e996c acrn-config: get default pci mmcfg base address
parse default pci mmcfg base address from target board.

Tracked-On: #4173
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-02 16:19:55 +08:00
Wei Liu 40929efe4b acrn-config: walk secondary PCI Bus for target board
There may be more than one PCI segment in target board, and DRHD info
should be parsed correctly base on secondary PCI bus. currently
board_parser.py tool did not handle such case.
Add this patch for walking secondary PCI Bus.

Tracked-On: #4143
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Wei Liu 5e9234203a acrn-config: refinement for DmarDevScope struct
Refine the DmarDevScope struct and some class names.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-29 09:05:33 +08:00
Wei Liu cdd086a81d acrn-config: by-pass acpi_idle/acpi_cpufreq for parsing target board
Current board parse logic would be broken if acpi_idle/acpi-cpufreq
driver is not loaded by native kernel.
This patch would just leave a warning to user and continue to parse
other information in this case.

Tracked-On: #4082
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-12 22:03:50 +08:00
Wei Liu 631c461314 acrn-config: Cx desc parsing enhancement
Previous code parse the Cx value by hardcoded position in sysfs desc
node, but this might be changed in different kernel.

This patch will parse the Cx value position by index key word like
MWAIT/IOPORT.

Tracked-On: #4074
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-12 22:03:50 +08:00
Wei Liu 4658259be7 acrn-config: refine DRHD structure initialization
1. Initialize DRHDn_DEVSCOPEn_TYPE/DRHDn_DEVSCOPEn_ID for each devscope;
2. Remove DRHDn_IOAPIC_ID macro;
2. Refine the value format from base 10 to 16.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-08 16:43:08 +08:00
Wei Liu 8fcfea1386 acrn-config: refinement for parsing DMAR table
Previous DRHD and device scope number are hard coded to 4, this patch removes
the limitation and parse the real drhd count/devscope count dynamically.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-08 16:43:08 +08:00
Wei Liu f10c937b40 acrn-config: correct value of DRHDx_IGNORE macro
The DRHDx_IGNORE should be defined to true when DRHD device BDF equal to
the given CONFIG_GPU_SBDF.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-08 16:43:08 +08:00
Wei Liu feba836944 acrn-config: refine ttyS info of board file
The previous method to handle ttyS info has an assumption that PCI
serial devices are all mmio type, this caused incorrect BDF info in
board XML file.
This patch fix this issue by dropping serial device BDF info and
replace it with IO type.

Tracked-On: #3900
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-25 10:56:23 +08:00
Wei Liu 9ea7a85ca5 acrn-config: set default package value for _S3 and _S5
Some BIOS does not support s3/s5, so there might be no _S3 or _S5
package in host ACPI table, previous code did not handle this, so
the build would be failed with the generated board file.
Set default s3/s5 package value to 0 for such case.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-24 15:13:51 +08:00
Wei Liu 009d835bba acrn-config: modify board info of block device info
As the blkid info contains 'UUID' information, which easy to lead to
confuse with the vm 'UUID'. So refine the format for block device.

v1-v2:
    1). align the style in BLOCK_DEVICE_INFO tag
    2). add 'mmcblk1p3' in BLOCK_DEVICE_INFO tag

v2-v3:
    1). correct the commit message.
    2). refine the api of handle_block_dev

Tracked-On: #3754
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-22 09:30:28 +08:00
Wei Liu 911be1d3b6 acrn-config: modify rootfs tag in board information
1. grap 'ext4' rootfs, and store it as "BLOCK_DEVICE_INFO" tag
2. remove 'Tab' from app tools
3. add support to parse ' ' from scenario xml

v1-v2:
    1). modify the board info "ROOT_DEVICE_INFO" -> "BLOCK_DEVICE_INFO"

Tracked-On: #3602
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2019-09-20 14:39:48 +08:00
Wei Liu 28d1b909e6 acrn-config: generate a scenario patch and apply to acrn-hypervisor
1.the script will parse the the board information which already
generated, $(scenario).xml modified by user, generate scenario
vm configuration and apply to the acrn-hypervisor source code base.

2.parse cpu/memory/ttys/rootfs information from native os and store it to
the source code

3.implemnt scenario_config and it's usage

usage: scenario_cfg_gen.py --board <board_info_file> -scenario <scenario_info_file>
board_info_file :  file name of the board info
scenario_info_file :  file name of the scenario info

sample:
	$ python3 scenario_cfg_gen.py --board ../board-xmls/apl-mrb.xml
--scenario ../config-xmls/scenarios/sdc.xml

Also improvement board config generate usage:
sample:
	$ python3 board_cfg_gen.py --board ../board-xmls/apl-mrb.xml
--scenario ../config-xmls/scenarios/sdc.xml

V1-V2:
    1). parse board_setting.xml was removed as these configuration will be
stitch into scenario configuration
    2). parse console for different formats
    3). parse epc sections
    4). add logical partition rootfs
    5). support to parse clos, while webui set to None type
    6). support to parse bootargs, while webui set to nul
    7). convert '-' to '_' for pci sub class name while generating source file

Tracked-On: #3602
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2019-09-16 09:34:37 +08:00
Wei Liu b73f97aaba acrn-config: enhance the target config
1. add misc.py to get systemd ram and root device
2. add more specify comments for arguments of functions

v1-v2:
    typo: Parser -> Parse
    some grammar check

v2-v3:
    add the message for Cx state

Tracked-On: #3602
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-09-16 09:34:37 +08:00
Wei Liu 8adefe26ac acrn-config: generate board information on target board
These tools run on the target board and genearate board information.

usage: python3 board_parser.py <board_name> [--out board_info_file]

sample:
	$ sudo python3 board_parser.py apl-up2

v1-v2:
1. allow board parameter for new board

v2-v3:
1. add the usage descriptions for tools
2. add description of kernel cmd line for README
3. output informations to a xml type
4. coding as PEP8 guildline

Tracked-On: #3480
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Reviewed-by: Shuang Zheng shuang.zheng@intel.com
Acked-by: Terry Zou <terry.zou@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-07-30 16:38:23 +08:00