Commit Graph

12 Commits

Author SHA1 Message Date
wenshelx 25dacc5c19 security: Enable '-fpie, -pie' options
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>
2018-08-31 11:18:26 +08:00
Zhi Jin 6367650a70 hv: debug: add the hypervisor NPK log
The npk_log is a log destination for the hypervisor, similar to the
console_log and the mem_log. It can be enabled/disabled/configured
by the SOS kernel via the hypercall HC_SETUP_HV_NPK_LOG.
The configuration includes:
1. Set the MMIO base address of the reserved NPK master.
2. Set the log level of the hypervisor NPK log.
After that, the npk_log can be enabled to write the hypervisor logs to
the MMIO address of the reserved NPK master with a simple header.

Signed-off-by: Zhi Jin <zhi.jin@intel.com>
Signed-off-by: Liu, Xiaojing <xiaojing.liu@intel.com>
Reviewed-by: CHEN Gang <gang.c.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-08-23 11:09:25 +08:00
Sainath Grandhi 581a336bc8 HV: Add Partitioning mode option for ACRN
Adding Kconfig option to choose and compile partitioning mode for ACRN.
Current implementation does not allow ACRN to support sharing mode
and partitioning mode out of a single binary.

Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
2018-08-02 12:58:09 +08:00
Junjie Mao a23549aa91 HV: build: make relocation-related code configurable
The relocation feature relies on the ld option "-z noreloc-overflow" which is
only available for binutils >= 2.27, while on Ubuntu 16.04 or older the default
version of binutils is 2.26.

This patch wraps the relocation code with a configurable macro and make it
undefined by default to avoid default build failures.

NOTE: This is just a hotfix. The code dropped with undefined CONFIG_RELOC needs
to be reviewed by the original author of this feature. Checks to the binutils
version will also follow up.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2018-07-11 19:18:26 +08:00
Zide Chen 6c9e451b41 hv: EFI can load Hypervisor to address other than COMNFIG_RAM_START
- UEFI: change __emalloc() function to allocate from any available memory
  under 4G
- Define CONFIG_RAM_START to the lowest possible address 1M, making sure
  HV can only be relocated to higher address

Signed-off-by: Zheng Gen <gen.zheng@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Reviewed-by: Yin fengwei <fengwei.yin@intel.com>
2018-07-11 10:25:16 +08:00
Yan, Like 20b50ad4e8 HV: correct loglevel definitions and default values
1. remove duplicated definitions of mem_loglevel/console_loglevel;
2. Set default loglevels to display important messages:
 - CONSOLE_LOGLEVEL_DEFALUT is changed from 2 to 3;
 - MEM_LOGLEVEL_DEFAULT is changed from 4 to 5.

Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Yan, Like <like.yan@intel.com>
2018-06-20 13:23:46 +08:00
Junjie Mao 8009cccb52 HV: make: manage debug/release build in kconfig
This patch introduces a configuration symbol RELEASE for managing debug/release
build in a similar way to how we manage PLATFORM.

Note:

1. 'make defconfig RELEASE=1' will still use the CONFIG_RELEASE defined in the
   default configuration. The 'RELEASE=1' option has no effect in this case.

2. 'make RELEASE=1' is backward-compatible and enforces a release version to be
   built.

v1 -> v2:

    * Pass RELEASE instead of CONFIG_RELEASE to silentoldconfig.py to avoid
      unintended overriding of the value.

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
Junjie Mao c4493cc1f8 HV: make: skip duplicated PLATFORM= on command line
Since .config has PLATFORM now, it is expected that the PLATFORM= command line
option is no longer necessary as long as a proper .config exists.

This patch implements this expectation. Now the platform to be selected is
determined by the following steps.

    1. If PLATFORM= is provided on the command line, the specified value is
       used.
    2. If there is no PLATFORM= on the command line and PLATFORM is defined in
       config.mk, its value is used.
    3. If neither PLATFORM= on the command line nor config.mk is available, a
       predefined default value is used.

v1 -> v2:

    * 'make oldconfig' should not pass CONFIG_xxx to the script since config.mk
      can be out-dated.
    * Change the default value of PLATFORM to SBL for backward compatibility of
      'make all'.

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
Yin Fengwei 8eaf4d2ab6 hv: Add suspend/resume callback for vtd
To handle S3 enter/exit for vtd.

Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-06-14 13:41:45 +08:00
Zide Chen 2a1a6ad0af hv: Other preparation for trampoline code relocation
- For UEFI boot, allocate memory for trampoline code in ACRN EFI,
  and pass the pointer to HV through efi_ctx
- Correct LOW_RAM_SIZE and LOW_RAM_START in Kconfig and bsp_cfg.h
- use trampline_start16_paddr instead of the hardcoded
  CONFIG_LOW_RAM_START for initial guest GDT and page tables

Signed-off-by: Zheng, Gen <gen.zheng@intel.com>
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Xu, Anthony <anthony.xu@intel.com>
2018-06-11 12:15:28 +08:00
Zide Chen 1f074a2f2a hv: add MTRR_ENABLED entry to Kconfig
MTRR feature was added after commit bce7ed1715 ("HV: config:
add Kconfig and defconfigs"), so the generated config.h doesn't
include CONFIG_MTRR_ENABLED

Signed-off-by: Zide Chen <zide.chen@intel.com>
2018-06-11 12:15:07 +08:00
Junjie Mao bce7ed1715 HV: config: add Kconfig and defconfigs for sbl & uefi
This patch converts the configuration entries (previously defined in
bsp/*/include/bsp/bsp_cfg.h) to a Kconfig script.

With the platform specified, the default values will be exactly those in the
corresponding bsp_cfg.h.

v4 -> v5:

    * No changes.

v3 -> v4:

    * No changes.

v2 -> v3:

    * No changes.

v1 -> v2:

    * No changes.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
2018-06-08 17:21:13 +08:00