HV: kconfig: add range check for memory setting

When user use make menuconfig to configure memory related kconfig items,
we need add range check to avoid compile error or other potential issues:

CONFIG_LOW_RAM_SIZE:(0 ~ 0x10000)
		the value should be less than 64KB;

CONFIG_HV_RAM_SIZE: (0x1000000 ~ 0x10000000)
		the hypervisor RAM size should be supposed between
		16MB to 256MB;

CONFIG_PLATFORM_RAM_SIZE: (0x100000000 ~ 0x4000000000)
		the platform RAM size should be larger than 4GB
		and less than 256GB;

CONFIG_SOS_RAM_SIZE: (0x100000000 ~ 0x4000000000)
		the SOS RAM size should be larger than 4GB
		and less than 256GB;

CONFIG_UOS_RAM_SIZE: (0 ~ 0x2000000000)
		the UOS RAM size should be less than 128GB;

Tracked-On: #4229

Signed-off-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
Victor Sun 2019-12-12 10:26:05 +08:00 committed by wenlingz
parent 249947030b
commit 78139b955c

View File

@ -178,6 +178,7 @@ config NPK_LOGLEVEL_DEFAULT
config LOW_RAM_SIZE config LOW_RAM_SIZE
hex "Size of the low RAM region" hex "Size of the low RAM region"
range 0 0x10000
default 0x00010000 default 0x00010000
help help
A 32-bit integer indicating the size of RAM region below address A 32-bit integer indicating the size of RAM region below address
@ -199,6 +200,7 @@ config HV_RAM_START
config HV_RAM_SIZE config HV_RAM_SIZE
hex "Size of the RAM region used by the hypervisor" hex "Size of the RAM region used by the hypervisor"
range 0x1000000 0x10000000
default 0x0b800000 default 0x0b800000
help help
A 64-bit integer indicating the size of RAM used by the hypervisor. A 64-bit integer indicating the size of RAM used by the hypervisor.
@ -207,6 +209,7 @@ config HV_RAM_SIZE
config PLATFORM_RAM_SIZE config PLATFORM_RAM_SIZE
hex "Size of the physical platform RAM" hex "Size of the physical platform RAM"
range 0x100000000 0x4000000000
default 0x400000000 default 0x400000000
help help
A 64-bit integer indicating the size of the physical platform RAM A 64-bit integer indicating the size of the physical platform RAM
@ -214,6 +217,7 @@ config PLATFORM_RAM_SIZE
config SOS_RAM_SIZE config SOS_RAM_SIZE
hex "Size of the Service OS (SOS) RAM" hex "Size of the Service OS (SOS) RAM"
range 0x100000000 0x4000000000
default 0x400000000 default 0x400000000
help help
A 64-bit integer indicating the size of the Service OS RAM (MMIO not A 64-bit integer indicating the size of the Service OS RAM (MMIO not
@ -221,6 +225,7 @@ config SOS_RAM_SIZE
config UOS_RAM_SIZE config UOS_RAM_SIZE
hex "Size of the User OS (UOS) RAM" hex "Size of the User OS (UOS) RAM"
range 0 0x2000000000
default 0x200000000 default 0x200000000
help help
A 64-bit integer indicating the size of the User OS RAM (MMIO not A 64-bit integer indicating the size of the User OS RAM (MMIO not