Skip to content

Commit

Permalink
Merge branch 'freebsd/12-stable/master' into hardened/12-stable/master
Browse files Browse the repository at this point in the history
* freebsd/12-stable/master:
  MFC r342747 - zfsboot: support newer ZFS versions
  MFC r342793 - selectively disable ZFS without disabling loader
  MFC r345246: i386: improve detection of the fast page fault assist.
  • Loading branch information
opntr-auto committed Mar 20, 2019
2 parents 9e9163d + 22a1fb5 commit eed2cf0
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*.cpp diff=cpp
*.hpp diff=cpp
*.py diff=python
. svn-properties=svn:keywords=tools/build/options/WITHOUT_LOADER_ZFS
2 changes: 2 additions & 0 deletions share/mk/src.opts.mk
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ __DEFAULT_YES_OPTIONS = \
WIRELESS \
WPA_SUPPLICANT_EAPOL \
ZFS \
LOADER_ZFS \
ZONEINFO

__DEFAULT_NO_OPTIONS = \
Expand Down Expand Up @@ -495,6 +496,7 @@ MK_SOURCELESS_UCODE:= no

.if ${MK_CDDL} == "no"
MK_ZFS:= no
MK_LOADER_ZFS:= no
MK_CTF:= no
.endif

Expand Down
2 changes: 1 addition & 1 deletion stand/efi/boot1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ CWARNFLAGS.zfs_module.c += -Wno-unused-function

# architecture-specific loader code
SRCS= boot1.c self_reloc.c start.S ufs_module.c
.if ${MK_ZFS} != "no"
.if ${MK_LOADER_ZFS} != "no"
SRCS+= zfs_module.c
CFLAGS.zfs_module.c+= -I${ZFSSRC}
CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/boot/zfs
Expand Down
2 changes: 1 addition & 1 deletion stand/efi/libefi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CFLAGS+= -fPIC -mno-red-zone
.endif
CFLAGS+= -I${EFIINC}
CFLAGS+= -I${EFIINCMD}
.if ${MK_ZFS} != "no"
.if ${MK_LOADER_ZFS} != "no"
CFLAGS+= -I${ZFSSRC}
CFLAGS+= -DEFI_ZFS_BOOT
.endif
Expand Down
2 changes: 1 addition & 1 deletion stand/efi/loader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SRCS= autoload.c \
vers.c

CFLAGS+= -I${.CURDIR}/../loader
.if ${MK_ZFS} != "no"
.if ${MK_LOADER_ZFS} != "no"
CFLAGS+= -I${ZFSSRC}
CFLAGS+= -DEFI_ZFS_BOOT
HAVE_ZFS= yes
Expand Down
2 changes: 1 addition & 1 deletion stand/i386/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ SUBDIR.yes+= pxeldr
SUBDIR.yes+= kgzldr
.endif

SUBDIR.${MK_ZFS}+= zfsboot gptzfsboot
SUBDIR.${MK_LOADER_ZFS}+= zfsboot gptzfsboot

.include <bsd.subdir.mk>
4 changes: 2 additions & 2 deletions stand/i386/loader/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# $FreeBSD$

HAVE_ZFS= ${MK_ZFS}
HAVE_ZFS= ${MK_LOADER_ZFS}

LOADER_NET_SUPPORT?= yes
LOADER_NFS_SUPPORT?= yes
Expand Down Expand Up @@ -64,7 +64,7 @@ ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN}
${LOADER}.bin: ${LOADER}.sym
strip -R .comment -R .note -o ${.TARGET} ${.ALLSRC}

.if ${MK_ZFS} == "yes" && ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP}
.if ${MK_LOADER_ZFS} == "yes" && ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP}
LINKS+= ${BINDIR}/${LOADER} ${BINDIR}/zfsloader
.endif
.if ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP}
Expand Down
2 changes: 1 addition & 1 deletion stand/libsa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ SRCS+= explicit_bzero.c
.endif

# Maybe ZFS
.if ${MK_ZFS} == "yes"
.if ${MK_LOADER_ZFS} == "yes"
.include "${SASRC}/zfs/Makefile.inc"
.endif

Expand Down
2 changes: 1 addition & 1 deletion stand/sparc64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ NO_OBJ=t
.include <bsd.init.mk>

SUBDIR.yes= boot1 loader
SUBDIR.${MK_ZFS}+=zfsboot
SUBDIR.${MK_LOADER_ZFS}+=zfsboot

.include <bsd.subdir.mk>
6 changes: 3 additions & 3 deletions stand/sparc64/loader/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# $FreeBSD$

HAVE_ZFS= ${MK_ZFS}
HAVE_ZFS= ${MK_LOADER_ZFS}

LOADER_DISK_SUPPORT?= yes
LOADER_UFS_SUPPORT?= yes
Expand All @@ -21,7 +21,7 @@ NEWVERSWHAT?= "bootstrap loader" sparc64
VERSION_FILE= ${.CURDIR}/../loader/version
INSTALLFLAGS= -b

.if ${MK_ZFS} != "no"
.if ${MK_LOADER_ZFS} != "no"
HAVE_ZFS= yes
.endif

Expand All @@ -42,7 +42,7 @@ HELP_FILES= ${.CURDIR}/help.sparc64

LDFLAGS+= -static

.if ${MK_ZFS} == "yes"
.if ${MK_LOADER_ZFS} == "yes"
LINKS= ${BINDIR}/loader ${BINDIR}/zfsloader
.endif

Expand Down
2 changes: 1 addition & 1 deletion stand/userboot/userboot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ VERSION_FILE= ${.CURDIR}/../userboot/version
LINKS+= ${BINDIR}/${SHLIB_NAME} ${BINDIR}/userboot.so
.endif

.if ${MK_ZFS} != "no"
.if ${MK_LOADER_ZFS} != "no"
CFLAGS+= -DUSERBOOT_ZFS_SUPPORT
HAVE_ZFS=yes
.endif
Expand Down
15 changes: 12 additions & 3 deletions sys/cddl/boot/zfs/zfsimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,8 @@ typedef struct sa_hdr_phys {
#define SA_PARENT_OFFSET 40
#define SA_SYMLINK_OFFSET 160

#define ZIO_OBJSET_MAC_LEN 32

/*
* Intent log header - this on disk structure holds fields to manage
* the log. All fields are 64 bit to easily handle cross architectures.
Expand All @@ -1133,17 +1135,24 @@ typedef struct zil_header {
uint64_t zh_pad[5];
} zil_header_t;

#define OBJSET_PHYS_SIZE 2048
#define OBJSET_PHYS_SIZE_V2 2048
#define OBJSET_PHYS_SIZE_V3 4096

typedef struct objset_phys {
dnode_phys_t os_meta_dnode;
zil_header_t os_zil_header;
uint64_t os_type;
uint64_t os_flags;
char os_pad[OBJSET_PHYS_SIZE - sizeof (dnode_phys_t)*3 -
sizeof (zil_header_t) - sizeof (uint64_t)*2];
uint8_t os_portable_mac[ZIO_OBJSET_MAC_LEN];
uint8_t os_local_mac[ZIO_OBJSET_MAC_LEN];
char os_pad0[OBJSET_PHYS_SIZE_V2 - sizeof (dnode_phys_t)*3 -
sizeof (zil_header_t) - sizeof (uint64_t)*2 -
2*ZIO_OBJSET_MAC_LEN];
dnode_phys_t os_userused_dnode;
dnode_phys_t os_groupused_dnode;
dnode_phys_t os_projectused_dnode;
char os_pad1[OBJSET_PHYS_SIZE_V3 - OBJSET_PHYS_SIZE_V2 -
sizeof (dnode_phys_t)];
} objset_phys_t;

typedef struct dsl_dir_phys {
Expand Down
4 changes: 4 additions & 0 deletions sys/i386/i386/exception.s
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ IDTVEC(prot)
pushl $T_PROTFLT
jmp irettraps
IDTVEC(page)
testl $PSL_VM, TF_EFLAGS-TF_ERR(%esp)
jnz 1f
testb $SEL_RPL_MASK, TF_CS-TF_ERR(%esp)
jnz 1f
cmpl $PMAP_TRM_MIN_ADDRESS, TF_EIP-TF_ERR(%esp)
jb 1f
movl %ebx, %cr3
Expand Down
2 changes: 1 addition & 1 deletion sys/sys/param.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
* in the range 5 to 9.
*/
#undef __FreeBSD_version
#define __FreeBSD_version 1200504 /* Master, propagated to newvers */
#define __FreeBSD_version 1200505 /* Master, propagated to newvers */

/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
Expand Down
2 changes: 2 additions & 0 deletions tools/build/options/WITHOUT_LOADER_ZFS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.\" $FreeBSD$
Set to not build ZFS file system boot loader support.
2 changes: 1 addition & 1 deletion tools/build/options/WITHOUT_ZFS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.\" $FreeBSD$
Set to not build ZFS file system.
Set to not build ZFS file system kernel module, libraries, and user commands.

0 comments on commit eed2cf0

Please sign in to comment.