svn commit: r332090 - head/stand/i386
Author: emaste Date: Fri Apr 6 02:57:58 2018 New Revision: 332090 URL: https://svnweb.freebsd.org/changeset/base/332090 Log: stand: pass --no-rosegment for i386 bits when linking with lld btxld does not correctly handle input with other than 2 PT_LOAD segments. Passing --no-rosegment lets lld produce output eqivalent to ld.bfd: 2 PT_LOAD segments and no PT_GNU_RELRO. PR: 225775 MFC after:3 weeks Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D14956 Modified: head/stand/i386/Makefile.inc Modified: head/stand/i386/Makefile.inc == --- head/stand/i386/Makefile.incFri Apr 6 02:47:43 2018 (r332089) +++ head/stand/i386/Makefile.incFri Apr 6 02:57:58 2018 (r332090) @@ -2,8 +2,13 @@ # # $FreeBSD$ +.sinclude + LOADER_ADDRESS?=0x20 LDFLAGS+= -nostdlib +.if defined(LINKER_TYPE) && ${LINKER_TYPE} == "lld" +LDFLAGS+= -Wl,--no-rosegment +.endif # BTX components BTXDIR=${BOOTOBJ}/i386/btx ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r332070 - in head/sys/geom: . label raid
Yep, exactly — md_intel was tasting the md(4) device. md_intel invokes g_raid_md_get_label() early on in its taste routine. On Thu, Apr 5, 2018 at 6:29 PM, Allan Judewrote: > On 2018-04-05 21:20, Conrad Meyer wrote: >> On Thu, Apr 5, 2018 at 6:08 PM, Allan Jude wrote: >>> On 2018-04-05 09:56, Sean Bruno wrote: Author: sbruno Date: Thu Apr 5 13:56:40 2018 New Revision: 332070 URL: https://svnweb.freebsd.org/changeset/base/332070 Log: Squash error from geom by sizing ident strings to DISK_IDENT_SIZE. ... >>> I might be missing something here, but it seems like you didn't actually >>> change the side of >>> ... >>> struct md_s >> >> The md side can be as small as it likes. It's the caller who needs to >> provide the large buffer, for other providers of the GEOM::ident >> attribute. >> >>> And I don't see where the destination buffer went from 24 bytes to a >>> larger value. >> >> Check the change in md_intel.c. >> >> Best, >> Conrad >> > > Right, but md_intel.c is for intel BIOS raid. > > I don't see the change that increased the size of the buffer in the > caller from 24 bytes to something more useful? > > Or was it md_intel tasting the md(4) device? > > -- > Allan Jude ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r332070 - in head/sys/geom: . label raid
On 2018-04-05 21:20, Conrad Meyer wrote: > On Thu, Apr 5, 2018 at 6:08 PM, Allan Judewrote: >> On 2018-04-05 09:56, Sean Bruno wrote: >>> Author: sbruno >>> Date: Thu Apr 5 13:56:40 2018 >>> New Revision: 332070 >>> URL: https://svnweb.freebsd.org/changeset/base/332070 >>> >>> Log: >>> Squash error from geom by sizing ident strings to DISK_IDENT_SIZE. >>> >>> ... >> I might be missing something here, but it seems like you didn't actually >> change the side of >> ... >> struct md_s > > The md side can be as small as it likes. It's the caller who needs to > provide the large buffer, for other providers of the GEOM::ident > attribute. > >> And I don't see where the destination buffer went from 24 bytes to a >> larger value. > > Check the change in md_intel.c. > > Best, > Conrad > Right, but md_intel.c is for intel BIOS raid. I don't see the change that increased the size of the buffer in the caller from 24 bytes to something more useful? Or was it md_intel tasting the md(4) device? -- Allan Jude ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r332070 - in head/sys/geom: . label raid
On Thu, Apr 5, 2018 at 6:08 PM, Allan Judewrote: > On 2018-04-05 09:56, Sean Bruno wrote: >> Author: sbruno >> Date: Thu Apr 5 13:56:40 2018 >> New Revision: 332070 >> URL: https://svnweb.freebsd.org/changeset/base/332070 >> >> Log: >> Squash error from geom by sizing ident strings to DISK_IDENT_SIZE. >> >> ... > I might be missing something here, but it seems like you didn't actually > change the side of > ... > struct md_s The md side can be as small as it likes. It's the caller who needs to provide the large buffer, for other providers of the GEOM::ident attribute. > And I don't see where the destination buffer went from 24 bytes to a > larger value. Check the change in md_intel.c. Best, Conrad ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r332070 - in head/sys/geom: . label raid
On 2018-04-05 09:56, Sean Bruno wrote: > Author: sbruno > Date: Thu Apr 5 13:56:40 2018 > New Revision: 332070 > URL: https://svnweb.freebsd.org/changeset/base/332070 > > Log: > Squash error from geom by sizing ident strings to DISK_IDENT_SIZE. > > Display attribute in future error strings and differentiate g_handleattr() > error messages for ease of debugging in the future. > > "g_handleattr: md1 bio_length 24 strlen 31 -> EFAULT" > > Reported by:swills > Reviewed by:imp cem avg > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D14962 > > Modified: > head/sys/geom/geom_subr.c > head/sys/geom/label/g_label_disk_ident.c > head/sys/geom/raid/md_ddf.c > head/sys/geom/raid/md_intel.c > I might be missing something here, but it seems like you didn't actually change the side of struct md_s { ... char ident[32]; ... } And I don't see where the destination buffer went from 24 bytes to a larger value. -- Allan Jude signature.asc Description: OpenPGP digital signature
svn commit: r332088 - head/sys/net
Author: brooks Date: Thu Apr 5 22:14:55 2018 New Revision: 332088 URL: https://svnweb.freebsd.org/changeset/base/332088 Log: Add 32-bit compat for ioctls that take struct ifgroupreq. Use an accessor to access ifgr_group and ifgr_groups. Use an macro CASE_IOC_IFGROUPREQ(cmd) in place of case statements such as "case SIOCAIFGROUP:". This avoids poluting the switch statements with large numbers of #ifdefs. Reviewed by: kib Obtained from:CheriBSD MFC after:1 week Sponsored by: DARPA, AFRL Differential Revision:https://reviews.freebsd.org/D14960 Modified: head/sys/net/if.c head/sys/net/if.h Modified: head/sys/net/if.c == --- head/sys/net/if.c Thu Apr 5 21:58:28 2018(r332087) +++ head/sys/net/if.c Thu Apr 5 22:14:55 2018(r332088) @@ -142,8 +142,25 @@ struct ifreq32 { CTASSERT(sizeof(struct ifreq) == sizeof(struct ifreq32)); CTASSERT(__offsetof(struct ifreq, ifr_ifru) == __offsetof(struct ifreq32, ifr_ifru)); -#endif +struct ifgroupreq32 { + charifgr_name[IFNAMSIZ]; + u_int ifgr_len; + union { + charifgru_group[IFNAMSIZ]; + uint32_tifgru_groups; + } ifgr_ifgru; +}; +#define_CASE_IOC_IFGROUPREQ_32(cmd)\ +case _IOC_NEWTYPE((cmd), struct ifgroupreq32): +#else +#define _CASE_IOC_IFGROUPREQ_32(cmd) +#endif /* COMPAT_FREEBSD32 */ + +#define CASE_IOC_IFGROUPREQ(cmd) \ +_CASE_IOC_IFGROUPREQ_32(cmd) \ +case (cmd) + union ifreq_union { struct ifreqifr; #ifdef COMPAT_FREEBSD32 @@ -151,6 +168,13 @@ union ifreq_union { #endif }; +union ifgroupreq_union { + struct ifgroupreq ifgr; +#ifdef COMPAT_FREEBSD32 + struct ifgroupreq32 ifgr32; +#endif +}; + SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers"); SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management"); @@ -1500,17 +1524,42 @@ if_delgroups(struct ifnet *ifp) IFNET_WUNLOCK(); } +static char * +ifgr_group_get(void *ifgrp) +{ + union ifgroupreq_union *ifgrup; + + ifgrup = ifgrp; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + return (>ifgr32.ifgr_ifgru.ifgru_group[0]); +#endif + return (>ifgr.ifgr_ifgru.ifgru_group[0]); +} + +static struct ifg_req * +ifgr_groups_get(void *ifgrp) +{ + union ifgroupreq_union *ifgrup; + + ifgrup = ifgrp; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + return ((struct ifg_req *)(uintptr_t) + ifgrup->ifgr32.ifgr_ifgru.ifgru_groups); +#endif + return (ifgrup->ifgr.ifgr_ifgru.ifgru_groups); +} + /* - * Stores all groups from an interface in memory pointed - * to by data + * Stores all groups from an interface in memory pointed to by ifgr. */ static int -if_getgroup(struct ifgroupreq *data, struct ifnet *ifp) +if_getgroup(struct ifgroupreq *ifgr, struct ifnet *ifp) { int len, error; struct ifg_list *ifgl; struct ifg_req ifgrq, *ifgp; - struct ifgroupreq *ifgr = data; if (ifgr->ifgr_len == 0) { IF_ADDR_RLOCK(ifp); @@ -1521,7 +1570,7 @@ if_getgroup(struct ifgroupreq *data, struct ifnet *ifp } len = ifgr->ifgr_len; - ifgp = ifgr->ifgr_groups; + ifgp = ifgr_groups_get(ifgr); /* XXX: wire */ IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifgl, >if_groups, ifgl_next) { @@ -1545,12 +1594,11 @@ if_getgroup(struct ifgroupreq *data, struct ifnet *ifp } /* - * Stores all members of a group in memory pointed to by data + * Stores all members of a group in memory pointed to by igfr */ static int -if_getgroupmembers(struct ifgroupreq *data) +if_getgroupmembers(struct ifgroupreq *ifgr) { - struct ifgroupreq *ifgr = data; struct ifg_group*ifg; struct ifg_member *ifgm; struct ifg_req ifgrq, *ifgp; @@ -1573,7 +1621,7 @@ if_getgroupmembers(struct ifgroupreq *data) } len = ifgr->ifgr_len; - ifgp = ifgr->ifgr_groups; + ifgp = ifgr_groups_get(ifgr); TAILQ_FOREACH(ifgm, >ifg_members, ifgm_next) { if (len < sizeof(ifgrq)) { IFNET_RUNLOCK(); @@ -2803,34 +2851,28 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, error = if_gethwaddr(ifp, ifr); break; - case SIOCAIFGROUP: - { - struct ifgroupreq *ifgr = (struct ifgroupreq *)ifr; - + CASE_IOC_IFGROUPREQ(SIOCAIFGROUP): error = priv_check(td, PRIV_NET_ADDIFGROUP); if (error) return (error); - if ((error = if_addgroup(ifp, ifgr->ifgr_group))) + if ((error = if_addgroup(ifp, +
svn commit: r332087 - head/sys/net
Author: brooks Date: Thu Apr 5 21:58:28 2018 New Revision: 332087 URL: https://svnweb.freebsd.org/changeset/base/332087 Log: ifconf(): Always zero the whole struct ifreq. The previous split of zeroing ifr_name and ifr_addr seperately is safe on current architectures, but would be unsafe if pointers were larger than 8 bytes. Combining the zeroing adds no real cost (a few instructions) and makes the security property easier to verify. Reviewed by: kib, emaste Obtained from:CheriBSD MFC after:3 days Sponsored by: DARPA, AFRL Differential Revision:https://reviews.freebsd.org/D14912 Modified: head/sys/net/if.c Modified: head/sys/net/if.c == --- head/sys/net/if.c Thu Apr 5 20:31:45 2018(r332086) +++ head/sys/net/if.c Thu Apr 5 21:58:28 2018(r332087) @@ -3129,10 +3129,10 @@ again: int addrs; /* -* Zero the ifr_name buffer to make sure we don't -* disclose the contents of the stack. +* Zero the ifr to make sure we don't disclose the contents +* of the stack. */ - memset(ifr.ifr_name, 0, sizeof(ifr.ifr_name)); + memset(, 0, sizeof(ifr)); if (strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name)) >= sizeof(ifr.ifr_name)) { @@ -3166,7 +3166,6 @@ again: } IF_ADDR_RUNLOCK(ifp); if (addrs == 0) { - bzero((caddr_t)_addr, sizeof(ifr.ifr_addr)); sbuf_bcat(sb, , sizeof(ifr)); max_len += sizeof(ifr); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r332086 - head/sys/kern
On Thu, Apr 05, 2018 at 08:31:45PM +, Brooks Davis wrote: > Author: brooks > Date: Thu Apr 5 20:31:45 2018 > New Revision: 332086 > URL: https://svnweb.freebsd.org/changeset/base/332086 > > Log: > Added SAL annotatations to system calls. > > Modify makesyscalls.sh to strip out SAL annotations. > > No functional change. > > This is based on work I started in CheriBSD and use to validate fat > pointers at the syscall boundary. Tal Garfinkel reviewed the changes, > added annotations to COMPAT* syscalls and is using them in a record and > playback framework. One can envision other uses such as a WITNESS-like > validator for copyin/out as speculated on in the review. > > As this time we are only annotating sys/kern/syscalls.master as that is > sufficient for userspace work. If kernel use cases materialize, we can > annotate other syscalls.master as needed. > > Submitted by: Tal Garfinkel> Sponsored by: DARPA, AFRL (in part) > Differential Revision: https://reviews.freebsd.org/D14285 Sorry, I misplaced a: Reviewed by:cem (prior version) -- Brooks signature.asc Description: PGP signature
svn commit: r332086 - head/sys/kern
Author: brooks Date: Thu Apr 5 20:31:45 2018 New Revision: 332086 URL: https://svnweb.freebsd.org/changeset/base/332086 Log: Added SAL annotatations to system calls. Modify makesyscalls.sh to strip out SAL annotations. No functional change. This is based on work I started in CheriBSD and use to validate fat pointers at the syscall boundary. Tal Garfinkel reviewed the changes, added annotations to COMPAT* syscalls and is using them in a record and playback framework. One can envision other uses such as a WITNESS-like validator for copyin/out as speculated on in the review. As this time we are only annotating sys/kern/syscalls.master as that is sufficient for userspace work. If kernel use cases materialize, we can annotate other syscalls.master as needed. Submitted by: Tal GarfinkelSponsored by: DARPA, AFRL (in part) Differential Revision:https://reviews.freebsd.org/D14285 Modified: head/sys/kern/makesyscalls.sh head/sys/kern/syscalls.master Modified: head/sys/kern/makesyscalls.sh == --- head/sys/kern/makesyscalls.sh Thu Apr 5 19:45:30 2018 (r332085) +++ head/sys/kern/makesyscalls.sh Thu Apr 5 20:31:45 2018 (r332086) @@ -400,6 +400,16 @@ sed -e ' } if (argtype[argc] == "") parserr($f, "argument definition") + + # The parser adds space around parens. + # Remove it from annotations. + gsub(/ \( /, "(", argtype[argc]); + gsub(/ \)/, ")", argtype[argc]); + + #remove annotations + gsub(/_In[^ ]*[_)] /, "", argtype[argc]); + gsub(/_Out[^ ]*[_)] /, "", argtype[argc]); + argname[argc]=$f; f += 2; # skip name, and any comma } Modified: head/sys/kern/syscalls.master == --- head/sys/kern/syscalls.master Thu Apr 5 19:45:30 2018 (r332085) +++ head/sys/kern/syscalls.master Thu Apr 5 20:31:45 2018 (r332086) @@ -43,7 +43,32 @@ ; function prototype in sys/sysproto.h. Does add a ; definition to syscall.h besides adding a sysent. ; NOTSTATIC syscall is loadable + +; annotations: +; SAL 2.0 annotations are used to specify how system calls treat +; arguments that are passed using pointers. There are three basic +; annotations. ; +; _In_Object pointed to will be read and not modified. +; _Out_ Object pointed to will be written and not read. +; _Inout_ Object pointed to will be written and read. +; +; These annotations are used alone when the pointer refers to a single +; object i.e. scalar types, structs, and pointers, and not NULL. Adding +; the _opt_ suffix, e.g. _In_opt_, implies that the pointer may also +; refer to NULL. +; +; For pointers to arrays, additional suffixes are added: +; +; _In_z_, _Out_z_, _Inout_z_: +; for a NUL terminated array e.g. a string. +; _In_reads_z_(n),_Out_writes_z_(n), _Inout_updates_z_(n): +; for a NUL terminated array e.g. a string, of known length n bytes. +; _In_reads_(n),_Out_writes_(n),_Inout_updates_(n): +; for an array of n elements. +; _In_reads_bytes_(n), _Out_writes_bytes_(n), _Inout_updates_bytes(n): +; for a buffer of n-bytes. + ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master @@ -63,143 +88,181 @@ 1 AUE_EXITSTD { void sys_exit(int rval); } exit \ sys_exit_args void 2 AUE_FORKSTD { int fork(void); } -3 AUE_READSTD { ssize_t read(int fd, void *buf, \ +3 AUE_READSTD { ssize_t read(int fd, \ + _Out_writes_bytes_(nbyte) void *buf, \ size_t nbyte); } -4 AUE_WRITE STD { ssize_t write(int fd, const void *buf, \ +4 AUE_WRITE STD { ssize_t write(int fd, \ + _In_reads_bytes_(nbyte) const void *buf, \ size_t nbyte); } -5 AUE_OPEN_RWTC STD { int open(char *path, int flags, int mode); } +5 AUE_OPEN_RWTC STD { int open( \ + _In_z_ char *path, \ + int flags, \ + int mode); } ; XXX should be{ int open(const char *path, int flags, ...); } ; but we're not ready for `const' or varargs. ; XXX man page says `mode_t mode'. 6 AUE_CLOSE STD { int close(int
svn commit: r332085 - head/stand/common
Author: benno Date: Thu Apr 5 19:45:30 2018 New Revision: 332085 URL: https://svnweb.freebsd.org/changeset/base/332085 Log: Add an ISO9660 "partition table" type to loader. When booted via isoboot(8) loader will be handed a disk that simply contains an ISO9660 image. Currently this confuses it greatly. Teach it how to spot that it's in this situation and that ISO9660 has one "partition" covering the whole disk. Reviewed by: imp Sponsored by: iXsystems, Inc. Differential Revision:https://reviews.freebsd.org/D14915 Modified: head/stand/common/disk.c head/stand/common/part.c head/stand/common/part.h Modified: head/stand/common/disk.c == --- head/stand/common/disk.cThu Apr 5 19:40:46 2018(r332084) +++ head/stand/common/disk.cThu Apr 5 19:45:30 2018(r332085) @@ -270,6 +270,9 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize dev->d_offset = part.start; od->entrysize = part.end - part.start + 1; } + } else if (ptable_gettype(od->table) == PTABLE_ISO9660) { + dev->d_offset = 0; + od->entrysize = mediasize; } else if (slice >= 0) { /* Try to get information about partition */ if (slice == 0) Modified: head/stand/common/part.c == --- head/stand/common/part.cThu Apr 5 19:40:46 2018(r332084) +++ head/stand/common/part.cThu Apr 5 19:45:30 2018(r332085) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -97,6 +99,7 @@ static struct parttypes { { PART_LINUX, "Linux" }, { PART_LINUX_SWAP, "Linux swap" }, { PART_DOS, "DOS/Windows" }, + { PART_ISO9660, "ISO9660" }, }; const char * @@ -603,6 +606,45 @@ out: } #endif /* LOADER_VTOC8_SUPPORT */ +#define cdb2devb(bno) ((bno) * ISO_DEFAULT_BLOCK_SIZE / table->sectorsize) + +static struct ptable * +ptable_iso9660read(struct ptable *table, void *dev, diskread_t dread) +{ + uint8_t *buf; + struct iso_primary_descriptor *vd; + struct pentry *entry; + + buf = malloc(table->sectorsize); + if (buf == NULL) + return (table); + + if (dread(dev, buf, 1, cdb2devb(16)) != 0) { + DEBUG("read failed"); + ptable_close(table); + table = NULL; + goto out; + } + vd = (struct iso_primary_descriptor *)buf; + if (bcmp(vd->id, ISO_STANDARD_ID, sizeof vd->id) != 0) + goto out; + + entry = malloc(sizeof(*entry)); + if (entry == NULL) + goto out; + entry->part.start = 0; + entry->part.end = table->sectors; + entry->part.type = PART_ISO9660; + entry->part.index = 0; + STAILQ_INSERT_TAIL(>entries, entry, entry); + + table->type = PTABLE_ISO9660; + +out: + free(buf); + return (table); +} + struct ptable * ptable_open(void *dev, uint64_t sectors, uint16_t sectorsize, diskread_t *dread) @@ -633,6 +675,11 @@ ptable_open(void *dev, uint64_t sectors, uint16_t sect table->sectorsize = sectorsize; table->type = PTABLE_NONE; STAILQ_INIT(>entries); + + if (ptable_iso9660read(table, dev, dread) != NULL) { + if (table->type == PTABLE_ISO9660) + goto out; + } #ifdef LOADER_VTOC8_SUPPORT if (be16dec(buf + offsetof(struct vtoc8, magic)) == VTOC_MAGIC) { Modified: head/stand/common/part.h == --- head/stand/common/part.hThu Apr 5 19:40:46 2018(r332084) +++ head/stand/common/part.hThu Apr 5 19:45:30 2018(r332085) @@ -36,7 +36,8 @@ enum ptable_type { PTABLE_BSD, PTABLE_MBR, PTABLE_GPT, - PTABLE_VTOC8 + PTABLE_VTOC8, + PTABLE_ISO9660 }; enum partition_type { @@ -52,6 +53,7 @@ enum partition_type { PART_LINUX, PART_LINUX_SWAP, PART_DOS, + PART_ISO9660 }; struct ptable_entry { ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r332084 - in head: stand/i386 stand/i386/isoboot stand/libsa sys/fs/cd9660
Author: benno Date: Thu Apr 5 19:40:46 2018 New Revision: 332084 URL: https://svnweb.freebsd.org/changeset/base/332084 Log: Add isoboot(8) for booting BIOS systems from HDDs containing ISO images. This is part of a project for adding the ability to create hybrid CD/USB boot images. In the BIOS case when booting from something that isn't a CD we need some extra boot code to actually find our next stage (loader) within an ISO9660 filesystem. This code will reside in a GPT partition (similar to gptboot(8) from which it is derived) and looks for /boot/loader in an ISO9660 filesystem on the image. Reviewed by: imp Sponsored by: iXsystems, Inc. Differential Revision:https://reviews.freebsd.org/D14914 Added: head/stand/i386/isoboot/ head/stand/i386/isoboot/Makefile - copied, changed from r332081, head/stand/i386/gptboot/Makefile head/stand/i386/isoboot/isoboot.8 (contents, props changed) head/stand/i386/isoboot/isoboot.c - copied, changed from r332083, head/stand/i386/gptboot/gptboot.c head/stand/libsa/cd9660read.c (contents, props changed) Modified: head/stand/i386/Makefile head/sys/fs/cd9660/iso.h Modified: head/stand/i386/Makefile == --- head/stand/i386/MakefileThu Apr 5 19:29:22 2018(r332083) +++ head/stand/i386/MakefileThu Apr 5 19:40:46 2018(r332084) @@ -5,7 +5,7 @@ NO_OBJ=t .include SUBDIR.yes=mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ - libi386 + isoboot libi386 SUBDIR.${MK_LOADER_FIREWIRE}+= libfirewire Copied and modified: head/stand/i386/isoboot/Makefile (from r332081, head/stand/i386/gptboot/Makefile) == --- head/stand/i386/gptboot/MakefileThu Apr 5 18:19:48 2018 (r332081, copy source) +++ head/stand/i386/isoboot/MakefileThu Apr 5 19:40:46 2018 (r332084) @@ -4,10 +4,11 @@ HAVE_GELI=yes .include -.PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common ${SASRC} +.PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \ + ${BOOTSRC}/i386/common ${SASRC} -FILES= gptboot -MAN= gptboot.8 +FILES= isoboot +MAN= isoboot.8 NM?= nm @@ -19,15 +20,10 @@ REL1= 0x700 ORG1= 0x7c00 ORG2= 0x0 -# Decide level of UFS support. -GPTBOOT_UFS?= UFS1_AND_UFS2 -#GPTBOOT_UFS?= UFS2_ONLY -#GPTBOOT_UFS?= UFS1_ONLY +ISOBOOTSIZE?= 30720 -CFLAGS+=-DBOOTPROG=\"gptboot\" \ +CFLAGS+=-DBOOTPROG=\"isoboot\" \ -O1 \ - -DGPT \ - -D${GPTBOOT_UFS} \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ @@ -40,14 +36,17 @@ CFLAGS+=-DBOOTPROG=\"gptboot\" \ -Winline -Wno-pointer-sign CFLAGS.gcc+= --param max-inline-insns-single=100 +CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} LD_FLAGS+=${LD_FLAGS_BIN} -CLEANFILES+= gptboot +CLEANFILES+= isoboot -gptboot: gptldr.bin gptboot.bin ${BTXKERN} +isoboot: gptldr.bin isoboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \ - -o ${.TARGET} gptboot.bin + -o ${.TARGET} isoboot.bin + @set -- `ls -l ${.TARGET}`; x=$$((${ISOBOOTSIZE}-$$5)); \ + echo "$$x bytes available"; test $$x -ge 0 CLEANFILES+= gptldr.bin gptldr.out gptldr.o @@ -57,16 +56,13 @@ gptldr.bin: gptldr.out gptldr.out: gptldr.o ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o -CLEANFILES+= gptboot.bin gptboot.out gptboot.o sio.o crc32.o drv.o \ +CLEANFILES+= isoboot.bin isoboot.out isoboot.o sio.o crc32.o drv.o \ cons.o ${OPENCRYPTO_XTS} -gptboot.bin: gptboot.out - ${OBJCOPY} -S -O binary gptboot.out ${.TARGET} +isoboot.bin: isoboot.out + ${OBJCOPY} -S -O binary isoboot.out ${.TARGET} -gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS} +isoboot.out: ${BTXCRT} isoboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS} ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} .include - -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS.gptldr.S= ${CLANG_NO_IAS} Added: head/stand/i386/isoboot/isoboot.8 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/i386/isoboot/isoboot.8 Thu Apr 5 19:40:46 2018 (r332084) @@ -0,0 +1,69 @@ +.\" Copyright (c) 2018 iXsystems, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following
svn commit: r332083 - head/stand/i386/gptboot
Author: benno Date: Thu Apr 5 19:29:22 2018 New Revision: 332083 URL: https://svnweb.freebsd.org/changeset/base/332083 Log: Various style(9) fixes. Reviewed by: strip --strip-debug -o - gptboot.o | md5 Sponsored by: iXsystems, Inc. Modified: head/stand/i386/gptboot/gptboot.c Modified: head/stand/i386/gptboot/gptboot.c == --- head/stand/i386/gptboot/gptboot.c Thu Apr 5 19:27:24 2018 (r332082) +++ head/stand/i386/gptboot/gptboot.c Thu Apr 5 19:29:22 2018 (r332083) @@ -370,6 +370,7 @@ main(void) void exit(int x) { + while (1); __unreachable(); } @@ -491,12 +492,13 @@ load(void) static int parse_cmds(char *cmdstr, int *dskupdated) { - char *arg = cmdstr; + char *arg; char *ep, *p, *q; const char *cp; unsigned int drv; int c, i, j; + arg = cmdstr; *dskupdated = 0; while ((c = *arg++)) { if (c == ' ' || c == '\t' || c == '\n') @@ -533,7 +535,7 @@ parse_cmds(char *cmdstr, int *dskupdated) } for (i = 0; c != optstr[i]; i++) if (i == NOPT - 1) - return -1; + return (-1); opts ^= OPT_SET(flags[i]); } ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : @@ -553,23 +555,23 @@ parse_cmds(char *cmdstr, int *dskupdated) arg += 2; } if (q - arg != 2) - return -1; + return (-1); for (i = 0; arg[0] != dev_nm[i][0] || arg[1] != dev_nm[i][1]; i++) if (i == NDEV - 1) - return -1; + return (-1); dsk.type = i; arg += 3; dsk.unit = *arg - '0'; if (arg[1] != 'p' || dsk.unit > 9) - return -1; + return (-1); arg += 2; dsk.part = *arg - '0'; if (dsk.part < 1 || dsk.part > 9) - return -1; + return (-1); arg++; if (arg[0] != ')') - return -1; + return (-1); arg++; if (drv == -1) drv = dsk.unit; @@ -579,13 +581,13 @@ parse_cmds(char *cmdstr, int *dskupdated) } if ((i = ep - arg)) { if ((size_t)i >= sizeof(kname)) - return -1; + return (-1); memcpy(kname, arg, i + 1); } } arg = p; } - return 0; + return (0); } static int @@ -617,7 +619,9 @@ vdev_read(void *vdev __unused, void *priv, off_t off, char *p; daddr_t lba; unsigned int nb; - struct dsk *dskp = (struct dsk *) priv; + struct dsk *dskp; + + dskp = (struct dsk *)priv; if ((off & (DEV_BSIZE - 1)) || (bytes & (DEV_BSIZE - 1))) return (-1); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r332082 - head/stand/i386/gptboot
Author: benno Date: Thu Apr 5 19:27:24 2018 New Revision: 332082 URL: https://svnweb.freebsd.org/changeset/base/332082 Log: Use consistent whitespace. Reviewed by: strip --strip-debug -o - gptboot.o | md5 Sponsored by: iXsystems, Inc. Modified: head/stand/i386/gptboot/gptboot.c Modified: head/stand/i386/gptboot/gptboot.c == --- head/stand/i386/gptboot/gptboot.c Thu Apr 5 18:19:48 2018 (r332081) +++ head/stand/i386/gptboot/gptboot.c Thu Apr 5 19:27:24 2018 (r332082) @@ -132,87 +132,93 @@ xfsread(ufs_ino_t inode, void *buf, size_t nbyte) static void bios_getmem(void) { -uint64_t size; + uint64_t size; -/* Parse system memory map */ -v86.ebx = 0; -do { - v86.ctl = V86_FLAGS; - v86.addr = MEM_EXT; /* int 0x15 function 0xe820*/ - v86.eax = 0xe820; - v86.ecx = sizeof(struct bios_smap); - v86.edx = SMAP_SIG; - v86.es = VTOPSEG(); - v86.edi = VTOPOFF(); - v86int(); - if ((v86.efl & 1) || (v86.eax != SMAP_SIG)) - break; - /* look for a low-memory segment that's large enough */ - if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) && - (smap.length >= (512 * 1024))) - bios_basemem = smap.length; - /* look for the first segment in 'extended' memory */ - if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x10)) { - bios_extmem = smap.length; - } + /* Parse system memory map */ + v86.ebx = 0; + do { + v86.ctl = V86_FLAGS; + v86.addr = MEM_EXT; /* int 0x15 function 0xe820*/ + v86.eax = 0xe820; + v86.ecx = sizeof(struct bios_smap); + v86.edx = SMAP_SIG; + v86.es = VTOPSEG(); + v86.edi = VTOPOFF(); + v86int(); + if ((v86.efl & 1) || (v86.eax != SMAP_SIG)) + break; + /* look for a low-memory segment that's large enough */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) && + (smap.length >= (512 * 1024))) + bios_basemem = smap.length; + /* look for the first segment in 'extended' memory */ + if ((smap.type == SMAP_TYPE_MEMORY) && + (smap.base == 0x10)) { + bios_extmem = smap.length; + } - /* -* Look for the largest segment in 'extended' memory beyond -* 1MB but below 4GB. -*/ - if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base > 0x10) && - (smap.base < 0x1ull)) { - size = smap.length; + /* +* Look for the largest segment in 'extended' memory beyond +* 1MB but below 4GB. +*/ + if ((smap.type == SMAP_TYPE_MEMORY) && + (smap.base > 0x10) && (smap.base < 0x1ull)) { + size = smap.length; - /* -* If this segment crosses the 4GB boundary, truncate it. -*/ - if (smap.base + size > 0x1ull) - size = 0x1ull - smap.base; + /* +* If this segment crosses the 4GB boundary, +* truncate it. +*/ + if (smap.base + size > 0x1ull) + size = 0x1ull - smap.base; - if (size > high_heap_size) { - high_heap_size = size; - high_heap_base = smap.base; - } - } -} while (v86.ebx != 0); + if (size > high_heap_size) { + high_heap_size = size; + high_heap_base = smap.base; + } + } + } while (v86.ebx != 0); -/* Fall back to the old compatibility function for base memory */ -if (bios_basemem == 0) { - v86.ctl = 0; - v86.addr = 0x12;/* int 0x12 */ - v86int(); + /* Fall back to the old compatibility function for base memory */ + if (bios_basemem == 0) { + v86.ctl = 0; + v86.addr = 0x12;/* int 0x12 */ + v86int(); - bios_basemem = (v86.eax & 0x) * 1024; -} + bios_basemem = (v86.eax & 0x) * 1024; + } -/* Fall back through several compatibility functions for extended memory */ -if (bios_extmem == 0) { - v86.ctl = V86_FLAGS; - v86.addr = 0x15;/* int 0x15 function 0xe801*/ - v86.eax = 0xe801; - v86int(); - if (!(v86.efl & 1)) { - bios_extmem = ((v86.ecx & 0x) + ((v86.edx & 0x) * 64)) * 1024; + /* +*
svn commit: r332081 - head
Author: brooks Date: Thu Apr 5 18:19:48 2018 New Revision: 332081 URL: https://svnweb.freebsd.org/changeset/base/332081 Log: Allow -DNO_CLEAN buildworld after r332080. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Thu Apr 5 18:17:46 2018(r332080) +++ head/Makefile.inc1 Thu Apr 5 18:19:48 2018(r332081) @@ -806,7 +806,8 @@ _cleanobj_fast_depend_hack: .PHONY # Date SVN Rev Syscalls # 20170624 r320278 fstat fstatat fstatfs getdirentries getfsstat statfs # 20180404 r332048 sigreturn -.for f in fstat fstatat fstatfs getdirentries getfsstat sigreturn statfs +# 20180405 r332080 shmat +.for f in fstat fstatat fstatfs getdirentries getfsstat shmat sigreturn statfs .if exists(${OBJTOP}/lib/libc/.depend.${f}.o) @if egrep -qw '${f}\.[sS]' \ ${OBJTOP}/lib/libc/.depend.${f}.o; then \ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r332080 - in head/lib/libc: aarch64/sys arm/sys mips/sys riscv/sys
Author: brooks Date: Thu Apr 5 18:17:46 2018 New Revision: 332080 URL: https://svnweb.freebsd.org/changeset/base/332080 Log: Remove architecture specific shmat.S files. These files are identical to the generated system calls. In the case of MIPS, the file was already disconnected from the build. Submitted by: Ali MashtizadehReviewed by: kib Differential Revision:https://reviews.freebsd.org/D14976 Deleted: head/lib/libc/aarch64/sys/shmat.S head/lib/libc/arm/sys/shmat.S head/lib/libc/mips/sys/shmat.S head/lib/libc/riscv/sys/shmat.S Modified: head/lib/libc/aarch64/sys/Makefile.inc head/lib/libc/arm/sys/Makefile.inc head/lib/libc/riscv/sys/Makefile.inc Modified: head/lib/libc/aarch64/sys/Makefile.inc == --- head/lib/libc/aarch64/sys/Makefile.inc Thu Apr 5 17:26:03 2018 (r332079) +++ head/lib/libc/aarch64/sys/Makefile.inc Thu Apr 5 18:17:46 2018 (r332080) @@ -5,7 +5,6 @@ MIASM:= ${MIASM:Nfreebsd[467]_*} SRCS+= __vdso_gettc.c MDASM= cerror.S \ - shmat.S \ syscall.S \ vfork.S Modified: head/lib/libc/arm/sys/Makefile.inc == --- head/lib/libc/arm/sys/Makefile.inc Thu Apr 5 17:26:03 2018 (r332079) +++ head/lib/libc/arm/sys/Makefile.inc Thu Apr 5 18:17:46 2018 (r332080) @@ -2,7 +2,7 @@ SRCS+= __vdso_gettc.c -MDASM= Ovfork.S brk.S cerror.S sbrk.S shmat.S syscall.S +MDASM= Ovfork.S brk.S cerror.S sbrk.S syscall.S # Don't generate default code for these syscalls: NOASM+=vfork.o Modified: head/lib/libc/riscv/sys/Makefile.inc == --- head/lib/libc/riscv/sys/Makefile.incThu Apr 5 17:26:03 2018 (r332079) +++ head/lib/libc/riscv/sys/Makefile.incThu Apr 5 18:17:46 2018 (r332080) @@ -2,9 +2,7 @@ SRCS+= trivial-vdso_tc.c -#MDASM= ptrace.S MDASM= cerror.S \ - shmat.S \ syscall.S \ vfork.S ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r332072 - head/sys/sys
On Thu, 5 Apr 2018, Warner Losh wrote: On Thu, Apr 5, 2018 at 9:46 AM, Roger Pau Monn??wrote: On Thu, Apr 05, 2018 at 09:32:57AM -0600, Ian Lepore wrote: On Thu, 2018-04-05 at 14:31 +, Roger Pau Monn?? wrote: Log: introduce GiB and MiB macros ... +/* Unit conversion macros. */ +#define GiB(v) (v ## ULL << 30) +#define MiB(v) (v ## ULL << 20) + #endif /* _SYS_PARAM_H_ */ These names don't make it clear whether the conversion is bytes->GiB or GiB->bytes. The names seem way too generic for a public namespace in a file as heavily included behind your back as param.h is. Also, this completely reasonable usage won't work, likely with confusing compile error messages: int bytes, gibytes; ... bytes = GiB(gibytes); I find those helpful for their specific usage. I could introduce static inline functions like: size_t gb_to_bytes(size_t)... But I assume this is also going to cause further discussion. Yes, it gives even more namespace pollution and type errors. Macros at least don't expose their internals if they are not used. size_t is actually already part of the undocumented namespace pollution in . The type errors are restriction to just one type in another way. Type- generic APIs that avoid such restrictions are much harder to implement using inline functions than macros. Yea, traditional macro names would be "gibtob" and "btogib" but I didn't just reply to bikeshed a name: But you don't need to specify a type, consider the current btodb macro: #define btodb(bytes)/* calculates (bytes / DEV_BSIZE) */ \ (sizeof (bytes) > sizeof(long) \ ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \ : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT)) which shows how to do this in a macro, which is orthogonal to any name you may choose. I can also bikeshed function vs macro :) This macro is mostly my mistake in 1995-1996. The long long abominations in it were supposed to be temporary (until C99 standardized something better). It was originally MD for i386 only and then the sizes of almost all types are known and fixed so it is easier to hard-code minimal sizes that work. The optimization of avoiding using 64-bit types was more needed in 1995-1996 since CPUs were slower and compilers did less strength reduction. btodb() is much easier than dbtob() since it shifts right, so it can't overflow unless the cast of 'bytes' is wrong so that it truncations. dbtob() doesn't try hard to be optimal. It just always upcasts to off_t. jake later convinced me (in connection with his PAE and sparc64 work) that it should be the caller's responsibility to avoid overflow. Any casts in the macro limits it to the types in it. This is why the page to byte conversion macros don't have any casts in them. PAE usually needs 64-bit results, but this would just be a pessimization for normal i386, and deciding the casts in the macro as above is complicated. So correct GB() macros would look like ((v) << 30), where the caller must cast v to a large enough type. E.g., for variable v which might be larger than 4, on 32-bit systems, the caller must write something like GB((uintmax_t)v). But it is easier for writing to just multiply v by 1G. This is also easier for reading since it is unclear that GB() is even a conversion or which direction it goes in. A longer descriptive name would be about as clear and long as an explicit multiplication. I usually write 1G as ((type)1024 * 1024 * 1024) since the decimal and even hex values of 1G have too many digits to be clear, and multiplication is clearer than shifting and allows the type to be in the factor. Disk block size conversions need to use macros since the DEV_BSIZE = 512 was variable in theory (in practice this is now a fixed virtual size). Conversions to G don't need macros since the magic number in them is no more magic than the G in their name. Bruce___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r332079 - head/sys/compat/linuxkpi/common/include/asm
Author: markj Date: Thu Apr 5 17:26:03 2018 New Revision: 332079 URL: https://svnweb.freebsd.org/changeset/base/332079 Log: Fix the definitions of get_cpu() and put_cpu(). They are supposed to disable preemption. Reported by: rstone MFC after:5 days Modified: head/sys/compat/linuxkpi/common/include/asm/smp.h Modified: head/sys/compat/linuxkpi/common/include/asm/smp.h == --- head/sys/compat/linuxkpi/common/include/asm/smp.h Thu Apr 5 15:52:20 2018(r332078) +++ head/sys/compat/linuxkpi/common/include/asm/smp.h Thu Apr 5 17:26:03 2018(r332079) @@ -38,11 +38,11 @@ int linux_wbinvd_on_all_cpus(void); #endif #defineget_cpu() ({\ - sched_pin();\ + critical_enter(); \ PCPU_GET(cpuid);\ }) #defineput_cpu() \ - sched_unpin() + critical_exit() #endif /* _ASM_SMP_H_ */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r332072 - head/sys/sys
On Thu, Apr 05, 2018 at 09:58:36AM -0600, Warner Losh wrote: > On Thu, Apr 5, 2018 at 9:46 AM, Roger Pau Monnéwrote: > > > On Thu, Apr 05, 2018 at 09:32:57AM -0600, Ian Lepore wrote: > > > On Thu, 2018-04-05 at 14:31 +, Roger Pau Monné wrote: > > > > Author: royger > > > > Date: Thu Apr 5 14:31:54 2018 > > > > New Revision: 332072 > > > > URL: https://svnweb.freebsd.org/changeset/base/332072 > > > > > > > > Log: > > > > introduce GiB and MiB macros > > > > > > > > This macros convert from GiB or MiB into bytes. > > > > > > > > Sponsored by: Citrix Systems R > > > > > > > > Modified: > > > > head/sys/sys/param.h > > > > > > > > Modified: head/sys/sys/param.h > > > > > > == > > > > --- head/sys/sys/param.hThu Apr 5 14:25:39 2018(r332071) > > > > +++ head/sys/sys/param.hThu Apr 5 14:31:54 2018(r332072) > > > > @@ -362,4 +362,8 @@ __END_DECLS > > > > */ > > > > #define __PAST_END(array, offset) (((__typeof__(*(array)) > > *)(array))[offset]) > > > > > > > > +/* Unit conversion macros. */ > > > > +#define GiB(v) (v ## ULL << 30) > > > > +#define MiB(v) (v ## ULL << 20) > > > > + > > > > #endif /* _SYS_PARAM_H_ */ > > > > > > > > > > These names don't make it clear whether the conversion is bytes->GiB or > > > GiB->bytes. The names seem way too generic for a public namespace in a > > > file as heavily included behind your back as param.h is. > > > > > > Also, this completely reasonable usage won't work, likely with > > > confusing compile error messages: > > > > > > int bytes, gibytes; > > > ... > > > bytes = GiB(gibytes); > > > > I find those helpful for their specific usage. I could introduce > > static inline functions like: > > > > size_t gb_to_bytes(size_t)... > > > > But I assume this is also going to cause further discussion. > > > > Yea, traditional macro names would be "gibtob" and "btogib" but I didn't > just reply to bikeshed a name: > > But you don't need to specify a type, consider the current btodb macro: > #define btodb(bytes)/* calculates (bytes / DEV_BSIZE) > */ \ > (sizeof (bytes) > sizeof(long) \ > ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \ > : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT)) > > which shows how to do this in a macro, which is orthogonal to any name you > may choose. I can also bikeshed function vs macro :) I was just going to remove those from here and place them in the files where I use them, but I can also change them to: #define gibtob(gib) ((unsigned long long)(gib) << 30) #define mibtob(mib) ((unsigned long long)(mib) << 20) If it's not going to start a bikeshed. Thanks, Roger. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r332072 - head/sys/sys
On Thu, Apr 5, 2018 at 9:46 AM, Roger Pau Monnéwrote: > On Thu, Apr 05, 2018 at 09:32:57AM -0600, Ian Lepore wrote: > > On Thu, 2018-04-05 at 14:31 +, Roger Pau Monné wrote: > > > Author: royger > > > Date: Thu Apr 5 14:31:54 2018 > > > New Revision: 332072 > > > URL: https://svnweb.freebsd.org/changeset/base/332072 > > > > > > Log: > > > introduce GiB and MiB macros > > > > > > This macros convert from GiB or MiB into bytes. > > > > > > Sponsored by: Citrix Systems R > > > > > > Modified: > > > head/sys/sys/param.h > > > > > > Modified: head/sys/sys/param.h > > > > == > > > --- head/sys/sys/param.hThu Apr 5 14:25:39 2018(r332071) > > > +++ head/sys/sys/param.hThu Apr 5 14:31:54 2018(r332072) > > > @@ -362,4 +362,8 @@ __END_DECLS > > > */ > > > #define __PAST_END(array, offset) (((__typeof__(*(array)) > *)(array))[offset]) > > > > > > +/* Unit conversion macros. */ > > > +#define GiB(v) (v ## ULL << 30) > > > +#define MiB(v) (v ## ULL << 20) > > > + > > > #endif /* _SYS_PARAM_H_ */ > > > > > > > These names don't make it clear whether the conversion is bytes->GiB or > > GiB->bytes. The names seem way too generic for a public namespace in a > > file as heavily included behind your back as param.h is. > > > > Also, this completely reasonable usage won't work, likely with > > confusing compile error messages: > > > > int bytes, gibytes; > > ... > > bytes = GiB(gibytes); > > I find those helpful for their specific usage. I could introduce > static inline functions like: > > size_t gb_to_bytes(size_t)... > > But I assume this is also going to cause further discussion. > Yea, traditional macro names would be "gibtob" and "btogib" but I didn't just reply to bikeshed a name: But you don't need to specify a type, consider the current btodb macro: #define btodb(bytes)/* calculates (bytes / DEV_BSIZE) */ \ (sizeof (bytes) > sizeof(long) \ ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \ : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT)) which shows how to do this in a macro, which is orthogonal to any name you may choose. I can also bikeshed function vs macro :) Warner ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r332072 - head/sys/sys
On Thu, Apr 05, 2018 at 09:32:57AM -0600, Ian Lepore wrote: > On Thu, 2018-04-05 at 14:31 +, Roger Pau Monné wrote: > > Author: royger > > Date: Thu Apr 5 14:31:54 2018 > > New Revision: 332072 > > URL: https://svnweb.freebsd.org/changeset/base/332072 > > > > Log: > > introduce GiB and MiB macros > > > > This macros convert from GiB or MiB into bytes. > > > > Sponsored by: Citrix Systems R > > > > Modified: > > head/sys/sys/param.h > > > > Modified: head/sys/sys/param.h > > == > > --- head/sys/sys/param.hThu Apr 5 14:25:39 2018(r332071) > > +++ head/sys/sys/param.hThu Apr 5 14:31:54 2018(r332072) > > @@ -362,4 +362,8 @@ __END_DECLS > > */ > > #define __PAST_END(array, offset) (((__typeof__(*(array)) > > *)(array))[offset]) > > > > +/* Unit conversion macros. */ > > +#define GiB(v) (v ## ULL << 30) > > +#define MiB(v) (v ## ULL << 20) > > + > > #endif /* _SYS_PARAM_H_ */ > > > > These names don't make it clear whether the conversion is bytes->GiB or > GiB->bytes. The names seem way too generic for a public namespace in a > file as heavily included behind your back as param.h is. > > Also, this completely reasonable usage won't work, likely with > confusing compile error messages: > > int bytes, gibytes; > ... > bytes = GiB(gibytes); I find those helpful for their specific usage. I could introduce static inline functions like: size_t gb_to_bytes(size_t)... But I assume this is also going to cause further discussion. Roger. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r332077 - in head/sys: arm64/coresight conf
Author: br Date: Thu Apr 5 15:45:54 2018 New Revision: 332077 URL: https://svnweb.freebsd.org/changeset/base/332077 Log: Add support for the Coresight technology from ARM Ltd. ARM Coresight is a solution for debug and trace of complex SoC designs. This includes a collection of drivers for ARM Coresight interconnect devices within a small Coresight framework. Supported devices are: o Embedded Trace Macrocell v4 (ETMv4) o Funnel o Dynamic Replicator o Trace Memory Controller (TMC) o CPU debug module Devices are connected to each other internally in SoC and the configuration of each device endpoints is described in FDT. Typical trace flow (as found on Qualcomm Snapdragon 410e): CPU0 -> ETM0 -> funnel1 -> funnel0 -> ETF -> replicator -> ETR -> DRAM CPU1 -> ETM1 -^ CPU2 -> ETM2 -^ CPU3 -> ETM3 -^ Note that both Embedded Trace FIFO (ETF) and Embedded Trace Router (ETR) are hardware configurations of TMC. This is required for upcoming HWPMC tracing support. This is tested on single-core system only. Reviewed by: andrew (partially) Sponsored by: DARPA, AFRL Differential Revision:https://reviews.freebsd.org/D14618 Added: head/sys/arm64/coresight/ head/sys/arm64/coresight/coresight-cmd.c (contents, props changed) head/sys/arm64/coresight/coresight-cpu-debug.c (contents, props changed) head/sys/arm64/coresight/coresight-dynamic-replicator.c (contents, props changed) head/sys/arm64/coresight/coresight-etm4x.c (contents, props changed) head/sys/arm64/coresight/coresight-etm4x.h (contents, props changed) head/sys/arm64/coresight/coresight-funnel.c (contents, props changed) head/sys/arm64/coresight/coresight-funnel.h (contents, props changed) head/sys/arm64/coresight/coresight-tmc.c (contents, props changed) head/sys/arm64/coresight/coresight-tmc.h (contents, props changed) head/sys/arm64/coresight/coresight.c (contents, props changed) head/sys/arm64/coresight/coresight.h (contents, props changed) head/sys/arm64/coresight/coresight_if.m (contents, props changed) Modified: head/sys/conf/files.arm64 Added: head/sys/arm64/coresight/coresight-cmd.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/coresight/coresight-cmd.cThu Apr 5 15:45:54 2018 (r332077) @@ -0,0 +1,156 @@ +/*- + * Copyright (c) 2018 Ruslan Bukin+ * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "coresight_if.h" + +extern struct coresight_device_list cs_devs; + +static struct coresight_device * +coresight_next_device(struct coresight_device *cs_dev, +struct coresight_event *event) +{ + struct coresight_device *out; + struct endpoint *out_endp; + struct endpoint *endp; + + TAILQ_FOREACH(endp, _dev->pdata->endpoints, link) { + if (endp->slave != 0) + continue; + + out = coresight_get_output_device(endp, _endp); + if (out != NULL) { + if (LIST_EMPTY(>endplist)) { + /* Add source device */ + endp->cs_dev = cs_dev; + LIST_INSERT_HEAD(>endplist, endp, +
Re: svn commit: r331976 - head/sys/modules/cam
Thanks I'll attend to that. Warner On Thu, Apr 5, 2018 at 9:22 AM, Konstantin Belousovwrote: > On Wed, Apr 04, 2018 at 02:37:05AM +, Warner Losh wrote: > > Author: imp > > Date: Wed Apr 4 02:37:05 2018 > > New Revision: 331976 > > URL: https://svnweb.freebsd.org/changeset/base/331976 > > > > Log: > > Add nvme_da back. > > > > Now that it can co-exist in the kernel with nvd, add it back to the > > cam module. > > > > Sponsored by: Netflix > > > > Modified: > > head/sys/modules/cam/Makefile > > > > Modified: head/sys/modules/cam/Makefile > > > == > > --- head/sys/modules/cam/Makefile Wed Apr 4 02:35:48 2018 > (r331975) > > +++ head/sys/modules/cam/Makefile Wed Apr 4 02:37:05 2018 > (r331976) > > @@ -46,6 +46,7 @@ SRCS+= ata_machdep.c > > SRCS+= ata_pmp.c > > SRCS+= nvme_all.c > > SRCS+= nvme_xpt.c > > +SRCS+= nvme_da.c > > > > EXPORT_SYMS= YES # XXX evaluate > > This change resulted in the following: > > Preloaded elf obj module "/boot/kernel/cam.ko" at 0x812bb898. > link_elf_obj: symbol nvme_strvis undefined > KLD file cam.ko - could not finalize loading > KLD file ahci.ko - cannot find dependency "cam" > ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r332072 - head/sys/sys
On Thu, 2018-04-05 at 14:31 +, Roger Pau Monné wrote: > Author: royger > Date: Thu Apr 5 14:31:54 2018 > New Revision: 332072 > URL: https://svnweb.freebsd.org/changeset/base/332072 > > Log: > introduce GiB and MiB macros > > This macros convert from GiB or MiB into bytes. > > Sponsored by: Citrix Systems R > > Modified: > head/sys/sys/param.h > > Modified: head/sys/sys/param.h > == > --- head/sys/sys/param.h Thu Apr 5 14:25:39 2018(r332071) > +++ head/sys/sys/param.h Thu Apr 5 14:31:54 2018(r332072) > @@ -362,4 +362,8 @@ __END_DECLS > */ > #define __PAST_END(array, offset) (((__typeof__(*(array)) *)(array))[offset]) > > +/* Unit conversion macros. */ > +#define GiB(v) (v ## ULL << 30) > +#define MiB(v) (v ## ULL << 20) > + > #endif /* _SYS_PARAM_H_ */ > These names don't make it clear whether the conversion is bytes->GiB or GiB->bytes. The names seem way too generic for a public namespace in a file as heavily included behind your back as param.h is. Also, this completely reasonable usage won't work, likely with confusing compile error messages: int bytes, gibytes; ... bytes = GiB(gibytes); -- Ian ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r332072 - head/sys/sys
On Thu, 5 Apr 2018, [UTF-8] Roger Pau Monn?? wrote: Log: introduce GiB and MiB macros This macros convert from GiB or MiB into bytes. This is undocumented namspace pollution with bad names and worse types. The better names GB and MB would be more likely to conflicted with code not written by disk marketers. Modified: head/sys/sys/param.h == --- head/sys/sys/param.hThu Apr 5 14:25:39 2018(r332071) +++ head/sys/sys/param.hThu Apr 5 14:31:54 2018(r332072) @@ -362,4 +362,8 @@ __END_DECLS */ #define __PAST_END(array, offset) (((__typeof__(*(array)) *)(array))[offset]) Old style bug: space instead of tab after #define. +/* Unit conversion macros. */ +#define GiB(v) (v ## ULL << 30) +#define MiB(v) (v ## ULL << 20) + New style bugs: - space instead of tab after #define - use of the long long abomination Type error: - the abomination doesn't have the same type of carefully typedefed types like vm_size_t on any supported arch. #endif /* _SYS_PARAM_H_ */ Old style bugs: - tab instead of space before comment on #endif. - backwards comment on #endif. Bruce___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r331976 - head/sys/modules/cam
On Wed, Apr 04, 2018 at 02:37:05AM +, Warner Losh wrote: > Author: imp > Date: Wed Apr 4 02:37:05 2018 > New Revision: 331976 > URL: https://svnweb.freebsd.org/changeset/base/331976 > > Log: > Add nvme_da back. > > Now that it can co-exist in the kernel with nvd, add it back to the > cam module. > > Sponsored by: Netflix > > Modified: > head/sys/modules/cam/Makefile > > Modified: head/sys/modules/cam/Makefile > == > --- head/sys/modules/cam/Makefile Wed Apr 4 02:35:48 2018 > (r331975) > +++ head/sys/modules/cam/Makefile Wed Apr 4 02:37:05 2018 > (r331976) > @@ -46,6 +46,7 @@ SRCS+= ata_machdep.c > SRCS+= ata_pmp.c > SRCS+= nvme_all.c > SRCS+= nvme_xpt.c > +SRCS+= nvme_da.c > > EXPORT_SYMS= YES # XXX evaluate This change resulted in the following: Preloaded elf obj module "/boot/kernel/cam.ko" at 0x812bb898. link_elf_obj: symbol nvme_strvis undefined KLD file cam.ko - could not finalize loading KLD file ahci.ko - cannot find dependency "cam" ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r332073 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/include x86/x86
On Thu, 5 Apr 2018, [UTF-8] Roger Pau Monn?? wrote: Log: x86: improve reservation of AP trampoline memory This has lots of style bugs. Mainly changing the KNF spelling of 'unsigned' as u_int to the verbose 'unsigned int' in code that used to be careful to use the KNF spelling. Bruce___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r332075 - head/sbin/reboot
Author: rgrimes Date: Thu Apr 5 15:00:08 2018 New Revision: 332075 URL: https://svnweb.freebsd.org/changeset/base/332075 Log: Exit with usage when extra arguments are on command line preventing mistakes such as "halt 0p" for "halt -p". Approved by: bde (mentor), phk (mentor) MFC after:1 week Modified: head/sbin/reboot/reboot.c Modified: head/sbin/reboot/reboot.c == --- head/sbin/reboot/reboot.c Thu Apr 5 14:55:44 2018(r332074) +++ head/sbin/reboot/reboot.c Thu Apr 5 15:00:08 2018(r332075) @@ -116,6 +116,8 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; + if (argc != 0) + usage(); if ((howto & (RB_DUMP | RB_HALT)) == (RB_DUMP | RB_HALT)) errx(1, "cannot dump (-d) when halting; must reboot instead"); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r332073 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/include x86/x86
Author: royger Date: Thu Apr 5 14:39:51 2018 New Revision: 332073 URL: https://svnweb.freebsd.org/changeset/base/332073 Log: x86: improve reservation of AP trampoline memory So that it doesn't rely on physmap[1] containing an address below 1MiB. Instead scan the full physmap and search for a suitable address to place the trampoline code (below 1MiB) and the initial memory pages (below 4GiB). Sponsored by: Citrix Systems R Reviewed by: kib Differential Revision:https://reviews.freebsd.org/D14878 Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/mpboot.S head/sys/amd64/include/smp.h head/sys/i386/i386/machdep.c head/sys/i386/i386/mp_machdep.c head/sys/i386/include/smp.h head/sys/x86/include/init.h head/sys/x86/include/x86_smp.h head/sys/x86/x86/mp_x86.c Modified: head/sys/amd64/amd64/machdep.c == --- head/sys/amd64/amd64/machdep.c Thu Apr 5 14:31:54 2018 (r332072) +++ head/sys/amd64/amd64/machdep.c Thu Apr 5 14:39:51 2018 (r332073) @@ -1246,14 +1246,10 @@ getmemsize(caddr_t kmdp, u_int64_t first) * Make hole for "AP -> long mode" bootstrap code. The * mp_bootaddress vector is only available when the kernel * is configured to support APs and APs for the system start -* in 32bit mode (e.g. SMP bare metal). +* in real mode mode (e.g. SMP bare metal). */ - if (init_ops.mp_bootaddress) { - if (physmap[1] >= 0x1) - panic( - "Basemem segment is not suitable for AP bootstrap code!"); - physmap[1] = init_ops.mp_bootaddress(physmap[1] / 1024); - } + if (init_ops.mp_bootaddress) + init_ops.mp_bootaddress(physmap, _idx); /* * Maxmem isn't the "maximum memory", it's one larger than the Modified: head/sys/amd64/amd64/mp_machdep.c == --- head/sys/amd64/amd64/mp_machdep.c Thu Apr 5 14:31:54 2018 (r332072) +++ head/sys/amd64/amd64/mp_machdep.c Thu Apr 5 14:39:51 2018 (r332073) @@ -96,24 +96,45 @@ char *nmi_stack; static int start_ap(int apic_id); -static u_int bootMP_size; -static u_int boot_address; - /* * Calculate usable address in base memory for AP trampoline code. */ -u_int -mp_bootaddress(u_int basemem) +void +mp_bootaddress(vm_paddr_t *physmap, unsigned int *physmap_idx) { + unsigned int i; + bool allocated; - bootMP_size = mptramp_end - mptramp_start; - boot_address = trunc_page(basemem * 1024); /* round down to 4k boundary */ - if (((basemem * 1024) - boot_address) < bootMP_size) - boot_address -= PAGE_SIZE; /* not enough, lower by 4k */ - /* 3 levels of page table pages */ - mptramp_pagetables = boot_address - (PAGE_SIZE * 3); + alloc_ap_trampoline(physmap, physmap_idx); - return mptramp_pagetables; + allocated = false; + for (i = *physmap_idx; i <= *physmap_idx; i -= 2) { + /* +* Find a memory region big enough below the 4GB boundary to +* store the initial page tables. Note that it needs to be +* aligned to a page boundary. +*/ + if (physmap[i] >= GiB(4) || + (physmap[i + 1] - round_page(physmap[i])) < (PAGE_SIZE * 3)) + continue; + + allocated = true; + mptramp_pagetables = round_page(physmap[i]); + physmap[i] = round_page(physmap[i]) + (PAGE_SIZE * 3); + if (physmap[i] == physmap[i + 1] && *physmap_idx != 0) { + memmove([i], [i + 2], + sizeof(*physmap) * (*physmap_idx - i + 2)); + *physmap_idx -= 2; + } + } + + if (!allocated) { + mptramp_pagetables = trunc_page(boot_address) - (PAGE_SIZE * 3); + if (bootverbose) + printf( +"Cannot find enough space for the initial AP page tables, placing them at %#x", + mptramp_pagetables); + } } /* Modified: head/sys/amd64/amd64/mpboot.S == --- head/sys/amd64/amd64/mpboot.S Thu Apr 5 14:31:54 2018 (r332072) +++ head/sys/amd64/amd64/mpboot.S Thu Apr 5 14:39:51 2018 (r332073) @@ -216,8 +216,14 @@ lgdt_desc: .word gdtend-gdt /* Length */ .long gdt-mptramp_start /* Offset plus %ds << 4 */ - .globl mptramp_end mptramp_end: + /* +* The size of the trampoline code that needs to be relocated +* below the 1MiB boundary. +*/ + .globl bootMP_size
svn commit: r332072 - head/sys/sys
Author: royger Date: Thu Apr 5 14:31:54 2018 New Revision: 332072 URL: https://svnweb.freebsd.org/changeset/base/332072 Log: introduce GiB and MiB macros This macros convert from GiB or MiB into bytes. Sponsored by: Citrix Systems R Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h == --- head/sys/sys/param.hThu Apr 5 14:25:39 2018(r332071) +++ head/sys/sys/param.hThu Apr 5 14:31:54 2018(r332072) @@ -362,4 +362,8 @@ __END_DECLS */ #define __PAST_END(array, offset) (((__typeof__(*(array)) *)(array))[offset]) +/* Unit conversion macros. */ +#define GiB(v) (v ## ULL << 30) +#define MiB(v) (v ## ULL << 20) + #endif /* _SYS_PARAM_H_ */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r332070 - in head/sys/geom: . label raid
Author: sbruno Date: Thu Apr 5 13:56:40 2018 New Revision: 332070 URL: https://svnweb.freebsd.org/changeset/base/332070 Log: Squash error from geom by sizing ident strings to DISK_IDENT_SIZE. Display attribute in future error strings and differentiate g_handleattr() error messages for ease of debugging in the future. "g_handleattr: md1 bio_length 24 strlen 31 -> EFAULT" Reported by: swills Reviewed by: imp cem avg Sponsored by: Limelight Networks Differential Revision:https://reviews.freebsd.org/D14962 Modified: head/sys/geom/geom_subr.c head/sys/geom/label/g_label_disk_ident.c head/sys/geom/raid/md_ddf.c head/sys/geom/raid/md_intel.c Modified: head/sys/geom/geom_subr.c == --- head/sys/geom/geom_subr.c Thu Apr 5 13:39:53 2018(r332069) +++ head/sys/geom/geom_subr.c Thu Apr 5 13:56:40 2018(r332070) @@ -1050,16 +1050,16 @@ g_handleattr(struct bio *bp, const char *attribute, co bzero(bp->bio_data, bp->bio_length); if (strlcpy(bp->bio_data, val, bp->bio_length) >= bp->bio_length) { - printf("%s: %s bio_length %jd len %zu -> EFAULT\n", - __func__, bp->bio_to->name, + printf("%s: %s %s bio_length %jd strlen %zu -> EFAULT\n", + __func__, bp->bio_to->name, attribute, (intmax_t)bp->bio_length, strlen(val)); error = EFAULT; } } else if (bp->bio_length == len) { bcopy(val, bp->bio_data, len); } else { - printf("%s: %s bio_length %jd len %d -> EFAULT\n", __func__, - bp->bio_to->name, (intmax_t)bp->bio_length, len); + printf("%s: %s %s bio_length %jd len %d -> EFAULT\n", __func__, + bp->bio_to->name, attribute, (intmax_t)bp->bio_length, len); error = EFAULT; } if (error == 0) Modified: head/sys/geom/label/g_label_disk_ident.c == --- head/sys/geom/label/g_label_disk_ident.cThu Apr 5 13:39:53 2018 (r332069) +++ head/sys/geom/label/g_label_disk_ident.cThu Apr 5 13:56:40 2018 (r332070) @@ -49,7 +49,7 @@ static void g_label_disk_ident_taste(struct g_consumer *cp, char *label, size_t size) { struct g_class *cls; - char ident[100]; + char ident[DISK_IDENT_SIZE]; int ident_len, found, i; g_topology_assert_not(); Modified: head/sys/geom/raid/md_ddf.c == --- head/sys/geom/raid/md_ddf.c Thu Apr 5 13:39:53 2018(r332069) +++ head/sys/geom/raid/md_ddf.c Thu Apr 5 13:56:40 2018(r332070) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "geom/raid/g_raid.h" #include "geom/raid/md_ddf.h" @@ -572,7 +573,7 @@ ddf_meta_create(struct g_raid_disk *disk, struct ddf_m off_t anchorlba; u_int ss, pos, size; int len, error; - char serial_buffer[24]; + char serial_buffer[DISK_IDENT_SIZE]; if (sample->hdr == NULL) sample = NULL; Modified: head/sys/geom/raid/md_intel.c == --- head/sys/geom/raid/md_intel.c Thu Apr 5 13:39:53 2018 (r332069) +++ head/sys/geom/raid/md_intel.c Thu Apr 5 13:56:40 2018 (r332070) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "geom/raid/g_raid.h" #include "g_raid_md_if.h" @@ -1450,7 +1451,7 @@ g_raid_md_create_intel(struct g_raid_md_object *md, st static int g_raid_md_get_label(struct g_consumer *cp, char *serial, int serlen) { - char serial_buffer[24]; + char serial_buffer[DISK_IDENT_SIZE]; int len, error; len = sizeof(serial_buffer); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r331701 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/openso
On 29/03/2018 01:01, Alexander Motin wrote: > MFV r331695, 331700: 9166 zfs storage pool checkpoint > > illumos/illumos-gate@8671400134a11c848244896ca51a7db4d0f69da4 > > The idea of Storage Pool Checkpoint (aka zpool checkpoint) deals with > exactly that. It can be thought of as a “pool-wide snapshot” (or a > variation of extreme rewind that doesn’t corrupt your data). It remembers > the entire state of the pool at the point that it was taken and the user > can revert back to it later or discard it. Its generic use case is an > administrator that is about to perform a set of destructive actions to ZFS > as part of a critical procedure. She takes a checkpoint of the pool before > performing the actions, then rewinds back to it if one of them fails or puts > the pool into an unexpected state. Otherwise, she discards it. With the > assumption that no one else is making modifications to ZFS, she basically > wraps all these actions into a “high-level transaction”. A small nit: > /* check options */ > - while ((c = getopt(argc, argv, ":aCc:d:DEfFmnNo:R:T:VX")) != -1) { > + while ((c = getopt_long(argc, argv, ":aCc:d:DEfFmnNo:rR:T:VX", > + long_options, NULL)) != -1) { > switch (c) { It seems that on illumos zpool import has an undocumented option with no effect, -r. I think that we removed that option from FreeBSD. This commit restored it. I am actually indifferent about having it. Just pointing out this possibly unintended change. -- Andriy Gapon ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r332061 - head/sys/amd64/ia32
Author: kib Date: Thu Apr 5 11:03:21 2018 New Revision: 332061 URL: https://svnweb.freebsd.org/changeset/base/332061 Log: Fix ERESTART for lcall $7,$0 syscalls. The lcall trampoline enters kernel by int $0x80, which sets up invalid length of the instruction for %rip rewind. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/sys/amd64/ia32/ia32_syscall.c Modified: head/sys/amd64/ia32/ia32_syscall.c == --- head/sys/amd64/ia32/ia32_syscall.c Thu Apr 5 11:03:05 2018 (r332060) +++ head/sys/amd64/ia32/ia32_syscall.c Thu Apr 5 11:03:21 2018 (r332061) @@ -146,6 +146,7 @@ ia32_fetch_syscall_args(struct thread *td) frame->tf_rip = eip; frame->tf_cs = cs; frame->tf_rsp += 2 * sizeof(u_int32_t); + frame->tf_err = 7; /* size of lcall $7,$0 */ } #endif ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r332060 - head/sys/amd64/amd64
Author: kib Date: Thu Apr 5 11:03:05 2018 New Revision: 332060 URL: https://svnweb.freebsd.org/changeset/base/332060 Log: Make the INTO instruction operational in 32bit mode. Having the IDT entry specify ring 0 DPL caused delivery of #GP instead of #OF. The instruction is not valid in 64bit mode, which probably explains why the IDT entry for #OF was initially set this way. It is interesting to note that the BOUND instruction works with the IDT #BR entry DPL 0, most likely CPU considers #BR from BOUND as generated by a machine, not user. Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c == --- head/sys/amd64/amd64/machdep.c Thu Apr 5 06:21:51 2018 (r332059) +++ head/sys/amd64/amd64/machdep.c Thu Apr 5 11:03:05 2018 (r332060) @@ -1636,7 +1636,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) setidt(IDT_BP, pti ? (bpt_pti) : (bpt), SDT_SYSIGT, SEL_UPL, 0); setidt(IDT_OF, pti ? (ofl_pti) : (ofl), SDT_SYSIGT, - SEL_KPL, 0); + SEL_UPL, 0); setidt(IDT_BR, pti ? (bnd_pti) : (bnd), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_UD, pti ? (ill_pti) : (ill), SDT_SYSIGT, ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"