History log of /kvm-unit-tests/lib/x86/fwcfg.c (Results 1 – 6 of 6)
Revision Date Author Comments
# 82147b77 30-Jul-2020 Paolo Bonzini <pbonzini@redhat.com>

fw_cfg: avoid index out of bounds

clang compilation fails with

lib/x86/fwcfg.c:32:3: error: array index 17 is past the end of the array (which contains 16 elements) [-Werror,-Warray-bounds]

fw_cfg: avoid index out of bounds

clang compilation fails with

lib/x86/fwcfg.c:32:3: error: array index 17 is past the end of the array (which contains 16 elements) [-Werror,-Warray-bounds]
fw_override[FW_CFG_MAX_RAM] = atol(str) * 1024 * 1024;

The reason is that FW_CFG_MAX_RAM does not exist in the fw-cfg spec and was
added for bare metal support. Fix the size of the array and rename FW_CFG_MAX_ENTRY
to FW_CFG_NUM_ENTRIES, so that it is clear that it must be one plus the
highest valid entry.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# eb2db85d 10-Jul-2020 Nadav Amit <namit@vmware.com>

x86: Allow to limit maximum RAM address

While there is a feature to limit RAM memory, we should also be able to
limit the maximum RAM address. Specifically, svm can only work when the
maximum RAM ad

x86: Allow to limit maximum RAM address

While there is a feature to limit RAM memory, we should also be able to
limit the maximum RAM address. Specifically, svm can only work when the
maximum RAM address is lower than 4G, as it does not map the rest of the
memory into the NPT.

Allow to do so using the firmware, when in fact the expected use-case is
to provide this infomation on bare-metal using the MEMLIMIT parameter in
initrd.

Signed-off-by: Nadav Amit <namit@vmware.com>
Message-Id: <20200710183320.27266-5-namit@vmware.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 40ff1913 22-Aug-2019 Sean Christopherson <sean.j.christopherson@intel.com>

x86: Fix breakage of fw_cfg for 32-bit unit tests

Ensure the fw_cfg overrides are parsed prior consuming any of said
overrides. fwcfg_get_u() treats zero as a valid overide value, which
is slightly

x86: Fix breakage of fw_cfg for 32-bit unit tests

Ensure the fw_cfg overrides are parsed prior consuming any of said
overrides. fwcfg_get_u() treats zero as a valid overide value, which
is slightly problematic since the overrides are in the .bss and thus
initialized to zero.

Add a limit check when indexing fw_override so that future code doesn't
spontaneously explode.

Cc: Nadav Amit <nadav.amit@gmail.com>
Fixes: 03b1e4570f967 ("x86: Support environments without test-devices")
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 03b1e457 22-Jul-2019 Nadav Amit <nadav.amit@gmail.com>

x86: Support environments without test-devices

Enable to run the tests when test-device is not present (e.g.,
bare-metal). Users can provide the number of CPUs and ram size through
kernel parameters

x86: Support environments without test-devices

Enable to run the tests when test-device is not present (e.g.,
bare-metal). Users can provide the number of CPUs and ram size through
kernel parameters.

On Ubuntu that uses grub, for example, the tests can be run by copying a
test to the boot directory (/boot) and adding a menu-entry to grub
(e.g., by editing /etc/grub.d/40_custom):

menuentry 'idt_test' {
set root='[ROOT]'
multiboot [BOOT_RELATIVE]/[TEST].flat [PARAMETERS]
module params.initrd
}

Replace:
* [ROOT] with `grub-probe --target=bios_hints /boot`
* [BOOT_RELATIVE] with `grub-mkrelpath /boot`
* [TEST] with the test executed
* [PARAMETERS] with the test parameters

params.initrd, which would be located on the boot directory should
describe the machine and tell the test infrastructure that a test
device is not present and boot-loader was used (the bootloader and qemu
deliver test . For example for a 4 core machines with 4GB of
memory:

NR_CPUS=4
MEMSIZE=4096
TEST_DEVICE=0
BOOTLOADER=1

Since we do not really use E820, using more than 4GB is likely to fail
due to holes.

Finally, do not forget to run update-grub. Remember that the output goes
to the serial port.

Cc: Andrew Jones <drjones@redhat.com>
Signed-off-by: Nadav Amit <nadav.amit@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 23b8916b 29-Jun-2017 Thomas Huth <thuth@redhat.com>

Mark some local functions as "static"

Discovered while compiling kvm-unit-tests with the
"-Wmissing-prototypes" parameter of GCC.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <14987617

Mark some local functions as "static"

Discovered while compiling kvm-unit-tests with the
"-Wmissing-prototypes" parameter of GCC.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1498761773-11164-4-git-send-email-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 7d36db35 03-Aug-2010 Avi Kivity <avi@redhat.com>

Initial commit from qemu-kvm.git kvm/test/

Signed-off-by: Avi Kivity <avi@redhat.com>