Commit Graph

58 Commits

Author SHA1 Message Date
Junjie Mao e96937aa89 Makefile: do not try to figure out BOARD and SCENARIO for cleanup
The targets "clean" and "distclean" are special as they do not need BOARD
or SCENARIO from users. This patch stops the guesswork of BOARD and
SCENARIO if any of those two targets are specified.

It is assumed that "clean" or "distclean" is not invoked with other targets
at the same time.

Tracked-On: #8259
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-10-26 14:09:44 +08:00
Junjie Mao 64cbc706b7 Makefile: retake XMLs from users if they are updated
In the current config.mk board and scenario XMLs are only copied to the
build directory when they do not exist. That prevents users from using XML
files they have edited, probably to fix previously reported validation
errors, for a rebuild unless the former build directory is totally removed.

This patch adds the user-given paths to XML files (if they exist) as
dependencies of the copied files in the build directory, so that users can
now provide new board and/or scenario XMLs to an existing build to
automatically trigger a complete rebuild.

Building without explicitly specifying BOARD and SCENARIO is still
supported if a build directory already exists. In that case the copied
board and scenario XMLs will not be modified.

Tracked-On: #8259
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-10-26 14:09:44 +08:00
Junjie Mao 314f3004c7 Makefile: make dependencies on validated configurations explicit
ACRN config tools generate source files, scripts and binaries based on
users' inputs in the configurations files, i.e., board and scenario
XMLs. Those generation activities all assume that users' inputs are
properly validated, so that all assumptions they have on such inputs are
hold.

Unfortunately, not all dependencies on validated user inputs are explicitly
stated in the Makefiles today. That will cause random error messages
(typically a Python stack trace) to be printed along with validation errors
when an invalid scenario XML is given, and such messages confuse users
about the root causes of the failure.

This patch decouples scenario validation from genconf.sh and make that step
as a separate target that depends on the board and scenario XMLs. One
timestamp file is generated only when the validation succeeds so that
targets requiring validated XMLs can refer that file in its dependency list
to make it explicit.

Dependencies of the following targets are also updated accordingly:

  * $(HV_ALLOCATION_XML), which is the allocation XML including static
    allocation results, now also depends on validated XMLs.

  * $(HV_CONFIG_TIMESTAMP), which records when the config source files are
    generated, now also depends on validated XMLs.

  * $(SERIAL_CONF), which is the serial conf for the service VM, depends on
    the allocation XML.

By the way, the missing dependency on HV_CONFIG_DIR for touching
HV_DIFFCONFIG_LIST is added to fix the "file not found" issue.

Tracked-On: #8259
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-10-26 14:09:44 +08:00
Ziheng Li eb8bcb06b3 Update copyright year range in code headers
Modified the copyright year range in code, and corrected "int32_tel"
into "Intel" in two "hypervisor/include/debug/profiling.h" and
"hypervisor/include/debug/profiling_internal.h".

Tracked-On: #7559
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-07-15 11:48:35 +08:00
Conghui a2e2640507 config-tools: ignore the scenario and board field
Ignore the "scenario" and "board" field in <scenario>.xml:
    <acrn-config board="whl-ipc-i5" scenario="shared">

Tracked-On: #7345
Signed-off-by: Conghui <conghui.chen@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-04-24 13:53:32 +08:00
Conghui 593414e9c2 config-tools: support absolute path
1. Support absolute path for scenario file.
2. Use the scenario xml file name as scenario name, but if it is
'scenario.xml', use the upper level directory name.
e.g.
	SCENARIO=<pathxxx>/shared/scenario.xml
Then scenario name would be 'shared'.

3. Change 'realpath' to 'abspath' as we should keep the original path
for scenario file even it is a link file. This will make sure the
scenario name is always consistent with file set in 'SCENARIO='.

Tracked-On: #7345
Signed-off-by: Conghui <conghui.chen@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-04-24 13:53:32 +08:00
Geoffroy Van Cutsem 8b16be9185 Remove "All rights reserved" string headers
Many of the license and Intel copyright headers include the "All rights
reserved" string. It is not relevant in the context of the BSD-3-Clause
license that the code is released under. This patch removes those strings
throughout the code (hypervisor, devicemodel and misc).

Tracked-On: #7254
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2022-04-06 13:21:02 +08:00
Kunhui-Li 74dc103d9e config_tools: remove board and scenario attributes
remove board and scenario attributes dependency for new configuration.

To do:
will remove board and scenario attributes in all scenario XML files
and update the upgrader.py after the new configuration works.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-03-31 19:32:52 +08:00
Junjie Mao 7ad9596dd6 config_tools: change representation of build types
Instead of using a Boolean variable indicating whether a build is for debug
or release, it is more intuitive to specify the build types as "debug" or
"release".

This patch converts the config item RELEASE to BUILD_TYPE which takes
"debug" or "release" as of now.

The generated header and makefile still uses RELEASE, and the command line
option RELEASE=<y or n> is also preserved.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-15 10:22:37 +08:00
Junjie Mao 433b37b1a8 config_tools: unify the CLI of scenario-manipulating scripts
Today the scripts that populate default values and validate scenarios have
different command-line interfaces: the former requires an XML schema as
input (which is cumbersome in most cases), while the latter always infer
where the XML schema is (which is inflexible).

This patch unifies the command line options of those scripts as follows:

  - The scenario XML is always a required positional argument.

  - The output file path (if any) is an optional positional argument.

  - The schema XML file is an optional long option. When not specified, the
    scripts will always use the one under the misc/config_tools/schema
    directory.

Also, this patch makes the validator.py executable, as is done to other
executable scripts in the repo.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-03-15 10:22:37 +08:00
Geoffroy Van Cutsem af8b51a63f Makefile: remove default BOARD and SCENARIO values
Remove the fact that a default BOARD and SCENARIO are used in case there was
none provided by the user, nor any available from a previous build. Up until
now, if that was the case, a build was triggered using a default set of BOARD
and SCENARIO values. The 'make' command will now error out asking the user to
specify those parameters.

Tracked-On: #7112
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2022-02-28 10:04:15 +08:00
Geoffroy Van Cutsem 8db94b1335 Makefile: fix typo in config.mk
Fix typo in hypervisor/scripts/makefile/config.mk file.

Tracked-On: #5647
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2022-02-08 11:10:16 +08:00
Junjie Mao 1f305beba9 config_tools: add a script that focuses on XML validation
Today the XML validation logic is embedded in scenario_cfg_gen.py which is
highly entangled with the Python-internal representation of
configurations. Such representation is used by the current configurator,
but will soon be obsolete when the new configurator is introduced.

In order to avoid unnecessary work on this internal representation when we
refine the schema of scenario XML files, this patch separates the
validation logic into a new script which can either be used from the
command line or imported in other Python-based applications. At build time
this script will be used instead to validate the XML files given by users.

This change makes it easier to refine the current configuration items for
better developer experience.

Migration of existing checks in scenario_cfg_gen.py to XML schema will be
done by a following series.

v2 -> v3:
 * Keep Invoking asl_gen.py to generate vACPI tables for pre-launched VMs.

v1 -> v2:
 * Remove "all rights reserved" from the license header
 * Upgrade the severity of the message indicating lack of xmlschema as
   error according to our latest definitions of log severities, as
   validation violations could indicate build time or boot time failures.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-01-26 14:19:01 +08:00
Junjie Mao c83c49ae36 Makefile: allow arbitrary character in paths
Today we assume the paths to the build directory do not contain the
character `@` and build the sed commands on top of this
assumption. However, there is no guarantee that this assumption holds.

This patch changes the separating character in sed pattern replacing
commands back to slash ('/') and escape the slashes in the replacements to
make the commands work. That gives more flexibility to the paths where
users can put their configuration files and build the project.

Tracked-On: #6691
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2022-01-24 15:38:39 +08:00
Kunhui-Li 2a8c587824 config_tools: update board name in makefile
update board name from nuc7i7dnb to nuc11tnbi5 in makefile because
we have removed the nuc7i7dnb board folder, and also update the
scenario name from industry to shared to fix "make all" build issue.

Tracked-On: #6315
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-09-29 16:53:44 +08:00
Junjie Mao efcb9e2fdf Makefile: fix wrong reference to board XML and skip binary in diffconfig
The current config.mk uses the variable BOARD_FILE as the path to the board
XML when generating an unmodified copy of configuration files for
comparison, which is incorrect. The right variable is HV_BOARD_XML which is
the path to the copy of board XML that is actually used for the build.

This patch corrects the bug above.

In addition, this patch also skips binary files (which are not meant to be
edited manually) when calculating the differences.

Tracked-On: #6592
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-09-19 20:23:44 +08:00
Junjie Mao 2bfaa34cf2 config_tools: populate default values in scenario XML
While we have default values of configuration entries stated in the schema
of scenario XMLs, today we still require user-given scenario XMLs to
contain literally ALL XML nodes. Missing of a single node will cause schema
validation errors even though we can use its default value defined in the
schema.

This patch allows user-given scenario XMLs to ignore nodes with default
values. It is done by adding the missing nodes, all containing the defined
default values, to the input scenario XML when copying it to the build
directory. This approach imposes no changes to either the schema or
subsequent scripts in the build system.

Tracked-On: #6292
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-09-13 09:05:52 +08:00
Kunhui-Li 578c18b962 config_tools: remove obsolete kconfig files
Remove obsolete Kconfig files;
Update Kconfig related README and error message.

Tracked-On: #6315
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-08-09 09:25:02 +08:00
Yang,Yu-chu 1de47b0433 config-tools: build acrn with xslt generated pci_dev.c and board_info.h
Build acrn using xslt transformed pci_dev.c and board_info.h.

Tracked-On: #6024
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-24 21:53:22 +08:00
Geoffroy Van Cutsem 86176a30a0 config-tools: fix a couple of typos in helper script
Fix a couple of typos in text displayed by a helper script
used when building ACRN. No functional change made to the
script itself.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-05-10 13:18:08 +08:00
Yang,Yu-chu 5f2f82f4d8 config-tools: introduce xslt transform and clang-format in genconf.sh
Add "transform" to generate following files with xsltproc in genconf.sh:
  - ivshmem_cfg.h
  - misc_cfg.h
  - pt_intx.c
  - vm_configurations.c
  - vm_configurations.h

Add code formatter using clang-format. It formats the gernerated code
with customized condfiguration if clang-format package and configuraion
file ".clang-format" exist.

Add sed in genconf.sh "transform" to replace the copyright "YEAR" of generated files.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Junjie Mao 22064f71c1 Makefile: do not define default BOARD/SCENARIO in top-level Makefile
The top-level Makefile should not define any default value as the
hypervisor may have its own configurations set by previous builds.

This patch also changes the hypervisor default RELEASE to `n`.

Tracked-On: #5772
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-03-03 09:13:44 +08:00
Junjie Mao d5c11d5e79 Makefile: fixes to bugs that break diffconfig and applydiffconfig
This patch resolves the following bugs that break the targets `diffconfig`
and `applydiffconfig`:

 - Comments after variable definitions cause the varaible to contain
   unintended trailing whitespaces.

 - HV_CONFIG_XML is no longer defined; it is now HV_SCENARIO_XML.

 - '*.asl' files are also generated and should be involved when comparing
   the generated configuration files.

 - Strings between diacritic marks (`) are intepreted as shell commands
   even they are part of informative messages.

 - HV_DIFFCONFIG_LIST should not contain duplicated lines.

Tracked-On: #5772
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-03-03 09:13:44 +08:00
Junjie Mao 0edaaa880f Makefile: prefer RELEASE=y|n over RELEASE=0|1
For clarity, we now prefer y|n over 0|1 as the values of boolean options on
make command lines. This patch applies this preference to the Makefile of
the device model and tools, while RELEASE=0|1 is still supported for
backward compatibility.

Tracked-On: #5772
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-03-03 09:13:44 +08:00
Junjie Mao 0de004e5c9 Makefile: fix build issues due to reorg of misc/
This patch fixes the following issues that break the build system:

 1. The tag of the root nodes of board/scenario XML files are still acrn-config,
    not config_tools. This patch reverts the XPATH that refers to these nodes.

 2. HV_PREDEFINED_BOARD_DIR now also relies on BOARD which may not be
    available at the time the variable is defined. As both board and
    scenario XML files are placed under the same directory, this patch
    refines the path calculation logic to get rid of mixing variables of
    the different flavors.

Tracked-On: #5644
Fixes: 97c9b24030 ("acrn-config: Reorg config tool folder")
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-01-28 10:20:38 +08:00
Xie, nanlin 97c9b24030 acrn-config: Reorg config tool folder
Remove vm_configs folder and move all the XML files and generic code example into config_tools/data

Tracked-On: #5644
Signed-off-by: Xie, nanlin <nanlin.xie@intel.com>
2021-01-27 11:08:28 +08:00
Junjie Mao 775214b710 Makefile: create and apply patches to generated sources
In order to enable changing the generated C configuration files manually,
this patch introduces the target `diffconfig` to the build system.

After generating the configuration files, a developer can manually modify
these sources (which are placed under build/configs) and invoke `make
diffconfig` to generate a patch that shows the made differences. Such
patches can be registered to a build by invoking the `applydiffconfig`
target. The build system will always apply them whenever the configuration
files are regenerated.

A typical workflow to create a patch is as follows.

    # The pre_build target relies on generated configuration files
    hypervisor$ make BOARD=xxx SCENARIO=yyy pre_build

    (manually edit files under build/configs/boards and
      build/configs/scenarios)

    hypervisor$ make diffconfig   # Patch generated to build/config.patch
    hypervisor$ cp build/config.patch /path/to/patch

The following steps apply apply the patch to another build.

    hypervisor$ make BOARD=xxx SCENARIO=yyy defconfig
    hypervisor$ make applydiffconfig PATCH=/path/to/patch-file-or-directory
    hypervisor$ make

After any patch is registered for a build, the configuration files will be
automatically regenerated the next time `make` is invoked.

To show a list of registered patches for generated configuration files,
invoke `make applydiffconfig` without specifying `PATCH`.

v2:
 * Add target `applydiffconfig` which accepts a PATCH variable to register
   an arbitrary patch file or a directory containing patch file(s) for a
   build. `.config_patches` is no longer used.

Tracked-On: #5644
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-01-20 17:58:00 +08:00
Junjie Mao 866c0881a3 Makefile: generate C configuration files at build time
This patch makes the build system of the hypervisor to cache the board and
scenario XML files in the build directory and generate C configuration
files from them at build time. The C configuration files that are cached in
the git repo is no longer used or updated. Paths to these generated files
in the prebuild Makefile is updated accordingly.

The following targets are introduced or modified.

    * defconfig: Copy default configuration XMLs to the build directory and
                 generate C configuration files.

    * oldconfig: No action.

    * menuconfig: Print a message to redirect users to use the config app
                  and exit.

    * showconfig: Print the BOARD, SCENARIO and RELEASE configured for the
                  current build.

    * update_config: No action.

    * (default): Build the hypervisor with defined configurations.

The following variables can be set on the command line to specify the
default configuration to be used.

    * BOARD: Either a name of the target board or a path to a customized
             board XML. When a board name is specified, the board XML file
             is expected to be available under
             misc/acrn-config/xmls/board-xmls.

    * SCENARIO: Either a name of the scenario of a path to a customized
                scenario XML. When a scenario name is specified, the
                scenario XML file is expected to be available under
                misc/acrn-config/xmls/config-xmls/$(BOARD).

    * BOARD_FILE: Path to the board XML file to be used. This is now
                  obsoleted as BOARD provides the same functionality.

    * SCENARIO_FILE: Path to the scenario XML file to be used. This is now
                     obsoleted as BOARD provides the same functionality.

BOARD/SCENARIO or BOARD_FILE/SCENARIO_FILE shall be used in pair, and
BOARD_FILE/SCENARIO_FILE shall point to valid files when specified. Any
violation to those constraints will stop the build with error
messages. When BOARD/SCENARIO and BOARD_FILE/SCENARIO_FILE are both defined
on the command line, the former takes precedence as the latter are to be
obsoleted.

Additionally, users can define the RELEASE variable to specify a debug or
release build. In case a previous build exists but is configured for a
different build type, the build system will automatically update the
scenario XML and rebuild the sources.

This patch also includes the following tweaks:

    1. Do not use `realpath` to process search paths for generated
       headers. `realpath` only accepts paths of existing files, while the
       directories for generated headers may not be created at the time the
       search paths are calculated.
    2. Always expect `pci_dev.c` to be in place.
    3. HV_CONFIG_* series now encodes absolute paths.

v3:
 * Do not validate BOARD_FILE/SCENARIO_FILE if BOARD/SCENARIO are given.

v2:
 * `defconfig` now also generates the C configuration files.
 * BOARD/SCENARIO now accept either board/scenario names or XML file paths.
 * Adapt to the new allocation.xml & unified.xml.
 * Cleanup names of internal variables in config.mk for brevity.

Tracked-On: #5644
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-01-20 17:58:00 +08:00
Junjie Mao 2f6abbe752 acrn-config: add XSLT scripts to transform XMLs to config.[h|mk]
In order to remove Kconfig from the build process, acrn-config shall
transform XML configuration files to config.h and config.mk by itself. This
patch adds XSLT scripts that do the trick.

Unfortunately, the scenario XML file along is not sufficient to generate
config.h and config.mk, though. In addition to resource
allocation (i.e. allocating physical RAM for the hypervisor), the
transformation also need to do the following:

    1. Translate UART info in board XML into several configuration entries
       depending on the UART selected in the scenario XML.
    2. Use the MAX_MSIX_TABLE_NUM value in the board XML if the scenario
       XML does not specify it.

In order to use XSLT to transform both XMLs in one shot, a template is
provided to create another XML that includes (using XInclude) both board
and scenario XMLs as sub-nodes. It will be instantiated once the
transformations are integrated in the following patch.

v2:
 * Add `allocation.xml` to `unified.xml` to include the results from static
   allocation.
 * Use HV_RAM_START and HV_RAM_SIZE in allocation results if they are not
   explicitly specified in the scenario XML.

Tracked-On: #5644
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-01-20 17:58:00 +08:00
Junjie Mao 9cff2bbdc0 acrn-config: add a script to generate config sources from XMLs
In order for a unified interface for generating configuration sources from
board and scenario XMLs, this patch introduces a script named genconf.sh
which takes XML files as inputs and generate sources under the specified
directory. Once used in Makefiles, this script helps to minimize the
impacts on the Makefiles when we refine the configuration source generation
process in the future.

This patch also adds a non-zero return value to board_cfg_gen.py and
scenario_cfg_gen.py so that we do not need to inspect the logs to determine
if the generation succeeds.

Tracked-On: #5644
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-01-20 17:58:00 +08:00
Wei Liu e2a5c56840 Makefile: modify the realpath to abspath function
realpath function would be got null while the directory or file is
not exist, modify the function abspath to instead realpath.

Tracked-On: #5146
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
2020-08-08 17:07:48 +08:00
Victor Sun af9867f4cc Makefile: fix issue on make menuconfig
The BOARD/SCENARIO envrionment variable should be passed in one shell command;

Tracked-On: #5077

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-08-04 09:05:29 +08:00
Victor Sun a57a4fd7fb HV: Make: enable build for new configs layout
The make command is same as old configs layout:

under acrn-hypervisor folder:
	make hypervisor BOARD=xxx SCENARIO=xxx [TARGET_DIR]=xxx [RELEASE=x]

under hypervisor folder:
	make BOARD=xxx SCENARIO=xxx [TARGET_DIR]=xxx [RELEASE=x]

if BOARD/SCENARIO parameter is not specified, the default will be:
	BOARD=nuc7i7dnb SCENARIO=industry

Tracked-On: #5077

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-07-24 16:16:06 +08:00
Victor Sun a6e552b7b5 Makefile: minor fix on hypervisor dependency
The $(VERSION) should be depended on config.h change. For example, when RELEASE
parameter is changed in make commmand, CONFIG_RELEASE need to be updated in
defconfig file, and then message in version.h should be updated.

The patch also fix a bug that a code path in make defconfig never be triggered
because shell will treat [ ! -f $(KCONFIG_FILE) ] as false when $(KCONFIG_FILE)
is not specified. (i.e. "$(KCONFIG_FILE)" == "")

Tracked-On: #2412

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-06-04 15:03:43 +08:00
Victor Sun 00a38e89c4 Makefile: do not override RELEASE when build with XML
SCENARIO XML file has included RELEASE or DEBUG info already, so if RELEASE
is not specified in make command, Makefile should not override RELEASE info
in SCENARIO XML. If RELEASE is specified in make command, then RELEASE info
in SCENARIO XML could be overridden by make command.

The patch also fixed a issue that get correct board defconfig when build
hypervisor from TARGET_DIR;

Tracked-On: #4688

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-04-22 16:45:43 +08:00
Victor Sun dba0591f72 Kconfig: change scenario variable type to string
Basicly ACRN scenario is a configuration name for specific usage. By giving
scenario name ACRN will load corresponding VM configurations to build the
hypervisor. But customer might have their own scenario name, change the
scenario type from choice to string is friendly to them since Kconfig source
file change will not be needed.

With this change, CONFIG_$(SCENARIO) will not exist in kconfig file and will
be instead of CONFIG_SCENARIO, so the Makefile need to be changed accordingly;

Tracked-On: #4616

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-04-17 13:45:18 +08:00
Victor Sun e5777adf5e Makefile: support make with external configurations
Customer might have specific folder where stores their own configurations
for their customized scenario/board, so add TARGET_DIR parameter to support
option that build hyprvisor with specified configurations.

So valid usages are: (target = all | hypervisor)
 1. make <target>
 2. make <target> KCONFIG_FILE=xxx [TARGET_DIR=xxx]
 3. make <target> BOARD=xxx SCENARIO=xxx [TARGET_DIR=xxx]
 4. make <target> BOARD_FILE=xxx SCENARIO_FILE=xxx [TARGET_DIR=xxx]
 5. make <target> KCONFIG_FILE=xxx BOARD_FILE=xxx SCENARIO_FILE=xxx [TARGET_DIR=xxx]

If TARGET_DIR parameter is not specified in make command, hypervisor will be
built with board configurations under hypervisor/arch/x86/configs/ and scenario
configurations under hypervisor/scenarios/. Moreover, the configurations would
be overwritten if BOARD/SCENARIO files are specified in make command.

If TARGET_DIR parameter is specified in make command, hypervisor will be built
with configuration under that folder if no BOARD/SCENARIO files are specified.
When BOARD/SCENARIO files are available in make command, the TARGET_DIR is used
to store configurations that BOARD/SCENARIO file provided, i.e. Configurations
in TARGET_DIR folder will be overwritten.

Tracked-On: #4517

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-04-03 15:15:05 +08:00
Victor Sun 471f7e5b28 Makefile: parameters check for board and scenario
When user use make parameters to specify BOARD and SCENARIO, there might
be some conflict because parameter of KCONFIG_FILE/BOARD_FILE/SCENARIO_FILE
also includes BOARD/SCENARIO info. To simplify, we only alow below valid
usages:

 1. make <target>
 2. make <target> KCONFIG_FILE=xxx
 3. make <target> BOARD=xxx SCENARIO=xxx
 4. make <target> BOARD_FILE=xxx SCENARIO_FILE=xxx
 5. make <target> KCONFIG_FILE=xxx BOARD_FILE=xxx SCENARIO_FILE=xxx

Especially for case 1 that no any parameters are specified:
    a. If hypervisor/build/.config file which generated by "make menuconfig"
       exist, the .config file will be loaded as KCONFIG_FILE:
       i.e. equal: make <target> KCONFIG_FILE=hypervisor/build/.config

    b. If hypervisor/build/.config file does not exist,
       the default BOARD/SCENARIO will be loaded:
       i.e. equal: make <target> BOARD=$(BOARD) SCENARIO=$(SCENARIO)

Tracked-On: #4517

Signed-off-by: Victor Sun <victor.sun@intel.com>
2020-04-03 15:15:05 +08:00
Victor Sun 0d52f933da Makefile: move .mk file to hv scripts folder
The *.mk files under misc/acrn-config/library are all rules for hypervisor
makefiles only, so move these files to hypervisor/scripts/makefile/ folder.

The folder of acrn-config/library/ will be used to store python script lib only.

Tracked-On: #3779

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Terry Zou <terry.zou@intel.com>
2019-11-13 16:05:30 +08:00
lirui34 70312bfb7e dm: Add licenses to the scripts.
Add licenses to the scripts:
```
devicemodel/samples/apl-mrb/launch_uos.sh
devicemodel/samples/apl-up2/launch_uos.sh
devicemodel/samples/nuc/launch_hard_rt_vm.sh
devicemodel/samples/nuc/launch_uos.sh
devicemodel/samples/nuc/launch_vxworks.sh
devicemodel/samples/nuc/launch_win.sh
devicemodel/samples/nuc/launch_zephyr.sh
hypervisor/scripts/genld.sh
```

Tracked-On: #4061
Signed-off-by: lirui34 <ruix.li@intel.com>
2019-11-11 15:35:19 +08:00
Victor Sun ed8fb94778 Makefile: support make from XML for new board
Currently make hypervisor will depend on a $(BOARD).config file to load
board defconfig which triggered by oldconfig process, this will block
make from XMLs for a new board because $(BOARD).config never exist.
This requires us to patch configuration for new board earlier than make
oldconfig.

Tracked-On: #4067
Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-11-11 15:01:50 +08:00
Terry Zou a9c38a5cfb HV:Acrn-hypvervisor Root Directory Clean-up and create misc/ folder for Acrn daemons, services and tools.
This patch is to clean-up acrn-hypervisor root directory, targt only 5 folders under acrn-hypervisor:1.hypervisor,2.devicemodel,3.misc,4.doc,5.build

Tracked-On: #3482
Signed-off-by: Terry Zou <terry.zou@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-07-29 22:58:24 +08:00
Tw ce387084ed hv: remove CONFIG_PLATFORM_[SBL|UEFI] and UEFI_STUB
ACRN now has unified the way to handle SBL and UEFI.
so just remove corresponding macros in Kconfig.
BTW, default configuration in Kconfig is for UEFI boards.

Tracked-On: #2708
Signed-off-by: Tw <wei.tan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-03-13 10:26:55 +08:00
Tw 59c2b33a90 Makefile: separate PLATFORM into BOARD+FIRMWARE
Combination of BOARD and FIRMWARE is a more precious definition.
And we decide PLATFORM_XXX based on FIRMWARE, remove relative one in
board config.

We reserve PLATFORM for backward compatibility.

Tracked-On: #1995
Signed-off-by: Tw <wei.tan@intel.com>
Reviewed-by: Yin Fengwei < fengwei.yin@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2018-12-12 13:23:28 +08:00
Junjie Mao 5f6a10f1e1 kconfig: use defconfig instead of default values in silentoldconfig
Currently silentoldconfig uses the default values in Kconfig when .config does
not exist or is for a different platform from the one specified in command line
options. This makes it impossible to leverage defconfigs when a simple 'make' is
invoked to build the hypervisor, as 'make' calls oldconfig instead of defconfig
for creating a configuration file.

With DEFCONFIG_LIST in Kconfig, now silentoldconfig is also able to know which
defconfig is appropriate given the specified board. This patch changes the
behavior of oldsilentconfig as follows.

    1. When an old .config for the given board exists, the script updates the
       .config per configurations specified from the command line. Instead of
       manually resetting all symbols, the script now relies on Kconfiglib's
       internal logic to automatically update invisible symbols after symbol
       value changes.

    2. When an old .config does not exist or is not for the specified board, the
       defconfig for that board is used as base line and further tweaked per
       configurations from the command line.

v3 -> v4:

* Rephrase comments in silentoldconfig.py.

v2 -> v3:

* Keep backward compatibility of silentoldconfig.py since vmcfg also uses the
  script.

v1 -> v2:

* Include .config when it is edited manually so that new configurations
  overwritten the old (in the outdated config.mk).

* Compare the board in .config with the one in the defconfig instead of what is
  specified in the environment variable BOARD, as defconfig and BOARD may use
  different names (e.g. aliases or different cases)

Tracked-On: #1588
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
2018-10-30 10:49:12 +08:00
Junjie Mao b9d54f4ab3 kconfig: support board-specific defconfig
The current defconfigs are BIOS-specific which makes it difficult to maintain
multiple defconfigs for boards running the same BIOS.

This patch re-organizes the defconfigs to be board-specific. A command line
option BOARD is introduced to specify a board on which the current build targets
at. The original PLATFORM is kept for backward compatibility which redirects to
apl-mrb and nuc6cayh for sbl and uefi, respectively.

The getting started guide is also updated accordingly.

v1 -> v2:

* Rewrite 'up2' to 'UP2'.

Tracked-On: #1588
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
2018-10-30 10:49:12 +08:00
Junjie Mao 8bde372c32 kconfig: enforce remaking config.mk after oldconfig changes .config
Without any command under the .config target, config.mk will not be remade in
the same execution of make after oldconfig changes .config. This can result to
inconsistency between .config and the built image right after .config is
changed.

Tracked-On: #1588
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
2018-10-30 10:49:12 +08:00
Junjie Mao c7907a823c kconfig: a faster way to check the availability of python3 package
It is faster to check the existance of a certain library by trying importing
that library, instead of invoking pip3 for a complete list of installed
libraries. Time of the check can be significantly reduced.

    # time pip3 list
    ...
    real    0m6.038s
    user    0m0.652s
    sys     0m0.036s

    # time python3 -c "import kconfiglib"
    real    0m0.037s
    user    0m0.036s
    sys     0m0.000s

Tracked-On: #1588
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
2018-10-30 10:49:12 +08:00
Huihuang Shi 8ccaf3c3e8 use genld.sh to generate link_ram.ld
Use genld.sh instead of config.h to generate link_ram.ld.
It can avoid the conflicts of the syntax between ld script and
C.

V1->V2:
    change the deps name to config,

Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
reviewed-by: Junjie Mao <junjie.mao@intel.com>
2018-10-12 16:32:25 +08:00
Junjie Mao 5251f42574 HV: make: rename minimalconfig to savedefconfig
... following the naming convention of Linux kbuild.

v1 -> v2:

    * Introduced.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Geoffroy VanCutsem <geoffroy.vancutsem@intel.com>
2018-06-15 15:50:09 +08:00