/kvm-unit-tests/lib/libfdt/ |
H A D | fdt_overlay.c | 1 // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) 3 * libfdt - Flat Device Tree manipulation 15 * overlay_get_target_phandle - retrieves the target phandle of a fragment 16 * @fdto: pointer to the device tree overlay blob 17 * @fragment: node offset of the fragment in the overlay 21 * property) instead of a path (target-path property). 26 * -1, if the phandle was malformed 37 if ((len != sizeof(*val)) || (fdt32_to_cpu(*val) == (uint32_t)-1)) in overlay_get_target_phandle() 38 return (uint32_t)-1; in overlay_get_target_phandle() 44 * overlay_get_target - retrieves the offset of a fragment's target [all …]
|
H A D | libfdt.h | 1 /* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */ 5 * libfdt - Flat Device Tree manipulation 28 * tree, but its buffer did not have sufficient space to 29 * contain the expanded tree. Use fdt_open_into() to move the 30 * device tree to a buffer with more space. */ 35 * offset which is out-of-bounds, or which points to an 44 * length, or the phandle value was either 0 or -1, which are 48 * tree created by the sequential-write functions, which is 51 /* Error codes: codes for bad device tree blobs */ 53 /* FDT_ERR_TRUNCATED: FDT or a sub-block is improperly [all …]
|
H A D | libfdt_internal.h | 1 /* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */ 5 * libfdt - Flat Device Tree manipulation 10 #define FDT_ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) 50 * Internal helpers to access tructural elements of the device tree 54 * where unaligned memory reads will be handled in a graceful manner. 83 * You should have another method of validating the device tree, such as a 91 * This does essentially no checks. Only the latest device-tree 92 * version is correctly handled. Inconsistencies or errors in the device 93 * tree may cause undefined behaviour or crashes. Invalid parameters 96 * If an error occurs when modifying the tree it may leave the tree in [all …]
|
H A D | fdt.c | 1 // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) 3 * libfdt - Flat Device Tree manipulation 14 * Minimal sanity check for a read-only tree. fdt_ro_probe_() checks 16 * device tree with sane information in its header. 25 /* The device tree must be at an 8-byte aligned address */ in fdt_ro_probe_() 27 return -FDT_ERR_ALIGNMENT; in fdt_ro_probe_() 30 /* Complete tree */ in fdt_ro_probe_() 33 return -FDT_ERR_BADVERSION; in fdt_ro_probe_() 36 return -FDT_ERR_BADVERSION; in fdt_ro_probe_() 39 /* Unfinished sequential-write blob */ in fdt_ro_probe_() [all …]
|
H A D | fdt_rw.c | 1 // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) 3 * libfdt - Flat Device Tree manipulation 32 return -FDT_ERR_BADVERSION; in fdt_rw_probe_() 35 return -FDT_ERR_BADLAYOUT; in fdt_rw_probe_() 58 size_t soff = p - (char *)fdt; in fdt_splice_() 61 return -FDT_ERR_BADOFFSET; in fdt_splice_() 63 return -FDT_ERR_BADOFFSET; in fdt_splice_() 64 if (dsize - oldlen + newlen > fdt_totalsize(fdt)) in fdt_splice_() 65 return -FDT_ERR_NOSPACE; in fdt_splice_() 66 memmove(p + newlen, p + oldlen, ((char *)fdt + dsize) - (p + oldlen)); in fdt_splice_() [all …]
|
H A D | fdt_ro.c | 1 // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) 3 * libfdt - Flat Device Tree manipulation 54 err = -FDT_ERR_BADOFFSET; in fdt_get_string() 58 len = totalsize - absoffset; in fdt_get_string() 66 if ((fdt_size_dt_strings(fdt) - stroffset) < len) in fdt_get_string() 67 len = fdt_size_dt_strings(fdt) - stroffset; in fdt_get_string() 70 unsigned int sw_stroffset = -stroffset; in fdt_get_string() 78 err = -FDT_ERR_INTERNAL; in fdt_get_string() 86 err = -FDT_ERR_TRUNCATED; in fdt_get_string() 91 *lenp = n - s; in fdt_get_string() [all …]
|
H A D | fdt_sw.c | 1 // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) 3 * libfdt - Flat Device Tree manipulation 17 return -FDT_ERR_BADSTATE; in fdt_sw_probe_() 19 return -FDT_ERR_BADMAGIC; in fdt_sw_probe_() 45 return -FDT_ERR_BADSTATE; in fdt_sw_probe_memrsv_() 72 return -FDT_ERR_BADSTATE; in fdt_sw_probe_struct_() 99 spaceleft = fdt_totalsize(fdt) - fdt_off_dt_struct(fdt) in fdt_grab_space_() 100 - fdt_size_dt_strings(fdt); in fdt_grab_space_() 116 return -FDT_ERR_NOSPACE; in fdt_create_with_flags() 119 return -FDT_ERR_BADFLAGS; in fdt_create_with_flags() [all …]
|
/kvm-unit-tests/lib/s390x/ |
H A D | mmu.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 24 * @pgtable root of the page table tree 33 * @pgtable root of the page table tree 43 * @pgtable root of the page table tree 54 * @len size in bytes 63 * @len size in bytes 71 * @pgtable root of the page table tree 80 * @pgtable root of the page table tree
|
/kvm-unit-tests/lib/arm/ |
H A D | io.c | 3 * devices exposed from QEMU, e.g. pl011 and chr-testdev. That's 13 #include <chr-testdev.h> 23 * Use this guess for the uart base in order to make an attempt at 25 * base address that we read from the device tree later. This is 26 * the address we expect the virtual machine manager to put in 27 * its generated device tree. 36 * kvm-unit-tests uses the uart only for output. Both uart models have in uart0_init_fdt() 45 assert(ret >= 0 || ret == -FDT_ERR_NOTFOUND); in uart0_init_fdt() 47 if (ret == -FDT_ERR_NOTFOUND) { in uart0_init_fdt() 51 assert(ret == 0 || ret == -FDT_ERR_NOTFOUND); in uart0_init_fdt() [all …]
|
/kvm-unit-tests/lib/riscv/ |
H A D | io.c | 1 // SPDX-License-Identifier: GPL-2.0-only 21 * Use this guess for the uart base in order to make an attempt at 23 * base address that we read from the device tree later. This is 24 * the address we expect the virtual machine manager to put in 25 * its generated device tree. 66 assert(ret >= 0 || ret == -FDT_ERR_NOTFOUND); in uart0_init_fdt() 68 if (ret == -FDT_ERR_NOTFOUND) { in uart0_init_fdt() 71 assert(ret == 0 || ret == -FDT_ERR_NOTFOUND); in uart0_init_fdt() 77 printf("%s: Compatible uart not found in the device tree, aborting...\n", in uart0_init_fdt() 85 val = fdt_getprop(dt_fdt(), ret, "reg-shift", &len); in uart0_init_fdt() [all …]
|
/kvm-unit-tests/ |
H A D | README.macOS.md | 1 # kvm-unit-tests on macOS 8 tests. They're available in [homebrew](https://brew.sh): 11 $ brew install gnu-getopt 14 A cross-compiler with ELF support is required to build kvm-unit-tests on macOS. 16 ### Pre-built cross-compiler 18 Binary packages of ELF cross-compilers for i386 and x86_64 target can be 21 $ brew install i686-elf-gcc 22 $ brew install x86_64-elf-gcc 25 Make enhanced getopt available in the current shell session: 27 export PATH="/usr/local/opt/gnu-getopt/bin:$PATH" [all …]
|
H A D | MAINTAINERS | 9 In general, if you have a question about inclusion of a patch, you 19 W: Web-page with status/info 21 T: SCM tree type and location. Type is one of: git, hg, quilt, stgit. 26 much other than throw the odd patch in. See below. 34 F: drivers/net/ all files in and below drivers/net 35 F: drivers/net/* all files in drivers/net, but not below 36 F: */net/* all files in "any top level directory"/net 43 matches all files in and below net excluding net/ipv6/ 44 K: Keyword perl extended regex pattern to match content in a 55 ------------------------------ [all …]
|
H A D | configure | 3 if [ -z "${BASH_VERSINFO[0]}" ] || [ "${BASH_VERSINFO[0]}" -lt 4 ] ; then 4 echo "Error: Bash version 4 or newer is required for the kvm-unit-tests" 13 case "$arch" in 15 echo "cortex-a15" 18 echo "cortex-a57" 31 case "$arch" in 33 echo "cortex-a15" 51 arch=$(uname -m | sed -e 's/i.86/i386/;s/arm64/aarch64/;s/arm.*/arm/;s/ppc64.*/ppc64/') 72 # Enable -Werror by default for git repositories only (i.e. developer builds) 73 if [ -e "$srcdir"/.git ]; then [all …]
|
/kvm-unit-tests/scripts/ |
H A D | check-patch.py | 3 # check-patch.py: run checkpatch.pl across all commits in a branch 7 # SPDX-License-Identifier: GPL-2.0-or-later 9 # This file is taken from qemu.git 029e13a8a56a2 .gitlab-ci.d/check-patch.py 17 namespace = "kvm-unit-tests" 28 subprocess.check_call(["git", "remote", "add", "check-patch", repourl]) 29 subprocess.check_call(["git", "fetch", "check-patch", "master"]) 34 ancestor = subprocess.check_output(["git", "merge-base", 35 "check-patch/master", "HEAD"], 40 log = subprocess.check_output(["git", "log", "--format=%H %s", 44 subprocess.check_call(["git", "remote", "rm", "check-patch"]) [all …]
|
H A D | get_maintainer.pl | 2 # SPDX-License-Identifier: GPL-2.0 8 # the files modified in a patch or for a file 11 # perl scripts/get_maintainer.pl [OPTIONS] -f <file> 42 my $email_git_since = "1-year-ago"; 43 my $email_hg_since = "-365"; 53 my $tree = 1; 82 # a) responsible for the code in question, or 85 push(@signature_tags, "Signed-off-by:"); 86 push(@signature_tags, "Reviewed-by:"); 87 push(@signature_tags, "Acked-by:"); [all …]
|
H A D | checkpatch.pl | 2 # SPDX-License-Identifier: GPL-2.0 7 # (c) 2008-2010 Andy Whitcroft <apw@canonical.com> 8 # (c) 2010-2018 Joe Perches <joe@perches.com> 33 my $tree = 1; 73 my $docsfile = "$D/../Documentation/dev-tools/checkpatch.rst"; 76 my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE 78 my $git_command ='export LANGUAGE=en_US.UTF-8; git'; 82 my %maybe_linker_symbol; # for externs in c exceptions, when seen in *vmlinux.lds.h 92 -q, --quiet quiet 93 -v, --verbose verbose mode [all …]
|
/kvm-unit-tests/lib/ |
H A D | devicetree.h | 5 * for Linux required device tree content. The accessors provided are 7 * Documentation/devicetree/booting-without-of.txt 32 s != -FDT_ERR_NOTFOUND; \ 54 * - a positive value on match 55 * - zero on no match 56 * - a negative FDT_ERR_* value on failure 63 * in @reg, a bus specific structure 65 * - zero on success 66 * - a negative FDT_ERR_* value on failure 92 * processor bus using the parent node's #address-cells [all …]
|
H A D | pci-host-generic.c | 2 * Generic PCI host controller as described in PCI Bus Binding to Open Firmware 14 #include "pci-host-generic.h" 49 * See kernel Documentation/devicetree/bindings/pci/host-generic-pci.txt 50 * and function gen_pci_probe() in drivers/pci/host/pci-host-generic.c 68 printf("No device tree found\n"); in pci_dt_probe() 83 "pci-host-ecam-generic"); in pci_dt_probe() 84 if (node == -FDT_ERR_NOTFOUND) { in pci_dt_probe() 91 assert(prop && len == 4 && !strcmp((char *)prop->data, "pci")); in pci_dt_probe() 97 prop = fdt_get_property(fdt, node, "bus-range", &len); in pci_dt_probe() 99 assert(len == -FDT_ERR_NOTFOUND); in pci_dt_probe() [all …]
|
/kvm-unit-tests/arm/ |
H A D | selftest.c | 15 #include <asm/asm-offsets.h> 40 if (len == -1) in check_setup() 48 phys_addr_t memsize = PHYS_END - PHYS_OFFSET; in check_setup() 80 * fully parsing the device tree there's no way to be certain of any in check_pabt_init() 87 for (r = mem_regions; r->end; ++r) { in check_pabt_init() 88 if (r->flags & MR_F_IO) in check_pabt_init() 90 if (r->end > highest_end) in check_pabt_init() 91 highest_end = PAGE_ALIGN(r->end); in check_pabt_init() 98 mmu_clear_user(current_thread_info()->pgtable, vaddr); in check_pabt_init() 119 "stmia r0, { r0-lr }\n" \ [all …]
|
/kvm-unit-tests/x86/ |
H A D | access.c | 17 #define PT_BASE_ADDR_MASK ((pt_element_t)((((pt_element_t)1 << 36) - 1) & PAGE_MASK)) 31 (((address) >> (12 + ((level)-1) * 9)) & 511) 38 * Keep the PRESENT and reserved bits in the higher numbers so that they aren't 39 * toggled on every test, e.g. to keep entries in the TLB. 183 /* 5-level paging, 1-based to avoid math. */ 209 for (i = at->pt_levels; i >= min_level; --i) { in walk_va() 326 pt_env->pt_pool_pa = AT_PAGING_STRUCTURES_PHYS; in ac_env_int() 327 pt_env->pt_pool_current = 0; in ac_env_int() 328 pt_env->pt_levels = page_table_levels; in ac_env_int() 336 * Each test needs at most pt_levels-1 structures per virtual address, in ac_test_alloc_pt() [all …]
|