mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
Merge branch '2024-05-13-assorted-updates' into next
- A few zfs fixes, ARMv8 timer cleanups, support more algorithms with the nuvoton crypto driver, virtio + env in filesystem fix, K3 code cleanup and warning fix in gen_compile_commands.
This commit is contained in:
@@ -191,6 +191,14 @@ config ARMV8_EA_EL3_FIRST
|
||||
Exception handling at all exception levels for External Abort and
|
||||
SError interrupt exception are taken in EL3.
|
||||
|
||||
config ARMV8_UDELAY_EVENT_STREAM
|
||||
bool "Use the event stream for udelay"
|
||||
default y if ARCH_VEXPRESS64
|
||||
help
|
||||
Use the event stream provided by the AArch64 architectural timer for
|
||||
delays. This is more efficient than the default polling
|
||||
implementation.
|
||||
|
||||
menuconfig ARMV8_CRYPTO
|
||||
bool "ARM64 Accelerated Cryptographic Algorithms"
|
||||
|
||||
|
||||
@@ -114,3 +114,30 @@ ulong timer_get_boot_us(void)
|
||||
|
||||
return val / get_tbclk();
|
||||
}
|
||||
|
||||
#if CONFIG_IS_ENABLED(ARMV8_UDELAY_EVENT_STREAM)
|
||||
void __udelay(unsigned long usec)
|
||||
{
|
||||
u64 target = get_ticks() + usec_to_tick(usec);
|
||||
|
||||
/* At EL2 or above, use the event stream to avoid polling CNTPCT_EL0 so often */
|
||||
if (current_el() >= 2) {
|
||||
u32 cnthctl_val;
|
||||
const u8 event_period = 0x7;
|
||||
|
||||
asm volatile("mrs %0, cnthctl_el2" : "=r" (cnthctl_val));
|
||||
asm volatile("msr cnthctl_el2, %0" : : "r"
|
||||
(cnthctl_val | CNTHCTL_EL2_EVNT_EN | CNTHCTL_EL2_EVNT_I(event_period)));
|
||||
|
||||
while (get_ticks() + (1ULL << event_period) <= target)
|
||||
wfe();
|
||||
|
||||
/* Reset the event stream */
|
||||
asm volatile("msr cnthctl_el2, %0" : : "r" (cnthctl_val));
|
||||
}
|
||||
|
||||
/* Fall back to polling CNTPCT_EL0 */
|
||||
while (get_ticks() <= target)
|
||||
;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -69,8 +69,10 @@
|
||||
/*
|
||||
* CNTHCTL_EL2 bits definitions
|
||||
*/
|
||||
#define CNTHCTL_EL2_EL1PCEN_EN (1 << 1) /* Physical timer regs accessible */
|
||||
#define CNTHCTL_EL2_EL1PCTEN_EN (1 << 0) /* Physical counter accessible */
|
||||
#define CNTHCTL_EL2_EVNT_EN BIT(2) /* Enable the event stream */
|
||||
#define CNTHCTL_EL2_EVNT_I(val) ((val) << 4) /* Event stream trigger bits */
|
||||
#define CNTHCTL_EL2_EL1PCEN_EN (1 << 1) /* Physical timer regs accessible */
|
||||
#define CNTHCTL_EL2_EL1PCTEN_EN (1 << 0) /* Physical counter accessible */
|
||||
|
||||
/*
|
||||
* HCR_EL2 bits definitions
|
||||
@@ -154,6 +156,13 @@ enum dcache_option {
|
||||
"wfi" : : : "memory"); \
|
||||
})
|
||||
|
||||
#define wfe() \
|
||||
({asm volatile( \
|
||||
"wfe" : : : "memory"); \
|
||||
})
|
||||
|
||||
#define sev() asm volatile("sev")
|
||||
|
||||
static inline unsigned int current_el(void)
|
||||
{
|
||||
unsigned long el;
|
||||
@@ -369,6 +378,8 @@ void switch_to_hypervisor_ret(void);
|
||||
|
||||
#ifdef __ARM_ARCH_7A__
|
||||
#define wfi() __asm__ __volatile__ ("wfi" : : : "memory")
|
||||
#define wfe() __asm__ __volatile__ ("wfe" : : : "memory")
|
||||
#define sev() __asm__ __volatile__ ("sev")
|
||||
#else
|
||||
#define wfi()
|
||||
#endif
|
||||
|
||||
@@ -36,25 +36,6 @@ struct exynos5_sysreg {
|
||||
|
||||
#define USB20_PHY_CFG_HOST_LINK_EN (1 << 0)
|
||||
|
||||
/*
|
||||
* This instruction causes an event to be signaled to all cores
|
||||
* within a multiprocessor system. If SEV is implemented,
|
||||
* WFE must also be implemented.
|
||||
*/
|
||||
#define sev() __asm__ __volatile__ ("sev\n\t" : : );
|
||||
/*
|
||||
* If the Event Register is not set, WFE suspends execution until
|
||||
* one of the following events occurs:
|
||||
* - an IRQ interrupt, unless masked by the CPSR I-bit
|
||||
* - an FIQ interrupt, unless masked by the CPSR F-bit
|
||||
* - an Imprecise Data abort, unless masked by the CPSR A-bit
|
||||
* - a Debug Entry request, if Debug is enabled
|
||||
* - an Event signaled by another processor using the SEV instruction.
|
||||
* If the Event Register is set, WFE clears it and returns immediately.
|
||||
* If WFE is implemented, SEV must also be implemented.
|
||||
*/
|
||||
#define wfe() __asm__ __volatile__ ("wfe\n\t" : : );
|
||||
|
||||
/* Move 0xd3 value to CPSR register to enable SVC mode */
|
||||
#define svc32_mode_en() __asm__ __volatile__ \
|
||||
("@ I&F disable, Mode: 0x13 - SVC\n\t" \
|
||||
|
||||
@@ -6,24 +6,12 @@
|
||||
obj-$(CONFIG_ARM64) += arm64/
|
||||
obj-$(CONFIG_CPU_V7R) += r5/
|
||||
obj-$(CONFIG_OF_LIBFDT) += common_fdt.o
|
||||
ifeq ($(CONFIG_OF_LIBFDT)$(CONFIG_OF_SYSTEM_SETUP),yy)
|
||||
obj-$(CONFIG_SOC_K3_AM654) += am654_fdt.o
|
||||
obj-$(CONFIG_SOC_K3_J721E) += j721e_fdt.o
|
||||
obj-$(CONFIG_SOC_K3_J721S2) += j721s2_fdt.o
|
||||
obj-$(CONFIG_SOC_K3_AM625) += am625_fdt.o
|
||||
obj-$(CONFIG_SOC_K3_AM62A7) += am62a7_fdt.o
|
||||
obj-$(CONFIG_SOC_K3_J784S4) += j784s4_fdt.o
|
||||
endif
|
||||
ifeq ($(CONFIG_SPL_BUILD),y)
|
||||
obj-$(CONFIG_SOC_K3_AM654) += am654_init.o
|
||||
obj-$(CONFIG_SOC_K3_J721E) += j721e_init.o
|
||||
obj-$(CONFIG_SOC_K3_J721S2) += j721s2_init.o
|
||||
obj-$(CONFIG_SOC_K3_AM642) += am642_init.o
|
||||
obj-$(CONFIG_SOC_K3_AM625) += am625_init.o
|
||||
obj-$(CONFIG_SOC_K3_AM62A7) += am62a7_init.o
|
||||
obj-$(CONFIG_SOC_K3_J784S4) += j784s4_init.o
|
||||
obj-$(CONFIG_SOC_K3_AM62P5) += am62p5_init.o
|
||||
endif
|
||||
obj-y += common.o security.o
|
||||
obj-$(CONFIG_SOC_K3_AM62A7) += am62ax/
|
||||
obj-$(CONFIG_SOC_K3_AM62P5) += am62px/
|
||||
obj-$(CONFIG_SOC_K3_AM625) += am62x/
|
||||
obj-$(CONFIG_SOC_K3_AM642) += am64x/
|
||||
obj-$(CONFIG_SOC_K3_AM654) += am65x/
|
||||
obj-$(CONFIG_SOC_K3_J721E) += j721e/
|
||||
obj-$(CONFIG_SOC_K3_J721S2) += j721s2/
|
||||
obj-$(CONFIG_SOC_K3_J784S4) += j784s4/
|
||||
|
||||
7
arch/arm/mach-k3/am62ax/Makefile
Normal file
7
arch/arm/mach-k3/am62ax/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/
|
||||
# Andrew Davis <afd@ti.com>
|
||||
|
||||
obj-$(CONFIG_OF_SYSTEM_SETUP) += am62a7_fdt.o
|
||||
obj-$(CONFIG_SPL_BUILD) += am62a7_init.o
|
||||
@@ -4,9 +4,10 @@
|
||||
*/
|
||||
|
||||
#include <asm/hardware.h>
|
||||
#include "common_fdt.h"
|
||||
#include <fdt_support.h>
|
||||
|
||||
#include "../common_fdt.h"
|
||||
|
||||
int ft_system_setup(void *blob, struct bd_info *bd)
|
||||
{
|
||||
fdt_fixup_reserved(blob, "tfa", CONFIG_K3_ATF_LOAD_ADDR, 0x80000);
|
||||
@@ -8,12 +8,13 @@
|
||||
#include <spl.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
#include "sysfw-loader.h"
|
||||
#include "common.h"
|
||||
#include <dm.h>
|
||||
#include <dm/uclass-internal.h>
|
||||
#include <dm/pinctrl.h>
|
||||
|
||||
#include "../sysfw-loader.h"
|
||||
#include "../common.h"
|
||||
|
||||
struct fwl_data cbass_main_fwls[] = {
|
||||
{ "FSS_DAT_REG3", 7, 8 },
|
||||
};
|
||||
6
arch/arm/mach-k3/am62px/Makefile
Normal file
6
arch/arm/mach-k3/am62px/Makefile
Normal file
@@ -0,0 +1,6 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/
|
||||
# Andrew Davis <afd@ti.com>
|
||||
|
||||
obj-$(CONFIG_SPL_BUILD) += am62p5_init.o
|
||||
@@ -8,12 +8,13 @@
|
||||
#include <spl.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
#include "sysfw-loader.h"
|
||||
#include "common.h"
|
||||
#include <dm.h>
|
||||
#include <dm/uclass-internal.h>
|
||||
#include <dm/pinctrl.h>
|
||||
|
||||
#include "../sysfw-loader.h"
|
||||
#include "../common.h"
|
||||
|
||||
struct fwl_data cbass_main_fwls[] = {
|
||||
{ "FSS_DAT_REG3", 7, 8 },
|
||||
};
|
||||
@@ -1,2 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
obj-$(CONFIG_OF_SYSTEM_SETUP) += am625_fdt.o
|
||||
obj-$(CONFIG_SPL_BUILD) += am625_init.o
|
||||
obj-y += boot.o
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
*/
|
||||
|
||||
#include <asm/hardware.h>
|
||||
#include "common_fdt.h"
|
||||
#include <fdt_support.h>
|
||||
|
||||
#include "../common_fdt.h"
|
||||
|
||||
static void fdt_fixup_cores_nodes_am625(void *blob, int core_nr)
|
||||
{
|
||||
char node_path[32];
|
||||
@@ -9,13 +9,14 @@
|
||||
#include <spl.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
#include "sysfw-loader.h"
|
||||
#include "common.h"
|
||||
#include <dm.h>
|
||||
#include <dm/uclass-internal.h>
|
||||
#include <dm/pinctrl.h>
|
||||
#include <dm/ofnode.h>
|
||||
|
||||
#include "../sysfw-loader.h"
|
||||
#include "../common.h"
|
||||
|
||||
#define RTC_BASE_ADDRESS 0x2b1f0000
|
||||
#define REG_K3RTC_S_CNT_LSW (RTC_BASE_ADDRESS + 0x18)
|
||||
#define REG_K3RTC_KICK0 (RTC_BASE_ADDRESS + 0x70)
|
||||
@@ -1,2 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
obj-$(CONFIG_SPL_BUILD) += am642_init.o
|
||||
obj-y += boot.o
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
#include <spl.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
#include "sysfw-loader.h"
|
||||
#include "common.h"
|
||||
#include <linux/soc/ti/ti_sci_protocol.h>
|
||||
#include <dm.h>
|
||||
#include <dm/uclass-internal.h>
|
||||
@@ -21,6 +19,9 @@
|
||||
#include <dm/root.h>
|
||||
#include <command.h>
|
||||
|
||||
#include "../sysfw-loader.h"
|
||||
#include "../common.h"
|
||||
|
||||
#define CTRLMMR_MCU_RST_CTRL 0x04518170
|
||||
|
||||
#define CTRLMMR_MCU_RST_SRC (MCU_CTRL_MMR0_BASE + 0x18178)
|
||||
7
arch/arm/mach-k3/am65x/Makefile
Normal file
7
arch/arm/mach-k3/am65x/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/
|
||||
# Andrew Davis <afd@ti.com>
|
||||
|
||||
obj-$(CONFIG_OF_SYSTEM_SETUP) += am654_fdt.o
|
||||
obj-$(CONFIG_SPL_BUILD) += am654_init.o
|
||||
@@ -3,9 +3,10 @@
|
||||
* Copyright 2023 Toradex - https://www.toradex.com/
|
||||
*/
|
||||
|
||||
#include "common_fdt.h"
|
||||
#include <fdt_support.h>
|
||||
|
||||
#include "../common_fdt.h"
|
||||
|
||||
int ft_system_setup(void *blob, struct bd_info *bd)
|
||||
{
|
||||
return fdt_fixup_msmc_ram_k3(blob);
|
||||
@@ -12,8 +12,6 @@
|
||||
#include <asm/io.h>
|
||||
#include <spl.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
#include "sysfw-loader.h"
|
||||
#include "common.h"
|
||||
#include <dm.h>
|
||||
#include <dm/uclass-internal.h>
|
||||
#include <dm/pinctrl.h>
|
||||
@@ -22,6 +20,9 @@
|
||||
#include <mmc.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "../sysfw-loader.h"
|
||||
#include "../common.h"
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#ifdef CONFIG_K3_LOAD_SYSFW
|
||||
7
arch/arm/mach-k3/j721e/Makefile
Normal file
7
arch/arm/mach-k3/j721e/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/
|
||||
# Andrew Davis <afd@ti.com>
|
||||
|
||||
obj-$(CONFIG_OF_SYSTEM_SETUP) += j721e_fdt.o
|
||||
obj-$(CONFIG_SPL_BUILD) += j721e_init.o
|
||||
@@ -3,9 +3,10 @@
|
||||
* Copyright 2023 Toradex - https://www.toradex.com/
|
||||
*/
|
||||
|
||||
#include "common_fdt.h"
|
||||
#include <fdt_support.h>
|
||||
|
||||
#include "../common_fdt.h"
|
||||
|
||||
int ft_system_setup(void *blob, struct bd_info *bd)
|
||||
{
|
||||
return fdt_fixup_msmc_ram_k3(blob);
|
||||
@@ -11,8 +11,6 @@
|
||||
#include <asm/io.h>
|
||||
#include <asm/armv7_mpu.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
#include "sysfw-loader.h"
|
||||
#include "common.h"
|
||||
#include <linux/soc/ti/ti_sci_protocol.h>
|
||||
#include <dm.h>
|
||||
#include <dm/uclass-internal.h>
|
||||
@@ -22,6 +20,9 @@
|
||||
#include <mmc.h>
|
||||
#include <remoteproc.h>
|
||||
|
||||
#include "../sysfw-loader.h"
|
||||
#include "../common.h"
|
||||
|
||||
#ifdef CONFIG_K3_LOAD_SYSFW
|
||||
struct fwl_data cbass_hc_cfg0_fwls[] = {
|
||||
#if defined(CONFIG_TARGET_J721E_R5_EVM)
|
||||
7
arch/arm/mach-k3/j721s2/Makefile
Normal file
7
arch/arm/mach-k3/j721s2/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/
|
||||
# Andrew Davis <afd@ti.com>
|
||||
|
||||
obj-$(CONFIG_OF_SYSTEM_SETUP) += j721s2_fdt.o
|
||||
obj-$(CONFIG_SPL_BUILD) += j721s2_init.o
|
||||
@@ -3,9 +3,10 @@
|
||||
* Copyright 2023 Toradex - https://www.toradex.com/
|
||||
*/
|
||||
|
||||
#include "common_fdt.h"
|
||||
#include <fdt_support.h>
|
||||
|
||||
#include "../common_fdt.h"
|
||||
|
||||
int ft_system_setup(void *blob, struct bd_info *bd)
|
||||
{
|
||||
return fdt_fixup_msmc_ram_k3(blob);
|
||||
@@ -11,8 +11,6 @@
|
||||
#include <asm/io.h>
|
||||
#include <asm/armv7_mpu.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
#include "sysfw-loader.h"
|
||||
#include "common.h"
|
||||
#include <linux/soc/ti/ti_sci_protocol.h>
|
||||
#include <dm.h>
|
||||
#include <dm/uclass-internal.h>
|
||||
@@ -21,6 +19,9 @@
|
||||
#include <mmc.h>
|
||||
#include <remoteproc.h>
|
||||
|
||||
#include "../sysfw-loader.h"
|
||||
#include "../common.h"
|
||||
|
||||
struct fwl_data cbass_hc_cfg0_fwls[] = {
|
||||
{ "PCIE0_CFG", 2577, 7 },
|
||||
{ "EMMC8SS0_CFG", 2579, 4 },
|
||||
7
arch/arm/mach-k3/j784s4/Makefile
Normal file
7
arch/arm/mach-k3/j784s4/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/
|
||||
# Andrew Davis <afd@ti.com>
|
||||
|
||||
obj-$(CONFIG_OF_SYSTEM_SETUP) += j784s4_fdt.o
|
||||
obj-$(CONFIG_SPL_BUILD) += j784s4_init.o
|
||||
@@ -6,9 +6,10 @@
|
||||
* Apurva Nandan <a-nandan@ti.com>
|
||||
*/
|
||||
|
||||
#include "common_fdt.h"
|
||||
#include <fdt_support.h>
|
||||
|
||||
#include "../common_fdt.h"
|
||||
|
||||
int ft_system_setup(void *blob, struct bd_info *bd)
|
||||
{
|
||||
return fdt_fixup_msmc_ram_k3(blob);
|
||||
@@ -11,8 +11,6 @@
|
||||
#include <asm/io.h>
|
||||
#include <asm/armv7_mpu.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
#include "sysfw-loader.h"
|
||||
#include "common.h"
|
||||
#include <linux/soc/ti/ti_sci_protocol.h>
|
||||
#include <dm.h>
|
||||
#include <dm/uclass-internal.h>
|
||||
@@ -20,6 +18,9 @@
|
||||
#include <mmc.h>
|
||||
#include <remoteproc.h>
|
||||
|
||||
#include "../sysfw-loader.h"
|
||||
#include "../common.h"
|
||||
|
||||
#define J784S4_MAX_DDR_CONTROLLERS 4
|
||||
|
||||
struct fwl_data infra_cbass0_fwls[] = {
|
||||
@@ -19,7 +19,11 @@ static int do_sigsegv(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
static int do_undefined(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
#ifdef __powerpc__
|
||||
asm volatile (".long 0xffffffff\n");
|
||||
#else
|
||||
asm volatile (".word 0xffff\n");
|
||||
#endif
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
5
env/ext4.c
vendored
5
env/ext4.c
vendored
@@ -31,6 +31,7 @@
|
||||
#include <ext4fs.h>
|
||||
#include <mmc.h>
|
||||
#include <scsi.h>
|
||||
#include <virtio.h>
|
||||
#include <asm/global_data.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
@@ -150,6 +151,10 @@ static int env_ext4_load(void)
|
||||
if (!strcmp(ifname, "scsi"))
|
||||
scsi_scan(true);
|
||||
#endif
|
||||
#if defined(CONFIG_VIRTIO)
|
||||
if (!strcmp(ifname, "virtio"))
|
||||
virtio_init();
|
||||
#endif
|
||||
|
||||
part = blk_get_device_part_str(ifname, dev_and_part,
|
||||
&dev_desc, &info, 1);
|
||||
|
||||
5
env/fat.c
vendored
5
env/fat.c
vendored
@@ -17,6 +17,7 @@
|
||||
#include <fat.h>
|
||||
#include <mmc.h>
|
||||
#include <scsi.h>
|
||||
#include <virtio.h>
|
||||
#include <asm/cache.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <linux/stddef.h>
|
||||
@@ -133,6 +134,10 @@ static int env_fat_load(void)
|
||||
if (!strcmp(CONFIG_ENV_FAT_INTERFACE, "scsi"))
|
||||
scsi_scan(true);
|
||||
#endif
|
||||
#if defined(CONFIG_VIRTIO)
|
||||
if (!strcmp(ifname, "virtio"))
|
||||
virtio_init();
|
||||
#endif
|
||||
#endif
|
||||
part = blk_get_device_part_str(ifname, dev_and_part,
|
||||
&dev_desc, &info, 1);
|
||||
|
||||
22
fs/zfs/zfs.c
22
fs/zfs/zfs.c
@@ -16,6 +16,7 @@
|
||||
#include <linux/time.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <asm/byteorder.h>
|
||||
#include <u-boot/zlib.h>
|
||||
#include "zfs_common.h"
|
||||
#include "div64.h"
|
||||
|
||||
@@ -182,7 +183,8 @@ static int
|
||||
zlib_decompress(void *s, void *d,
|
||||
uint32_t slen, uint32_t dlen)
|
||||
{
|
||||
if (zlib_decompress(s, d, slen, dlen) < 0)
|
||||
uLongf z_dest_len = dlen;
|
||||
if (uncompress(d, &z_dest_len, s, slen) != Z_OK)
|
||||
return ZFS_ERR_BAD_FS;
|
||||
return ZFS_ERR_NONE;
|
||||
}
|
||||
@@ -333,6 +335,12 @@ vdev_uberblock_compare(uberblock_t *ub1, uberblock_t *ub2)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
is_supported_spa_version(uint64_t version) {
|
||||
return version == FEATURES_SUPPORTED_SPA_VERSION ||
|
||||
(version > 0 && version <= SPA_VERSION);
|
||||
}
|
||||
|
||||
/*
|
||||
* Three pieces of information are needed to verify an uberblock: the magic
|
||||
* number, the version number, and the checksum.
|
||||
@@ -354,14 +362,12 @@ uberblock_verify(uberblock_t *uber, int offset, struct zfs_data *data)
|
||||
return ZFS_ERR_BAD_FS;
|
||||
}
|
||||
|
||||
if (zfs_to_cpu64(uber->ub_magic, LITTLE_ENDIAN) == UBERBLOCK_MAGIC
|
||||
&& zfs_to_cpu64(uber->ub_version, LITTLE_ENDIAN) > 0
|
||||
&& zfs_to_cpu64(uber->ub_version, LITTLE_ENDIAN) <= SPA_VERSION)
|
||||
if (zfs_to_cpu64(uber->ub_magic, LITTLE_ENDIAN) == UBERBLOCK_MAGIC &&
|
||||
is_supported_spa_version(zfs_to_cpu64(uber->ub_version, LITTLE_ENDIAN)))
|
||||
endian = LITTLE_ENDIAN;
|
||||
|
||||
if (zfs_to_cpu64(uber->ub_magic, BIG_ENDIAN) == UBERBLOCK_MAGIC
|
||||
&& zfs_to_cpu64(uber->ub_version, BIG_ENDIAN) > 0
|
||||
&& zfs_to_cpu64(uber->ub_version, BIG_ENDIAN) <= SPA_VERSION)
|
||||
if (zfs_to_cpu64(uber->ub_magic, BIG_ENDIAN) == UBERBLOCK_MAGIC &&
|
||||
is_supported_spa_version(zfs_to_cpu64(uber->ub_version, BIG_ENDIAN)))
|
||||
endian = BIG_ENDIAN;
|
||||
|
||||
if (endian == UNKNOWN_ENDIAN) {
|
||||
@@ -1787,7 +1793,7 @@ check_pool_label(struct zfs_data *data)
|
||||
return ZFS_ERR_BAD_FS;
|
||||
}
|
||||
|
||||
if (version > SPA_VERSION) {
|
||||
if (!is_supported_spa_version(version)) {
|
||||
free(nvlist);
|
||||
printf("SPA version too new %llu > %llu\n",
|
||||
(unsigned long long) version,
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#define __VIRTIO_H__
|
||||
|
||||
#include <virtio_types.h>
|
||||
#include <dm/device.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/bug.h>
|
||||
#include <linux/typecheck.h>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
* On-disk version number.
|
||||
*/
|
||||
#define SPA_VERSION 28ULL
|
||||
#define FEATURES_SUPPORTED_SPA_VERSION 5000ULL
|
||||
|
||||
/*
|
||||
* The following are configuration names used in the nvlist describing a pool's
|
||||
|
||||
@@ -172,7 +172,7 @@ def process_line(root_directory, command_prefix, file_path):
|
||||
# escape the pound sign '#', either as '\#' or '$(pound)' (depending on the
|
||||
# kernel version). The compile_commands.json file is not interepreted
|
||||
# by Make, so this code replaces the escaped version with '#'.
|
||||
prefix = command_prefix.replace('\#', '#').replace('$(pound)', '#')
|
||||
prefix = command_prefix.replace(r'\#', '#').replace('$(pound)', '#')
|
||||
|
||||
# Return the canonical path, eliminating any symbolic links encountered in the path.
|
||||
abs_path = os.path.realpath(os.path.join(root_directory, file_path))
|
||||
|
||||
Reference in New Issue
Block a user