From owner-svn-src-stable@freebsd.org Sun Nov 8 00:00:49 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7EBED2D6058; Sun, 8 Nov 2020 00:00:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTDmK3BRwz4SsY; Sun, 8 Nov 2020 00:00:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6056A16959; Sun, 8 Nov 2020 00:00:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A800nFG054910; Sun, 8 Nov 2020 00:00:49 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A800ns4054909; Sun, 8 Nov 2020 00:00:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202011080000.0A800ns4054909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 8 Nov 2020 00:00:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367467 - stable/11/contrib/libcxxrt X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/contrib/libcxxrt X-SVN-Commit-Revision: 367467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2020 00:00:49 -0000 Author: dim Date: Sun Nov 8 00:00:49 2020 New Revision: 367467 URL: https://svnweb.freebsd.org/changeset/base/367467 Log: MFC r367323: Update libcxxrt's private copy of elftoolchain demangler This updates the private copy of libelftc_dem_gnu3.c in libcxxrt with the most recent version from upstream r3877. Similar to r367322, this fixes a number of possible assertions, and allows it to correctly demangle several names that it could not handle before. PR: 250702 MFC r367337: Make vector-related functions in libcxxrt's demangler static Follow-up to r367323 by re-adding static to a number of the functions copied from elftc's libelftc_vstr.c. This was requested by upstream. PR: 250702 Modified: stable/11/contrib/libcxxrt/libelftc_dem_gnu3.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libcxxrt/libelftc_dem_gnu3.c ============================================================================== --- stable/11/contrib/libcxxrt/libelftc_dem_gnu3.c Sat Nov 7 23:57:57 2020 (r367466) +++ stable/11/contrib/libcxxrt/libelftc_dem_gnu3.c Sun Nov 8 00:00:49 2020 (r367467) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2007, 2008 Hyogeol Lee + * Copyright (c) 2007 Hyogeol Lee + * Copyright (c) 2015-2017 Kai Wang * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -54,12 +55,17 @@ struct vector_str { }; #define BUFFER_GROWFACTOR 1.618 -#define VECTOR_DEF_CAPACITY 8 +#define BUFFER_GROW(x) (((x)+0.5)*BUFFER_GROWFACTOR) + +#define ELFTC_FAILURE 0 #define ELFTC_ISDIGIT(C) (isdigit((C) & 0xFF)) +#define ELFTC_SUCCESS 1 +#define VECTOR_DEF_CAPACITY 8 + enum type_qualifier { TYPE_PTR, TYPE_REF, TYPE_CMX, TYPE_IMG, TYPE_EXT, TYPE_RST, TYPE_VAT, - TYPE_CST, TYPE_VEC + TYPE_CST, TYPE_VEC, TYPE_RREF }; struct vector_type_qualifier { @@ -73,35 +79,57 @@ enum read_cmd { READ_TYPE, READ_FUNC, READ_PTRMEM }; +struct read_cmd_item { + enum read_cmd cmd; + void *data; +}; + struct vector_read_cmd { size_t size, capacity; - enum read_cmd *r_container; + struct read_cmd_item *r_container; }; +enum push_qualifier { + PUSH_ALL_QUALIFIER, + PUSH_CV_QUALIFIER, + PUSH_NON_CV_QUALIFIER, +}; + struct cpp_demangle_data { struct vector_str output; /* output string vector */ - struct vector_str output_tmp; struct vector_str subst; /* substitution string vector */ struct vector_str tmpl; struct vector_str class_type; + struct vector_str *cur_output; /* ptr to current output vec */ struct vector_read_cmd cmd; - bool paren; /* parenthesis opened */ - bool pfirst; /* first element of parameter */ bool mem_rst; /* restrict member function */ bool mem_vat; /* volatile member function */ bool mem_cst; /* const member function */ + bool mem_ref; /* lvalue-ref member func */ + bool mem_rref; /* rvalue-ref member func */ + bool is_tmpl; /* template args */ + bool is_functype; /* function type */ + bool ref_qualifier; /* ref qualifier */ + enum type_qualifier ref_qualifier_type; /* ref qualifier type */ + enum push_qualifier push_qualifier; /* which qualifiers to push */ int func_type; const char *cur; /* current mangled name ptr */ const char *last_sname; /* last source name */ - int push_head; }; +struct type_delimit { + bool paren; + bool firstp; +}; + #define CPP_DEMANGLE_TRY_LIMIT 128 #define FLOAT_SPRINTF_TRY_LIMIT 5 #define FLOAT_QUADRUPLE_BYTES 16 #define FLOAT_EXTENED_BYTES 10 #define SIMPLE_HASH(x,y) (64 * x + y) +#define DEM_PUSH_STR(d,s) cpp_demangle_push_str((d), (s), strlen((s))) +#define VEC_PUSH_STR(d,s) vector_str_push((d), (s), strlen((s))) static size_t get_strlen_sum(const struct vector_str *v); static bool vector_str_grow(struct vector_str *v); @@ -213,7 +241,7 @@ vector_str_grow(struct vector_str *v) assert(v->capacity > 0); - tmp_cap = v->capacity * BUFFER_GROWFACTOR; + tmp_cap = BUFFER_GROW(v->capacity); assert(tmp_cap > v->capacity); @@ -314,7 +342,7 @@ vector_str_push_vector_head(struct vector_str *dst, st if (dst == NULL || org == NULL) return (false); - tmp_cap = (dst->size + org->size) * BUFFER_GROWFACTOR; + tmp_cap = BUFFER_GROW(dst->size + org->size); if ((tmp_ctn = malloc(sizeof(char *) * tmp_cap)) == NULL) return (false); @@ -342,6 +370,47 @@ vector_str_push_vector_head(struct vector_str *dst, st } /** + * @brief Push org vector to the tail of det vector. + * @return false at failed, true at success. + */ +static bool +vector_str_push_vector(struct vector_str *dst, struct vector_str *org) +{ + size_t i, j, tmp_cap; + char **tmp_ctn; + + if (dst == NULL || org == NULL) + return (false); + + tmp_cap = BUFFER_GROW(dst->size + org->size); + + if ((tmp_ctn = malloc(sizeof(char *) * tmp_cap)) == NULL) + return (false); + + for (i = 0; i < dst->size; ++i) + tmp_ctn[i] = dst->container[i]; + + for (i = 0; i < org->size; ++i) + if ((tmp_ctn[i + dst->size] = strdup(org->container[i])) == + NULL) { + for (j = 0; j < i + dst->size; ++j) + free(tmp_ctn[j]); + + free(tmp_ctn); + + return (false); + } + + free(dst->container); + + dst->container = tmp_ctn; + dst->capacity = tmp_cap; + dst->size += org->size; + + return (true); +} + +/** * @brief Get new allocated flat string from vector between begin and end. * * If r_len is not NULL, string length will be returned. @@ -387,6 +456,7 @@ static int cpp_demangle_push_fp(struct cpp_demangle_da char *(*)(const char *, size_t)); static int cpp_demangle_push_str(struct cpp_demangle_data *, const char *, size_t); +static int cpp_demangle_pop_str(struct cpp_demangle_data *); static int cpp_demangle_push_subst(struct cpp_demangle_data *, const char *, size_t); static int cpp_demangle_push_subst_v(struct cpp_demangle_data *, @@ -419,16 +489,18 @@ static int cpp_demangle_read_number_as_string(struct c static int cpp_demangle_read_nv_offset(struct cpp_demangle_data *); static int cpp_demangle_read_offset(struct cpp_demangle_data *); static int cpp_demangle_read_offset_number(struct cpp_demangle_data *); -static int cpp_demangle_read_pointer_to_member(struct cpp_demangle_data *); +static int cpp_demangle_read_pointer_to_member(struct cpp_demangle_data *, + struct vector_type_qualifier *); static int cpp_demangle_read_sname(struct cpp_demangle_data *); static int cpp_demangle_read_subst(struct cpp_demangle_data *); static int cpp_demangle_read_subst_std(struct cpp_demangle_data *); static int cpp_demangle_read_subst_stdtmpl(struct cpp_demangle_data *, - const char *, size_t); + const char *); static int cpp_demangle_read_tmpl_arg(struct cpp_demangle_data *); static int cpp_demangle_read_tmpl_args(struct cpp_demangle_data *); static int cpp_demangle_read_tmpl_param(struct cpp_demangle_data *); -static int cpp_demangle_read_type(struct cpp_demangle_data *, int); +static int cpp_demangle_read_type(struct cpp_demangle_data *, + struct type_delimit *); static int cpp_demangle_read_type_flat(struct cpp_demangle_data *, char **); static int cpp_demangle_read_uqname(struct cpp_demangle_data *); @@ -440,10 +512,12 @@ static char *decode_fp_to_float80(const char *, size_t static char *decode_fp_to_long_double(const char *, size_t); static int hex_to_dec(char); static void vector_read_cmd_dest(struct vector_read_cmd *); -static int vector_read_cmd_find(struct vector_read_cmd *, enum read_cmd); +static struct read_cmd_item *vector_read_cmd_find(struct vector_read_cmd *, + enum read_cmd); static int vector_read_cmd_init(struct vector_read_cmd *); static int vector_read_cmd_pop(struct vector_read_cmd *); -static int vector_read_cmd_push(struct vector_read_cmd *, enum read_cmd); +static int vector_read_cmd_push(struct vector_read_cmd *, enum read_cmd, + void *); static void vector_type_qualifier_dest(struct vector_type_qualifier *); static int vector_type_qualifier_init(struct vector_type_qualifier *); static int vector_type_qualifier_push(struct vector_type_qualifier *, @@ -460,14 +534,16 @@ char * __cxa_demangle_gnu3(const char *org) { struct cpp_demangle_data ddata; + struct vector_str ret_type; + struct type_delimit td; ssize_t org_len; unsigned int limit; - char *rtn = NULL; + char *rtn; + bool has_ret, more_type; - if (org == NULL) + if (org == NULL || (org_len = strlen(org)) < 2) return (NULL); - org_len = strlen(org); if (org_len > 11 && !strncmp(org, "_GLOBAL__I_", 11)) { if ((rtn = malloc(org_len + 19)) == NULL) return (NULL); @@ -476,52 +552,100 @@ __cxa_demangle_gnu3(const char *org) return (rtn); } - // Try demangling as a type for short encodings - if ((org_len < 2) || (org[0] != '_' || org[1] != 'Z' )) { - if (!cpp_demangle_data_init(&ddata, org)) - return (NULL); - if (!cpp_demangle_read_type(&ddata, 0)) - goto clean; - rtn = vector_str_get_flat(&ddata.output, (size_t *) NULL); - goto clean; - } + if (org[0] != '_' || org[1] != 'Z') + return (NULL); - if (!cpp_demangle_data_init(&ddata, org + 2)) return (NULL); rtn = NULL; + has_ret = more_type = false; if (!cpp_demangle_read_encoding(&ddata)) goto clean; + /* + * Pop function name from substitution candidate list. + */ + if (*ddata.cur != 0 && ddata.subst.size >= 1) { + if (!vector_str_pop(&ddata.subst)) + goto clean; + } + + td.paren = false; + td.firstp = true; limit = 0; + + /* + * The first type is a return type if we just demangled template + * args. (the template args is right next to the function name, + * which means it's a template function) + */ + if (ddata.is_tmpl) { + ddata.is_tmpl = false; + if (!vector_str_init(&ret_type)) + goto clean; + ddata.cur_output = &ret_type; + has_ret = true; + } + while (*ddata.cur != '\0') { /* * Breaking at some gcc info at tail. e.g) @@GLIBCXX_3.4 */ if (*ddata.cur == '@' && *(ddata.cur + 1) == '@') break; - if (!cpp_demangle_read_type(&ddata, 1)) - goto clean; + + if (has_ret) { + /* Read return type */ + if (!cpp_demangle_read_type(&ddata, NULL)) + goto clean; + } else { + /* Read function arg type */ + if (!cpp_demangle_read_type(&ddata, &td)) + goto clean; + } + + if (has_ret) { + /* Push return type to the beginning */ + if (!VEC_PUSH_STR(&ret_type, " ")) + goto clean; + if (!vector_str_push_vector_head(&ddata.output, + &ret_type)) + goto clean; + ddata.cur_output = &ddata.output; + vector_str_dest(&ret_type); + has_ret = false; + more_type = true; + } else if (more_type) + more_type = false; if (limit++ > CPP_DEMANGLE_TRY_LIMIT) goto clean; } + if (more_type) + goto clean; if (ddata.output.size == 0) goto clean; - if (ddata.paren && !vector_str_push(&ddata.output, ")", 1)) + if (td.paren && !VEC_PUSH_STR(&ddata.output, ")")) goto clean; - if (ddata.mem_vat && !vector_str_push(&ddata.output, " volatile", 9)) + if (ddata.mem_vat && !VEC_PUSH_STR(&ddata.output, " volatile")) goto clean; - if (ddata.mem_cst && !vector_str_push(&ddata.output, " const", 6)) + if (ddata.mem_cst && !VEC_PUSH_STR(&ddata.output, " const")) goto clean; - if (ddata.mem_rst && !vector_str_push(&ddata.output, " restrict", 9)) + if (ddata.mem_rst && !VEC_PUSH_STR(&ddata.output, " restrict")) goto clean; + if (ddata.mem_ref && !VEC_PUSH_STR(&ddata.output, " &")) + goto clean; + if (ddata.mem_rref && !VEC_PUSH_STR(&ddata.output, " &&")) + goto clean; rtn = vector_str_get_flat(&ddata.output, (size_t *) NULL); clean: + if (has_ret) + vector_str_dest(&ret_type); + cpp_demangle_data_dest(&ddata); return (rtn); @@ -538,7 +662,6 @@ cpp_demangle_data_dest(struct cpp_demangle_data *d) vector_str_dest(&d->class_type); vector_str_dest(&d->tmpl); vector_str_dest(&d->subst); - vector_str_dest(&d->output_tmp); vector_str_dest(&d->output); } @@ -551,43 +674,42 @@ cpp_demangle_data_init(struct cpp_demangle_data *d, co if (!vector_str_init(&d->output)) return (0); - if (!vector_str_init(&d->output_tmp)) - goto clean1; if (!vector_str_init(&d->subst)) - goto clean2; + goto clean1; if (!vector_str_init(&d->tmpl)) - goto clean3; + goto clean2; if (!vector_str_init(&d->class_type)) - goto clean4; + goto clean3; if (!vector_read_cmd_init(&d->cmd)) - goto clean5; + goto clean4; assert(d->output.container != NULL); - assert(d->output_tmp.container != NULL); assert(d->subst.container != NULL); assert(d->tmpl.container != NULL); assert(d->class_type.container != NULL); - d->paren = false; - d->pfirst = false; d->mem_rst = false; d->mem_vat = false; d->mem_cst = false; + d->mem_ref = false; + d->mem_rref = false; + d->is_tmpl = false; + d->is_functype = false; + d->ref_qualifier = false; + d->push_qualifier = PUSH_ALL_QUALIFIER; d->func_type = 0; d->cur = cur; + d->cur_output = &d->output; d->last_sname = NULL; - d->push_head = 0; return (1); -clean5: - vector_str_dest(&d->class_type); clean4: - vector_str_dest(&d->tmpl); + vector_str_dest(&d->class_type); clean3: - vector_str_dest(&d->subst); + vector_str_dest(&d->tmpl); clean2: - vector_str_dest(&d->output_tmp); + vector_str_dest(&d->subst); clean1: vector_str_dest(&d->output); @@ -632,13 +754,27 @@ cpp_demangle_push_str(struct cpp_demangle_data *ddata, if (ddata == NULL || str == NULL || len == 0) return (0); - if (ddata->push_head > 0) - return (vector_str_push(&ddata->output_tmp, str, len)); + /* + * is_tmpl is used to check if the type (function arg) is right next + * to template args, and should always be cleared whenever new string + * pushed. + */ + ddata->is_tmpl = false; - return (vector_str_push(&ddata->output, str, len)); + return (vector_str_push(ddata->cur_output, str, len)); } static int +cpp_demangle_pop_str(struct cpp_demangle_data *ddata) +{ + + if (ddata == NULL) + return (0); + + return (vector_str_pop(ddata->cur_output)); +} + +static int cpp_demangle_push_subst(struct cpp_demangle_data *ddata, const char *str, size_t len) { @@ -677,9 +813,11 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_d struct vector_type_qualifier *v, const char *type_str) { struct vector_str subst_v; + enum type_qualifier t; size_t idx, e_idx, e_len; - int rtn; char *buf; + int rtn; + bool cv; if (ddata == NULL || v == NULL) return (0); @@ -691,18 +829,22 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_d if (type_str != NULL) { if (!vector_str_init(&subst_v)) return (0); - if (!vector_str_push(&subst_v, type_str, strlen(type_str))) + if (!VEC_PUSH_STR(&subst_v, type_str)) goto clean; } + cv = true; e_idx = 0; while (idx > 0) { switch (v->q_container[idx - 1]) { case TYPE_PTR: - if (!cpp_demangle_push_str(ddata, "*", 1)) + cv = false; + if (ddata->push_qualifier == PUSH_CV_QUALIFIER) + break; + if (!DEM_PUSH_STR(ddata, "*")) goto clean; if (type_str != NULL) { - if (!vector_str_push(&subst_v, "*", 1)) + if (!VEC_PUSH_STR(&subst_v, "*")) goto clean; if (!cpp_demangle_push_subst_v(ddata, &subst_v)) @@ -711,10 +853,13 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_d break; case TYPE_REF: - if (!cpp_demangle_push_str(ddata, "&", 1)) + cv = false; + if (ddata->push_qualifier == PUSH_CV_QUALIFIER) + break; + if (!DEM_PUSH_STR(ddata, "&")) goto clean; if (type_str != NULL) { - if (!vector_str_push(&subst_v, "&", 1)) + if (!VEC_PUSH_STR(&subst_v, "&")) goto clean; if (!cpp_demangle_push_subst_v(ddata, &subst_v)) @@ -722,11 +867,29 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_d } break; + case TYPE_RREF: + cv = false; + if (ddata->push_qualifier == PUSH_CV_QUALIFIER) + break; + if (!DEM_PUSH_STR(ddata, "&&")) + goto clean; + if (type_str != NULL) { + if (!VEC_PUSH_STR(&subst_v, "&&")) + goto clean; + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) + goto clean; + } + break; + case TYPE_CMX: - if (!cpp_demangle_push_str(ddata, " complex", 8)) + cv = false; + if (ddata->push_qualifier == PUSH_CV_QUALIFIER) + break; + if (!DEM_PUSH_STR(ddata, " complex")) goto clean; if (type_str != NULL) { - if (!vector_str_push(&subst_v, " complex", 8)) + if (!VEC_PUSH_STR(&subst_v, " complex")) goto clean; if (!cpp_demangle_push_subst_v(ddata, &subst_v)) @@ -735,11 +898,13 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_d break; case TYPE_IMG: - if (!cpp_demangle_push_str(ddata, " imaginary", 10)) + cv = false; + if (ddata->push_qualifier == PUSH_CV_QUALIFIER) + break; + if (!DEM_PUSH_STR(ddata, " imaginary")) goto clean; if (type_str != NULL) { - if (!vector_str_push(&subst_v, " imaginary", - 10)) + if (!VEC_PUSH_STR(&subst_v, " imaginary")) goto clean; if (!cpp_demangle_push_subst_v(ddata, &subst_v)) @@ -748,6 +913,9 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_d break; case TYPE_EXT: + cv = false; + if (ddata->push_qualifier == PUSH_CV_QUALIFIER) + break; if (v->ext_name.size == 0 || e_idx > v->ext_name.size - 1) goto clean; @@ -759,14 +927,13 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_d snprintf(buf, e_len + 2, " %s", v->ext_name.container[e_idx]); - if (!cpp_demangle_push_str(ddata, buf, e_len + 1)) { + if (!DEM_PUSH_STR(ddata, buf)) { free(buf); goto clean; } if (type_str != NULL) { - if (!vector_str_push(&subst_v, buf, - e_len + 1)) { + if (!VEC_PUSH_STR(&subst_v, buf)) { free(buf); goto clean; } @@ -781,11 +948,22 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_d break; case TYPE_RST: - if (!cpp_demangle_push_str(ddata, " restrict", 9)) + if (ddata->push_qualifier == PUSH_NON_CV_QUALIFIER && + cv) + break; + if (ddata->push_qualifier == PUSH_CV_QUALIFIER && !cv) + break; + if (!DEM_PUSH_STR(ddata, " restrict")) goto clean; if (type_str != NULL) { - if (!vector_str_push(&subst_v, " restrict", 9)) + if (!VEC_PUSH_STR(&subst_v, " restrict")) goto clean; + if (idx - 1 > 0) { + t = v->q_container[idx - 2]; + if (t == TYPE_RST || t == TYPE_VAT || + t == TYPE_CST) + break; + } if (!cpp_demangle_push_subst_v(ddata, &subst_v)) goto clean; @@ -793,11 +971,22 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_d break; case TYPE_VAT: - if (!cpp_demangle_push_str(ddata, " volatile", 9)) + if (ddata->push_qualifier == PUSH_NON_CV_QUALIFIER && + cv) + break; + if (ddata->push_qualifier == PUSH_CV_QUALIFIER && !cv) + break; + if (!DEM_PUSH_STR(ddata, " volatile")) goto clean; if (type_str != NULL) { - if (!vector_str_push(&subst_v, " volatile", 9)) + if (!VEC_PUSH_STR(&subst_v, " volatile")) goto clean; + if (idx - 1 > 0) { + t = v->q_container[idx - 2]; + if (t == TYPE_RST || t == TYPE_VAT || + t == TYPE_CST) + break; + } if (!cpp_demangle_push_subst_v(ddata, &subst_v)) goto clean; @@ -805,11 +994,22 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_d break; case TYPE_CST: - if (!cpp_demangle_push_str(ddata, " const", 6)) + if (ddata->push_qualifier == PUSH_NON_CV_QUALIFIER && + cv) + break; + if (ddata->push_qualifier == PUSH_CV_QUALIFIER && !cv) + break; + if (!DEM_PUSH_STR(ddata, " const")) goto clean; if (type_str != NULL) { - if (!vector_str_push(&subst_v, " const", 6)) + if (!VEC_PUSH_STR(&subst_v, " const")) goto clean; + if (idx - 1 > 0) { + t = v->q_container[idx - 2]; + if (t == TYPE_RST || t == TYPE_VAT || + t == TYPE_CST) + break; + } if (!cpp_demangle_push_subst_v(ddata, &subst_v)) goto clean; @@ -817,6 +1017,9 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_d break; case TYPE_VEC: + cv = false; + if (ddata->push_qualifier == PUSH_CV_QUALIFIER) + break; if (v->ext_name.size == 0 || e_idx > v->ext_name.size - 1) goto clean; @@ -827,13 +1030,12 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_d goto clean; snprintf(buf, e_len + 12, " __vector(%s)", v->ext_name.container[e_idx]); - if (!cpp_demangle_push_str(ddata, buf, e_len + 11)) { + if (!DEM_PUSH_STR(ddata, buf)) { free(buf); goto clean; } if (type_str != NULL) { - if (!vector_str_push(&subst_v, buf, - e_len + 11)) { + if (!VEC_PUSH_STR(&subst_v, buf)) { free(buf); goto clean; } @@ -907,10 +1109,10 @@ cpp_demangle_read_array(struct cpp_demangle_data *ddat if (*(++ddata->cur) == '\0') return (0); - if (!cpp_demangle_read_type(ddata, 0)) + if (!cpp_demangle_read_type(ddata, NULL)) return (0); - if (!cpp_demangle_push_str(ddata, "[]", 2)) + if (!DEM_PUSH_STR(ddata, "[]")) return (0); } else { if (ELFTC_ISDIGIT(*ddata->cur) != 0) { @@ -923,13 +1125,13 @@ cpp_demangle_read_array(struct cpp_demangle_data *ddat assert(num_len > 0); if (*(++ddata->cur) == '\0') return (0); - if (!cpp_demangle_read_type(ddata, 0)) + if (!cpp_demangle_read_type(ddata, NULL)) return (0); - if (!cpp_demangle_push_str(ddata, "[", 1)) + if (!DEM_PUSH_STR(ddata, "[")) return (0); if (!cpp_demangle_push_str(ddata, num, num_len)) return (0); - if (!cpp_demangle_push_str(ddata, "]", 1)) + if (!DEM_PUSH_STR(ddata, "]")) return (0); } else { p_idx = ddata->output.size; @@ -953,11 +1155,11 @@ cpp_demangle_read_array(struct cpp_demangle_data *ddat free(exp); return (0); } - if (!cpp_demangle_read_type(ddata, 0)) { + if (!cpp_demangle_read_type(ddata, NULL)) { free(exp); return (0); } - if (!cpp_demangle_push_str(ddata, "[", 1)) { + if (!DEM_PUSH_STR(ddata, "[")) { free(exp); return (0); } @@ -965,7 +1167,7 @@ cpp_demangle_read_array(struct cpp_demangle_data *ddat free(exp); return (0); } - if (!cpp_demangle_push_str(ddata, "]", 1)) { + if (!DEM_PUSH_STR(ddata, "]")) { free(exp); return (0); } @@ -1001,10 +1203,10 @@ cpp_demangle_read_expr_primary(struct cpp_demangle_dat switch (*(++ddata->cur)) { case '0': ddata->cur += 2; - return (cpp_demangle_push_str(ddata, "false", 5)); + return (DEM_PUSH_STR(ddata, "false")); case '1': ddata->cur += 2; - return (cpp_demangle_push_str(ddata, "true", 4)); + return (DEM_PUSH_STR(ddata, "true")); default: return (0); } @@ -1041,7 +1243,7 @@ cpp_demangle_read_expr_primary(struct cpp_demangle_dat case 'x': case 'y': if (*(++ddata->cur) == 'n') { - if (!cpp_demangle_push_str(ddata, "-", 1)) + if (!DEM_PUSH_STR(ddata, "-")) return (0); ++ddata->cur; } @@ -1070,11 +1272,11 @@ cpp_demangle_read_expression(struct cpp_demangle_data switch (SIMPLE_HASH(*ddata->cur, *(ddata->cur + 1))) { case SIMPLE_HASH('s', 't'): ddata->cur += 2; - return (cpp_demangle_read_type(ddata, 0)); + return (cpp_demangle_read_type(ddata, NULL)); case SIMPLE_HASH('s', 'r'): ddata->cur += 2; - if (!cpp_demangle_read_type(ddata, 0)) + if (!cpp_demangle_read_type(ddata, NULL)) return (0); if (!cpp_demangle_read_uqname(ddata)) return (0); @@ -1351,8 +1553,7 @@ cpp_demangle_read_expression_flat(struct cpp_demangle_ size_t i, p_idx, idx, exp_len; char *exp; - output = ddata->push_head > 0 ? &ddata->output_tmp : - &ddata->output; + output = &ddata->output; p_idx = output->size; @@ -1429,8 +1630,12 @@ static int cpp_demangle_read_function(struct cpp_demangle_data *ddata, int *ext_c, struct vector_type_qualifier *v) { + struct type_delimit td; + struct read_cmd_item *rc; size_t class_type_size, class_type_len, limit; const char *class_type; + int i; + bool paren, non_cv_qualifier; if (ddata == NULL || *ddata->cur != 'F' || v == NULL) return (0); @@ -1441,12 +1646,43 @@ cpp_demangle_read_function(struct cpp_demangle_data *d *ext_c = 1; ++ddata->cur; } - if (!cpp_demangle_read_type(ddata, 0)) + + /* Return type */ + if (!cpp_demangle_read_type(ddata, NULL)) return (0); + if (*ddata->cur != 'E') { - if (!cpp_demangle_push_str(ddata, "(", 1)) + if (!DEM_PUSH_STR(ddata, " ")) return (0); - if (vector_read_cmd_find(&ddata->cmd, READ_PTRMEM)) { + + non_cv_qualifier = false; + if (v->size > 0) { + for (i = 0; (size_t) i < v->size; i++) { + if (v->q_container[i] != TYPE_RST && + v->q_container[i] != TYPE_VAT && + v->q_container[i] != TYPE_CST) { + non_cv_qualifier = true; + break; + } + } + } + + paren = false; + rc = vector_read_cmd_find(&ddata->cmd, READ_PTRMEM); + if (non_cv_qualifier || rc != NULL) { + if (!DEM_PUSH_STR(ddata, "(")) + return (0); + paren = true; + } + + /* Push non-cv qualifiers. */ + ddata->push_qualifier = PUSH_NON_CV_QUALIFIER; + if (!cpp_demangle_push_type_qualifier(ddata, v, NULL)) + return (0); + + if (rc) { + if (non_cv_qualifier && !DEM_PUSH_STR(ddata, " ")) + return (0); if ((class_type_size = ddata->class_type.size) == 0) return (0); class_type = @@ -1458,42 +1694,69 @@ cpp_demangle_read_function(struct cpp_demangle_data *d if (!cpp_demangle_push_str(ddata, class_type, class_type_len)) return (0); - if (!cpp_demangle_push_str(ddata, "::*", 3)) + if (!DEM_PUSH_STR(ddata, "::*")) return (0); + /* Push pointer-to-member qualifiers. */ + ddata->push_qualifier = PUSH_ALL_QUALIFIER; + if (!cpp_demangle_push_type_qualifier(ddata, rc->data, + NULL)) + return (0); ++ddata->func_type; - } else { - if (!cpp_demangle_push_type_qualifier(ddata, v, - (const char *) NULL)) + } + + if (paren) { + if (!DEM_PUSH_STR(ddata, ")")) return (0); - vector_type_qualifier_dest(v); - if (!vector_type_qualifier_init(v)) - return (0); + paren = false; } - if (!cpp_demangle_push_str(ddata, ")(", 2)) - return (0); - + td.paren = false; + td.firstp = true; limit = 0; + ddata->is_functype = true; for (;;) { - if (!cpp_demangle_read_type(ddata, 0)) + if (!cpp_demangle_read_type(ddata, &td)) return (0); if (*ddata->cur == 'E') break; if (limit++ > CPP_DEMANGLE_TRY_LIMIT) return (0); } - - if (vector_read_cmd_find(&ddata->cmd, READ_PTRMEM) == 1) { - if (!cpp_demangle_push_type_qualifier(ddata, v, - (const char *) NULL)) + ddata->is_functype = false; + if (td.paren) { + if (!DEM_PUSH_STR(ddata, ")")) return (0); - vector_type_qualifier_dest(v); - if (!vector_type_qualifier_init(v)) - return (0); + td.paren = false; } - if (!cpp_demangle_push_str(ddata, ")", 1)) + /* Push CV qualifiers. */ + ddata->push_qualifier = PUSH_CV_QUALIFIER; + if (!cpp_demangle_push_type_qualifier(ddata, v, NULL)) return (0); + + ddata->push_qualifier = PUSH_ALL_QUALIFIER; + + /* Release type qualifier vector. */ + vector_type_qualifier_dest(v); + if (!vector_type_qualifier_init(v)) + return (0); + + /* Push ref-qualifiers. */ + if (ddata->ref_qualifier) { + switch (ddata->ref_qualifier_type) { + case TYPE_REF: + if (!DEM_PUSH_STR(ddata, " &")) + return (0); + break; + case TYPE_RREF: + if (!DEM_PUSH_STR(ddata, " &&")) + return (0); + break; + default: + return (0); + } + ddata->ref_qualifier = false; + } } ++ddata->cur; @@ -1515,7 +1778,7 @@ cpp_demangle_read_encoding(struct cpp_demangle_data *d /* special name */ switch (SIMPLE_HASH(*ddata->cur, *(ddata->cur + 1))) { case SIMPLE_HASH('G', 'A'): - if (!cpp_demangle_push_str(ddata, "hidden alias for ", 17)) + if (!DEM_PUSH_STR(ddata, "hidden alias for ")) return (0); ddata->cur += 2; if (*ddata->cur == '\0') @@ -1523,7 +1786,7 @@ cpp_demangle_read_encoding(struct cpp_demangle_data *d return (cpp_demangle_read_encoding(ddata)); case SIMPLE_HASH('G', 'R'): - if (!cpp_demangle_push_str(ddata, "reference temporary #", 21)) + if (!DEM_PUSH_STR(ddata, "reference temporary #")) return (0); ddata->cur += 2; if (*ddata->cur == '\0') @@ -1533,11 +1796,11 @@ cpp_demangle_read_encoding(struct cpp_demangle_data *d rtn = 0; if (!cpp_demangle_read_number_as_string(ddata, &num_str)) goto clean1; - if (!cpp_demangle_push_str(ddata, num_str, strlen(num_str))) + if (!DEM_PUSH_STR(ddata, num_str)) goto clean2; - if (!cpp_demangle_push_str(ddata, " for ", 5)) + if (!DEM_PUSH_STR(ddata, " for ")) goto clean2; - if (!cpp_demangle_push_str(ddata, name, strlen(name))) + if (!DEM_PUSH_STR(ddata, name)) goto clean2; rtn = 1; clean2: @@ -1552,14 +1815,12 @@ cpp_demangle_read_encoding(struct cpp_demangle_data *d return (0); switch (*ddata->cur) { case 'n': - if (!cpp_demangle_push_str(ddata, - "non-transaction clone for ", 26)) + if (!DEM_PUSH_STR(ddata, "non-transaction clone for ")) return (0); break; case 't': default: - if (!cpp_demangle_push_str(ddata, - "transaction clone for ", 22)) + if (!DEM_PUSH_STR(ddata, "transaction clone for ")) return (0); break; } @@ -1568,15 +1829,15 @@ cpp_demangle_read_encoding(struct cpp_demangle_data *d case SIMPLE_HASH('G', 'V'): /* sentry object for 1 time init */ - if (!cpp_demangle_push_str(ddata, "guard variable for ", 20)) + if (!DEM_PUSH_STR(ddata, "guard variable for ")) return (0); ddata->cur += 2; break; case SIMPLE_HASH('T', 'c'): /* virtual function covariant override thunk */ - if (!cpp_demangle_push_str(ddata, - "virtual function covariant override ", 36)) + if (!DEM_PUSH_STR(ddata, + "virtual function covariant override ")) return (0); ddata->cur += 2; if (*ddata->cur == '\0') @@ -1589,8 +1850,7 @@ cpp_demangle_read_encoding(struct cpp_demangle_data *d case SIMPLE_HASH('T', 'C'): /* construction vtable */ - if (!cpp_demangle_push_str(ddata, "construction vtable for ", - 24)) + if (!DEM_PUSH_STR(ddata, "construction vtable for ")) return (0); ddata->cur += 2; if (*ddata->cur == '\0') @@ -1602,11 +1862,11 @@ cpp_demangle_read_encoding(struct cpp_demangle_data *d goto clean3; if (*ddata->cur++ != '_') *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Sun Nov 8 00:30:54 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 802B82D6D0E; Sun, 8 Nov 2020 00:30:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTFR23Gcvz4VPY; Sun, 8 Nov 2020 00:30:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62F35173C5; Sun, 8 Nov 2020 00:30:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A80Us3k075884; Sun, 8 Nov 2020 00:30:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A80Us5w075883; Sun, 8 Nov 2020 00:30:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011080030.0A80Us5w075883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 8 Nov 2020 00:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367468 - stable/12/sys/dev/ocs_fc X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/ocs_fc X-SVN-Commit-Revision: 367468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2020 00:30:54 -0000 Author: mav Date: Sun Nov 8 00:30:53 2020 New Revision: 367468 URL: https://svnweb.freebsd.org/changeset/base/367468 Log: MFC r367041: Fix incorrect constants of target tag action. ocs_scsi_recv_cmd() receives the flags after ocs_get_flags_fcp_cmd(), which translates them from FCP_TASK_ATTR_* to OCS_SCSI_CMD_*. As result non-SIMPLE requests turned into HEAD or ORDERED depending on direction. Modified: stable/12/sys/dev/ocs_fc/ocs_cam.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ocs_fc/ocs_cam.c ============================================================================== --- stable/12/sys/dev/ocs_fc/ocs_cam.c Sun Nov 8 00:00:49 2020 (r367467) +++ stable/12/sys/dev/ocs_fc/ocs_cam.c Sun Nov 8 00:30:53 2020 (r367468) @@ -579,9 +579,9 @@ int32_t ocs_scsi_recv_cmd(ocs_io_t *io, uint64_t lun, if (flags & OCS_SCSI_CMD_SIMPLE) atio->tag_action = MSG_SIMPLE_Q_TAG; - else if (flags & FCP_TASK_ATTR_HEAD_OF_QUEUE) + else if (flags & OCS_SCSI_CMD_HEAD_OF_QUEUE) atio->tag_action = MSG_HEAD_OF_Q_TAG; - else if (flags & FCP_TASK_ATTR_ORDERED) + else if (flags & OCS_SCSI_CMD_ORDERED) atio->tag_action = MSG_ORDERED_Q_TAG; else atio->tag_action = 0; From owner-svn-src-stable@freebsd.org Sun Nov 8 00:31:50 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7224F2D6BEE; Sun, 8 Nov 2020 00:31:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTFS62rnhz4VKr; Sun, 8 Nov 2020 00:31:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54B5C175A4; Sun, 8 Nov 2020 00:31:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A80Voos076846; Sun, 8 Nov 2020 00:31:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A80VoCc076845; Sun, 8 Nov 2020 00:31:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011080031.0A80VoCc076845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 8 Nov 2020 00:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367469 - stable/11/sys/dev/ocs_fc X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/ocs_fc X-SVN-Commit-Revision: 367469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2020 00:31:50 -0000 Author: mav Date: Sun Nov 8 00:31:49 2020 New Revision: 367469 URL: https://svnweb.freebsd.org/changeset/base/367469 Log: MFC r367041: Fix incorrect constants of target tag action. ocs_scsi_recv_cmd() receives the flags after ocs_get_flags_fcp_cmd(), which translates them from FCP_TASK_ATTR_* to OCS_SCSI_CMD_*. As result non-SIMPLE requests turned into HEAD or ORDERED depending on direction. Modified: stable/11/sys/dev/ocs_fc/ocs_cam.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ocs_fc/ocs_cam.c ============================================================================== --- stable/11/sys/dev/ocs_fc/ocs_cam.c Sun Nov 8 00:30:53 2020 (r367468) +++ stable/11/sys/dev/ocs_fc/ocs_cam.c Sun Nov 8 00:31:49 2020 (r367469) @@ -579,9 +579,9 @@ int32_t ocs_scsi_recv_cmd(ocs_io_t *io, uint64_t lun, if (flags & OCS_SCSI_CMD_SIMPLE) atio->tag_action = MSG_SIMPLE_Q_TAG; - else if (flags & FCP_TASK_ATTR_HEAD_OF_QUEUE) + else if (flags & OCS_SCSI_CMD_HEAD_OF_QUEUE) atio->tag_action = MSG_HEAD_OF_Q_TAG; - else if (flags & FCP_TASK_ATTR_ORDERED) + else if (flags & OCS_SCSI_CMD_ORDERED) atio->tag_action = MSG_ORDERED_Q_TAG; else atio->tag_action = 0; From owner-svn-src-stable@freebsd.org Sun Nov 8 00:59:09 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A888C2E0000; Sun, 8 Nov 2020 00:59:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTG3d47sPz4Wny; Sun, 8 Nov 2020 00:59:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CEC2175DB; Sun, 8 Nov 2020 00:59:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A80x92v091069; Sun, 8 Nov 2020 00:59:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A80x9vN091068; Sun, 8 Nov 2020 00:59:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011080059.0A80x9vN091068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 8 Nov 2020 00:59:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367470 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 367470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2020 00:59:09 -0000 Author: kib Date: Sun Nov 8 00:59:09 2020 New Revision: 367470 URL: https://svnweb.freebsd.org/changeset/base/367470 Log: MFC r367249: Cleanup of net/if_media.c: switch to ANSI C function definitions. Modified: stable/12/sys/net/if_media.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_media.c ============================================================================== --- stable/12/sys/net/if_media.c Sun Nov 8 00:31:49 2020 (r367469) +++ stable/12/sys/net/if_media.c Sun Nov 8 00:59:09 2020 (r367470) @@ -85,11 +85,8 @@ static void ifmedia_printword(int); * Initialize if_media struct for a specific interface instance. */ void -ifmedia_init(ifm, dontcare_mask, change_callback, status_callback) - struct ifmedia *ifm; - int dontcare_mask; - ifm_change_cb_t change_callback; - ifm_stat_cb_t status_callback; +ifmedia_init(struct ifmedia *ifm, int dontcare_mask, + ifm_change_cb_t change_callback, ifm_stat_cb_t status_callback) { LIST_INIT(&ifm->ifm_list); @@ -101,8 +98,7 @@ ifmedia_init(ifm, dontcare_mask, change_callback, stat } void -ifmedia_removeall(ifm) - struct ifmedia *ifm; +ifmedia_removeall(struct ifmedia *ifm) { struct ifmedia_entry *entry; @@ -119,11 +115,7 @@ ifmedia_removeall(ifm) * for a specific interface instance. */ void -ifmedia_add(ifm, mword, data, aux) - struct ifmedia *ifm; - int mword; - int data; - void *aux; +ifmedia_add(struct ifmedia *ifm, int mword, int data, void *aux) { struct ifmedia_entry *entry; @@ -154,10 +146,7 @@ ifmedia_add(ifm, mword, data, aux) * supported media for a specific interface instance. */ void -ifmedia_list_add(ifm, lp, count) - struct ifmedia *ifm; - struct ifmedia_entry *lp; - int count; +ifmedia_list_add(struct ifmedia *ifm, struct ifmedia_entry *lp, int count) { int i; @@ -174,10 +163,7 @@ ifmedia_list_add(ifm, lp, count) * media-change callback. */ void -ifmedia_set(ifm, target) - struct ifmedia *ifm; - int target; - +ifmedia_set(struct ifmedia *ifm, int target) { struct ifmedia_entry *match; @@ -219,11 +205,8 @@ compat_media(int media) * Device-independent media ioctl support function. */ int -ifmedia_ioctl(ifp, ifr, ifm, cmd) - struct ifnet *ifp; - struct ifreq *ifr; - struct ifmedia *ifm; - u_long cmd; +ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, struct ifmedia *ifm, + u_long cmd) { struct ifmedia_entry *match; struct ifmediareq *ifmr = (struct ifmediareq *) ifr; @@ -345,10 +328,7 @@ ifmedia_ioctl(ifp, ifr, ifm, cmd) * */ static struct ifmedia_entry * -ifmedia_match(ifm, target, mask) - struct ifmedia *ifm; - int target; - int mask; +ifmedia_match(struct ifmedia *ifm, int target, int mask) { struct ifmedia_entry *match, *next; @@ -454,8 +434,7 @@ static const struct ifmedia_type_to_subtype ifmedia_ty * print a media word. */ static void -ifmedia_printword(ifmw) - int ifmw; +ifmedia_printword(int ifmw) { const struct ifmedia_description *desc; const struct ifmedia_type_to_subtype *ttos; From owner-svn-src-stable@freebsd.org Sun Nov 8 01:00:11 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 385782D7FA6; Sun, 8 Nov 2020 01:00:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTG4q1B5Nz4XJt; Sun, 8 Nov 2020 01:00:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BF6317AD5; Sun, 8 Nov 2020 01:00:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A810AjG091237; Sun, 8 Nov 2020 01:00:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A810Aep091236; Sun, 8 Nov 2020 01:00:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011080100.0A810Aep091236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 8 Nov 2020 01:00:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367471 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 367471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2020 01:00:11 -0000 Author: kib Date: Sun Nov 8 01:00:10 2020 New Revision: 367471 URL: https://svnweb.freebsd.org/changeset/base/367471 Log: MFC r367250: Cleanup of net/if_media.c: some style. Modified: stable/12/sys/net/if_media.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_media.c ============================================================================== --- stable/12/sys/net/if_media.c Sun Nov 8 00:59:09 2020 (r367470) +++ stable/12/sys/net/if_media.c Sun Nov 8 01:00:10 2020 (r367471) @@ -213,7 +213,7 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, st int error = 0; if (ifp == NULL || ifr == NULL || ifm == NULL) - return(EINVAL); + return (EINVAL); switch (cmd) { @@ -244,10 +244,9 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, st * Keep going in case the connected media changed. * Similarly, if best match changed (kernel debugger?). */ - if ((IFM_SUBTYPE(newmedia) != IFM_AUTO) && - (newmedia == ifm->ifm_media) && - (match == ifm->ifm_cur)) - return 0; + if (IFM_SUBTYPE(newmedia) != IFM_AUTO && + newmedia == ifm->ifm_media && match == ifm->ifm_cur) + return (0); /* * We found a match, now make the driver switch to it. @@ -347,7 +346,7 @@ ifmedia_match(struct ifmedia *ifm, int target, int mas } } - return match; + return (match); } /* @@ -363,7 +362,8 @@ ifmedia_baudrate(int mword) int i; for (i = 0; ifmedia_baudrate_descriptions[i].ifmb_word != 0; i++) { - if (IFM_TYPE_MATCH(mword, ifmedia_baudrate_descriptions[i].ifmb_word)) + if (IFM_TYPE_MATCH(mword, ifmedia_baudrate_descriptions[i]. + ifmb_word)) return (ifmedia_baudrate_descriptions[i].ifmb_baudrate); } From owner-svn-src-stable@freebsd.org Sun Nov 8 01:01:28 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B81F2E03B3; Sun, 8 Nov 2020 01:01:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTG6J38dWz4X6b; Sun, 8 Nov 2020 01:01:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F2C61793E; Sun, 8 Nov 2020 01:01:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A811Sjn094465; Sun, 8 Nov 2020 01:01:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A811SSD094464; Sun, 8 Nov 2020 01:01:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011080101.0A811SSD094464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 8 Nov 2020 01:01:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367472 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 367472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2020 01:01:28 -0000 Author: kib Date: Sun Nov 8 01:01:27 2020 New Revision: 367472 URL: https://svnweb.freebsd.org/changeset/base/367472 Log: MFC r367251: Cleanup of net/if_media.c: simplify cleanup loop in ifmedia_removeall(). Modified: stable/12/sys/net/if_media.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_media.c ============================================================================== --- stable/12/sys/net/if_media.c Sun Nov 8 01:00:10 2020 (r367471) +++ stable/12/sys/net/if_media.c Sun Nov 8 01:01:27 2020 (r367472) @@ -102,8 +102,7 @@ ifmedia_removeall(struct ifmedia *ifm) { struct ifmedia_entry *entry; - for (entry = LIST_FIRST(&ifm->ifm_list); entry; - entry = LIST_FIRST(&ifm->ifm_list)) { + while ((entry = LIST_FIRST(&ifm->ifm_list)) != NULL) { LIST_REMOVE(entry, ifm_list); free(entry, M_IFADDR); } From owner-svn-src-stable@freebsd.org Sun Nov 8 01:02:41 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E4462E032D; Sun, 8 Nov 2020 01:02:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTG7j2D7Pz4Xlv; Sun, 8 Nov 2020 01:02:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EE82177CE; Sun, 8 Nov 2020 01:02:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A812fAn097091; Sun, 8 Nov 2020 01:02:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A812fMD097090; Sun, 8 Nov 2020 01:02:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011080102.0A812fMD097090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 8 Nov 2020 01:02:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367473 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 367473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2020 01:02:41 -0000 Author: kib Date: Sun Nov 8 01:02:40 2020 New Revision: 367473 URL: https://svnweb.freebsd.org/changeset/base/367473 Log: MFC r367252: net/if_media.c: improve IFMEDIA_DEBUG output. Modified: stable/12/sys/net/if_media.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_media.c ============================================================================== --- stable/12/sys/net/if_media.c Sun Nov 8 01:01:27 2020 (r367472) +++ stable/12/sys/net/if_media.c Sun Nov 8 01:02:40 2020 (r367473) @@ -124,7 +124,7 @@ ifmedia_add(struct ifmedia *ifm, int mword, int data, printf("ifmedia_add: null ifm\n"); return; } - printf("Adding entry for "); + printf("Adding entry for (%#010x) ", mword); ifmedia_printword(mword); } #endif @@ -230,8 +230,8 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, st #ifdef IFMEDIA_DEBUG if (ifmedia_debug) { printf( - "ifmedia_ioctl: no media found for 0x%x\n", - newmedia); + "ifmedia_ioctl: no media found for %#010x mask %#010x\n", + newmedia, ifm->ifm_mask); } #endif return (ENXIO); @@ -338,7 +338,7 @@ ifmedia_match(struct ifmedia *ifm, int target, int mas #if defined(IFMEDIA_DEBUG) || defined(DIAGNOSTIC) if (match) { printf("ifmedia_match: multiple match for " - "0x%x/0x%x\n", target, mask); + "%#010x/%#010x\n", target, mask); } #endif match = next; From owner-svn-src-stable@freebsd.org Sun Nov 8 10:08:20 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A9162ECACD; Sun, 8 Nov 2020 10:08:20 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTVFJ3zsjz3GMw; Sun, 8 Nov 2020 10:08:20 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7756B1E2C1; Sun, 8 Nov 2020 10:08:20 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A8A8KPq029957; Sun, 8 Nov 2020 10:08:20 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A8A8KE0029956; Sun, 8 Nov 2020 10:08:20 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011081008.0A8A8KE0029956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Sun, 8 Nov 2020 10:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367482 - stable/12/share/man/man7 X-SVN-Group: stable-12 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/12/share/man/man7 X-SVN-Commit-Revision: 367482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2020 10:08:20 -0000 Author: 0mp (doc,ports committer) Date: Sun Nov 8 10:08:20 2020 New Revision: 367482 URL: https://svnweb.freebsd.org/changeset/base/367482 Log: MFC r367256: Do not document default locations of the OpenBSD and NetBSD ports trees Our own Ports Collection is not targeting those systems at the moment, so let's stop documenting bits specific to OpenBSD and NetBSD in the ports documentation. Especially, that it might bit rot one day. Modified: stable/12/share/man/man7/ports.7 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man7/ports.7 ============================================================================== --- stable/12/share/man/man7/ports.7 Sun Nov 8 09:50:58 2020 (r367481) +++ stable/12/share/man/man7/ports.7 Sun Nov 8 10:08:20 2020 (r367482) @@ -372,14 +372,7 @@ You can change all of these. Location of the ports tree. This is .Pa /usr/ports -on -.Fx -and -.Ox , -and -.Pa /usr/pkgsrc -on -.Nx . +by default. .It Va WRKDIRPREFIX Where to create any temporary files. Useful if From owner-svn-src-stable@freebsd.org Sun Nov 8 10:13:07 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DAEB2ECEBD; Sun, 8 Nov 2020 10:13:07 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTVLq0QYyz3GrX; Sun, 8 Nov 2020 10:13:07 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 018161E4B9; Sun, 8 Nov 2020 10:13:07 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A8AD6KZ035875; Sun, 8 Nov 2020 10:13:06 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A8AD6Ch035874; Sun, 8 Nov 2020 10:13:06 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011081013.0A8AD6Ch035874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Sun, 8 Nov 2020 10:13:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367483 - stable/11/share/man/man7 X-SVN-Group: stable-11 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/11/share/man/man7 X-SVN-Commit-Revision: 367483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2020 10:13:07 -0000 Author: 0mp (doc,ports committer) Date: Sun Nov 8 10:13:06 2020 New Revision: 367483 URL: https://svnweb.freebsd.org/changeset/base/367483 Log: MFC r367256: Do not document default locations of the OpenBSD and NetBSD ports trees Our own Ports Collection is not targeting those systems at the moment, so let's stop documenting bits specific to OpenBSD and NetBSD in the ports documentation. Especially, that it might bit rot one day. Modified: stable/11/share/man/man7/ports.7 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man7/ports.7 ============================================================================== --- stable/11/share/man/man7/ports.7 Sun Nov 8 10:08:20 2020 (r367482) +++ stable/11/share/man/man7/ports.7 Sun Nov 8 10:13:06 2020 (r367483) @@ -361,14 +361,7 @@ You can change all of these. Location of the ports tree. This is .Pa /usr/ports -on -.Fx -and -.Ox , -and -.Pa /usr/pkgsrc -on -.Nx . +by default. .It Va WRKDIRPREFIX Where to create any temporary files. Useful if From owner-svn-src-stable@freebsd.org Sun Nov 8 17:10:13 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CA43466721; Sun, 8 Nov 2020 17:10:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTgc52fn7z3td5; Sun, 8 Nov 2020 17:10:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E10A2338E; Sun, 8 Nov 2020 17:10:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A8HADSU085994; Sun, 8 Nov 2020 17:10:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A8HADRR085993; Sun, 8 Nov 2020 17:10:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202011081710.0A8HADRR085993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 8 Nov 2020 17:10:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367489 - stable/12/usr.sbin/mergemaster X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.sbin/mergemaster X-SVN-Commit-Revision: 367489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2020 17:10:13 -0000 Author: emaste Date: Sun Nov 8 17:10:12 2020 New Revision: 367489 URL: https://svnweb.freebsd.org/changeset/base/367489 Log: MFC r367042: mergemaster: Clarify installed and updated versions Describe "diff installed new" as "Displaying differences between installed and new." Previously mergemaster described them in the opposite order. PR: 249214 Reported by: Yuri Victorovich Modified: stable/12/usr.sbin/mergemaster/mergemaster.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/12/usr.sbin/mergemaster/mergemaster.sh Sun Nov 8 15:54:59 2020 (r367488) +++ stable/12/usr.sbin/mergemaster/mergemaster.sh Sun Nov 8 17:10:12 2020 (r367489) @@ -143,7 +143,7 @@ diff_loop () { echo ' ====================================================================== ' echo '' ( - echo " *** Displaying differences between ${COMPFILE} and installed version:" + echo " *** Displaying differences between installed version and ${COMPFILE}:" echo '' diff ${DIFF_FLAG} ${DIFF_OPTIONS} "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" ) | ${PAGER} From owner-svn-src-stable@freebsd.org Mon Nov 9 00:39:49 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66A9A2E346B; Mon, 9 Nov 2020 00:39:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTsZs2RQDz3Lqs; Mon, 9 Nov 2020 00:39:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 468A1B06; Mon, 9 Nov 2020 00:39:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A90dnlY085681; Mon, 9 Nov 2020 00:39:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A90dnCh085680; Mon, 9 Nov 2020 00:39:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011090039.0A90dnCh085680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Nov 2020 00:39:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367504 - stable/12/sbin/ifconfig X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sbin/ifconfig X-SVN-Commit-Revision: 367504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 00:39:49 -0000 Author: kib Date: Mon Nov 9 00:39:48 2020 New Revision: 367504 URL: https://svnweb.freebsd.org/changeset/base/367504 Log: MFC r367285: ifconfig: properly detect invalid mediaopt keywords. Modified: stable/12/sbin/ifconfig/ifmedia.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ifconfig/ifmedia.c ============================================================================== --- stable/12/sbin/ifconfig/ifmedia.c Mon Nov 9 00:34:23 2020 (r367503) +++ stable/12/sbin/ifconfig/ifmedia.c Mon Nov 9 00:39:48 2020 (r367504) @@ -566,7 +566,7 @@ get_media_options(int type, const char *val) struct ifmedia_description *desc; struct ifmedia_type_to_subtype *ttos; char *optlist, *optptr; - int option = 0, i, rval = 0; + int option, i, rval = 0; /* We muck with the string, so copy it. */ optlist = strdup(val); @@ -587,12 +587,13 @@ get_media_options(int type, const char *val) */ optptr = optlist; for (; (optptr = strtok(optptr, ",")) != NULL; optptr = NULL) { + option = -1; for (i = 0; ttos->options[i].desc != NULL; i++) { option = lookup_media_word(ttos->options[i].desc, optptr); if (option != -1) break; } - if (option == 0) + if (option == -1) errx(1, "unknown option: %s", optptr); rval |= option; } From owner-svn-src-stable@freebsd.org Mon Nov 9 01:13:28 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ADDE92E3B6C; Mon, 9 Nov 2020 01:13:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTtKh4YGCz3N2j; Mon, 9 Nov 2020 01:13:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EE13E7C; Mon, 9 Nov 2020 01:13:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A91DSV2010221; Mon, 9 Nov 2020 01:13:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A91DSg5010220; Mon, 9 Nov 2020 01:13:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011090113.0A91DSg5010220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 9 Nov 2020 01:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367505 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 367505 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 01:13:28 -0000 Author: mav Date: Mon Nov 9 01:13:28 2020 New Revision: 367505 URL: https://svnweb.freebsd.org/changeset/base/367505 Log: MFC r367052: Enable bioq 'car limit' added at r335066 at 128 bios. Without the 'car limit' enabled (before this), running sequential ZFS scrub on HDD without command queuing support, I've measured latency on concurrent random reads reaching 4 seconds (surprised that not more). Enabling this reduced the latency to 65 milliseconds, while scrub still doing ~180MB/s. For disks with command queuing this does not make much difference (if any), since most time all the requests are queued down to the disk or HBA, leaving nothing in the queue to sort. And even if something does not fit, staying on the queue, it is likely not for long. To not limit sorting in such bursty scenarios I've added batched counter zeroing when the queue is getting empty. The internal scheduler of the SAS HDD I was testing seems to be even more loyal to random I/O, reducing the scrub speed to ~120MB/s. So in case somebody worried this is limit is too strict -- it actually looks relaxed. Modified: stable/12/sys/kern/subr_disk.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/subr_disk.c ============================================================================== --- stable/12/sys/kern/subr_disk.c Mon Nov 9 00:39:48 2020 (r367504) +++ stable/12/sys/kern/subr_disk.c Mon Nov 9 01:13:28 2020 (r367505) @@ -26,7 +26,7 @@ __FBSDID("$FreeBSD$"); #include #include -static int bioq_batchsize = 0; +static int bioq_batchsize = 128; SYSCTL_INT(_debug, OID_AUTO, bioq_batchsize, CTLFLAG_RW, &bioq_batchsize, 0, "BIOQ batch size"); @@ -172,6 +172,8 @@ bioq_remove(struct bio_queue_head *head, struct bio *b head->insert_point = NULL; TAILQ_REMOVE(&head->queue, bp, bio_queue); + if (TAILQ_EMPTY(&head->queue)) + head->batched = 0; head->total--; } From owner-svn-src-stable@freebsd.org Mon Nov 9 01:14:23 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC0882E3C44; Mon, 9 Nov 2020 01:14:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTtLl4yDrz3N0c; Mon, 9 Nov 2020 01:14:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93663ECB; Mon, 9 Nov 2020 01:14:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A91ENH3010318; Mon, 9 Nov 2020 01:14:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A91ENJL010315; Mon, 9 Nov 2020 01:14:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202011090114.0A91ENJL010315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 9 Nov 2020 01:14:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367506 - in stable/12/sys: cam dev/ahci dev/siis X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys: cam dev/ahci dev/siis X-SVN-Commit-Revision: 367506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 01:14:23 -0000 Author: mav Date: Mon Nov 9 01:14:22 2020 New Revision: 367506 URL: https://svnweb.freebsd.org/changeset/base/367506 Log: MFC r367261: Add icc (Isochronous Command Completion) ccb_ataio field. Modified: stable/12/sys/cam/cam_ccb.h stable/12/sys/dev/ahci/ahci.c stable/12/sys/dev/siis/siis.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/cam_ccb.h ============================================================================== --- stable/12/sys/cam/cam_ccb.h Mon Nov 9 01:13:28 2020 (r367505) +++ stable/12/sys/cam/cam_ccb.h Mon Nov 9 01:14:22 2020 (r367506) @@ -785,6 +785,8 @@ struct ccb_ataio { u_int32_t resid; /* Transfer residual length: 2's comp */ u_int8_t ata_flags; /* Flags for the rest of the buffer */ #define ATA_FLAG_AUX 0x1 +#define ATA_FLAG_ICC 0x2 + uint8_t icc; /* Isochronous Command Completion */ uint32_t aux; uint32_t unused; }; Modified: stable/12/sys/dev/ahci/ahci.c ============================================================================== --- stable/12/sys/dev/ahci/ahci.c Mon Nov 9 01:13:28 2020 (r367505) +++ stable/12/sys/dev/ahci/ahci.c Mon Nov 9 01:14:22 2020 (r367506) @@ -2585,15 +2585,17 @@ ahci_setup_fis(struct ahci_channel *ch, struct ahci_cm fis[12] = ccb->ataio.cmd.sector_count; } fis[13] = ccb->ataio.cmd.sector_count_exp; + if (ccb->ataio.ata_flags & ATA_FLAG_ICC) + fis[14] = ccb->ataio.icc; fis[15] = ATA_A_4BIT; + if (ccb->ataio.ata_flags & ATA_FLAG_AUX) { + fis[16] = ccb->ataio.aux & 0xff; + fis[17] = (ccb->ataio.aux >> 8) & 0xff; + fis[18] = (ccb->ataio.aux >> 16) & 0xff; + fis[19] = (ccb->ataio.aux >> 24) & 0xff; + } } else { fis[15] = ccb->ataio.cmd.control; - } - if (ccb->ataio.ata_flags & ATA_FLAG_AUX) { - fis[16] = ccb->ataio.aux & 0xff; - fis[17] = (ccb->ataio.aux >> 8) & 0xff; - fis[18] = (ccb->ataio.aux >> 16) & 0xff; - fis[19] = (ccb->ataio.aux >> 24) & 0xff; } return (20); } Modified: stable/12/sys/dev/siis/siis.c ============================================================================== --- stable/12/sys/dev/siis/siis.c Mon Nov 9 01:13:28 2020 (r367505) +++ stable/12/sys/dev/siis/siis.c Mon Nov 9 01:14:22 2020 (r367506) @@ -1729,6 +1729,8 @@ siis_setup_fis(device_t dev, struct siis_cmd *ctp, uni fis[12] = ccb->ataio.cmd.sector_count; fis[13] = ccb->ataio.cmd.sector_count_exp; } + if (ccb->ataio.ata_flags & ATA_FLAG_ICC) + fis[14] = ccb->ataio.icc; fis[15] = ATA_A_4BIT; if (ccb->ataio.ata_flags & ATA_FLAG_AUX) { fis[16] = ccb->ataio.aux & 0xff; From owner-svn-src-stable@freebsd.org Mon Nov 9 01:38:03 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4D2C2E460F; Mon, 9 Nov 2020 01:38:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTtt33vn7z3Nr0; Mon, 9 Nov 2020 01:38:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 746A6106D; Mon, 9 Nov 2020 01:38:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A91c3PF023136; Mon, 9 Nov 2020 01:38:03 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A91c39G023133; Mon, 9 Nov 2020 01:38:03 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202011090138.0A91c39G023133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Nov 2020 01:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367507 - in stable/12: share/man/man4 sys/dev/arcmsr X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/dev/arcmsr X-SVN-Commit-Revision: 367507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 01:38:03 -0000 Author: delphij Date: Mon Nov 9 01:38:02 2020 New Revision: 367507 URL: https://svnweb.freebsd.org/changeset/base/367507 Log: MFC r358477,365113,366767: arcmsr(4) 1.50.00.00. Modified: stable/12/share/man/man4/arcmsr.4 stable/12/sys/dev/arcmsr/arcmsr.c stable/12/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/arcmsr.4 ============================================================================== --- stable/12/share/man/man4/arcmsr.4 Mon Nov 9 01:14:22 2020 (r367506) +++ stable/12/share/man/man4/arcmsr.4 Mon Nov 9 01:38:02 2020 (r367507) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 8, 2017 +.Dd October 15, 2020 .Dt ARCMSR 4 .Os .Sh NAME @@ -153,6 +153,8 @@ ARC-1882 ARC-1883 .It ARC-1884 +.It +ARC-1886 .El .Sh FILES .Bl -tag -width ".Pa /dev/arcmsr?" -compact Modified: stable/12/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/12/sys/dev/arcmsr/arcmsr.c Mon Nov 9 01:14:22 2020 (r367506) +++ stable/12/sys/dev/arcmsr/arcmsr.c Mon Nov 9 01:38:02 2020 (r367507) @@ -81,6 +81,7 @@ ** 1.30.00.00 11/30/2015 Ching Huang Added support ARC1203 ** 1.40.00.00 07/11/2017 Ching Huang Added support ARC1884 ** 1.40.00.01 10/30/2017 Ching Huang Fixed release memory resource +** 1.50.00.00 09/30/2020 Ching Huang Added support ARC-1886, NVMe/SAS/SATA controller ****************************************************************************************** */ @@ -130,29 +131,15 @@ __FBSDID("$FreeBSD$"); ************************************************************************** ************************************************************************** */ -#if __FreeBSD_version >= 500005 - #include - #include - #include - #include - #include -#else - #include - #include - #include -#endif +#include +#include +#include +#include +#include -#if !defined(CAM_NEW_TRAN_CODE) && __FreeBSD_version >= 700025 -#define CAM_NEW_TRAN_CODE 1 -#endif - -#if __FreeBSD_version > 500000 #define arcmsr_callout_init(a) callout_init(a, /*mpsafe*/1); -#else -#define arcmsr_callout_init(a) callout_init(a); -#endif -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.40.00.01 2017-10-30" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.50.00.00 2020-09-30" #include /* ************************************************************************** @@ -190,6 +177,7 @@ static void arcmsr_polling_devmap(void *arg); static void arcmsr_srb_timeout(void *arg); static void arcmsr_hbd_postqueue_isr(struct AdapterControlBlock *acb); static void arcmsr_hbe_postqueue_isr(struct AdapterControlBlock *acb); +static void arcmsr_hbf_postqueue_isr(struct AdapterControlBlock *acb); static void arcmsr_teardown_intr(device_t dev, struct AdapterControlBlock *acb); #ifdef ARCMSR_DEBUG1 static void arcmsr_dump_data(struct AdapterControlBlock *acb); @@ -220,12 +208,7 @@ static device_method_t arcmsr_methods[]={ DEVMETHOD(device_shutdown, arcmsr_shutdown), DEVMETHOD(device_suspend, arcmsr_suspend), DEVMETHOD(device_resume, arcmsr_resume), - -#if __FreeBSD_version >= 803000 DEVMETHOD_END -#else - { 0, 0 } -#endif }; static driver_t arcmsr_driver={ @@ -239,59 +222,23 @@ MODULE_DEPEND(arcmsr, cam, 1, 1, 1); #ifndef BUS_DMA_COHERENT #define BUS_DMA_COHERENT 0x04 /* hint: map memory in a coherent way */ #endif -#if __FreeBSD_version >= 501000 static struct cdevsw arcmsr_cdevsw={ - #if __FreeBSD_version >= 503000 .d_version = D_VERSION, - #endif - #if (__FreeBSD_version>=503000 && __FreeBSD_version<600034) - .d_flags = D_NEEDGIANT, - #endif .d_open = arcmsr_open, /* open */ .d_close = arcmsr_close, /* close */ .d_ioctl = arcmsr_ioctl, /* ioctl */ .d_name = "arcmsr", /* name */ }; -#else - #define ARCMSR_CDEV_MAJOR 180 - -static struct cdevsw arcmsr_cdevsw = { - arcmsr_open, /* open */ - arcmsr_close, /* close */ - noread, /* read */ - nowrite, /* write */ - arcmsr_ioctl, /* ioctl */ - nopoll, /* poll */ - nommap, /* mmap */ - nostrategy, /* strategy */ - "arcmsr", /* name */ - ARCMSR_CDEV_MAJOR, /* major */ - nodump, /* dump */ - nopsize, /* psize */ - 0 /* flags */ - }; -#endif /* ************************************************************************** ************************************************************************** */ -#if __FreeBSD_version < 500005 - static int arcmsr_open(dev_t dev, int flags, int fmt, struct proc *proc) -#else - #if __FreeBSD_version < 503000 - static int arcmsr_open(dev_t dev, int flags, int fmt, struct thread *proc) - #else - static int arcmsr_open(struct cdev *dev, int flags, int fmt, struct thread *proc) - #endif -#endif +static int arcmsr_open(struct cdev *dev, int flags, int fmt, struct thread *proc) { - #if __FreeBSD_version < 503000 - struct AdapterControlBlock *acb = dev->si_drv1; - #else - int unit = dev2unit(dev); - struct AdapterControlBlock *acb = devclass_get_softc(arcmsr_devclass, unit); - #endif - if(acb == NULL) { + int unit = dev2unit(dev); + struct AdapterControlBlock *acb = devclass_get_softc(arcmsr_devclass, unit); + + if (acb == NULL) { return ENXIO; } return (0); @@ -300,23 +247,12 @@ static struct cdevsw arcmsr_cdevsw = { ************************************************************************** ************************************************************************** */ -#if __FreeBSD_version < 500005 - static int arcmsr_close(dev_t dev, int flags, int fmt, struct proc *proc) -#else - #if __FreeBSD_version < 503000 - static int arcmsr_close(dev_t dev, int flags, int fmt, struct thread *proc) - #else - static int arcmsr_close(struct cdev *dev, int flags, int fmt, struct thread *proc) - #endif -#endif +static int arcmsr_close(struct cdev *dev, int flags, int fmt, struct thread *proc) { - #if __FreeBSD_version < 503000 - struct AdapterControlBlock *acb = dev->si_drv1; - #else - int unit = dev2unit(dev); - struct AdapterControlBlock *acb = devclass_get_softc(arcmsr_devclass, unit); - #endif - if(acb == NULL) { + int unit = dev2unit(dev); + struct AdapterControlBlock *acb = devclass_get_softc(arcmsr_devclass, unit); + + if (acb == NULL) { return ENXIO; } return 0; @@ -325,24 +261,12 @@ static struct cdevsw arcmsr_cdevsw = { ************************************************************************** ************************************************************************** */ -#if __FreeBSD_version < 500005 - static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct proc *proc) -#else - #if __FreeBSD_version < 503000 - static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc) - #else - static int arcmsr_ioctl(struct cdev *dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc) - #endif -#endif +static int arcmsr_ioctl(struct cdev *dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc) { - #if __FreeBSD_version < 503000 - struct AdapterControlBlock *acb = dev->si_drv1; - #else - int unit = dev2unit(dev); - struct AdapterControlBlock *acb = devclass_get_softc(arcmsr_devclass, unit); - #endif - - if(acb == NULL) { + int unit = dev2unit(dev); + struct AdapterControlBlock *acb = devclass_get_softc(arcmsr_devclass, unit); + + if (acb == NULL) { return ENXIO; } return (arcmsr_iop_ioctlcmd(acb, ioctl_cmd, arg)); @@ -372,19 +296,20 @@ static u_int32_t arcmsr_disable_allintr( struct Adapte break; case ACB_ADAPTER_TYPE_C: { /* disable all outbound interrupt */ - intmask_org = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_mask) ; /* disable outbound message0 int */ + intmask_org = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_mask); /* disable outbound message0 int */ CHIP_REG_WRITE32(HBC_MessageUnit, 0, host_int_mask, intmask_org|ARCMSR_HBCMU_ALL_INTMASKENABLE); } break; case ACB_ADAPTER_TYPE_D: { /* disable all outbound interrupt */ - intmask_org = CHIP_REG_READ32(HBD_MessageUnit, 0, pcief0_int_enable) ; /* disable outbound message0 int */ + intmask_org = CHIP_REG_READ32(HBD_MessageUnit, 0, pcief0_int_enable); /* disable outbound message0 int */ CHIP_REG_WRITE32(HBD_MessageUnit, 0, pcief0_int_enable, ARCMSR_HBDMU_ALL_INT_DISABLE); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { /* disable all outbound interrupt */ - intmask_org = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_mask) ; /* disable outbound message0 int */ + intmask_org = CHIP_REG_READ32(HBE_MessageUnit, 0, host_int_mask); /* disable outbound message0 int */ CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_mask, intmask_org | ARCMSR_HBEMU_ALL_INTMASKENABLE); } break; @@ -430,7 +355,8 @@ static void arcmsr_enable_allintr( struct AdapterContr acb->outbound_int_enable = mask; } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { /* enable outbound Post Queue, outbound doorbell Interrupt */ mask = ~(ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR | ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR); CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_mask, intmask_org & mask); @@ -529,7 +455,7 @@ static u_int8_t arcmsr_hbe_wait_msgint_ready(struct Ad { u_int32_t Index, read_doorbell; u_int8_t Retries = 0x00; - + do { for(Index=0; Index < 100; Index++) { read_doorbell = CHIP_REG_READ32(HBE_MessageUnit, 0, iobound_doorbell); @@ -620,7 +546,7 @@ static void arcmsr_flush_hbd_cache(struct AdapterContr static void arcmsr_flush_hbe_cache(struct AdapterControlBlock *acb) { int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */ - + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE); acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); @@ -655,7 +581,8 @@ static void arcmsr_flush_adapter_cache(struct AdapterC arcmsr_flush_hbd_cache(acb); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { arcmsr_flush_hbe_cache(acb); } break; @@ -811,7 +738,8 @@ static void arcmsr_abort_allcmd(struct AdapterControlB arcmsr_abort_hbd_allcmd(acb); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { arcmsr_abort_hbe_allcmd(acb); } break; @@ -922,6 +850,7 @@ static void arcmsr_drain_donequeue(struct AdapterContr srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFE0)); /*frame must be 32 bytes aligned*/ break; case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: srb = acb->psrb_pool[flag_srb]; break; default: @@ -1012,7 +941,6 @@ static void arcmsr_done4abort_postqueue(struct Adapter } break; case ACB_ADAPTER_TYPE_C: { - while((CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) { flag_srb = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low); error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1) ? TRUE : FALSE; @@ -1020,14 +948,15 @@ static void arcmsr_done4abort_postqueue(struct Adapter } } break; - case ACB_ADAPTER_TYPE_D: { - arcmsr_hbd_postqueue_isr(acb); - } + case ACB_ADAPTER_TYPE_D: + arcmsr_hbd_postqueue_isr(acb); break; - case ACB_ADAPTER_TYPE_E: { - arcmsr_hbe_postqueue_isr(acb); - } + case ACB_ADAPTER_TYPE_E: + arcmsr_hbe_postqueue_isr(acb); break; + case ACB_ADAPTER_TYPE_F: + arcmsr_hbf_postqueue_isr(acb); + break; } } /* @@ -1246,8 +1175,20 @@ static void arcmsr_post_srb(struct AdapterControlBlock ccb_post_stamp = (srb->smid | ((arc_cdb_size-1) >> 6)); CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_queueport_high, 0); CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_queueport_low, ccb_post_stamp); - } + } break; + case ACB_ADAPTER_TYPE_F: { + u_int32_t ccb_post_stamp, arc_cdb_size; + + if (srb->arc_cdb_size <= 0x300) + arc_cdb_size = (srb->arc_cdb_size - 1) >> 6 | 1; + else + arc_cdb_size = (((srb->arc_cdb_size + 0xff) >> 8) + 2) << 1 | 1; + ccb_post_stamp = (srb->smid | arc_cdb_size); + CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_queueport_high, 0); + CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_queueport_low, ccb_post_stamp); + } + break; } } /* @@ -1285,10 +1226,13 @@ static struct QBUFFER *arcmsr_get_iop_rqbuffer( struct break; case ACB_ADAPTER_TYPE_E: { struct HBE_MessageUnit *phbcmu = (struct HBE_MessageUnit *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbcmu->message_rbuffer; } break; + case ACB_ADAPTER_TYPE_F: + qbuffer = (struct QBUFFER *)acb->message_rbuffer; + break; } return(qbuffer); } @@ -1327,10 +1271,13 @@ static struct QBUFFER *arcmsr_get_iop_wqbuffer( struct break; case ACB_ADAPTER_TYPE_E: { struct HBE_MessageUnit *phbcmu = (struct HBE_MessageUnit *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbcmu->message_wbuffer; } break; + case ACB_ADAPTER_TYPE_F: + qbuffer = (struct QBUFFER *)acb->message_wbuffer; + break; } return(qbuffer); } @@ -1362,7 +1309,8 @@ static void arcmsr_iop_message_read(struct AdapterCont CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_doorbell, ARCMSR_HBDMU_DRV2IOP_DATA_OUT_READ); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { /* let IOP know data has been read */ acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_DATA_READ_OK; CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); @@ -1410,7 +1358,8 @@ static void arcmsr_iop_message_wrote(struct AdapterCon CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_doorbell, ARCMSR_HBDMU_DRV2IOP_DATA_IN_READY); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { /* ** push inbound doorbell tell iop, driver data write ok ** and wait reply on next hwinterrupt for next Qbuffer post @@ -1511,7 +1460,8 @@ static void arcmsr_stop_adapter_bgrb(struct AdapterCon arcmsr_stop_hbd_bgrb(acb); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { arcmsr_stop_hbe_bgrb(acb); } break; @@ -1540,7 +1490,6 @@ static void arcmsr_poll(struct cam_sim *psim) */ static u_int32_t arcmsr_Read_iop_rqbuffer_data_D(struct AdapterControlBlock *acb, struct QBUFFER *prbuffer) { - u_int8_t *pQbuffer; u_int8_t *buf1 = NULL; u_int32_t *iop_data, *buf2 = NULL; @@ -1585,7 +1534,6 @@ static u_int32_t arcmsr_Read_iop_rqbuffer_data_D(struc */ static u_int32_t arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, struct QBUFFER *prbuffer) { - u_int8_t *pQbuffer; u_int8_t *iop_data; u_int32_t iop_len; @@ -1752,7 +1700,7 @@ static void arcmsr_rescan_lun(struct AdapterControlBlo union ccb *ccb; if ((ccb = (union ccb *)xpt_alloc_ccb_nowait()) == NULL) - return; + return; if (xpt_create_path(&path, NULL, cam_sim_path(acb->psim), target, lun) != CAM_REQ_CMP) { xpt_free_ccb(ccb); @@ -1767,7 +1715,6 @@ static void arcmsr_rescan_lun(struct AdapterControlBlo xpt_action(ccb); } - static void arcmsr_abort_dr_ccbs(struct AdapterControlBlock *acb, int target, int lun) { struct CommandControlBlock *srb; @@ -1842,10 +1789,18 @@ static void arcmsr_dr_handle(struct AdapterControlBloc devicemap = offsetof(struct HBE_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); for (target = 0; target < 4; target++) { - deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); - devicemap += 4; + deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); + devicemap += 4; } break; + case ACB_ADAPTER_TYPE_F: + devicemap = ARCMSR_FW_DEVMAP_OFFSET; + for (target = 0; target < 4; target++) + { + deviceMapCurrent[target] = acb->msgcode_rwbuffer[devicemap]; + devicemap += 1; + } + break; } if(acb->acb_flags & ACB_F_BUS_HANG_ON) @@ -1856,7 +1811,7 @@ static void arcmsr_dr_handle(struct AdapterControlBloc ** adapter posted CONFIG message ** copy the new map, note if there are differences with the current map */ - pDevMap = (u_int8_t *)&deviceMapCurrent[0]; + pDevMap = (u_int8_t *)&deviceMapCurrent[0]; for (target = 0; target < ARCMSR_MAX_TARGETID - 1; target++) { if (*pDevMap != acb->device_map[target]) @@ -2043,7 +1998,7 @@ static void arcmsr_hbd_doorbell_isr(struct AdapterCont static void arcmsr_hbe_doorbell_isr(struct AdapterControlBlock *acb) { u_int32_t doorbell_status, in_doorbell; - + /* ******************************************************************* ** Maybe here we need to check wrqbuffer_lock is lock or not @@ -2084,7 +2039,7 @@ static void arcmsr_hba_postqueue_isr(struct AdapterCon while((flag_srb = CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_queueport)) != 0xFFFFFFFF) { /* check if command done with no error*/ - error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0) ? TRUE : FALSE; + error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0) ? TRUE : FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } /*drain reply FIFO*/ } @@ -2113,7 +2068,7 @@ static void arcmsr_hbb_postqueue_isr(struct AdapterCon index %= ARCMSR_MAX_HBB_POSTQUEUE; /*if last index number set it to 0 */ phbbmu->doneq_index = index; /* check if command done with no error*/ - error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; + error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } /*drain reply FIFO*/ } @@ -2131,7 +2086,7 @@ static void arcmsr_hbc_postqueue_isr(struct AdapterCon ** areca cdb command done ***************************************************************************** */ - bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); + bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); do { flag_srb = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low); if (flag_srb == 0xFFFFFFFF) @@ -2141,7 +2096,7 @@ static void arcmsr_hbc_postqueue_isr(struct AdapterCon arcmsr_drain_donequeue(acb, flag_srb, error); throttling++; if(throttling == ARCMSR_HBC_ISR_THROTTLING_LEVEL) { - CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell,ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING); + CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING); throttling = 0; } } while(CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR); @@ -2214,7 +2169,7 @@ static void arcmsr_hbe_postqueue_isr(struct AdapterCon u_int16_t error; uint32_t doneq_index; uint16_t cmdSMID; - + /* ***************************************************************************** ** areca cdb command done @@ -2233,6 +2188,35 @@ static void arcmsr_hbe_postqueue_isr(struct AdapterCon acb->doneq_index = doneq_index; CHIP_REG_WRITE32(HBE_MessageUnit, 0, reply_post_consumer_index, doneq_index); } + +static void arcmsr_hbf_postqueue_isr(struct AdapterControlBlock *acb) +{ + uint16_t error; + uint32_t doneq_index; + uint16_t cmdSMID; + + /* + ***************************************************************************** + ** areca cdb command done + ***************************************************************************** + */ + bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + doneq_index = acb->doneq_index; + while (1) { + cmdSMID = acb->pCompletionQ[doneq_index].cmdSMID; + if (cmdSMID == 0xffff) + break; + error = (acb->pCompletionQ[doneq_index].cmdFlag & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1) ? TRUE : FALSE; + arcmsr_drain_donequeue(acb, (u_int32_t)cmdSMID, error); + acb->pCompletionQ[doneq_index].cmdSMID = 0xffff; + doneq_index++; + if (doneq_index >= acb->completionQ_entry) + doneq_index = 0; + } + acb->doneq_index = doneq_index; + CHIP_REG_WRITE32(HBF_MessageUnit, 0, reply_post_consumer_index, doneq_index); +} + /* ********************************************************************** ********************************************************************** @@ -2394,6 +2378,34 @@ static void arcmsr_handle_hbe_isr( struct AdapterContr host_interrupt_status = CHIP_REG_READ32(HBE_MessageUnit, 0, host_int_status); } while (host_interrupt_status & (ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR | ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR)); } + +static void arcmsr_handle_hbf_isr( struct AdapterControlBlock *acb) +{ + u_int32_t host_interrupt_status; + /* + ********************************************* + ** check outbound intstatus + ********************************************* + */ + host_interrupt_status = CHIP_REG_READ32(HBF_MessageUnit, 0, host_int_status) & + (ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR | + ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR); + if(!host_interrupt_status) { + /*it must be share irq*/ + return; + } + do { + /* MU doorbell interrupts*/ + if(host_interrupt_status & ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR) { + arcmsr_hbe_doorbell_isr(acb); + } + /* MU post queue interrupts*/ + if(host_interrupt_status & ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR) { + arcmsr_hbf_postqueue_isr(acb); + } + host_interrupt_status = CHIP_REG_READ32(HBF_MessageUnit, 0, host_int_status); + } while (host_interrupt_status & (ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR | ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR)); +} /* ****************************************************************************** ****************************************************************************** @@ -2416,6 +2428,9 @@ static void arcmsr_interrupt(struct AdapterControlBloc case ACB_ADAPTER_TYPE_E: arcmsr_handle_hbe_isr(acb); break; + case ACB_ADAPTER_TYPE_F: + arcmsr_handle_hbf_isr(acb); + break; default: printf("arcmsr%d: interrupt service," " unknown adapter type =%d\n", acb->pci_unit, acb->adapter_type); @@ -2446,7 +2461,7 @@ static void arcmsr_polling_devmap(void *arg) CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); break; - case ACB_ADAPTER_TYPE_B: { + case ACB_ADAPTER_TYPE_B: { struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_GET_CONFIG); } @@ -2461,13 +2476,24 @@ static void arcmsr_polling_devmap(void *arg) CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); break; - case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_E: CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); - break; - } + break; + case ACB_ADAPTER_TYPE_F: { + u_int32_t outMsg1 = CHIP_REG_READ32(HBF_MessageUnit, 0, outbound_msgaddr1); + if (!(outMsg1 & ARCMSR_HBFMU_MESSAGE_FIRMWARE_OK) || + (outMsg1 & ARCMSR_HBFMU_MESSAGE_NO_VOLUME_CHANGE)) + goto nxt6s; + CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBF_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + break; + } + } +nxt6s: if((acb->acb_flags & ACB_F_SCSISTOPADAPTER) == 0) { callout_reset(&acb->devmap_callout, 5 * hz, arcmsr_polling_devmap, acb); /* polling per 5 seconds */ @@ -3066,7 +3092,7 @@ static void arcmsr_handle_virtual_command(struct Adapt case INQUIRY: { unsigned char inqdata[36]; char *buffer = pccb->csio.data_ptr; - + inqdata[0] = T_PROCESSOR; /* Periph Qualifier & Periph Dev Type */ inqdata[1] = 0; /* rem media bit & Dev Type Modifier */ inqdata[2] = 0; /* ISO, ECMA, & ANSI versions */ @@ -3160,7 +3186,6 @@ static void arcmsr_action(struct cam_sim *psim, union strlcpy(cpi->hba_vid, "ARCMSR", HBA_IDLEN); strlcpy(cpi->dev_name, cam_sim_name(psim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(psim); - #ifdef CAM_NEW_TRAN_CODE if(acb->adapter_bus_speed == ACB_BUS_SPEED_12G) cpi->base_transfer_speed = 1200000; else if(acb->adapter_bus_speed == ACB_BUS_SPEED_6G) @@ -3183,14 +3208,13 @@ static void arcmsr_action(struct cam_sim *psim, union cpi->protocol_version = SCSI_REV_2; } cpi->protocol = PROTO_SCSI; - #endif cpi->ccb_h.status |= CAM_REQ_CMP; xpt_done(pccb); break; } case XPT_ABORT: { union ccb *pabort_ccb; - + pabort_ccb = pccb->cab.abort_ccb; switch (pabort_ccb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: @@ -3241,7 +3265,6 @@ static void arcmsr_action(struct cam_sim *psim, union break; } cts = &pccb->cts; - #ifdef CAM_NEW_TRAN_CODE { struct ccb_trans_settings_scsi *scsi; struct ccb_trans_settings_spi *spi; @@ -3288,22 +3311,6 @@ static void arcmsr_action(struct cam_sim *psim, union | CTS_SPI_VALID_BUS_WIDTH; } } - #else - { - cts->flags = (CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB); - if (acb->adapter_bus_speed == ACB_BUS_SPEED_6G) - cts->sync_period = 1; - else - cts->sync_period = 2; - cts->sync_offset = 32; - cts->bus_width = MSG_EXT_WDTR_BUS_16_BIT; - cts->valid = CCB_TRANS_SYNC_RATE_VALID | - CCB_TRANS_SYNC_OFFSET_VALID | - CCB_TRANS_BUS_WIDTH_VALID | - CCB_TRANS_DISC_VALID | - CCB_TRANS_TQ_VALID; - } - #endif pccb->ccb_h.status |= CAM_REQ_CMP; xpt_done(pccb); break; @@ -3319,38 +3326,7 @@ static void arcmsr_action(struct cam_sim *psim, union xpt_done(pccb); break; } -#if __FreeBSD_version >= 500000 cam_calc_geometry(&pccb->ccg, 1); -#else - { - struct ccb_calc_geometry *ccg; - u_int32_t size_mb; - u_int32_t secs_per_cylinder; - - ccg = &pccb->ccg; - if (ccg->block_size == 0) { - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - } - if(((1024L * 1024L)/ccg->block_size) < 0) { - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - } - size_mb = ccg->volume_size/((1024L * 1024L)/ccg->block_size); - if(size_mb > 1024 ) { - ccg->heads = 255; - ccg->secs_per_track = 63; - } else { - ccg->heads = 64; - ccg->secs_per_track = 32; - } - secs_per_cylinder = ccg->heads * ccg->secs_per_track; - ccg->cylinders = ccg->volume_size / secs_per_cylinder; - pccb->ccb_h.status |= CAM_REQ_CMP; - } -#endif xpt_done(pccb); break; default: @@ -3443,6 +3419,7 @@ static void arcmsr_start_adapter_bgrb(struct AdapterCo arcmsr_start_hbd_bgrb(acb); break; case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: arcmsr_start_hbe_bgrb(acb); break; } @@ -3584,7 +3561,7 @@ polling_ccb_retry: break; } if (acb->srboutstandingcount == 0) { - break; + break; } goto polling_ccb_retry; } @@ -3676,7 +3653,7 @@ static void arcmsr_polling_hbe_srbdone(struct AdapterC struct CommandControlBlock *srb; u_int32_t poll_srb_done=0, poll_count=0, doneq_index; u_int16_t error, cmdSMID; - + polling_ccb_retry: poll_count++; bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); @@ -3687,12 +3664,12 @@ polling_ccb_retry: break;/*chip FIFO no ccb for completion already*/ } else { UDELAY(25000); - if ((poll_count > 100) && (poll_srb != NULL)) { + if ((poll_count > 100) && (poll_srb != NULL)) { break; } - if (acb->srboutstandingcount == 0) { - break; - } + if (acb->srboutstandingcount == 0) { + break; + } goto polling_ccb_retry; } } @@ -3728,25 +3705,21 @@ polling_ccb_retry: static void arcmsr_polling_srbdone(struct AdapterControlBlock *acb, struct CommandControlBlock *poll_srb) { switch (acb->adapter_type) { - case ACB_ADAPTER_TYPE_A: { - arcmsr_polling_hba_srbdone(acb, poll_srb); - } + case ACB_ADAPTER_TYPE_A: + arcmsr_polling_hba_srbdone(acb, poll_srb); break; - case ACB_ADAPTER_TYPE_B: { - arcmsr_polling_hbb_srbdone(acb, poll_srb); - } + case ACB_ADAPTER_TYPE_B: + arcmsr_polling_hbb_srbdone(acb, poll_srb); break; - case ACB_ADAPTER_TYPE_C: { - arcmsr_polling_hbc_srbdone(acb, poll_srb); - } + case ACB_ADAPTER_TYPE_C: + arcmsr_polling_hbc_srbdone(acb, poll_srb); break; - case ACB_ADAPTER_TYPE_D: { - arcmsr_polling_hbd_srbdone(acb, poll_srb); - } + case ACB_ADAPTER_TYPE_D: + arcmsr_polling_hbd_srbdone(acb, poll_srb); break; - case ACB_ADAPTER_TYPE_E: { - arcmsr_polling_hbe_srbdone(acb, poll_srb); - } + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: + arcmsr_polling_hbe_srbdone(acb, poll_srb); break; } } @@ -3963,14 +3936,14 @@ static void arcmsr_get_hbe_config(struct AdapterContro size_t iop_firm_version = offsetof(struct HBE_MessageUnit,msgcode_rwbuffer[ARCMSR_FW_VERS_OFFSET]); /*firm_version,17,68-83*/ size_t iop_device_map = offsetof(struct HBE_MessageUnit,msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); int i; - + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); if(!arcmsr_hbe_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'get adapter firmware miscellaneous data' timeout \n", acb->pci_unit); } - + i = 0; while(i < 8) { *acb_firm_model = bus_space_read_1(acb->btag[0], acb->bhandle[0], iop_firm_model+i); @@ -4006,29 +3979,81 @@ static void arcmsr_get_hbe_config(struct AdapterContro ********************************************************************** ********************************************************************** */ +static void arcmsr_get_hbf_config(struct AdapterControlBlock *acb) +{ + u_int32_t *acb_firm_model = (u_int32_t *)acb->firm_model; + u_int32_t *acb_firm_version = (u_int32_t *)acb->firm_version; + u_int32_t *acb_device_map = (u_int32_t *)acb->device_map; + size_t iop_firm_model = ARCMSR_FW_MODEL_OFFSET; /*firm_model,15,60-67*/ + size_t iop_firm_version = ARCMSR_FW_VERS_OFFSET; /*firm_version,17,68-83*/ + size_t iop_device_map = ARCMSR_FW_DEVMAP_OFFSET; + int i; + + CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + if(!arcmsr_hbe_wait_msgint_ready(acb)) + printf("arcmsr%d: wait 'get adapter firmware miscellaneous data' timeout \n", acb->pci_unit); + + i = 0; + while(i < 2) { + *acb_firm_model = acb->msgcode_rwbuffer[iop_firm_model]; + /* 8 bytes firm_model, 15, 60-67*/ + acb_firm_model++; + iop_firm_model++; + i++; + } + i = 0; + while(i < 4) { + *acb_firm_version = acb->msgcode_rwbuffer[iop_firm_version]; + /* 16 bytes firm_version, 17, 68-83*/ + acb_firm_version++; + iop_firm_version++; + i++; + } + i = 0; + while(i < 4) { + *acb_device_map = acb->msgcode_rwbuffer[iop_device_map]; + acb_device_map++; + iop_device_map++; + i++; + } + printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version); + acb->firm_request_len = acb->msgcode_rwbuffer[1]; /*firm_request_len, 1, 04-07*/ + acb->firm_numbers_queue = acb->msgcode_rwbuffer[2]; /*firm_numbers_queue, 2, 08-11*/ + acb->firm_sdram_size = acb->msgcode_rwbuffer[3]; /*firm_sdram_size, 3, 12-15*/ + acb->firm_ide_channels = acb->msgcode_rwbuffer[4]; /*firm_ide_channels, 4, 16-19*/ + acb->firm_cfg_version = acb->msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]; /*firm_cfg_version, 25*/ + if(acb->firm_numbers_queue > ARCMSR_MAX_OUTSTANDING_CMD) + acb->maxOutstanding = ARCMSR_MAX_OUTSTANDING_CMD - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; +} +/* +********************************************************************** +********************************************************************** +*/ static void arcmsr_get_firmware_spec(struct AdapterControlBlock *acb) { switch (acb->adapter_type) { - case ACB_ADAPTER_TYPE_A: { - arcmsr_get_hba_config(acb); - } + case ACB_ADAPTER_TYPE_A: + arcmsr_get_hba_config(acb); break; - case ACB_ADAPTER_TYPE_B: { - arcmsr_get_hbb_config(acb); - } + case ACB_ADAPTER_TYPE_B: + arcmsr_get_hbb_config(acb); break; - case ACB_ADAPTER_TYPE_C: { - arcmsr_get_hbc_config(acb); - } + case ACB_ADAPTER_TYPE_C: + arcmsr_get_hbc_config(acb); break; - case ACB_ADAPTER_TYPE_D: { - arcmsr_get_hbd_config(acb); - } + case ACB_ADAPTER_TYPE_D: + arcmsr_get_hbd_config(acb); break; - case ACB_ADAPTER_TYPE_E: { - arcmsr_get_hbe_config(acb); - } + case ACB_ADAPTER_TYPE_E: + arcmsr_get_hbe_config(acb); break; + case ACB_ADAPTER_TYPE_F: + arcmsr_get_hbf_config(acb); + break; } } /* @@ -4090,7 +4115,8 @@ static void arcmsr_wait_firmware_ready( struct Adapter } } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { while ((CHIP_REG_READ32(HBE_MessageUnit, 0, outbound_msgaddr1) & ARCMSR_HBEMU_MESSAGE_FIRMWARE_OK) == 0) { if (timeout++ > 4000) /* (4000*15)/1000 = 60 sec */ @@ -4143,7 +4169,8 @@ static void arcmsr_clear_doorbell_queue_buffer( struct CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_doorbell, ARCMSR_HBDMU_DRV2IOP_DATA_OUT_READ); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { /* empty doorbell Qbuffer if door bell ringed */ acb->in_doorbell = CHIP_REG_READ32(HBE_MessageUnit, 0, iobound_doorbell); CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0); /*clear doorbell interrupt */ @@ -4278,6 +4305,27 @@ static u_int32_t arcmsr_iop_confirm(struct AdapterCont } } break; + case ACB_ADAPTER_TYPE_F: { + u_int32_t cdb_phyaddr_lo32; + cdb_phyaddr_lo32 = srb_phyaddr_lo32 + offsetof(struct CommandControlBlock, arcmsr_cdb); + acb->msgcode_rwbuffer[0] = ARCMSR_SIGNATURE_SET_CONFIG; + acb->msgcode_rwbuffer[1] = ARCMSR_SIGNATURE_1886; + acb->msgcode_rwbuffer[2] = cdb_phyaddr_lo32; + acb->msgcode_rwbuffer[3] = srb_phyaddr_hi32; + acb->msgcode_rwbuffer[4] = SRB_SIZE; + cdb_phyaddr_lo32 = srb_phyaddr_lo32 + ARCMSR_SRBS_POOL_SIZE; + acb->msgcode_rwbuffer[5] = cdb_phyaddr_lo32; + acb->msgcode_rwbuffer[6] = srb_phyaddr_hi32; + acb->msgcode_rwbuffer[7] = COMPLETION_Q_POOL_SIZE; + CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_SET_CONFIG); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBF_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + if(!arcmsr_hbe_wait_msgint_ready(acb)) { + printf( "arcmsr%d: 'set srb high part physical address' timeout \n", acb->pci_unit); + return FALSE; + } + } + break; } return (TRUE); } @@ -4341,7 +4389,7 @@ static void arcmsr_map_free_srb(void *arg, bus_dma_seg return; } if((acb->adapter_type == ACB_ADAPTER_TYPE_C) || (acb->adapter_type == ACB_ADAPTER_TYPE_D) - || (acb->adapter_type == ACB_ADAPTER_TYPE_E)) + || (acb->adapter_type == ACB_ADAPTER_TYPE_E) || (acb->adapter_type == ACB_ADAPTER_TYPE_F)) { srb_tmp->cdb_phyaddr_low = srb_phyaddr; srb_tmp->cdb_phyaddr_high = (u_int32_t)((srb_phyaddr >> 16) >> 16); @@ -4356,6 +4404,15 @@ static void arcmsr_map_free_srb(void *arg, bus_dma_seg } if (acb->adapter_type == ACB_ADAPTER_TYPE_E) acb->pCompletionQ = (pCompletion_Q)srb_tmp; + else if (acb->adapter_type == ACB_ADAPTER_TYPE_F) { + acb->pCompletionQ = (pCompletion_Q)srb_tmp; + acb->completeQ_phys = srb_phyaddr; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Mon Nov 9 01:39:56 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 631DF2E42E6; Mon, 9 Nov 2020 01:39:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTtwD2Khhz3P9T; Mon, 9 Nov 2020 01:39:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42897143E; Mon, 9 Nov 2020 01:39:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A91du1a023275; Mon, 9 Nov 2020 01:39:56 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A91dtb8023272; Mon, 9 Nov 2020 01:39:55 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202011090139.0A91dtb8023272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Nov 2020 01:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367508 - in stable/11: share/man/man4 sys/dev/arcmsr X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/dev/arcmsr X-SVN-Commit-Revision: 367508 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 01:39:56 -0000 Author: delphij Date: Mon Nov 9 01:39:55 2020 New Revision: 367508 URL: https://svnweb.freebsd.org/changeset/base/367508 Log: MFC r358477,365113,366767: arcmsr(4) 1.50.00.00. Modified: stable/11/share/man/man4/arcmsr.4 stable/11/sys/dev/arcmsr/arcmsr.c stable/11/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/arcmsr.4 ============================================================================== --- stable/11/share/man/man4/arcmsr.4 Mon Nov 9 01:38:02 2020 (r367507) +++ stable/11/share/man/man4/arcmsr.4 Mon Nov 9 01:39:55 2020 (r367508) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 8, 2017 +.Dd October 15, 2020 .Dt ARCMSR 4 .Os .Sh NAME @@ -153,6 +153,8 @@ ARC-1882 ARC-1883 .It ARC-1884 +.It +ARC-1886 .El .Sh FILES .Bl -tag -width ".Pa /dev/arcmsr?" -compact Modified: stable/11/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/11/sys/dev/arcmsr/arcmsr.c Mon Nov 9 01:38:02 2020 (r367507) +++ stable/11/sys/dev/arcmsr/arcmsr.c Mon Nov 9 01:39:55 2020 (r367508) @@ -79,6 +79,7 @@ ** 1.30.00.00 11/30/2015 Ching Huang Added support ARC1203 ** 1.40.00.00 07/11/2017 Ching Huang Added support ARC1884 ** 1.40.00.01 10/30/2017 Ching Huang Fixed release memory resource +** 1.50.00.00 09/30/2020 Ching Huang Added support ARC-1886, NVMe/SAS/SATA controller ****************************************************************************************** */ @@ -128,29 +129,15 @@ __FBSDID("$FreeBSD$"); ************************************************************************** ************************************************************************** */ -#if __FreeBSD_version >= 500005 - #include - #include - #include - #include - #include -#else - #include - #include - #include -#endif +#include +#include +#include +#include +#include -#if !defined(CAM_NEW_TRAN_CODE) && __FreeBSD_version >= 700025 -#define CAM_NEW_TRAN_CODE 1 -#endif - -#if __FreeBSD_version > 500000 #define arcmsr_callout_init(a) callout_init(a, /*mpsafe*/1); -#else -#define arcmsr_callout_init(a) callout_init(a); -#endif -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.40.00.01 2017-10-30" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.50.00.00 2020-09-30" #include /* ************************************************************************** @@ -188,6 +175,7 @@ static void arcmsr_polling_devmap(void *arg); static void arcmsr_srb_timeout(void *arg); static void arcmsr_hbd_postqueue_isr(struct AdapterControlBlock *acb); static void arcmsr_hbe_postqueue_isr(struct AdapterControlBlock *acb); +static void arcmsr_hbf_postqueue_isr(struct AdapterControlBlock *acb); static void arcmsr_teardown_intr(device_t dev, struct AdapterControlBlock *acb); #ifdef ARCMSR_DEBUG1 static void arcmsr_dump_data(struct AdapterControlBlock *acb); @@ -218,12 +206,7 @@ static device_method_t arcmsr_methods[]={ DEVMETHOD(device_shutdown, arcmsr_shutdown), DEVMETHOD(device_suspend, arcmsr_suspend), DEVMETHOD(device_resume, arcmsr_resume), - -#if __FreeBSD_version >= 803000 DEVMETHOD_END -#else - { 0, 0 } -#endif }; static driver_t arcmsr_driver={ @@ -237,59 +220,23 @@ MODULE_DEPEND(arcmsr, cam, 1, 1, 1); #ifndef BUS_DMA_COHERENT #define BUS_DMA_COHERENT 0x04 /* hint: map memory in a coherent way */ #endif -#if __FreeBSD_version >= 501000 static struct cdevsw arcmsr_cdevsw={ - #if __FreeBSD_version >= 503000 .d_version = D_VERSION, - #endif - #if (__FreeBSD_version>=503000 && __FreeBSD_version<600034) - .d_flags = D_NEEDGIANT, - #endif .d_open = arcmsr_open, /* open */ .d_close = arcmsr_close, /* close */ .d_ioctl = arcmsr_ioctl, /* ioctl */ .d_name = "arcmsr", /* name */ }; -#else - #define ARCMSR_CDEV_MAJOR 180 - -static struct cdevsw arcmsr_cdevsw = { - arcmsr_open, /* open */ - arcmsr_close, /* close */ - noread, /* read */ - nowrite, /* write */ - arcmsr_ioctl, /* ioctl */ - nopoll, /* poll */ - nommap, /* mmap */ - nostrategy, /* strategy */ - "arcmsr", /* name */ - ARCMSR_CDEV_MAJOR, /* major */ - nodump, /* dump */ - nopsize, /* psize */ - 0 /* flags */ - }; -#endif /* ************************************************************************** ************************************************************************** */ -#if __FreeBSD_version < 500005 - static int arcmsr_open(dev_t dev, int flags, int fmt, struct proc *proc) -#else - #if __FreeBSD_version < 503000 - static int arcmsr_open(dev_t dev, int flags, int fmt, struct thread *proc) - #else - static int arcmsr_open(struct cdev *dev, int flags, int fmt, struct thread *proc) - #endif -#endif +static int arcmsr_open(struct cdev *dev, int flags, int fmt, struct thread *proc) { - #if __FreeBSD_version < 503000 - struct AdapterControlBlock *acb = dev->si_drv1; - #else - int unit = dev2unit(dev); - struct AdapterControlBlock *acb = devclass_get_softc(arcmsr_devclass, unit); - #endif - if(acb == NULL) { + int unit = dev2unit(dev); + struct AdapterControlBlock *acb = devclass_get_softc(arcmsr_devclass, unit); + + if (acb == NULL) { return ENXIO; } return (0); @@ -298,23 +245,12 @@ static struct cdevsw arcmsr_cdevsw = { ************************************************************************** ************************************************************************** */ -#if __FreeBSD_version < 500005 - static int arcmsr_close(dev_t dev, int flags, int fmt, struct proc *proc) -#else - #if __FreeBSD_version < 503000 - static int arcmsr_close(dev_t dev, int flags, int fmt, struct thread *proc) - #else - static int arcmsr_close(struct cdev *dev, int flags, int fmt, struct thread *proc) - #endif -#endif +static int arcmsr_close(struct cdev *dev, int flags, int fmt, struct thread *proc) { - #if __FreeBSD_version < 503000 - struct AdapterControlBlock *acb = dev->si_drv1; - #else - int unit = dev2unit(dev); - struct AdapterControlBlock *acb = devclass_get_softc(arcmsr_devclass, unit); - #endif - if(acb == NULL) { + int unit = dev2unit(dev); + struct AdapterControlBlock *acb = devclass_get_softc(arcmsr_devclass, unit); + + if (acb == NULL) { return ENXIO; } return 0; @@ -323,24 +259,12 @@ static struct cdevsw arcmsr_cdevsw = { ************************************************************************** ************************************************************************** */ -#if __FreeBSD_version < 500005 - static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct proc *proc) -#else - #if __FreeBSD_version < 503000 - static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc) - #else - static int arcmsr_ioctl(struct cdev *dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc) - #endif -#endif +static int arcmsr_ioctl(struct cdev *dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc) { - #if __FreeBSD_version < 503000 - struct AdapterControlBlock *acb = dev->si_drv1; - #else - int unit = dev2unit(dev); - struct AdapterControlBlock *acb = devclass_get_softc(arcmsr_devclass, unit); - #endif - - if(acb == NULL) { + int unit = dev2unit(dev); + struct AdapterControlBlock *acb = devclass_get_softc(arcmsr_devclass, unit); + + if (acb == NULL) { return ENXIO; } return (arcmsr_iop_ioctlcmd(acb, ioctl_cmd, arg)); @@ -370,19 +294,20 @@ static u_int32_t arcmsr_disable_allintr( struct Adapte break; case ACB_ADAPTER_TYPE_C: { /* disable all outbound interrupt */ - intmask_org = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_mask) ; /* disable outbound message0 int */ + intmask_org = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_mask); /* disable outbound message0 int */ CHIP_REG_WRITE32(HBC_MessageUnit, 0, host_int_mask, intmask_org|ARCMSR_HBCMU_ALL_INTMASKENABLE); } break; case ACB_ADAPTER_TYPE_D: { /* disable all outbound interrupt */ - intmask_org = CHIP_REG_READ32(HBD_MessageUnit, 0, pcief0_int_enable) ; /* disable outbound message0 int */ + intmask_org = CHIP_REG_READ32(HBD_MessageUnit, 0, pcief0_int_enable); /* disable outbound message0 int */ CHIP_REG_WRITE32(HBD_MessageUnit, 0, pcief0_int_enable, ARCMSR_HBDMU_ALL_INT_DISABLE); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { /* disable all outbound interrupt */ - intmask_org = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_mask) ; /* disable outbound message0 int */ + intmask_org = CHIP_REG_READ32(HBE_MessageUnit, 0, host_int_mask); /* disable outbound message0 int */ CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_mask, intmask_org | ARCMSR_HBEMU_ALL_INTMASKENABLE); } break; @@ -428,7 +353,8 @@ static void arcmsr_enable_allintr( struct AdapterContr acb->outbound_int_enable = mask; } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { /* enable outbound Post Queue, outbound doorbell Interrupt */ mask = ~(ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR | ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR); CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_mask, intmask_org & mask); @@ -527,7 +453,7 @@ static u_int8_t arcmsr_hbe_wait_msgint_ready(struct Ad { u_int32_t Index, read_doorbell; u_int8_t Retries = 0x00; - + do { for(Index=0; Index < 100; Index++) { read_doorbell = CHIP_REG_READ32(HBE_MessageUnit, 0, iobound_doorbell); @@ -618,7 +544,7 @@ static void arcmsr_flush_hbd_cache(struct AdapterContr static void arcmsr_flush_hbe_cache(struct AdapterControlBlock *acb) { int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */ - + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE); acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); @@ -653,7 +579,8 @@ static void arcmsr_flush_adapter_cache(struct AdapterC arcmsr_flush_hbd_cache(acb); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { arcmsr_flush_hbe_cache(acb); } break; @@ -809,7 +736,8 @@ static void arcmsr_abort_allcmd(struct AdapterControlB arcmsr_abort_hbd_allcmd(acb); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { arcmsr_abort_hbe_allcmd(acb); } break; @@ -920,6 +848,7 @@ static void arcmsr_drain_donequeue(struct AdapterContr srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFE0)); /*frame must be 32 bytes aligned*/ break; case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: srb = acb->psrb_pool[flag_srb]; break; default: @@ -1010,7 +939,6 @@ static void arcmsr_done4abort_postqueue(struct Adapter } break; case ACB_ADAPTER_TYPE_C: { - while((CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) { flag_srb = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low); error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1) ? TRUE : FALSE; @@ -1018,14 +946,15 @@ static void arcmsr_done4abort_postqueue(struct Adapter } } break; - case ACB_ADAPTER_TYPE_D: { - arcmsr_hbd_postqueue_isr(acb); - } + case ACB_ADAPTER_TYPE_D: + arcmsr_hbd_postqueue_isr(acb); break; - case ACB_ADAPTER_TYPE_E: { - arcmsr_hbe_postqueue_isr(acb); - } + case ACB_ADAPTER_TYPE_E: + arcmsr_hbe_postqueue_isr(acb); break; + case ACB_ADAPTER_TYPE_F: + arcmsr_hbf_postqueue_isr(acb); + break; } } /* @@ -1244,8 +1173,20 @@ static void arcmsr_post_srb(struct AdapterControlBlock ccb_post_stamp = (srb->smid | ((arc_cdb_size-1) >> 6)); CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_queueport_high, 0); CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_queueport_low, ccb_post_stamp); - } + } break; + case ACB_ADAPTER_TYPE_F: { + u_int32_t ccb_post_stamp, arc_cdb_size; + + if (srb->arc_cdb_size <= 0x300) + arc_cdb_size = (srb->arc_cdb_size - 1) >> 6 | 1; + else + arc_cdb_size = (((srb->arc_cdb_size + 0xff) >> 8) + 2) << 1 | 1; + ccb_post_stamp = (srb->smid | arc_cdb_size); + CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_queueport_high, 0); + CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_queueport_low, ccb_post_stamp); + } + break; } } /* @@ -1283,10 +1224,13 @@ static struct QBUFFER *arcmsr_get_iop_rqbuffer( struct break; case ACB_ADAPTER_TYPE_E: { struct HBE_MessageUnit *phbcmu = (struct HBE_MessageUnit *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbcmu->message_rbuffer; } break; + case ACB_ADAPTER_TYPE_F: + qbuffer = (struct QBUFFER *)acb->message_rbuffer; + break; } return(qbuffer); } @@ -1325,10 +1269,13 @@ static struct QBUFFER *arcmsr_get_iop_wqbuffer( struct break; case ACB_ADAPTER_TYPE_E: { struct HBE_MessageUnit *phbcmu = (struct HBE_MessageUnit *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbcmu->message_wbuffer; } break; + case ACB_ADAPTER_TYPE_F: + qbuffer = (struct QBUFFER *)acb->message_wbuffer; + break; } return(qbuffer); } @@ -1360,7 +1307,8 @@ static void arcmsr_iop_message_read(struct AdapterCont CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_doorbell, ARCMSR_HBDMU_DRV2IOP_DATA_OUT_READ); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { /* let IOP know data has been read */ acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_DATA_READ_OK; CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); @@ -1408,7 +1356,8 @@ static void arcmsr_iop_message_wrote(struct AdapterCon CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_doorbell, ARCMSR_HBDMU_DRV2IOP_DATA_IN_READY); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { /* ** push inbound doorbell tell iop, driver data write ok ** and wait reply on next hwinterrupt for next Qbuffer post @@ -1509,7 +1458,8 @@ static void arcmsr_stop_adapter_bgrb(struct AdapterCon arcmsr_stop_hbd_bgrb(acb); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { arcmsr_stop_hbe_bgrb(acb); } break; @@ -1538,7 +1488,6 @@ static void arcmsr_poll(struct cam_sim *psim) */ static u_int32_t arcmsr_Read_iop_rqbuffer_data_D(struct AdapterControlBlock *acb, struct QBUFFER *prbuffer) { - u_int8_t *pQbuffer; u_int8_t *buf1 = NULL; u_int32_t *iop_data, *buf2 = NULL; @@ -1583,7 +1532,6 @@ static u_int32_t arcmsr_Read_iop_rqbuffer_data_D(struc */ static u_int32_t arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, struct QBUFFER *prbuffer) { - u_int8_t *pQbuffer; u_int8_t *iop_data; u_int32_t iop_len; @@ -1750,7 +1698,7 @@ static void arcmsr_rescan_lun(struct AdapterControlBlo union ccb *ccb; if ((ccb = (union ccb *)xpt_alloc_ccb_nowait()) == NULL) - return; + return; if (xpt_create_path(&path, NULL, cam_sim_path(acb->psim), target, lun) != CAM_REQ_CMP) { xpt_free_ccb(ccb); @@ -1765,7 +1713,6 @@ static void arcmsr_rescan_lun(struct AdapterControlBlo xpt_action(ccb); } - static void arcmsr_abort_dr_ccbs(struct AdapterControlBlock *acb, int target, int lun) { struct CommandControlBlock *srb; @@ -1840,10 +1787,18 @@ static void arcmsr_dr_handle(struct AdapterControlBloc devicemap = offsetof(struct HBE_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); for (target = 0; target < 4; target++) { - deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); - devicemap += 4; + deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); + devicemap += 4; } break; + case ACB_ADAPTER_TYPE_F: + devicemap = ARCMSR_FW_DEVMAP_OFFSET; + for (target = 0; target < 4; target++) + { + deviceMapCurrent[target] = acb->msgcode_rwbuffer[devicemap]; + devicemap += 1; + } + break; } if(acb->acb_flags & ACB_F_BUS_HANG_ON) @@ -1854,7 +1809,7 @@ static void arcmsr_dr_handle(struct AdapterControlBloc ** adapter posted CONFIG message ** copy the new map, note if there are differences with the current map */ - pDevMap = (u_int8_t *)&deviceMapCurrent[0]; + pDevMap = (u_int8_t *)&deviceMapCurrent[0]; for (target = 0; target < ARCMSR_MAX_TARGETID - 1; target++) { if (*pDevMap != acb->device_map[target]) @@ -2041,7 +1996,7 @@ static void arcmsr_hbd_doorbell_isr(struct AdapterCont static void arcmsr_hbe_doorbell_isr(struct AdapterControlBlock *acb) { u_int32_t doorbell_status, in_doorbell; - + /* ******************************************************************* ** Maybe here we need to check wrqbuffer_lock is lock or not @@ -2082,7 +2037,7 @@ static void arcmsr_hba_postqueue_isr(struct AdapterCon while((flag_srb = CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_queueport)) != 0xFFFFFFFF) { /* check if command done with no error*/ - error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0) ? TRUE : FALSE; + error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0) ? TRUE : FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } /*drain reply FIFO*/ } @@ -2111,7 +2066,7 @@ static void arcmsr_hbb_postqueue_isr(struct AdapterCon index %= ARCMSR_MAX_HBB_POSTQUEUE; /*if last index number set it to 0 */ phbbmu->doneq_index = index; /* check if command done with no error*/ - error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; + error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } /*drain reply FIFO*/ } @@ -2129,7 +2084,7 @@ static void arcmsr_hbc_postqueue_isr(struct AdapterCon ** areca cdb command done ***************************************************************************** */ - bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); + bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); do { flag_srb = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low); if (flag_srb == 0xFFFFFFFF) @@ -2139,7 +2094,7 @@ static void arcmsr_hbc_postqueue_isr(struct AdapterCon arcmsr_drain_donequeue(acb, flag_srb, error); throttling++; if(throttling == ARCMSR_HBC_ISR_THROTTLING_LEVEL) { - CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell,ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING); + CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING); throttling = 0; } } while(CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR); @@ -2212,7 +2167,7 @@ static void arcmsr_hbe_postqueue_isr(struct AdapterCon u_int16_t error; uint32_t doneq_index; uint16_t cmdSMID; - + /* ***************************************************************************** ** areca cdb command done @@ -2231,6 +2186,35 @@ static void arcmsr_hbe_postqueue_isr(struct AdapterCon acb->doneq_index = doneq_index; CHIP_REG_WRITE32(HBE_MessageUnit, 0, reply_post_consumer_index, doneq_index); } + +static void arcmsr_hbf_postqueue_isr(struct AdapterControlBlock *acb) +{ + uint16_t error; + uint32_t doneq_index; + uint16_t cmdSMID; + + /* + ***************************************************************************** + ** areca cdb command done + ***************************************************************************** + */ + bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + doneq_index = acb->doneq_index; + while (1) { + cmdSMID = acb->pCompletionQ[doneq_index].cmdSMID; + if (cmdSMID == 0xffff) + break; + error = (acb->pCompletionQ[doneq_index].cmdFlag & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1) ? TRUE : FALSE; + arcmsr_drain_donequeue(acb, (u_int32_t)cmdSMID, error); + acb->pCompletionQ[doneq_index].cmdSMID = 0xffff; + doneq_index++; + if (doneq_index >= acb->completionQ_entry) + doneq_index = 0; + } + acb->doneq_index = doneq_index; + CHIP_REG_WRITE32(HBF_MessageUnit, 0, reply_post_consumer_index, doneq_index); +} + /* ********************************************************************** ********************************************************************** @@ -2392,6 +2376,34 @@ static void arcmsr_handle_hbe_isr( struct AdapterContr host_interrupt_status = CHIP_REG_READ32(HBE_MessageUnit, 0, host_int_status); } while (host_interrupt_status & (ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR | ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR)); } + +static void arcmsr_handle_hbf_isr( struct AdapterControlBlock *acb) +{ + u_int32_t host_interrupt_status; + /* + ********************************************* + ** check outbound intstatus + ********************************************* + */ + host_interrupt_status = CHIP_REG_READ32(HBF_MessageUnit, 0, host_int_status) & + (ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR | + ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR); + if(!host_interrupt_status) { + /*it must be share irq*/ + return; + } + do { + /* MU doorbell interrupts*/ + if(host_interrupt_status & ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR) { + arcmsr_hbe_doorbell_isr(acb); + } + /* MU post queue interrupts*/ + if(host_interrupt_status & ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR) { + arcmsr_hbf_postqueue_isr(acb); + } + host_interrupt_status = CHIP_REG_READ32(HBF_MessageUnit, 0, host_int_status); + } while (host_interrupt_status & (ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR | ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR)); +} /* ****************************************************************************** ****************************************************************************** @@ -2414,6 +2426,9 @@ static void arcmsr_interrupt(struct AdapterControlBloc case ACB_ADAPTER_TYPE_E: arcmsr_handle_hbe_isr(acb); break; + case ACB_ADAPTER_TYPE_F: + arcmsr_handle_hbf_isr(acb); + break; default: printf("arcmsr%d: interrupt service," " unknown adapter type =%d\n", acb->pci_unit, acb->adapter_type); @@ -2444,7 +2459,7 @@ static void arcmsr_polling_devmap(void *arg) CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); break; - case ACB_ADAPTER_TYPE_B: { + case ACB_ADAPTER_TYPE_B: { struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_GET_CONFIG); } @@ -2459,13 +2474,24 @@ static void arcmsr_polling_devmap(void *arg) CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); break; - case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_E: CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); - break; - } + break; + case ACB_ADAPTER_TYPE_F: { + u_int32_t outMsg1 = CHIP_REG_READ32(HBF_MessageUnit, 0, outbound_msgaddr1); + if (!(outMsg1 & ARCMSR_HBFMU_MESSAGE_FIRMWARE_OK) || + (outMsg1 & ARCMSR_HBFMU_MESSAGE_NO_VOLUME_CHANGE)) + goto nxt6s; + CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBF_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + break; + } + } +nxt6s: if((acb->acb_flags & ACB_F_SCSISTOPADAPTER) == 0) { callout_reset(&acb->devmap_callout, 5 * hz, arcmsr_polling_devmap, acb); /* polling per 5 seconds */ @@ -3064,7 +3090,7 @@ static void arcmsr_handle_virtual_command(struct Adapt case INQUIRY: { unsigned char inqdata[36]; char *buffer = pccb->csio.data_ptr; - + inqdata[0] = T_PROCESSOR; /* Periph Qualifier & Periph Dev Type */ inqdata[1] = 0; /* rem media bit & Dev Type Modifier */ inqdata[2] = 0; /* ISO, ECMA, & ANSI versions */ @@ -3158,7 +3184,6 @@ static void arcmsr_action(struct cam_sim *psim, union strlcpy(cpi->hba_vid, "ARCMSR", HBA_IDLEN); strlcpy(cpi->dev_name, cam_sim_name(psim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(psim); - #ifdef CAM_NEW_TRAN_CODE if(acb->adapter_bus_speed == ACB_BUS_SPEED_12G) cpi->base_transfer_speed = 1200000; else if(acb->adapter_bus_speed == ACB_BUS_SPEED_6G) @@ -3181,14 +3206,13 @@ static void arcmsr_action(struct cam_sim *psim, union cpi->protocol_version = SCSI_REV_2; } cpi->protocol = PROTO_SCSI; - #endif cpi->ccb_h.status |= CAM_REQ_CMP; xpt_done(pccb); break; } case XPT_ABORT: { union ccb *pabort_ccb; - + pabort_ccb = pccb->cab.abort_ccb; switch (pabort_ccb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: @@ -3239,7 +3263,6 @@ static void arcmsr_action(struct cam_sim *psim, union break; } cts = &pccb->cts; - #ifdef CAM_NEW_TRAN_CODE { struct ccb_trans_settings_scsi *scsi; struct ccb_trans_settings_spi *spi; @@ -3286,22 +3309,6 @@ static void arcmsr_action(struct cam_sim *psim, union | CTS_SPI_VALID_BUS_WIDTH; } } - #else - { - cts->flags = (CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB); - if (acb->adapter_bus_speed == ACB_BUS_SPEED_6G) - cts->sync_period = 1; - else - cts->sync_period = 2; - cts->sync_offset = 32; - cts->bus_width = MSG_EXT_WDTR_BUS_16_BIT; - cts->valid = CCB_TRANS_SYNC_RATE_VALID | - CCB_TRANS_SYNC_OFFSET_VALID | - CCB_TRANS_BUS_WIDTH_VALID | - CCB_TRANS_DISC_VALID | - CCB_TRANS_TQ_VALID; - } - #endif pccb->ccb_h.status |= CAM_REQ_CMP; xpt_done(pccb); break; @@ -3317,38 +3324,7 @@ static void arcmsr_action(struct cam_sim *psim, union xpt_done(pccb); break; } -#if __FreeBSD_version >= 500000 cam_calc_geometry(&pccb->ccg, 1); -#else - { - struct ccb_calc_geometry *ccg; - u_int32_t size_mb; - u_int32_t secs_per_cylinder; - - ccg = &pccb->ccg; - if (ccg->block_size == 0) { - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - } - if(((1024L * 1024L)/ccg->block_size) < 0) { - pccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(pccb); - break; - } - size_mb = ccg->volume_size/((1024L * 1024L)/ccg->block_size); - if(size_mb > 1024 ) { - ccg->heads = 255; - ccg->secs_per_track = 63; - } else { - ccg->heads = 64; - ccg->secs_per_track = 32; - } - secs_per_cylinder = ccg->heads * ccg->secs_per_track; - ccg->cylinders = ccg->volume_size / secs_per_cylinder; - pccb->ccb_h.status |= CAM_REQ_CMP; - } -#endif xpt_done(pccb); break; default: @@ -3441,6 +3417,7 @@ static void arcmsr_start_adapter_bgrb(struct AdapterCo arcmsr_start_hbd_bgrb(acb); break; case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: arcmsr_start_hbe_bgrb(acb); break; } @@ -3582,7 +3559,7 @@ polling_ccb_retry: break; } if (acb->srboutstandingcount == 0) { - break; + break; } goto polling_ccb_retry; } @@ -3674,7 +3651,7 @@ static void arcmsr_polling_hbe_srbdone(struct AdapterC struct CommandControlBlock *srb; u_int32_t poll_srb_done=0, poll_count=0, doneq_index; u_int16_t error, cmdSMID; - + polling_ccb_retry: poll_count++; bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); @@ -3685,12 +3662,12 @@ polling_ccb_retry: break;/*chip FIFO no ccb for completion already*/ } else { UDELAY(25000); - if ((poll_count > 100) && (poll_srb != NULL)) { + if ((poll_count > 100) && (poll_srb != NULL)) { break; } - if (acb->srboutstandingcount == 0) { - break; - } + if (acb->srboutstandingcount == 0) { + break; + } goto polling_ccb_retry; } } @@ -3726,25 +3703,21 @@ polling_ccb_retry: static void arcmsr_polling_srbdone(struct AdapterControlBlock *acb, struct CommandControlBlock *poll_srb) { switch (acb->adapter_type) { - case ACB_ADAPTER_TYPE_A: { - arcmsr_polling_hba_srbdone(acb, poll_srb); - } + case ACB_ADAPTER_TYPE_A: + arcmsr_polling_hba_srbdone(acb, poll_srb); break; - case ACB_ADAPTER_TYPE_B: { - arcmsr_polling_hbb_srbdone(acb, poll_srb); - } + case ACB_ADAPTER_TYPE_B: + arcmsr_polling_hbb_srbdone(acb, poll_srb); break; - case ACB_ADAPTER_TYPE_C: { - arcmsr_polling_hbc_srbdone(acb, poll_srb); - } + case ACB_ADAPTER_TYPE_C: + arcmsr_polling_hbc_srbdone(acb, poll_srb); break; - case ACB_ADAPTER_TYPE_D: { - arcmsr_polling_hbd_srbdone(acb, poll_srb); - } + case ACB_ADAPTER_TYPE_D: + arcmsr_polling_hbd_srbdone(acb, poll_srb); break; - case ACB_ADAPTER_TYPE_E: { - arcmsr_polling_hbe_srbdone(acb, poll_srb); - } + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: + arcmsr_polling_hbe_srbdone(acb, poll_srb); break; } } @@ -3961,14 +3934,14 @@ static void arcmsr_get_hbe_config(struct AdapterContro size_t iop_firm_version = offsetof(struct HBE_MessageUnit,msgcode_rwbuffer[ARCMSR_FW_VERS_OFFSET]); /*firm_version,17,68-83*/ size_t iop_device_map = offsetof(struct HBE_MessageUnit,msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); int i; - + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); if(!arcmsr_hbe_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'get adapter firmware miscellaneous data' timeout \n", acb->pci_unit); } - + i = 0; while(i < 8) { *acb_firm_model = bus_space_read_1(acb->btag[0], acb->bhandle[0], iop_firm_model+i); @@ -4004,29 +3977,81 @@ static void arcmsr_get_hbe_config(struct AdapterContro ********************************************************************** ********************************************************************** */ +static void arcmsr_get_hbf_config(struct AdapterControlBlock *acb) +{ + u_int32_t *acb_firm_model = (u_int32_t *)acb->firm_model; + u_int32_t *acb_firm_version = (u_int32_t *)acb->firm_version; + u_int32_t *acb_device_map = (u_int32_t *)acb->device_map; + size_t iop_firm_model = ARCMSR_FW_MODEL_OFFSET; /*firm_model,15,60-67*/ + size_t iop_firm_version = ARCMSR_FW_VERS_OFFSET; /*firm_version,17,68-83*/ + size_t iop_device_map = ARCMSR_FW_DEVMAP_OFFSET; + int i; + + CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + if(!arcmsr_hbe_wait_msgint_ready(acb)) + printf("arcmsr%d: wait 'get adapter firmware miscellaneous data' timeout \n", acb->pci_unit); + + i = 0; + while(i < 2) { + *acb_firm_model = acb->msgcode_rwbuffer[iop_firm_model]; + /* 8 bytes firm_model, 15, 60-67*/ + acb_firm_model++; + iop_firm_model++; + i++; + } + i = 0; + while(i < 4) { + *acb_firm_version = acb->msgcode_rwbuffer[iop_firm_version]; + /* 16 bytes firm_version, 17, 68-83*/ + acb_firm_version++; + iop_firm_version++; + i++; + } + i = 0; + while(i < 4) { + *acb_device_map = acb->msgcode_rwbuffer[iop_device_map]; + acb_device_map++; + iop_device_map++; + i++; + } + printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version); + acb->firm_request_len = acb->msgcode_rwbuffer[1]; /*firm_request_len, 1, 04-07*/ + acb->firm_numbers_queue = acb->msgcode_rwbuffer[2]; /*firm_numbers_queue, 2, 08-11*/ + acb->firm_sdram_size = acb->msgcode_rwbuffer[3]; /*firm_sdram_size, 3, 12-15*/ + acb->firm_ide_channels = acb->msgcode_rwbuffer[4]; /*firm_ide_channels, 4, 16-19*/ + acb->firm_cfg_version = acb->msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]; /*firm_cfg_version, 25*/ + if(acb->firm_numbers_queue > ARCMSR_MAX_OUTSTANDING_CMD) + acb->maxOutstanding = ARCMSR_MAX_OUTSTANDING_CMD - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; +} +/* +********************************************************************** +********************************************************************** +*/ static void arcmsr_get_firmware_spec(struct AdapterControlBlock *acb) { switch (acb->adapter_type) { - case ACB_ADAPTER_TYPE_A: { - arcmsr_get_hba_config(acb); - } + case ACB_ADAPTER_TYPE_A: + arcmsr_get_hba_config(acb); break; - case ACB_ADAPTER_TYPE_B: { - arcmsr_get_hbb_config(acb); - } + case ACB_ADAPTER_TYPE_B: + arcmsr_get_hbb_config(acb); break; - case ACB_ADAPTER_TYPE_C: { - arcmsr_get_hbc_config(acb); - } + case ACB_ADAPTER_TYPE_C: + arcmsr_get_hbc_config(acb); break; - case ACB_ADAPTER_TYPE_D: { - arcmsr_get_hbd_config(acb); - } + case ACB_ADAPTER_TYPE_D: + arcmsr_get_hbd_config(acb); break; - case ACB_ADAPTER_TYPE_E: { - arcmsr_get_hbe_config(acb); - } + case ACB_ADAPTER_TYPE_E: + arcmsr_get_hbe_config(acb); break; + case ACB_ADAPTER_TYPE_F: + arcmsr_get_hbf_config(acb); + break; } } /* @@ -4088,7 +4113,8 @@ static void arcmsr_wait_firmware_ready( struct Adapter } } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { while ((CHIP_REG_READ32(HBE_MessageUnit, 0, outbound_msgaddr1) & ARCMSR_HBEMU_MESSAGE_FIRMWARE_OK) == 0) { if (timeout++ > 4000) /* (4000*15)/1000 = 60 sec */ @@ -4141,7 +4167,8 @@ static void arcmsr_clear_doorbell_queue_buffer( struct CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_doorbell, ARCMSR_HBDMU_DRV2IOP_DATA_OUT_READ); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { /* empty doorbell Qbuffer if door bell ringed */ acb->in_doorbell = CHIP_REG_READ32(HBE_MessageUnit, 0, iobound_doorbell); CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0); /*clear doorbell interrupt */ @@ -4276,6 +4303,27 @@ static u_int32_t arcmsr_iop_confirm(struct AdapterCont } } break; + case ACB_ADAPTER_TYPE_F: { + u_int32_t cdb_phyaddr_lo32; + cdb_phyaddr_lo32 = srb_phyaddr_lo32 + offsetof(struct CommandControlBlock, arcmsr_cdb); + acb->msgcode_rwbuffer[0] = ARCMSR_SIGNATURE_SET_CONFIG; + acb->msgcode_rwbuffer[1] = ARCMSR_SIGNATURE_1886; + acb->msgcode_rwbuffer[2] = cdb_phyaddr_lo32; + acb->msgcode_rwbuffer[3] = srb_phyaddr_hi32; + acb->msgcode_rwbuffer[4] = SRB_SIZE; + cdb_phyaddr_lo32 = srb_phyaddr_lo32 + ARCMSR_SRBS_POOL_SIZE; + acb->msgcode_rwbuffer[5] = cdb_phyaddr_lo32; + acb->msgcode_rwbuffer[6] = srb_phyaddr_hi32; + acb->msgcode_rwbuffer[7] = COMPLETION_Q_POOL_SIZE; + CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_SET_CONFIG); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBF_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + if(!arcmsr_hbe_wait_msgint_ready(acb)) { + printf( "arcmsr%d: 'set srb high part physical address' timeout \n", acb->pci_unit); + return FALSE; + } + } + break; } return (TRUE); } @@ -4339,7 +4387,7 @@ static void arcmsr_map_free_srb(void *arg, bus_dma_seg return; } if((acb->adapter_type == ACB_ADAPTER_TYPE_C) || (acb->adapter_type == ACB_ADAPTER_TYPE_D) - || (acb->adapter_type == ACB_ADAPTER_TYPE_E)) + || (acb->adapter_type == ACB_ADAPTER_TYPE_E) || (acb->adapter_type == ACB_ADAPTER_TYPE_F)) { srb_tmp->cdb_phyaddr_low = srb_phyaddr; srb_tmp->cdb_phyaddr_high = (u_int32_t)((srb_phyaddr >> 16) >> 16); @@ -4354,6 +4402,15 @@ static void arcmsr_map_free_srb(void *arg, bus_dma_seg } if (acb->adapter_type == ACB_ADAPTER_TYPE_E) acb->pCompletionQ = (pCompletion_Q)srb_tmp; + else if (acb->adapter_type == ACB_ADAPTER_TYPE_F) { + acb->pCompletionQ = (pCompletion_Q)srb_tmp; + acb->completeQ_phys = srb_phyaddr; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Mon Nov 9 01:52:17 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B4552E47A2; Mon, 9 Nov 2020 01:52:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTvBS6jJrz3Prj; Mon, 9 Nov 2020 01:52:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D921415BF; Mon, 9 Nov 2020 01:52:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A91qGeo033833; Mon, 9 Nov 2020 01:52:16 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A91qFEh032323; Mon, 9 Nov 2020 01:52:15 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202011090152.0A91qFEh032323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Nov 2020 01:52:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367510 - in stable/12: include lib/libc/stdlib X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/12: include lib/libc/stdlib X-SVN-Commit-Revision: 367510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 01:52:17 -0000 Author: delphij Date: Mon Nov 9 01:52:15 2020 New Revision: 367510 URL: https://svnweb.freebsd.org/changeset/base/367510 Log: MFC r366781, r366866: Implement ptsname_r. Modified: stable/12/include/stdlib.h stable/12/lib/libc/stdlib/Makefile.inc stable/12/lib/libc/stdlib/Symbol.map stable/12/lib/libc/stdlib/ptsname.3 stable/12/lib/libc/stdlib/ptsname.c Directory Properties: stable/12/ (props changed) Modified: stable/12/include/stdlib.h ============================================================================== --- stable/12/include/stdlib.h Mon Nov 9 01:41:55 2020 (r367509) +++ stable/12/include/stdlib.h Mon Nov 9 01:52:15 2020 (r367510) @@ -207,7 +207,6 @@ double drand48(void); double erand48(unsigned short[3]); /* char *fcvt(double, int, int * __restrict, int * __restrict); */ /* char *gcvt(double, int, int * __restrict, int * __restrict); */ -int grantpt(int); char *initstate(unsigned int, char *, size_t); long jrand48(unsigned short[3]); char *l64a(long); @@ -219,8 +218,6 @@ char *mktemp(char *); #endif long mrand48(void); long nrand48(unsigned short[3]); -int posix_openpt(int); -char *ptsname(int); int putenv(char *); long random(void); unsigned short @@ -228,8 +225,18 @@ unsigned short char *setstate(/* const */ char *); void srand48(long); void srandom(unsigned int); +#endif /* __XSI_VISIBLE */ + +#if __XSI_VISIBLE +int grantpt(int); +int posix_openpt(int); +char *ptsname(int); int unlockpt(int); #endif /* __XSI_VISIBLE */ +#if __BSD_VISIBLE +/* ptsname_r will be included in POSIX issue 8 */ +int ptsname_r(int, char *, size_t); +#endif #if __BSD_VISIBLE extern const char *malloc_conf; Modified: stable/12/lib/libc/stdlib/Makefile.inc ============================================================================== --- stable/12/lib/libc/stdlib/Makefile.inc Mon Nov 9 01:41:55 2020 (r367509) +++ stable/12/lib/libc/stdlib/Makefile.inc Mon Nov 9 01:52:15 2020 (r367510) @@ -50,7 +50,7 @@ MLINKS+=hcreate.3 hdestroy.3 hcreate.3 hsearch.3 MLINKS+=hcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 hsearch_r.3 MLINKS+=insque.3 remque.3 MLINKS+=lsearch.3 lfind.3 -MLINKS+=ptsname.3 grantpt.3 ptsname.3 unlockpt.3 +MLINKS+=ptsname.3 grantpt.3 ptsname.3 ptsname_r.3 ptsname.3 unlockpt.3 MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3 qsort.3 qsort_r.3 MLINKS+=rand.3 rand_r.3 rand.3 srand.3 rand.3 sranddev.3 MLINKS+=random.3 initstate.3 random.3 setstate.3 random.3 srandom.3 \ Modified: stable/12/lib/libc/stdlib/Symbol.map ============================================================================== --- stable/12/lib/libc/stdlib/Symbol.map Mon Nov 9 01:41:55 2020 (r367509) +++ stable/12/lib/libc/stdlib/Symbol.map Mon Nov 9 01:52:15 2020 (r367510) @@ -124,6 +124,10 @@ FBSD_1.5 { set_constraint_handler_s; }; +FBSD_1.6 { + ptsname_r; +}; + FBSDprivate_1.0 { __system; _system; Modified: stable/12/lib/libc/stdlib/ptsname.3 ============================================================================== --- stable/12/lib/libc/stdlib/ptsname.3 Mon Nov 9 01:41:55 2020 (r367509) +++ stable/12/lib/libc/stdlib/ptsname.3 Mon Nov 9 01:52:15 2020 (r367510) @@ -31,12 +31,13 @@ .\" .\" $FreeBSD$ .\" -.Dd August 20, 2008 +.Dd October 17, 2020 .Dt PTSNAME 3 .Os .Sh NAME .Nm grantpt , .Nm ptsname , +.Nm ptsname_r , .Nm unlockpt .Nd pseudo-terminal access functions .Sh LIBRARY @@ -47,6 +48,8 @@ .Fn grantpt "int fildes" .Ft "char *" .Fn ptsname "int fildes" +.Ft "int" +.Fn ptsname_r "int fildes" "char *buffer" "size_t buflen" .Ft int .Fn unlockpt "int fildes" .Sh DESCRIPTION @@ -87,12 +90,23 @@ and have been called. .Pp The +.Fn ptsname_r +function is the thread-safe version of +.Fn ptsname . +The caller must provide storage for the results of the full pathname of +the slave device in the +.Fa buffer +and +.Fa bufsize +arguments. +.Pp +The .Fn unlockpt function clears the lock held on the pseudo-terminal pair for the master device specified with .Fa fildes . .Sh RETURN VALUES -.Rv -std grantpt unlockpt +.Rv -std grantpt ptsname_r unlockpt .Pp The .Fn ptsname @@ -103,7 +117,8 @@ pointer is returned. .Sh ERRORS The .Fn grantpt , -.Fn ptsname +.Fn ptsname , +.Fn ptsname_r and .Fn unlockpt functions may fail and set @@ -116,6 +131,16 @@ is not a valid open file descriptor. .It Bq Er EINVAL .Fa fildes is not a master pseudo-terminal device. +.El +.Pp +In addition, the +.Fn ptsname_r +function may set +.Va errno +to: +.Bl -tag -width Er +.It Bq Er ERANGE +The buffer was too small. .El .Pp In addition, the Modified: stable/12/lib/libc/stdlib/ptsname.c ============================================================================== --- stable/12/lib/libc/stdlib/ptsname.c Mon Nov 9 01:41:55 2020 (r367509) +++ stable/12/lib/libc/stdlib/ptsname.c Mon Nov 9 01:52:15 2020 (r367510) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "un-namespace.h" /* @@ -71,23 +72,48 @@ __strong_reference(__isptmaster, grantpt); __strong_reference(__isptmaster, unlockpt); /* + * ptsname_r(): return the pathname of the slave pseudo-terminal device + * associated with the specified master. + */ +int +__ptsname_r(int fildes, char *buffer, size_t buflen) +{ + + if (buflen <= sizeof(_PATH_DEV)) { + errno = ERANGE; + return (-1); + } + + /* Make sure fildes points to a master device. */ + if (__isptmaster(fildes) != 0) + return (-1); + + memcpy(buffer, _PATH_DEV, sizeof(_PATH_DEV)); + buffer += sizeof(_PATH_DEV) - 1; + buflen -= sizeof(_PATH_DEV) - 1; + + if (fdevname_r(fildes, buffer, buflen) == NULL) { + if (errno == EINVAL) + errno = ERANGE; + return (-1); + } + + return (0); +} + +__strong_reference(__ptsname_r, ptsname_r); + +/* * ptsname(): return the pathname of the slave pseudo-terminal device * associated with the specified master. */ char * ptsname(int fildes) { - static char pt_slave[sizeof _PATH_DEV + SPECNAMELEN] = _PATH_DEV; - char *ret = NULL; + static char pt_slave[sizeof(_PATH_DEV) + SPECNAMELEN]; - /* Make sure fildes points to a master device. */ - if (__isptmaster(fildes) != 0) - goto done; + if (__ptsname_r(fildes, pt_slave, sizeof(pt_slave)) == 0) + return (pt_slave); - if (fdevname_r(fildes, pt_slave + (sizeof _PATH_DEV - 1), - sizeof pt_slave - (sizeof _PATH_DEV - 1)) != NULL) - ret = pt_slave; - -done: - return (ret); + return (NULL); } From owner-svn-src-stable@freebsd.org Mon Nov 9 01:55:30 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B9FA2E48DB; Mon, 9 Nov 2020 01:55:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTvGB3cxmz3Pxg; Mon, 9 Nov 2020 01:55:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F3F5193F; Mon, 9 Nov 2020 01:55:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A91tUJh035419; Mon, 9 Nov 2020 01:55:30 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A91tUcU035418; Mon, 9 Nov 2020 01:55:30 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202011090155.0A91tUcU035418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Nov 2020 01:55:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367511 - stable/12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/sys/sys X-SVN-Commit-Revision: 367511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 01:55:30 -0000 Author: delphij Date: Mon Nov 9 01:55:30 2020 New Revision: 367511 URL: https://svnweb.freebsd.org/changeset/base/367511 Log: Bump __FreeBSD_version after ptsname_r addition. Modified: stable/12/sys/sys/param.h Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Mon Nov 9 01:52:15 2020 (r367510) +++ stable/12/sys/sys/param.h Mon Nov 9 01:55:30 2020 (r367511) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1202503 /* Master, propagated to newvers */ +#define __FreeBSD_version 1202504 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable@freebsd.org Mon Nov 9 01:56:07 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFA482E4C1E; Mon, 9 Nov 2020 01:56:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTvGv55zMz3QHM; Mon, 9 Nov 2020 01:56:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1DAA181A; Mon, 9 Nov 2020 01:56:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A91u7ut035497; Mon, 9 Nov 2020 01:56:07 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A91u6Ce035493; Mon, 9 Nov 2020 01:56:06 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202011090156.0A91u6Ce035493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Nov 2020 01:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367512 - in stable/11: include lib/libc/stdlib X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/11: include lib/libc/stdlib X-SVN-Commit-Revision: 367512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 01:56:07 -0000 Author: delphij Date: Mon Nov 9 01:56:06 2020 New Revision: 367512 URL: https://svnweb.freebsd.org/changeset/base/367512 Log: MFC r366781, r366866: Implement ptsname_r. Modified: stable/11/include/stdlib.h stable/11/lib/libc/stdlib/Makefile.inc stable/11/lib/libc/stdlib/Symbol.map stable/11/lib/libc/stdlib/ptsname.3 stable/11/lib/libc/stdlib/ptsname.c Directory Properties: stable/11/ (props changed) Modified: stable/11/include/stdlib.h ============================================================================== --- stable/11/include/stdlib.h Mon Nov 9 01:55:30 2020 (r367511) +++ stable/11/include/stdlib.h Mon Nov 9 01:56:06 2020 (r367512) @@ -205,7 +205,6 @@ double drand48(void); double erand48(unsigned short[3]); /* char *fcvt(double, int, int * __restrict, int * __restrict); */ /* char *gcvt(double, int, int * __restrict, int * __restrict); */ -int grantpt(int); char *initstate(unsigned long /* XSI requires u_int */, char *, long); long jrand48(unsigned short[3]); char *l64a(long); @@ -217,8 +216,6 @@ char *mktemp(char *); #endif long mrand48(void); long nrand48(unsigned short[3]); -int posix_openpt(int); -char *ptsname(int); int putenv(char *); long random(void); unsigned short @@ -230,8 +227,18 @@ int setkey(const char *); char *setstate(/* const */ char *); void srand48(long); void srandom(unsigned long); +#endif /* __XSI_VISIBLE */ + +#if __XSI_VISIBLE +int grantpt(int); +int posix_openpt(int); +char *ptsname(int); int unlockpt(int); #endif /* __XSI_VISIBLE */ +#if __BSD_VISIBLE +/* ptsname_r will be included in POSIX issue 8 */ +int ptsname_r(int, char *, size_t); +#endif #if __BSD_VISIBLE extern const char *malloc_conf; Modified: stable/11/lib/libc/stdlib/Makefile.inc ============================================================================== --- stable/11/lib/libc/stdlib/Makefile.inc Mon Nov 9 01:55:30 2020 (r367511) +++ stable/11/lib/libc/stdlib/Makefile.inc Mon Nov 9 01:56:06 2020 (r367512) @@ -50,7 +50,7 @@ MLINKS+=hcreate.3 hdestroy.3 hcreate.3 hsearch.3 MLINKS+=hcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 hsearch_r.3 MLINKS+=insque.3 remque.3 MLINKS+=lsearch.3 lfind.3 -MLINKS+=ptsname.3 grantpt.3 ptsname.3 unlockpt.3 +MLINKS+=ptsname.3 grantpt.3 ptsname.3 ptsname_r.3 ptsname.3 unlockpt.3 MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3 qsort.3 qsort_r.3 MLINKS+=rand.3 rand_r.3 rand.3 srand.3 rand.3 sranddev.3 MLINKS+=random.3 initstate.3 random.3 setstate.3 random.3 srandom.3 \ Modified: stable/11/lib/libc/stdlib/Symbol.map ============================================================================== --- stable/11/lib/libc/stdlib/Symbol.map Mon Nov 9 01:55:30 2020 (r367511) +++ stable/11/lib/libc/stdlib/Symbol.map Mon Nov 9 01:56:06 2020 (r367512) @@ -124,6 +124,10 @@ FBSD_1.5 { set_constraint_handler_s; }; +FBSD_1.6 { + ptsname_r; +}; + FBSDprivate_1.0 { __system; _system; Modified: stable/11/lib/libc/stdlib/ptsname.3 ============================================================================== --- stable/11/lib/libc/stdlib/ptsname.3 Mon Nov 9 01:55:30 2020 (r367511) +++ stable/11/lib/libc/stdlib/ptsname.3 Mon Nov 9 01:56:06 2020 (r367512) @@ -31,12 +31,13 @@ .\" .\" $FreeBSD$ .\" -.Dd August 20, 2008 +.Dd October 17, 2020 .Dt PTSNAME 3 .Os .Sh NAME .Nm grantpt , .Nm ptsname , +.Nm ptsname_r , .Nm unlockpt .Nd pseudo-terminal access functions .Sh LIBRARY @@ -47,6 +48,8 @@ .Fn grantpt "int fildes" .Ft "char *" .Fn ptsname "int fildes" +.Ft "int" +.Fn ptsname_r "int fildes" "char *buffer" "size_t buflen" .Ft int .Fn unlockpt "int fildes" .Sh DESCRIPTION @@ -87,12 +90,23 @@ and have been called. .Pp The +.Fn ptsname_r +function is the thread-safe version of +.Fn ptsname . +The caller must provide storage for the results of the full pathname of +the slave device in the +.Fa buffer +and +.Fa bufsize +arguments. +.Pp +The .Fn unlockpt function clears the lock held on the pseudo-terminal pair for the master device specified with .Fa fildes . .Sh RETURN VALUES -.Rv -std grantpt unlockpt +.Rv -std grantpt ptsname_r unlockpt .Pp The .Fn ptsname @@ -103,7 +117,8 @@ pointer is returned. .Sh ERRORS The .Fn grantpt , -.Fn ptsname +.Fn ptsname , +.Fn ptsname_r and .Fn unlockpt functions may fail and set @@ -116,6 +131,16 @@ is not a valid open file descriptor. .It Bq Er EINVAL .Fa fildes is not a master pseudo-terminal device. +.El +.Pp +In addition, the +.Fn ptsname_r +function may set +.Va errno +to: +.Bl -tag -width Er +.It Bq Er ERANGE +The buffer was too small. .El .Pp In addition, the Modified: stable/11/lib/libc/stdlib/ptsname.c ============================================================================== --- stable/11/lib/libc/stdlib/ptsname.c Mon Nov 9 01:55:30 2020 (r367511) +++ stable/11/lib/libc/stdlib/ptsname.c Mon Nov 9 01:56:06 2020 (r367512) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "un-namespace.h" /* @@ -69,23 +70,48 @@ __strong_reference(__isptmaster, grantpt); __strong_reference(__isptmaster, unlockpt); /* + * ptsname_r(): return the pathname of the slave pseudo-terminal device + * associated with the specified master. + */ +int +__ptsname_r(int fildes, char *buffer, size_t buflen) +{ + + if (buflen <= sizeof(_PATH_DEV)) { + errno = ERANGE; + return (-1); + } + + /* Make sure fildes points to a master device. */ + if (__isptmaster(fildes) != 0) + return (-1); + + memcpy(buffer, _PATH_DEV, sizeof(_PATH_DEV)); + buffer += sizeof(_PATH_DEV) - 1; + buflen -= sizeof(_PATH_DEV) - 1; + + if (fdevname_r(fildes, buffer, buflen) == NULL) { + if (errno == EINVAL) + errno = ERANGE; + return (-1); + } + + return (0); +} + +__strong_reference(__ptsname_r, ptsname_r); + +/* * ptsname(): return the pathname of the slave pseudo-terminal device * associated with the specified master. */ char * ptsname(int fildes) { - static char pt_slave[sizeof _PATH_DEV + SPECNAMELEN] = _PATH_DEV; - char *ret = NULL; + static char pt_slave[sizeof(_PATH_DEV) + SPECNAMELEN]; - /* Make sure fildes points to a master device. */ - if (__isptmaster(fildes) != 0) - goto done; + if (__ptsname_r(fildes, pt_slave, sizeof(pt_slave)) == 0) + return (pt_slave); - if (fdevname_r(fildes, pt_slave + (sizeof _PATH_DEV - 1), - sizeof pt_slave - (sizeof _PATH_DEV - 1)) != NULL) - ret = pt_slave; - -done: - return (ret); + return (NULL); } From owner-svn-src-stable@freebsd.org Mon Nov 9 01:57:08 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 595772E4967; Mon, 9 Nov 2020 01:57:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTvJ426LGz3QC8; Mon, 9 Nov 2020 01:57:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B1DC1A0A; Mon, 9 Nov 2020 01:57:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A91v8jk035586; Mon, 9 Nov 2020 01:57:08 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A91v8WY035585; Mon, 9 Nov 2020 01:57:08 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202011090157.0A91v8WY035585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Nov 2020 01:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367513 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 367513 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 01:57:08 -0000 Author: delphij Date: Mon Nov 9 01:57:07 2020 New Revision: 367513 URL: https://svnweb.freebsd.org/changeset/base/367513 Log: Bump __FreeBSD_version after ptsname_r addition. Modified: stable/11/sys/sys/param.h Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Mon Nov 9 01:56:06 2020 (r367512) +++ stable/11/sys/sys/param.h Mon Nov 9 01:57:07 2020 (r367513) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1104509 /* Master, propagated to newvers */ +#define __FreeBSD_version 1104510 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable@freebsd.org Mon Nov 9 05:17:28 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FF792E7BD9; Mon, 9 Nov 2020 05:17:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTzlD3d45z3p3Z; Mon, 9 Nov 2020 05:17:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E88B4162; Mon, 9 Nov 2020 05:17:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A95HS37054280; Mon, 9 Nov 2020 05:17:28 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A95HNbP054254; Mon, 9 Nov 2020 05:17:23 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202011090517.0A95HNbP054254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Nov 2020 05:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367515 - stable/12/contrib/less X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/contrib/less X-SVN-Commit-Revision: 367515 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 05:17:28 -0000 Author: delphij Date: Mon Nov 9 05:17:23 2020 New Revision: 367515 URL: https://svnweb.freebsd.org/changeset/base/367515 Log: MFC r367005: MFV r366990: less v563. Relnotes: yes Modified: stable/12/contrib/less/NEWS stable/12/contrib/less/README stable/12/contrib/less/brac.c stable/12/contrib/less/ch.c stable/12/contrib/less/charset.c stable/12/contrib/less/charset.h stable/12/contrib/less/cmd.h stable/12/contrib/less/cmdbuf.c stable/12/contrib/less/command.c stable/12/contrib/less/compose.uni stable/12/contrib/less/cvt.c stable/12/contrib/less/decode.c stable/12/contrib/less/edit.c stable/12/contrib/less/filename.c stable/12/contrib/less/fmt.uni stable/12/contrib/less/forwback.c stable/12/contrib/less/funcs.h stable/12/contrib/less/help.c stable/12/contrib/less/ifile.c stable/12/contrib/less/input.c stable/12/contrib/less/jump.c stable/12/contrib/less/less.h stable/12/contrib/less/less.nro stable/12/contrib/less/lessecho.c stable/12/contrib/less/lessecho.nro stable/12/contrib/less/lesskey.c stable/12/contrib/less/lesskey.h stable/12/contrib/less/lesskey.nro stable/12/contrib/less/lglob.h stable/12/contrib/less/line.c stable/12/contrib/less/linenum.c stable/12/contrib/less/lsystem.c stable/12/contrib/less/main.c stable/12/contrib/less/mark.c stable/12/contrib/less/mkutable stable/12/contrib/less/optfunc.c stable/12/contrib/less/option.c stable/12/contrib/less/option.h stable/12/contrib/less/opttbl.c stable/12/contrib/less/os.c stable/12/contrib/less/output.c stable/12/contrib/less/pattern.c stable/12/contrib/less/pattern.h stable/12/contrib/less/pckeys.h stable/12/contrib/less/position.c stable/12/contrib/less/position.h stable/12/contrib/less/prompt.c stable/12/contrib/less/screen.c stable/12/contrib/less/scrsize.c stable/12/contrib/less/search.c stable/12/contrib/less/signal.c stable/12/contrib/less/tags.c stable/12/contrib/less/ttyin.c stable/12/contrib/less/ubin.uni stable/12/contrib/less/version.c stable/12/contrib/less/wide.uni Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/less/NEWS ============================================================================== --- stable/12/contrib/less/NEWS Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/NEWS Mon Nov 9 05:17:23 2020 (r367515) @@ -11,6 +11,31 @@ ====================================================================== + Major changes between "less" versions 551 and 563 + +* Update Unicode tables. + +* Treat Hangul Jamo medial vowels and final consonants as zero width. + +* Display error message immediately when -o is toggled and + input is not a pipe. + +* Fix regression: make screen repaint when "squished" and + a no-movement command is given. + +* Fix erroneous EOF calculation when F command is interrupted. + +* Make WIN32C version include this fix from 551: + Don't count lines in initial screen if using -X with -F. + +* Fix display bug in WIN32C version. + +* Fix memory corruption when built with libtermcap. + +* Support libtinfow. + +====================================================================== + Major changes between "less" versions 530 and 551 * Add --mouse option. Modified: stable/12/contrib/less/README ============================================================================== --- stable/12/contrib/less/README Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/README Mon Nov 9 05:17:23 2020 (r367515) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 551 + Less, version 563 - This is the distribution of less, version 551, released 11 Jun 2019. + This is the distribution of less, version 563, released 13 Jun 2020. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -32,6 +32,14 @@ This is the distribution of "less", a paginator simila The formatted manual page is in less.man. The manual page nroff source is in less.nro. Major changes made since the last posted version are in NEWS. + +======================================================================= +PRE-INSTALLATION (when using git) + +If you are building from a clone of a git repository, +type "make -f Makefile.aut". +If you are building from a numbered release package (a tar or zip file +with a name like less-999.tar.gz or less-999.zip), you should skip this step. ======================================================================= INSTALLATION (Unix systems only): Modified: stable/12/contrib/less/brac.c ============================================================================== --- stable/12/contrib/less/brac.c Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/brac.c Mon Nov 9 05:17:23 2020 (r367515) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/12/contrib/less/ch.c ============================================================================== --- stable/12/contrib/less/ch.c Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/ch.c Mon Nov 9 05:17:23 2020 (r367515) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -408,6 +408,7 @@ end_logfile(VOID_PARAM) } close(logfile); logfile = -1; + free(namelogfile); namelogfile = NULL; } @@ -842,7 +843,8 @@ seekable(f) public void ch_set_eof(VOID_PARAM) { - ch_fsize = ch_fpos; + if (ch_fsize != NULL_POSITION && ch_fsize < ch_fpos) + ch_fsize = ch_fpos; } Modified: stable/12/contrib/less/charset.c ============================================================================== --- stable/12/contrib/less/charset.c Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/charset.c Mon Nov 9 05:17:23 2020 (r367515) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -509,7 +509,7 @@ prutfchar(ch) */ public int utf_len(ch) - unsigned char ch; + int ch; { if ((ch & 0x80) == 0) return 1; Modified: stable/12/contrib/less/charset.h ============================================================================== --- stable/12/contrib/less/charset.h Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/charset.h Mon Nov 9 05:17:23 2020 (r367515) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/12/contrib/less/cmd.h ============================================================================== --- stable/12/contrib/less/cmd.h Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/cmd.h Mon Nov 9 05:17:23 2020 (r367515) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/12/contrib/less/cmdbuf.c ============================================================================== --- stable/12/contrib/less/cmdbuf.c Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/cmdbuf.c Mon Nov 9 05:17:23 2020 (r367515) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -34,7 +34,7 @@ static int literal; /* Next input char should not be static int updown_match = -1; /* Prefix length in up/down movement */ #if TAB_COMPLETE_FILENAME -static int cmd_complete(); +static int cmd_complete LESSPARAMS((int action)); /* * These variables are statics used by cmd_complete. */ @@ -960,10 +960,7 @@ cmd_istr(str) step_char(&s, +1, endline); action = cmd_ichar(os, s - os); if (action != CC_OK) - { - bell(); return (action); - } } return (CC_OK); } Modified: stable/12/contrib/less/command.c ============================================================================== --- stable/12/contrib/less/command.c Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/command.c Mon Nov 9 05:17:23 2020 (r367515) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -90,7 +90,7 @@ struct ungot { }; static struct ungot* ungot = NULL; -static void multi_search(); +static void multi_search LESSPARAMS((char *pattern, int n, int silent)); /* * Move the cursor to start of prompt line before executing a command. @@ -1806,6 +1806,12 @@ commands(VOID_PARAM) optgetname = FALSE; mca_opt_toggle(); c = getcc(); + cbuf = opt_toggle_disallowed(c); + if (cbuf != NULL) + { + error(cbuf, NULL_PARG); + break; + } goto again; case A_DISP_OPTION: Modified: stable/12/contrib/less/compose.uni ============================================================================== --- stable/12/contrib/less/compose.uni Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/compose.uni Mon Nov 9 05:17:23 2020 (r367515) @@ -1,4 +1,4 @@ -/* Generated by "./mkutable -f2 Mn Me -- unicode/UnicodeData.txt" on Wed Feb 13 17:57:05 PST 2019 */ +/* Generated by "./mkutable -f2 Mn Me -- unicode/UnicodeData.txt" on Tue May 19 14:47:34 PDT 2020 */ { 0x0300, 0x036f }, /* Mn */ { 0x0483, 0x0487 }, /* Mn */ { 0x0488, 0x0489 }, /* Me */ @@ -58,7 +58,7 @@ { 0x0b3f, 0x0b3f }, /* Mn */ { 0x0b41, 0x0b44 }, /* Mn */ { 0x0b4d, 0x0b4d }, /* Mn */ - { 0x0b56, 0x0b56 }, /* Mn */ + { 0x0b55, 0x0b56 }, /* Mn */ { 0x0b62, 0x0b63 }, /* Mn */ { 0x0b82, 0x0b82 }, /* Mn */ { 0x0bc0, 0x0bc0 }, /* Mn */ @@ -81,6 +81,7 @@ { 0x0d41, 0x0d44 }, /* Mn */ { 0x0d4d, 0x0d4d }, /* Mn */ { 0x0d62, 0x0d63 }, /* Mn */ + { 0x0d81, 0x0d81 }, /* Mn */ { 0x0dca, 0x0dca }, /* Mn */ { 0x0dd2, 0x0dd4 }, /* Mn */ { 0x0dd6, 0x0dd6 }, /* Mn */ @@ -88,8 +89,7 @@ { 0x0e34, 0x0e3a }, /* Mn */ { 0x0e47, 0x0e4e }, /* Mn */ { 0x0eb1, 0x0eb1 }, /* Mn */ - { 0x0eb4, 0x0eb9 }, /* Mn */ - { 0x0ebb, 0x0ebc }, /* Mn */ + { 0x0eb4, 0x0ebc }, /* Mn */ { 0x0ec8, 0x0ecd }, /* Mn */ { 0x0f18, 0x0f19 }, /* Mn */ { 0x0f35, 0x0f35 }, /* Mn */ @@ -112,6 +112,7 @@ { 0x1085, 0x1086 }, /* Mn */ { 0x108d, 0x108d }, /* Mn */ { 0x109d, 0x109d }, /* Mn */ + { 0x1160, 0x11ff }, /* Mn */ { 0x135d, 0x135f }, /* Mn */ { 0x1712, 0x1714 }, /* Mn */ { 0x1732, 0x1734 }, /* Mn */ @@ -140,6 +141,7 @@ { 0x1a7f, 0x1a7f }, /* Mn */ { 0x1ab0, 0x1abd }, /* Mn */ { 0x1abe, 0x1abe }, /* Me */ + { 0x1abf, 0x1ac0 }, /* Mn */ { 0x1b00, 0x1b03 }, /* Mn */ { 0x1b34, 0x1b34 }, /* Mn */ { 0x1b36, 0x1b3a }, /* Mn */ @@ -183,6 +185,7 @@ { 0xa806, 0xa806 }, /* Mn */ { 0xa80b, 0xa80b }, /* Mn */ { 0xa825, 0xa826 }, /* Mn */ + { 0xa82c, 0xa82c }, /* Mn */ { 0xa8c4, 0xa8c5 }, /* Mn */ { 0xa8e0, 0xa8f1 }, /* Mn */ { 0xa8ff, 0xa8ff }, /* Mn */ @@ -191,7 +194,7 @@ { 0xa980, 0xa982 }, /* Mn */ { 0xa9b3, 0xa9b3 }, /* Mn */ { 0xa9b6, 0xa9b9 }, /* Mn */ - { 0xa9bc, 0xa9bc }, /* Mn */ + { 0xa9bc, 0xa9bd }, /* Mn */ { 0xa9e5, 0xa9e5 }, /* Mn */ { 0xaa29, 0xaa2e }, /* Mn */ { 0xaa31, 0xaa32 }, /* Mn */ @@ -209,6 +212,8 @@ { 0xabe5, 0xabe5 }, /* Mn */ { 0xabe8, 0xabe8 }, /* Mn */ { 0xabed, 0xabed }, /* Mn */ + { 0xd7b0, 0xd7c6 }, /* Mn */ + { 0xd7cb, 0xd7fb }, /* Mn */ { 0xfb1e, 0xfb1e }, /* Mn */ { 0xfe00, 0xfe0f }, /* Mn */ { 0xfe20, 0xfe2f }, /* Mn */ @@ -222,6 +227,7 @@ { 0x10a3f, 0x10a3f }, /* Mn */ { 0x10ae5, 0x10ae6 }, /* Mn */ { 0x10d24, 0x10d27 }, /* Mn */ + { 0x10eab, 0x10eac }, /* Mn */ { 0x10f46, 0x10f50 }, /* Mn */ { 0x11001, 0x11001 }, /* Mn */ { 0x11038, 0x11046 }, /* Mn */ @@ -235,6 +241,7 @@ { 0x11180, 0x11181 }, /* Mn */ { 0x111b6, 0x111be }, /* Mn */ { 0x111c9, 0x111cc }, /* Mn */ + { 0x111cf, 0x111cf }, /* Mn */ { 0x1122f, 0x11231 }, /* Mn */ { 0x11234, 0x11234 }, /* Mn */ { 0x11236, 0x11237 }, /* Mn */ @@ -270,6 +277,12 @@ { 0x11727, 0x1172b }, /* Mn */ { 0x1182f, 0x11837 }, /* Mn */ { 0x11839, 0x1183a }, /* Mn */ + { 0x1193b, 0x1193c }, /* Mn */ + { 0x1193e, 0x1193e }, /* Mn */ + { 0x11943, 0x11943 }, /* Mn */ + { 0x119d4, 0x119d7 }, /* Mn */ + { 0x119da, 0x119db }, /* Mn */ + { 0x119e0, 0x119e0 }, /* Mn */ { 0x11a01, 0x11a0a }, /* Mn */ { 0x11a33, 0x11a38 }, /* Mn */ { 0x11a3b, 0x11a3e }, /* Mn */ @@ -296,7 +309,9 @@ { 0x11ef3, 0x11ef4 }, /* Mn */ { 0x16af0, 0x16af4 }, /* Mn */ { 0x16b30, 0x16b36 }, /* Mn */ + { 0x16f4f, 0x16f4f }, /* Mn */ { 0x16f8f, 0x16f92 }, /* Mn */ + { 0x16fe4, 0x16fe4 }, /* Mn */ { 0x1bc9d, 0x1bc9e }, /* Mn */ { 0x1d167, 0x1d169 }, /* Mn */ { 0x1d17b, 0x1d182 }, /* Mn */ @@ -314,6 +329,9 @@ { 0x1e01b, 0x1e021 }, /* Mn */ { 0x1e023, 0x1e024 }, /* Mn */ { 0x1e026, 0x1e02a }, /* Mn */ + { 0x1e130, 0x1e136 }, /* Mn */ + { 0x1e2ae, 0x1e2ae }, /* Mn */ + { 0x1e2ec, 0x1e2ef }, /* Mn */ { 0x1e8d0, 0x1e8d6 }, /* Mn */ { 0x1e944, 0x1e94a }, /* Mn */ { 0xe0100, 0xe01ef }, /* Mn */ Modified: stable/12/contrib/less/cvt.c ============================================================================== --- stable/12/contrib/less/cvt.c Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/cvt.c Mon Nov 9 05:17:23 2020 (r367515) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/12/contrib/less/decode.c ============================================================================== --- stable/12/contrib/less/decode.c Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/decode.c Mon Nov 9 05:17:23 2020 (r367515) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/12/contrib/less/edit.c ============================================================================== --- stable/12/contrib/less/edit.c Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/edit.c Mon Nov 9 05:17:23 2020 (r367515) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -854,7 +854,6 @@ loop: /* * Don't do anything. */ - free(filename); return; case 'q': quit(QUIT_OK); Modified: stable/12/contrib/less/filename.c ============================================================================== --- stable/12/contrib/less/filename.c Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/filename.c Mon Nov 9 05:17:23 2020 (r367515) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -795,7 +795,7 @@ lglob(filename) } /* - * @@@ + * Return canonical pathname. */ public char * lrealpath(path) Modified: stable/12/contrib/less/fmt.uni ============================================================================== --- stable/12/contrib/less/fmt.uni Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/fmt.uni Mon Nov 9 05:17:23 2020 (r367515) @@ -1,4 +1,4 @@ -/* Generated by "./mkutable -f2 Cf -- unicode/UnicodeData.txt" on Wed Feb 13 17:57:05 PST 2019 */ +/* Generated by "./mkutable -f2 Cf -- unicode/UnicodeData.txt" on Tue May 19 14:47:34 PDT 2020 */ { 0x00ad, 0x00ad }, /* Cf */ { 0x0600, 0x0605 }, /* Cf */ { 0x061c, 0x061c }, /* Cf */ @@ -14,6 +14,7 @@ { 0xfff9, 0xfffb }, /* Cf */ { 0x110bd, 0x110bd }, /* Cf */ { 0x110cd, 0x110cd }, /* Cf */ + { 0x13430, 0x13438 }, /* Cf */ { 0x1bca0, 0x1bca3 }, /* Cf */ { 0x1d173, 0x1d17a }, /* Cf */ { 0xe0001, 0xe0001 }, /* Cf */ Modified: stable/12/contrib/less/forwback.c ============================================================================== --- stable/12/contrib/less/forwback.c Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/forwback.c Mon Nov 9 05:17:23 2020 (r367515) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -21,7 +21,6 @@ public int screen_trashed; public int squished; public int no_back_scroll = 0; public int forw_prompt; -public int same_pos_bell = 1; extern int sigs; extern int top_scroll; @@ -290,7 +289,7 @@ forw(n, pos, force, only_last, nblank) forw_prompt = 1; } - if (nlines == 0 && !ignore_eoi && same_pos_bell) + if (nlines == 0 && !ignore_eoi) eof_bell(); else if (do_repaint) repaint(); @@ -350,7 +349,7 @@ back(n, pos, force, only_last) } } - if (nlines == 0 && same_pos_bell) + if (nlines == 0) eof_bell(); else if (do_repaint) repaint(); Modified: stable/12/contrib/less/funcs.h ============================================================================== --- stable/12/contrib/less/funcs.h Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/funcs.h Mon Nov 9 05:17:23 2020 (r367515) @@ -61,7 +61,7 @@ public int binary_char LESSPARAMS ((LWCHAR c)); public int control_char LESSPARAMS ((LWCHAR c)); public char * prchar LESSPARAMS ((LWCHAR c)); public char * prutfchar LESSPARAMS ((LWCHAR ch)); -public int utf_len LESSPARAMS ((unsigned char ch)); +public int utf_len LESSPARAMS ((int ch)); public int is_utf8_well_formed LESSPARAMS ((char *ss, int slen)); public void utf_skip_to_lead LESSPARAMS ((char **pp, char *limit)); public LWCHAR get_wchar LESSPARAMS ((constant char *p)); @@ -187,10 +187,10 @@ public void pshift_all LESSPARAMS ((VOID_PARAM)); public int is_ansi_end LESSPARAMS ((LWCHAR ch)); public int is_ansi_middle LESSPARAMS ((LWCHAR ch)); public void skip_ansi LESSPARAMS ((char **pp, constant char *limit)); -public int pappend LESSPARAMS ((unsigned char c, POSITION pos)); +public int pappend LESSPARAMS ((int c, POSITION pos)); public int pflushmbc LESSPARAMS ((VOID_PARAM)); public void pdone LESSPARAMS ((int endline, int chopped, int forw)); -public void set_status_col LESSPARAMS ((char c)); +public void set_status_col LESSPARAMS ((int c)); public int gline LESSPARAMS ((int i, int *ap)); public void null_line LESSPARAMS ((VOID_PARAM)); public POSITION forw_raw_line LESSPARAMS ((POSITION curr_pos, char **linep, int *line_lenp)); @@ -243,6 +243,7 @@ public void scan_option LESSPARAMS ((char *s)); public void toggle_option LESSPARAMS ((struct loption *o, int lower, char *s, int how_toggle)); public int opt_has_param LESSPARAMS ((struct loption *o)); public char * opt_prompt LESSPARAMS ((struct loption *o)); +public char * opt_toggle_disallowed LESSPARAMS ((int c)); public int isoptpending LESSPARAMS ((VOID_PARAM)); public void nopendopt LESSPARAMS ((VOID_PARAM)); public int getnum LESSPARAMS ((char **sp, char *printopt, int *errp)); Modified: stable/12/contrib/less/help.c ============================================================================== --- stable/12/contrib/less/help.c Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/help.c Mon Nov 9 05:17:23 2020 (r367515) @@ -1,4 +1,4 @@ -/* This file was generated by mkhelp.pl from less.hlp at 18:12 on 2019/6/11 */ +/* This file was generated by mkhelp.pl from less.hlp at 3:34 on 2020/6/14 */ #include "less.h" constant char helpdata[] = { '\n', Modified: stable/12/contrib/less/ifile.c ============================================================================== --- stable/12/contrib/less/ifile.c Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/ifile.c Mon Nov 9 05:17:23 2020 (r367515) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/12/contrib/less/input.c ============================================================================== --- stable/12/contrib/less/input.c Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/input.c Mon Nov 9 05:17:23 2020 (r367515) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/12/contrib/less/jump.c ============================================================================== --- stable/12/contrib/less/jump.c Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/jump.c Mon Nov 9 05:17:23 2020 (r367515) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -219,7 +219,7 @@ jump_loc(pos, sline) nline -= sindex; if (nline > 0) forw(nline, position(BOTTOM_PLUS_ONE), 1, 0, 0); - else if (nline < 0) + else back(-nline, position(TOP), 1, 0); #if HILITE_SEARCH if (show_attn) Modified: stable/12/contrib/less/less.h ============================================================================== --- stable/12/contrib/less/less.h Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/less.h Mon Nov 9 05:17:23 2020 (r367515) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/12/contrib/less/less.nro ============================================================================== --- stable/12/contrib/less/less.nro Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/less.nro Mon Nov 9 05:17:23 2020 (r367515) @@ -1,4 +1,5 @@ -.TH LESS 1 "Version 551: 11 Jun 2019" +'\" t +.TH LESS 1 "Version 563: 13 Jun 2020" .SH NAME less \- opposite of more .SH SYNOPSIS @@ -21,19 +22,18 @@ less \- opposite of more .B " [\-# \fIshift\/\fP] [+[+]\fIcmd\/\fP] [\-\-] [\fIfilename\/\fP]..." .br (See the OPTIONS section for alternate option syntax with long option names.) - +. .SH DESCRIPTION .I Less is a program similar to -.I more -(1), but which allows backward movement +.IR more (1), +but which allows backward movement in the file as well as forward movement. Also, .I less does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like -.I vi -(1). +.IR vi (1). .I Less uses termcap (or terminfo on some systems), so it can run on a variety of terminals. @@ -48,7 +48,7 @@ and Commands may be preceded by a decimal number, called N in the descriptions below. The number is used by some commands, as indicated. - +. .SH COMMANDS In the following descriptions, ^X means control-X. ESC stands for the ESCAPE key; for example ESC-v means the @@ -229,7 +229,7 @@ that is, do a simple textual comparison. .RE .IP ?pattern Search backward in the file for the N-th line containing the pattern. -The search starts at the last line displayed +The search starts at the last line displayed (but see the \-a and \-j options, which change this). .sp Certain characters are special as in the / command: @@ -376,7 +376,7 @@ this will reset the option to the "opposite" of its de and print a message describing the new setting. This does not work for numeric or string-valued options. .IP \-\-! -Like the \-! command, but takes a long option name +Like the \-!\& command, but takes a long option name rather than a single option letter. .IP _ (Underscore.) @@ -405,7 +405,7 @@ Exits The following four commands may or may not be valid, depending on your particular installation. -.PP +. .IP v Invokes an editor to edit the current file being viewed. The editor is taken from the environment variable VISUAL if defined, @@ -425,7 +425,7 @@ On MS-DOS and OS/2 systems, the shell is the normal co .IP "| shell-command" represents any mark letter. Pipes a section of the input file to the given shell command. -The section of the file to be piped is between the position marked by +The section of the file to be piped is between the position marked by the letter and the current screen. The entire current screen is included, regardless of whether the marked position is before or after the current screen. @@ -434,7 +434,7 @@ If is \&.\& or newline, the current screen is pipe .IP "s filename" Save the input to a file. This only works if the input is a pipe, not an ordinary file. -.PP +. .SH OPTIONS Command line options are described below. Most options may be changed while @@ -518,7 +518,7 @@ This was the default behavior in less versions prior t Specifies the amount of buffer space .I less will use for each file, in units of kilobytes (1024 bytes). -By default 64\ K of buffer space is used for each file +By default 64\ KB of buffer space is used for each file (unless the file is a pipe; see the \-B option). The \-b option specifies instead that \fIn\fP kilobytes of buffer space should be used for each file. @@ -530,7 +530,7 @@ buffers are allocated automatically as needed. If a large amount of data is read from the pipe, this can cause a large amount of memory to be allocated. The \-B option disables this automatic allocation of buffers for pipes, -so that only 64\ K +so that only 64\ KB (or the amount of space specified by the \-b option) is used for the pipe. Warning: use of \-B can result in erroneous display, since only the @@ -563,8 +563,9 @@ A single number \fIN\fP is the same as \fIN.M\fP, where \fIM\fP is the normal background color. The color may start or end with \fBu\fP to use underline (with the normal color, if by itself), if the system supports it (Windows only). -\fBx\fP may also be \fBa\fP to toggle strict ANSI sequence rendering (SGR mode). - +\fBx\fP may also be \fBa\fP to toggle strict ANSI sequence rendering +(SGR mode). +. .IP "\-e or \-\-quit-at-eof" Causes .I less @@ -654,8 +655,8 @@ The status column is also used if the \-w or \-W optio Causes .I less to open and interpret the named file as a -.I lesskey -(1) file. +.IR lesskey (1) +file. Multiple \-k options may be specified. If the LESSKEY or LESSKEY_SYSTEM environment variable is set, or if a lesskey file is found in a standard place (see KEY BINDINGS), @@ -746,7 +747,7 @@ to that string. \-Ph changes the prompt for the help screen. \-P= changes the message printed by the = command. \-Pw changes the message printed while waiting for data (in the F command). - +.sp 1 All prompt strings consist of a sequence of letters and special escape sequences. See the section on PROMPTS for more details. @@ -762,7 +763,7 @@ The default is to ring the terminal bell in all such c .IP "\-Q or \-\-QUIET or \-\-SILENT" Causes totally "quiet" operation: the terminal bell is never rung. -If the terminal has a "visual bell", it is used in all cases +If the terminal has a "visual bell", it is used in all cases where the terminal bell would have been rung. .IP "\-r or \-\-raw-control-chars" Causes "raw" control characters to be displayed. @@ -804,7 +805,7 @@ output. Causes lines longer than the screen width to be chopped (truncated) rather than wrapped. That is, the portion of a long line that does not fit in -the screen width is not shown. +the screen width is not displayed until you press RIGHT-ARROW. The default is to wrap long lines; that is, display the remainder on the next line. .IP "\-t\fItag\fP or \-\-tag=\fItag\fP" @@ -813,12 +814,12 @@ will edit the file containing that tag. For this to work, tag information must be available; for example, there may be a file in the current directory called "tags", which was previously built by -.I ctags -(1) or an equivalent command. +.IR ctags (1) +or an equivalent command. If the environment variable LESSGLOBALTAGS is set, it is taken to be the name of a command compatible with -.I global -(1), and that command is executed to find the tag. +.IR global (1), +and that command is executed to find the tag. (See http://www.gnu.org/software/global/global.html). The \-t option may also be specified from within .I less @@ -870,7 +871,7 @@ If only one \fIn\fP is specified, tab stops are set at If multiple values separated by commas are specified, tab stops are set at those positions, and then continue with the same spacing as the last two. -For example, \fI-x9,17\fP will set tabs at positions 9, 17, 25, 33, etc. +For example, \fI\-x9,17\fP will set tabs at positions 9, 17, 25, 33, etc. The default for \fIn\fP is 8. .IP "\-X or \-\-no-init" Disables sending the termcap initialization and deinitialization strings @@ -944,15 +945,15 @@ will display the contents of that new file. Enables mouse input: scrolling the mouse wheel down moves forward in the file, scrolling the mouse wheel up moves backwards in the file, -and clicking the mouse sets the "#" mark to the line +and clicking the mouse sets the "#" mark to the line where the mouse is clicked. -The number of lines to scroll when the wheel is moved +The number of lines to scroll when the wheel is moved can be set by the \-\-wheel-lines option. Mouse input works only on terminals which support X11 mouse reporting, -and on the Windows version of +and on the Windows version of .IR less . .IP "\-\-MOUSE" -Like \-\-mouse, except the direction scrolled +Like \-\-mouse, except the direction scrolled on mouse wheel movement is reversed. .IP "\-\-no-keypad" Disables sending the keypad initialization and deinitialization strings @@ -961,7 +962,7 @@ This is sometimes useful if the keypad strings make th keypad behave in an undesirable manner. .IP "\-\-no-histdups" This option changes the behavior so that if a search string or -file name is typed in, and the same string is already in the history list, +file name is typed in, and the same string is already in the history list, the existing copy is removed from the history list before the new one is added. Thus, a given string will appear only once in the history list. Normally, a string may appear multiple times. @@ -969,7 +970,7 @@ Normally, a string may appear multiple times. This option changes the character used to mark truncated lines. It may begin with a two-character attribute indicator like LESSBINFMT does. If there is no attribute indicator, standout is used. -If set to "-", truncated lines are not marked. +If set to "\-", truncated lines are not marked. .IP "\-\-save-marks" Save marks in the history file, so marks are retained across different invocations of \fIless\fP. @@ -1001,7 +1002,7 @@ If the option starts with ++, the initial command appl every file being viewed, not just the first one. The + command described previously may also be used to set (or change) an initial command for every file. - +. .SH "LINE EDITING" When entering command line at the bottom of the screen (for example, a filename for the :e command, @@ -1069,13 +1070,12 @@ If you have changed your line-kill character in Unix t other than ^U, that character is used instead of ^U. .IP "^G" Delete the entire command line and return to the main prompt. - +. .SH "KEY BINDINGS" You may define your own .I less commands by using the program -.I lesskey -(1) +.IR lesskey (1) to create a lesskey file. This file specifies a set of command keys and an action associated with each key. @@ -1125,7 +1125,7 @@ was built with a different sysconf directory than /usr that directory is where the sysless file is found.) On MS-DOS and Windows systems, the system-wide lesskey file is c:\e_sysless. On OS/2 systems, the system-wide lesskey file is c:\esysless.ini. - +. .SH "INPUT PREPROCESSOR" You may define an "input preprocessor" for .IR less . @@ -1294,7 +1294,7 @@ Similarly, if the first two characters of LESSOPEN are the input pipe is used on standard input as well as other files. Again, in this case the dash is not considered to be part of the input pipe command. - +. .SH "NATIONAL CHARACTER SETS" There are three types of characters in the input file: .IP "normal characters" @@ -1349,7 +1349,7 @@ In this case, the environment variable LESSCHARDEF can to define a character set. It should be set to a string where each character in the string represents one character in the character set. -The character "." is used for a normal character, "c" for control, +The character ".\&" is used for a normal character, "c" for control, and "b" for binary. A decimal number may be used for repetition. For example, "bccc4b.\&" would mean character 0 is binary, @@ -1361,26 +1361,22 @@ represent any real character set.) .PP This table shows the value of LESSCHARDEF which is equivalent to each of the possible values for LESSCHARSET: -.sp - ascii\ 8bcccbcc18b95.b -.br - dos\ \ \ 8bcccbcc12bc5b95.b. -.br - ebcdic 5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b -.br - \ \ \ \ \ \ 9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b. -.br - IBM-1047 4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc -.br - \ \ \ \ \ \ 191.b -.br - iso8859 8bcccbcc18b95.33b. -.br - koi8-r 8bcccbcc18b95.b128. -.br - latin1 8bcccbcc18b95.33b. -.br - next\ \ 8bcccbcc18b95.bb125.bb +. +.RS 5m +.TS +l l. +ascii 8bcccbcc18b95.b +dos 8bcccbcc12bc5b95.b. +ebcdic 5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b + 9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b. +IBM-1047 4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc + 191.b +iso8859 8bcccbcc18b95.33b. +koi8-r 8bcccbcc18b95.b128. +latin1 8bcccbcc18b95.33b. +next 8bcccbcc18b95.bb125.bb +.TE +.RE .PP If neither LESSCHARSET nor LESSCHARDEF is set, but any of the strings "UTF-8", "UTF8", "utf-8" or "utf8" @@ -1429,11 +1425,11 @@ setting ("*x") so specifying one will affect both; LESSUTFBINFMT is read after LESSBINFMT so its setting, if any, will have priority. Problematic octets in a UTF-8 file (octets of a truncated sequence, -octets of a complete but non-shortest form sequence, illegal octets, +octets of a complete but non-shortest form sequence, invalid octets, and stray trailing octets) are displayed individually using LESSBINFMT so as to facilitate diagnostic of how the UTF-8 file is ill-formed. - +. .SH "PROMPTS" The \-P option allows you to tailor the prompt to your preference. The string given to the \-P option replaces the specified prompt string. @@ -1500,7 +1496,8 @@ Causes any trailing spaces to be removed. Usually used at the end of the string, but may appear anywhere. .IP "%T" Normally expands to the word "file". -However if viewing files via a tags list using the \-t option, it expands to the word "tag". +However if viewing files via a tags list using the \-t option, +it expands to the word "tag". .IP "%x" Replaced by the name of the next input file in the list. .PP @@ -1620,7 +1617,7 @@ line number, followed by the shell-escaped file name. If your editor does not accept the "+linenumber" syntax, or has other differences in invocation syntax, the LESSEDIT variable can be changed to modify this default. - +. .SH SECURITY When the environment variable LESSSECURE is set to 1, .I less @@ -1641,14 +1638,14 @@ log files use of lesskey files .IP "\-t" use of tags files -.IP " " +.IP metacharacters in filenames, such as * -.IP " " +.IP filename completion (TAB, ^L) .RE .PP Less can also be compiled to be permanently in "secure" mode. - +. .SH "COMPATIBILITY WITH MORE" If the environment variable LESS_IS_MORE is set to 1, or if the program is invoked via a file link named "more", @@ -1666,7 +1663,7 @@ behaves as if the \-E option were set. .PP The \-m option works differently. If the \-m option is not set, the medium prompt is used, -and it is prefixed with the string "--More--". +and it is prefixed with the string "\-\-More\-\-". If the \-m option is set, the short prompt is used. .PP The \-n option acts like the \-z option. @@ -1678,12 +1675,12 @@ command rather than a search pattern. .PP The LESS environment variable is ignored, and the MORE environment variable is used in its place. - +. .SH "ENVIRONMENT VARIABLES" Environment variables may be specified either in the system environment as usual, or in a -.I lesskey -(1) file. +.IR lesskey (1) +file. If environment variables are defined in more than one place, variables defined in a local lesskey file take precedence over variables defined in the system environment, which take precedence @@ -1738,8 +1735,8 @@ See discussion under PROMPTS. .IP LESSGLOBALTAGS Name of the command used by the \-t option to find global tags. Normally should be set to "global" if your system has the -.I global -(1) command. If not set, global tags are not used. +.IR global (1) +command. If not set, global tags are not used. .IP LESSHISTFILE Name of the history file used to remember search commands and shell commands between invocations of @@ -1752,9 +1749,13 @@ on OS/2 systems. The maximum number of commands to save in the history file. The default is 100. .IP LESSKEY -Name of the default lesskey(1) file. +Name of the default +.IR lesskey (1) +file. .IP LESSKEY_SYSTEM -Name of the default system-wide lesskey(1) file. +Name of the default system-wide +.IR lesskey (1) +file. .IP LESSMETACHARS List of characters which are considered "metacharacters" by the shell. .IP LESSMETAESCAPE @@ -1773,8 +1774,8 @@ String to be appended to a directory name in filename Format for displaying non-printable Unicode code points. .IP LESS_IS_MORE Emulate the -.I more -(1) command. +.IR more (1) +command. .IP LINES Sets the number of lines on the screen. Takes precedence over the number of lines specified by the TERM variable. @@ -1791,19 +1792,19 @@ compatible mode. User's search path (used to find a lesskey file on MS-DOS and OS/2 systems). .IP SHELL -The shell used to execute the ! command, as well as to expand filenames. +The shell used to execute the !\& command, as well as to expand filenames. .IP TERM The type of terminal on which .I less is being run. .IP VISUAL The name of the editor (used for the v command). - +. .SH "SEE ALSO" -lesskey(1) - +.BR lesskey (1) +. .SH COPYRIGHT -Copyright (C) 1984-2019 Mark Nudelman +Copyright (C) 1984-2020 Mark Nudelman .PP less is part of the GNU project and is free software. You can redistribute it and/or modify it @@ -1823,9 +1824,9 @@ less is distributed in the hope that it will be useful WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - +. .SH AUTHOR -.PP +. Mark Nudelman .br Report bugs at https://github.com/gwsw/less/issues. Modified: stable/12/contrib/less/lessecho.c ============================================================================== --- stable/12/contrib/less/lessecho.c Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/lessecho.c Mon Nov 9 05:17:23 2020 (r367515) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/12/contrib/less/lessecho.nro ============================================================================== --- stable/12/contrib/less/lessecho.nro Mon Nov 9 03:02:34 2020 (r367514) +++ stable/12/contrib/less/lessecho.nro Mon Nov 9 05:17:23 2020 (r367515) @@ -1,4 +1,4 @@ -.TH LESSECHO 1 "Version 551: 11 Jun 2019" +.TH LESSECHO 1 "Version 563: 13 Jun 2020" .SH NAME lessecho \- expand metacharacters .SH SYNOPSIS @@ -44,7 +44,7 @@ Specifies "n" to be the escape char for metachars, as Specifies that all arguments are to be quoted. The default is that only arguments containing metacharacters are quoted .SH "SEE ALSO" -less(1) +.BR less (1) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Mon Nov 9 05:20:08 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2681D2E7771; Mon, 9 Nov 2020 05:20:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CTzpJ0XYRz3pCM; Mon, 9 Nov 2020 05:20:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00BE34208; Mon, 9 Nov 2020 05:20:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A95K7j4054479; Mon, 9 Nov 2020 05:20:07 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A95K2o3054447; Mon, 9 Nov 2020 05:20:02 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202011090520.0A95K2o3054447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Nov 2020 05:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367516 - stable/11/contrib/less X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/contrib/less X-SVN-Commit-Revision: 367516 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 05:20:08 -0000 Author: delphij Date: Mon Nov 9 05:20:02 2020 New Revision: 367516 URL: https://svnweb.freebsd.org/changeset/base/367516 Log: MFC r367005: MFV r366990: less v563. Relnotes: yes Modified: stable/11/contrib/less/NEWS stable/11/contrib/less/README stable/11/contrib/less/brac.c stable/11/contrib/less/ch.c stable/11/contrib/less/charset.c stable/11/contrib/less/charset.h stable/11/contrib/less/cmd.h stable/11/contrib/less/cmdbuf.c stable/11/contrib/less/command.c stable/11/contrib/less/compose.uni stable/11/contrib/less/cvt.c stable/11/contrib/less/decode.c stable/11/contrib/less/edit.c stable/11/contrib/less/filename.c stable/11/contrib/less/fmt.uni stable/11/contrib/less/forwback.c stable/11/contrib/less/funcs.h stable/11/contrib/less/help.c stable/11/contrib/less/ifile.c stable/11/contrib/less/input.c stable/11/contrib/less/jump.c stable/11/contrib/less/less.h stable/11/contrib/less/less.nro stable/11/contrib/less/lessecho.c stable/11/contrib/less/lessecho.nro stable/11/contrib/less/lesskey.c stable/11/contrib/less/lesskey.h stable/11/contrib/less/lesskey.nro stable/11/contrib/less/lglob.h stable/11/contrib/less/line.c stable/11/contrib/less/linenum.c stable/11/contrib/less/lsystem.c stable/11/contrib/less/main.c stable/11/contrib/less/mark.c stable/11/contrib/less/mkutable stable/11/contrib/less/optfunc.c stable/11/contrib/less/option.c stable/11/contrib/less/option.h stable/11/contrib/less/opttbl.c stable/11/contrib/less/os.c stable/11/contrib/less/output.c stable/11/contrib/less/pattern.c stable/11/contrib/less/pattern.h stable/11/contrib/less/pckeys.h stable/11/contrib/less/position.c stable/11/contrib/less/position.h stable/11/contrib/less/prompt.c stable/11/contrib/less/screen.c stable/11/contrib/less/scrsize.c stable/11/contrib/less/search.c stable/11/contrib/less/signal.c stable/11/contrib/less/tags.c stable/11/contrib/less/ttyin.c stable/11/contrib/less/ubin.uni stable/11/contrib/less/version.c stable/11/contrib/less/wide.uni Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/less/NEWS ============================================================================== --- stable/11/contrib/less/NEWS Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/NEWS Mon Nov 9 05:20:02 2020 (r367516) @@ -11,6 +11,31 @@ ====================================================================== + Major changes between "less" versions 551 and 563 + +* Update Unicode tables. + +* Treat Hangul Jamo medial vowels and final consonants as zero width. + +* Display error message immediately when -o is toggled and + input is not a pipe. + +* Fix regression: make screen repaint when "squished" and + a no-movement command is given. + +* Fix erroneous EOF calculation when F command is interrupted. + +* Make WIN32C version include this fix from 551: + Don't count lines in initial screen if using -X with -F. + +* Fix display bug in WIN32C version. + +* Fix memory corruption when built with libtermcap. + +* Support libtinfow. + +====================================================================== + Major changes between "less" versions 530 and 551 * Add --mouse option. Modified: stable/11/contrib/less/README ============================================================================== --- stable/11/contrib/less/README Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/README Mon Nov 9 05:20:02 2020 (r367516) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 551 + Less, version 563 - This is the distribution of less, version 551, released 11 Jun 2019. + This is the distribution of less, version 563, released 13 Jun 2020. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -32,6 +32,14 @@ This is the distribution of "less", a paginator simila The formatted manual page is in less.man. The manual page nroff source is in less.nro. Major changes made since the last posted version are in NEWS. + +======================================================================= +PRE-INSTALLATION (when using git) + +If you are building from a clone of a git repository, +type "make -f Makefile.aut". +If you are building from a numbered release package (a tar or zip file +with a name like less-999.tar.gz or less-999.zip), you should skip this step. ======================================================================= INSTALLATION (Unix systems only): Modified: stable/11/contrib/less/brac.c ============================================================================== --- stable/11/contrib/less/brac.c Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/brac.c Mon Nov 9 05:20:02 2020 (r367516) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/11/contrib/less/ch.c ============================================================================== --- stable/11/contrib/less/ch.c Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/ch.c Mon Nov 9 05:20:02 2020 (r367516) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -408,6 +408,7 @@ end_logfile(VOID_PARAM) } close(logfile); logfile = -1; + free(namelogfile); namelogfile = NULL; } @@ -842,7 +843,8 @@ seekable(f) public void ch_set_eof(VOID_PARAM) { - ch_fsize = ch_fpos; + if (ch_fsize != NULL_POSITION && ch_fsize < ch_fpos) + ch_fsize = ch_fpos; } Modified: stable/11/contrib/less/charset.c ============================================================================== --- stable/11/contrib/less/charset.c Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/charset.c Mon Nov 9 05:20:02 2020 (r367516) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -509,7 +509,7 @@ prutfchar(ch) */ public int utf_len(ch) - unsigned char ch; + int ch; { if ((ch & 0x80) == 0) return 1; Modified: stable/11/contrib/less/charset.h ============================================================================== --- stable/11/contrib/less/charset.h Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/charset.h Mon Nov 9 05:20:02 2020 (r367516) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/11/contrib/less/cmd.h ============================================================================== --- stable/11/contrib/less/cmd.h Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/cmd.h Mon Nov 9 05:20:02 2020 (r367516) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/11/contrib/less/cmdbuf.c ============================================================================== --- stable/11/contrib/less/cmdbuf.c Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/cmdbuf.c Mon Nov 9 05:20:02 2020 (r367516) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -34,7 +34,7 @@ static int literal; /* Next input char should not be static int updown_match = -1; /* Prefix length in up/down movement */ #if TAB_COMPLETE_FILENAME -static int cmd_complete(); +static int cmd_complete LESSPARAMS((int action)); /* * These variables are statics used by cmd_complete. */ @@ -960,10 +960,7 @@ cmd_istr(str) step_char(&s, +1, endline); action = cmd_ichar(os, s - os); if (action != CC_OK) - { - bell(); return (action); - } } return (CC_OK); } Modified: stable/11/contrib/less/command.c ============================================================================== --- stable/11/contrib/less/command.c Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/command.c Mon Nov 9 05:20:02 2020 (r367516) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -90,7 +90,7 @@ struct ungot { }; static struct ungot* ungot = NULL; -static void multi_search(); +static void multi_search LESSPARAMS((char *pattern, int n, int silent)); /* * Move the cursor to start of prompt line before executing a command. @@ -1806,6 +1806,12 @@ commands(VOID_PARAM) optgetname = FALSE; mca_opt_toggle(); c = getcc(); + cbuf = opt_toggle_disallowed(c); + if (cbuf != NULL) + { + error(cbuf, NULL_PARG); + break; + } goto again; case A_DISP_OPTION: Modified: stable/11/contrib/less/compose.uni ============================================================================== --- stable/11/contrib/less/compose.uni Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/compose.uni Mon Nov 9 05:20:02 2020 (r367516) @@ -1,4 +1,4 @@ -/* Generated by "./mkutable -f2 Mn Me -- unicode/UnicodeData.txt" on Wed Feb 13 17:57:05 PST 2019 */ +/* Generated by "./mkutable -f2 Mn Me -- unicode/UnicodeData.txt" on Tue May 19 14:47:34 PDT 2020 */ { 0x0300, 0x036f }, /* Mn */ { 0x0483, 0x0487 }, /* Mn */ { 0x0488, 0x0489 }, /* Me */ @@ -58,7 +58,7 @@ { 0x0b3f, 0x0b3f }, /* Mn */ { 0x0b41, 0x0b44 }, /* Mn */ { 0x0b4d, 0x0b4d }, /* Mn */ - { 0x0b56, 0x0b56 }, /* Mn */ + { 0x0b55, 0x0b56 }, /* Mn */ { 0x0b62, 0x0b63 }, /* Mn */ { 0x0b82, 0x0b82 }, /* Mn */ { 0x0bc0, 0x0bc0 }, /* Mn */ @@ -81,6 +81,7 @@ { 0x0d41, 0x0d44 }, /* Mn */ { 0x0d4d, 0x0d4d }, /* Mn */ { 0x0d62, 0x0d63 }, /* Mn */ + { 0x0d81, 0x0d81 }, /* Mn */ { 0x0dca, 0x0dca }, /* Mn */ { 0x0dd2, 0x0dd4 }, /* Mn */ { 0x0dd6, 0x0dd6 }, /* Mn */ @@ -88,8 +89,7 @@ { 0x0e34, 0x0e3a }, /* Mn */ { 0x0e47, 0x0e4e }, /* Mn */ { 0x0eb1, 0x0eb1 }, /* Mn */ - { 0x0eb4, 0x0eb9 }, /* Mn */ - { 0x0ebb, 0x0ebc }, /* Mn */ + { 0x0eb4, 0x0ebc }, /* Mn */ { 0x0ec8, 0x0ecd }, /* Mn */ { 0x0f18, 0x0f19 }, /* Mn */ { 0x0f35, 0x0f35 }, /* Mn */ @@ -112,6 +112,7 @@ { 0x1085, 0x1086 }, /* Mn */ { 0x108d, 0x108d }, /* Mn */ { 0x109d, 0x109d }, /* Mn */ + { 0x1160, 0x11ff }, /* Mn */ { 0x135d, 0x135f }, /* Mn */ { 0x1712, 0x1714 }, /* Mn */ { 0x1732, 0x1734 }, /* Mn */ @@ -140,6 +141,7 @@ { 0x1a7f, 0x1a7f }, /* Mn */ { 0x1ab0, 0x1abd }, /* Mn */ { 0x1abe, 0x1abe }, /* Me */ + { 0x1abf, 0x1ac0 }, /* Mn */ { 0x1b00, 0x1b03 }, /* Mn */ { 0x1b34, 0x1b34 }, /* Mn */ { 0x1b36, 0x1b3a }, /* Mn */ @@ -183,6 +185,7 @@ { 0xa806, 0xa806 }, /* Mn */ { 0xa80b, 0xa80b }, /* Mn */ { 0xa825, 0xa826 }, /* Mn */ + { 0xa82c, 0xa82c }, /* Mn */ { 0xa8c4, 0xa8c5 }, /* Mn */ { 0xa8e0, 0xa8f1 }, /* Mn */ { 0xa8ff, 0xa8ff }, /* Mn */ @@ -191,7 +194,7 @@ { 0xa980, 0xa982 }, /* Mn */ { 0xa9b3, 0xa9b3 }, /* Mn */ { 0xa9b6, 0xa9b9 }, /* Mn */ - { 0xa9bc, 0xa9bc }, /* Mn */ + { 0xa9bc, 0xa9bd }, /* Mn */ { 0xa9e5, 0xa9e5 }, /* Mn */ { 0xaa29, 0xaa2e }, /* Mn */ { 0xaa31, 0xaa32 }, /* Mn */ @@ -209,6 +212,8 @@ { 0xabe5, 0xabe5 }, /* Mn */ { 0xabe8, 0xabe8 }, /* Mn */ { 0xabed, 0xabed }, /* Mn */ + { 0xd7b0, 0xd7c6 }, /* Mn */ + { 0xd7cb, 0xd7fb }, /* Mn */ { 0xfb1e, 0xfb1e }, /* Mn */ { 0xfe00, 0xfe0f }, /* Mn */ { 0xfe20, 0xfe2f }, /* Mn */ @@ -222,6 +227,7 @@ { 0x10a3f, 0x10a3f }, /* Mn */ { 0x10ae5, 0x10ae6 }, /* Mn */ { 0x10d24, 0x10d27 }, /* Mn */ + { 0x10eab, 0x10eac }, /* Mn */ { 0x10f46, 0x10f50 }, /* Mn */ { 0x11001, 0x11001 }, /* Mn */ { 0x11038, 0x11046 }, /* Mn */ @@ -235,6 +241,7 @@ { 0x11180, 0x11181 }, /* Mn */ { 0x111b6, 0x111be }, /* Mn */ { 0x111c9, 0x111cc }, /* Mn */ + { 0x111cf, 0x111cf }, /* Mn */ { 0x1122f, 0x11231 }, /* Mn */ { 0x11234, 0x11234 }, /* Mn */ { 0x11236, 0x11237 }, /* Mn */ @@ -270,6 +277,12 @@ { 0x11727, 0x1172b }, /* Mn */ { 0x1182f, 0x11837 }, /* Mn */ { 0x11839, 0x1183a }, /* Mn */ + { 0x1193b, 0x1193c }, /* Mn */ + { 0x1193e, 0x1193e }, /* Mn */ + { 0x11943, 0x11943 }, /* Mn */ + { 0x119d4, 0x119d7 }, /* Mn */ + { 0x119da, 0x119db }, /* Mn */ + { 0x119e0, 0x119e0 }, /* Mn */ { 0x11a01, 0x11a0a }, /* Mn */ { 0x11a33, 0x11a38 }, /* Mn */ { 0x11a3b, 0x11a3e }, /* Mn */ @@ -296,7 +309,9 @@ { 0x11ef3, 0x11ef4 }, /* Mn */ { 0x16af0, 0x16af4 }, /* Mn */ { 0x16b30, 0x16b36 }, /* Mn */ + { 0x16f4f, 0x16f4f }, /* Mn */ { 0x16f8f, 0x16f92 }, /* Mn */ + { 0x16fe4, 0x16fe4 }, /* Mn */ { 0x1bc9d, 0x1bc9e }, /* Mn */ { 0x1d167, 0x1d169 }, /* Mn */ { 0x1d17b, 0x1d182 }, /* Mn */ @@ -314,6 +329,9 @@ { 0x1e01b, 0x1e021 }, /* Mn */ { 0x1e023, 0x1e024 }, /* Mn */ { 0x1e026, 0x1e02a }, /* Mn */ + { 0x1e130, 0x1e136 }, /* Mn */ + { 0x1e2ae, 0x1e2ae }, /* Mn */ + { 0x1e2ec, 0x1e2ef }, /* Mn */ { 0x1e8d0, 0x1e8d6 }, /* Mn */ { 0x1e944, 0x1e94a }, /* Mn */ { 0xe0100, 0xe01ef }, /* Mn */ Modified: stable/11/contrib/less/cvt.c ============================================================================== --- stable/11/contrib/less/cvt.c Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/cvt.c Mon Nov 9 05:20:02 2020 (r367516) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/11/contrib/less/decode.c ============================================================================== --- stable/11/contrib/less/decode.c Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/decode.c Mon Nov 9 05:20:02 2020 (r367516) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/11/contrib/less/edit.c ============================================================================== --- stable/11/contrib/less/edit.c Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/edit.c Mon Nov 9 05:20:02 2020 (r367516) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -854,7 +854,6 @@ loop: /* * Don't do anything. */ - free(filename); return; case 'q': quit(QUIT_OK); Modified: stable/11/contrib/less/filename.c ============================================================================== --- stable/11/contrib/less/filename.c Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/filename.c Mon Nov 9 05:20:02 2020 (r367516) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -795,7 +795,7 @@ lglob(filename) } /* - * @@@ + * Return canonical pathname. */ public char * lrealpath(path) Modified: stable/11/contrib/less/fmt.uni ============================================================================== --- stable/11/contrib/less/fmt.uni Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/fmt.uni Mon Nov 9 05:20:02 2020 (r367516) @@ -1,4 +1,4 @@ -/* Generated by "./mkutable -f2 Cf -- unicode/UnicodeData.txt" on Wed Feb 13 17:57:05 PST 2019 */ +/* Generated by "./mkutable -f2 Cf -- unicode/UnicodeData.txt" on Tue May 19 14:47:34 PDT 2020 */ { 0x00ad, 0x00ad }, /* Cf */ { 0x0600, 0x0605 }, /* Cf */ { 0x061c, 0x061c }, /* Cf */ @@ -14,6 +14,7 @@ { 0xfff9, 0xfffb }, /* Cf */ { 0x110bd, 0x110bd }, /* Cf */ { 0x110cd, 0x110cd }, /* Cf */ + { 0x13430, 0x13438 }, /* Cf */ { 0x1bca0, 0x1bca3 }, /* Cf */ { 0x1d173, 0x1d17a }, /* Cf */ { 0xe0001, 0xe0001 }, /* Cf */ Modified: stable/11/contrib/less/forwback.c ============================================================================== --- stable/11/contrib/less/forwback.c Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/forwback.c Mon Nov 9 05:20:02 2020 (r367516) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -21,7 +21,6 @@ public int screen_trashed; public int squished; public int no_back_scroll = 0; public int forw_prompt; -public int same_pos_bell = 1; extern int sigs; extern int top_scroll; @@ -290,7 +289,7 @@ forw(n, pos, force, only_last, nblank) forw_prompt = 1; } - if (nlines == 0 && !ignore_eoi && same_pos_bell) + if (nlines == 0 && !ignore_eoi) eof_bell(); else if (do_repaint) repaint(); @@ -350,7 +349,7 @@ back(n, pos, force, only_last) } } - if (nlines == 0 && same_pos_bell) + if (nlines == 0) eof_bell(); else if (do_repaint) repaint(); Modified: stable/11/contrib/less/funcs.h ============================================================================== --- stable/11/contrib/less/funcs.h Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/funcs.h Mon Nov 9 05:20:02 2020 (r367516) @@ -61,7 +61,7 @@ public int binary_char LESSPARAMS ((LWCHAR c)); public int control_char LESSPARAMS ((LWCHAR c)); public char * prchar LESSPARAMS ((LWCHAR c)); public char * prutfchar LESSPARAMS ((LWCHAR ch)); -public int utf_len LESSPARAMS ((unsigned char ch)); +public int utf_len LESSPARAMS ((int ch)); public int is_utf8_well_formed LESSPARAMS ((char *ss, int slen)); public void utf_skip_to_lead LESSPARAMS ((char **pp, char *limit)); public LWCHAR get_wchar LESSPARAMS ((constant char *p)); @@ -187,10 +187,10 @@ public void pshift_all LESSPARAMS ((VOID_PARAM)); public int is_ansi_end LESSPARAMS ((LWCHAR ch)); public int is_ansi_middle LESSPARAMS ((LWCHAR ch)); public void skip_ansi LESSPARAMS ((char **pp, constant char *limit)); -public int pappend LESSPARAMS ((unsigned char c, POSITION pos)); +public int pappend LESSPARAMS ((int c, POSITION pos)); public int pflushmbc LESSPARAMS ((VOID_PARAM)); public void pdone LESSPARAMS ((int endline, int chopped, int forw)); -public void set_status_col LESSPARAMS ((char c)); +public void set_status_col LESSPARAMS ((int c)); public int gline LESSPARAMS ((int i, int *ap)); public void null_line LESSPARAMS ((VOID_PARAM)); public POSITION forw_raw_line LESSPARAMS ((POSITION curr_pos, char **linep, int *line_lenp)); @@ -243,6 +243,7 @@ public void scan_option LESSPARAMS ((char *s)); public void toggle_option LESSPARAMS ((struct loption *o, int lower, char *s, int how_toggle)); public int opt_has_param LESSPARAMS ((struct loption *o)); public char * opt_prompt LESSPARAMS ((struct loption *o)); +public char * opt_toggle_disallowed LESSPARAMS ((int c)); public int isoptpending LESSPARAMS ((VOID_PARAM)); public void nopendopt LESSPARAMS ((VOID_PARAM)); public int getnum LESSPARAMS ((char **sp, char *printopt, int *errp)); Modified: stable/11/contrib/less/help.c ============================================================================== --- stable/11/contrib/less/help.c Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/help.c Mon Nov 9 05:20:02 2020 (r367516) @@ -1,4 +1,4 @@ -/* This file was generated by mkhelp.pl from less.hlp at 18:12 on 2019/6/11 */ +/* This file was generated by mkhelp.pl from less.hlp at 3:34 on 2020/6/14 */ #include "less.h" constant char helpdata[] = { '\n', Modified: stable/11/contrib/less/ifile.c ============================================================================== --- stable/11/contrib/less/ifile.c Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/ifile.c Mon Nov 9 05:20:02 2020 (r367516) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/11/contrib/less/input.c ============================================================================== --- stable/11/contrib/less/input.c Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/input.c Mon Nov 9 05:20:02 2020 (r367516) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/11/contrib/less/jump.c ============================================================================== --- stable/11/contrib/less/jump.c Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/jump.c Mon Nov 9 05:20:02 2020 (r367516) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -219,7 +219,7 @@ jump_loc(pos, sline) nline -= sindex; if (nline > 0) forw(nline, position(BOTTOM_PLUS_ONE), 1, 0, 0); - else if (nline < 0) + else back(-nline, position(TOP), 1, 0); #if HILITE_SEARCH if (show_attn) Modified: stable/11/contrib/less/less.h ============================================================================== --- stable/11/contrib/less/less.h Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/less.h Mon Nov 9 05:20:02 2020 (r367516) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/11/contrib/less/less.nro ============================================================================== --- stable/11/contrib/less/less.nro Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/less.nro Mon Nov 9 05:20:02 2020 (r367516) @@ -1,4 +1,5 @@ -.TH LESS 1 "Version 551: 11 Jun 2019" +'\" t +.TH LESS 1 "Version 563: 13 Jun 2020" .SH NAME less \- opposite of more .SH SYNOPSIS @@ -21,19 +22,18 @@ less \- opposite of more .B " [\-# \fIshift\/\fP] [+[+]\fIcmd\/\fP] [\-\-] [\fIfilename\/\fP]..." .br (See the OPTIONS section for alternate option syntax with long option names.) - +. .SH DESCRIPTION .I Less is a program similar to -.I more -(1), but which allows backward movement +.IR more (1), +but which allows backward movement in the file as well as forward movement. Also, .I less does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like -.I vi -(1). +.IR vi (1). .I Less uses termcap (or terminfo on some systems), so it can run on a variety of terminals. @@ -48,7 +48,7 @@ and Commands may be preceded by a decimal number, called N in the descriptions below. The number is used by some commands, as indicated. - +. .SH COMMANDS In the following descriptions, ^X means control-X. ESC stands for the ESCAPE key; for example ESC-v means the @@ -229,7 +229,7 @@ that is, do a simple textual comparison. .RE .IP ?pattern Search backward in the file for the N-th line containing the pattern. -The search starts at the last line displayed +The search starts at the last line displayed (but see the \-a and \-j options, which change this). .sp Certain characters are special as in the / command: @@ -376,7 +376,7 @@ this will reset the option to the "opposite" of its de and print a message describing the new setting. This does not work for numeric or string-valued options. .IP \-\-! -Like the \-! command, but takes a long option name +Like the \-!\& command, but takes a long option name rather than a single option letter. .IP _ (Underscore.) @@ -405,7 +405,7 @@ Exits The following four commands may or may not be valid, depending on your particular installation. -.PP +. .IP v Invokes an editor to edit the current file being viewed. The editor is taken from the environment variable VISUAL if defined, @@ -425,7 +425,7 @@ On MS-DOS and OS/2 systems, the shell is the normal co .IP "| shell-command" represents any mark letter. Pipes a section of the input file to the given shell command. -The section of the file to be piped is between the position marked by +The section of the file to be piped is between the position marked by the letter and the current screen. The entire current screen is included, regardless of whether the marked position is before or after the current screen. @@ -434,7 +434,7 @@ If is \&.\& or newline, the current screen is pipe .IP "s filename" Save the input to a file. This only works if the input is a pipe, not an ordinary file. -.PP +. .SH OPTIONS Command line options are described below. Most options may be changed while @@ -518,7 +518,7 @@ This was the default behavior in less versions prior t Specifies the amount of buffer space .I less will use for each file, in units of kilobytes (1024 bytes). -By default 64\ K of buffer space is used for each file +By default 64\ KB of buffer space is used for each file (unless the file is a pipe; see the \-B option). The \-b option specifies instead that \fIn\fP kilobytes of buffer space should be used for each file. @@ -530,7 +530,7 @@ buffers are allocated automatically as needed. If a large amount of data is read from the pipe, this can cause a large amount of memory to be allocated. The \-B option disables this automatic allocation of buffers for pipes, -so that only 64\ K +so that only 64\ KB (or the amount of space specified by the \-b option) is used for the pipe. Warning: use of \-B can result in erroneous display, since only the @@ -563,8 +563,9 @@ A single number \fIN\fP is the same as \fIN.M\fP, where \fIM\fP is the normal background color. The color may start or end with \fBu\fP to use underline (with the normal color, if by itself), if the system supports it (Windows only). -\fBx\fP may also be \fBa\fP to toggle strict ANSI sequence rendering (SGR mode). - +\fBx\fP may also be \fBa\fP to toggle strict ANSI sequence rendering +(SGR mode). +. .IP "\-e or \-\-quit-at-eof" Causes .I less @@ -654,8 +655,8 @@ The status column is also used if the \-w or \-W optio Causes .I less to open and interpret the named file as a -.I lesskey -(1) file. +.IR lesskey (1) +file. Multiple \-k options may be specified. If the LESSKEY or LESSKEY_SYSTEM environment variable is set, or if a lesskey file is found in a standard place (see KEY BINDINGS), @@ -746,7 +747,7 @@ to that string. \-Ph changes the prompt for the help screen. \-P= changes the message printed by the = command. \-Pw changes the message printed while waiting for data (in the F command). - +.sp 1 All prompt strings consist of a sequence of letters and special escape sequences. See the section on PROMPTS for more details. @@ -762,7 +763,7 @@ The default is to ring the terminal bell in all such c .IP "\-Q or \-\-QUIET or \-\-SILENT" Causes totally "quiet" operation: the terminal bell is never rung. -If the terminal has a "visual bell", it is used in all cases +If the terminal has a "visual bell", it is used in all cases where the terminal bell would have been rung. .IP "\-r or \-\-raw-control-chars" Causes "raw" control characters to be displayed. @@ -804,7 +805,7 @@ output. Causes lines longer than the screen width to be chopped (truncated) rather than wrapped. That is, the portion of a long line that does not fit in -the screen width is not shown. +the screen width is not displayed until you press RIGHT-ARROW. The default is to wrap long lines; that is, display the remainder on the next line. .IP "\-t\fItag\fP or \-\-tag=\fItag\fP" @@ -813,12 +814,12 @@ will edit the file containing that tag. For this to work, tag information must be available; for example, there may be a file in the current directory called "tags", which was previously built by -.I ctags -(1) or an equivalent command. +.IR ctags (1) +or an equivalent command. If the environment variable LESSGLOBALTAGS is set, it is taken to be the name of a command compatible with -.I global -(1), and that command is executed to find the tag. +.IR global (1), +and that command is executed to find the tag. (See http://www.gnu.org/software/global/global.html). The \-t option may also be specified from within .I less @@ -870,7 +871,7 @@ If only one \fIn\fP is specified, tab stops are set at If multiple values separated by commas are specified, tab stops are set at those positions, and then continue with the same spacing as the last two. -For example, \fI-x9,17\fP will set tabs at positions 9, 17, 25, 33, etc. +For example, \fI\-x9,17\fP will set tabs at positions 9, 17, 25, 33, etc. The default for \fIn\fP is 8. .IP "\-X or \-\-no-init" Disables sending the termcap initialization and deinitialization strings @@ -944,15 +945,15 @@ will display the contents of that new file. Enables mouse input: scrolling the mouse wheel down moves forward in the file, scrolling the mouse wheel up moves backwards in the file, -and clicking the mouse sets the "#" mark to the line +and clicking the mouse sets the "#" mark to the line where the mouse is clicked. -The number of lines to scroll when the wheel is moved +The number of lines to scroll when the wheel is moved can be set by the \-\-wheel-lines option. Mouse input works only on terminals which support X11 mouse reporting, -and on the Windows version of +and on the Windows version of .IR less . .IP "\-\-MOUSE" -Like \-\-mouse, except the direction scrolled +Like \-\-mouse, except the direction scrolled on mouse wheel movement is reversed. .IP "\-\-no-keypad" Disables sending the keypad initialization and deinitialization strings @@ -961,7 +962,7 @@ This is sometimes useful if the keypad strings make th keypad behave in an undesirable manner. .IP "\-\-no-histdups" This option changes the behavior so that if a search string or -file name is typed in, and the same string is already in the history list, +file name is typed in, and the same string is already in the history list, the existing copy is removed from the history list before the new one is added. Thus, a given string will appear only once in the history list. Normally, a string may appear multiple times. @@ -969,7 +970,7 @@ Normally, a string may appear multiple times. This option changes the character used to mark truncated lines. It may begin with a two-character attribute indicator like LESSBINFMT does. If there is no attribute indicator, standout is used. -If set to "-", truncated lines are not marked. +If set to "\-", truncated lines are not marked. .IP "\-\-save-marks" Save marks in the history file, so marks are retained across different invocations of \fIless\fP. @@ -1001,7 +1002,7 @@ If the option starts with ++, the initial command appl every file being viewed, not just the first one. The + command described previously may also be used to set (or change) an initial command for every file. - +. .SH "LINE EDITING" When entering command line at the bottom of the screen (for example, a filename for the :e command, @@ -1069,13 +1070,12 @@ If you have changed your line-kill character in Unix t other than ^U, that character is used instead of ^U. .IP "^G" Delete the entire command line and return to the main prompt. - +. .SH "KEY BINDINGS" You may define your own .I less commands by using the program -.I lesskey -(1) +.IR lesskey (1) to create a lesskey file. This file specifies a set of command keys and an action associated with each key. @@ -1125,7 +1125,7 @@ was built with a different sysconf directory than /usr that directory is where the sysless file is found.) On MS-DOS and Windows systems, the system-wide lesskey file is c:\e_sysless. On OS/2 systems, the system-wide lesskey file is c:\esysless.ini. - +. .SH "INPUT PREPROCESSOR" You may define an "input preprocessor" for .IR less . @@ -1294,7 +1294,7 @@ Similarly, if the first two characters of LESSOPEN are the input pipe is used on standard input as well as other files. Again, in this case the dash is not considered to be part of the input pipe command. - +. .SH "NATIONAL CHARACTER SETS" There are three types of characters in the input file: .IP "normal characters" @@ -1349,7 +1349,7 @@ In this case, the environment variable LESSCHARDEF can to define a character set. It should be set to a string where each character in the string represents one character in the character set. -The character "." is used for a normal character, "c" for control, +The character ".\&" is used for a normal character, "c" for control, and "b" for binary. A decimal number may be used for repetition. For example, "bccc4b.\&" would mean character 0 is binary, @@ -1361,26 +1361,22 @@ represent any real character set.) .PP This table shows the value of LESSCHARDEF which is equivalent to each of the possible values for LESSCHARSET: -.sp - ascii\ 8bcccbcc18b95.b -.br - dos\ \ \ 8bcccbcc12bc5b95.b. -.br - ebcdic 5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b -.br - \ \ \ \ \ \ 9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b. -.br - IBM-1047 4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc -.br - \ \ \ \ \ \ 191.b -.br - iso8859 8bcccbcc18b95.33b. -.br - koi8-r 8bcccbcc18b95.b128. -.br - latin1 8bcccbcc18b95.33b. -.br - next\ \ 8bcccbcc18b95.bb125.bb +. +.RS 5m +.TS +l l. +ascii 8bcccbcc18b95.b +dos 8bcccbcc12bc5b95.b. +ebcdic 5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b + 9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b. +IBM-1047 4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc + 191.b +iso8859 8bcccbcc18b95.33b. +koi8-r 8bcccbcc18b95.b128. +latin1 8bcccbcc18b95.33b. +next 8bcccbcc18b95.bb125.bb +.TE +.RE .PP If neither LESSCHARSET nor LESSCHARDEF is set, but any of the strings "UTF-8", "UTF8", "utf-8" or "utf8" @@ -1429,11 +1425,11 @@ setting ("*x") so specifying one will affect both; LESSUTFBINFMT is read after LESSBINFMT so its setting, if any, will have priority. Problematic octets in a UTF-8 file (octets of a truncated sequence, -octets of a complete but non-shortest form sequence, illegal octets, +octets of a complete but non-shortest form sequence, invalid octets, and stray trailing octets) are displayed individually using LESSBINFMT so as to facilitate diagnostic of how the UTF-8 file is ill-formed. - +. .SH "PROMPTS" The \-P option allows you to tailor the prompt to your preference. The string given to the \-P option replaces the specified prompt string. @@ -1500,7 +1496,8 @@ Causes any trailing spaces to be removed. Usually used at the end of the string, but may appear anywhere. .IP "%T" Normally expands to the word "file". -However if viewing files via a tags list using the \-t option, it expands to the word "tag". +However if viewing files via a tags list using the \-t option, +it expands to the word "tag". .IP "%x" Replaced by the name of the next input file in the list. .PP @@ -1620,7 +1617,7 @@ line number, followed by the shell-escaped file name. If your editor does not accept the "+linenumber" syntax, or has other differences in invocation syntax, the LESSEDIT variable can be changed to modify this default. - +. .SH SECURITY When the environment variable LESSSECURE is set to 1, .I less @@ -1641,14 +1638,14 @@ log files use of lesskey files .IP "\-t" use of tags files -.IP " " +.IP metacharacters in filenames, such as * -.IP " " +.IP filename completion (TAB, ^L) .RE .PP Less can also be compiled to be permanently in "secure" mode. - +. .SH "COMPATIBILITY WITH MORE" If the environment variable LESS_IS_MORE is set to 1, or if the program is invoked via a file link named "more", @@ -1666,7 +1663,7 @@ behaves as if the \-E option were set. .PP The \-m option works differently. If the \-m option is not set, the medium prompt is used, -and it is prefixed with the string "--More--". +and it is prefixed with the string "\-\-More\-\-". If the \-m option is set, the short prompt is used. .PP The \-n option acts like the \-z option. @@ -1678,12 +1675,12 @@ command rather than a search pattern. .PP The LESS environment variable is ignored, and the MORE environment variable is used in its place. - +. .SH "ENVIRONMENT VARIABLES" Environment variables may be specified either in the system environment as usual, or in a -.I lesskey -(1) file. +.IR lesskey (1) +file. If environment variables are defined in more than one place, variables defined in a local lesskey file take precedence over variables defined in the system environment, which take precedence @@ -1738,8 +1735,8 @@ See discussion under PROMPTS. .IP LESSGLOBALTAGS Name of the command used by the \-t option to find global tags. Normally should be set to "global" if your system has the -.I global -(1) command. If not set, global tags are not used. +.IR global (1) +command. If not set, global tags are not used. .IP LESSHISTFILE Name of the history file used to remember search commands and shell commands between invocations of @@ -1752,9 +1749,13 @@ on OS/2 systems. The maximum number of commands to save in the history file. The default is 100. .IP LESSKEY -Name of the default lesskey(1) file. +Name of the default +.IR lesskey (1) +file. .IP LESSKEY_SYSTEM -Name of the default system-wide lesskey(1) file. +Name of the default system-wide +.IR lesskey (1) +file. .IP LESSMETACHARS List of characters which are considered "metacharacters" by the shell. .IP LESSMETAESCAPE @@ -1773,8 +1774,8 @@ String to be appended to a directory name in filename Format for displaying non-printable Unicode code points. .IP LESS_IS_MORE Emulate the -.I more -(1) command. +.IR more (1) +command. .IP LINES Sets the number of lines on the screen. Takes precedence over the number of lines specified by the TERM variable. @@ -1791,19 +1792,19 @@ compatible mode. User's search path (used to find a lesskey file on MS-DOS and OS/2 systems). .IP SHELL -The shell used to execute the ! command, as well as to expand filenames. +The shell used to execute the !\& command, as well as to expand filenames. .IP TERM The type of terminal on which .I less is being run. .IP VISUAL The name of the editor (used for the v command). - +. .SH "SEE ALSO" -lesskey(1) - +.BR lesskey (1) +. .SH COPYRIGHT -Copyright (C) 1984-2019 Mark Nudelman +Copyright (C) 1984-2020 Mark Nudelman .PP less is part of the GNU project and is free software. You can redistribute it and/or modify it @@ -1823,9 +1824,9 @@ less is distributed in the hope that it will be useful WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - +. .SH AUTHOR -.PP +. Mark Nudelman .br Report bugs at https://github.com/gwsw/less/issues. Modified: stable/11/contrib/less/lessecho.c ============================================================================== --- stable/11/contrib/less/lessecho.c Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/lessecho.c Mon Nov 9 05:20:02 2020 (r367516) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/11/contrib/less/lessecho.nro ============================================================================== --- stable/11/contrib/less/lessecho.nro Mon Nov 9 05:17:23 2020 (r367515) +++ stable/11/contrib/less/lessecho.nro Mon Nov 9 05:20:02 2020 (r367516) @@ -1,4 +1,4 @@ -.TH LESSECHO 1 "Version 551: 11 Jun 2019" +.TH LESSECHO 1 "Version 563: 13 Jun 2020" .SH NAME lessecho \- expand metacharacters .SH SYNOPSIS @@ -44,7 +44,7 @@ Specifies "n" to be the escape char for metachars, as Specifies that all arguments are to be quoted. The default is that only arguments containing metacharacters are quoted .SH "SEE ALSO" -less(1) +.BR less (1) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Mon Nov 9 09:30:50 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 308122EC2D4; Mon, 9 Nov 2020 09:30:50 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CV5MZ0bPYz4XGl; Mon, 9 Nov 2020 09:30:50 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07756716B; Mon, 9 Nov 2020 09:30:50 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A99UnAr006237; Mon, 9 Nov 2020 09:30:49 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A99UnAT006236; Mon, 9 Nov 2020 09:30:49 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011090930.0A99UnAT006236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 9 Nov 2020 09:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367518 - stable/12/sbin/mdconfig X-SVN-Group: stable-12 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/12/sbin/mdconfig X-SVN-Commit-Revision: 367518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 09:30:50 -0000 Author: 0mp (doc,ports committer) Date: Mon Nov 9 09:30:49 2020 New Revision: 367518 URL: https://svnweb.freebsd.org/changeset/base/367518 Log: MFC r367420: Use Cm macros instead of Ar when referring to a specific memory disk type Modified: stable/12/sbin/mdconfig/mdconfig.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/mdconfig/mdconfig.8 ============================================================================== --- stable/12/sbin/mdconfig/mdconfig.8 Mon Nov 9 08:53:15 2020 (r367517) +++ stable/12/sbin/mdconfig/mdconfig.8 Mon Nov 9 09:30:49 2020 (r367518) @@ -127,7 +127,7 @@ Filename to use for the vnode type memory disk. The .Fl a and -.Fl t Ar vnode +.Fl t Cm vnode options are implied if not specified. .It Fl l List configured devices. @@ -170,7 +170,7 @@ When used without the option, the .Fl a and -.Fl t Ar swap +.Fl t Cm swap options are implied if not specified. .It Fl S Ar sectorsize Sectorsize to use for the memory disk, in bytes. @@ -246,7 +246,7 @@ The last form, is provided for convenience as an abbreviation of .Nm .Fl a -.Fl t Ar vnode +.Fl t Cm vnode .Fl f Ar file . .Sh EXAMPLES Create a disk with From owner-svn-src-stable@freebsd.org Mon Nov 9 09:31:21 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A90D82EC1FD; Mon, 9 Nov 2020 09:31:21 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CV5N93x03z4XfR; Mon, 9 Nov 2020 09:31:21 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79EE96D7D; Mon, 9 Nov 2020 09:31:21 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A99VL2Q006307; Mon, 9 Nov 2020 09:31:21 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A99VLaJ006306; Mon, 9 Nov 2020 09:31:21 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011090931.0A99VLaJ006306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 9 Nov 2020 09:31:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367519 - stable/11/sbin/mdconfig X-SVN-Group: stable-11 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/11/sbin/mdconfig X-SVN-Commit-Revision: 367519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 09:31:21 -0000 Author: 0mp (doc,ports committer) Date: Mon Nov 9 09:31:21 2020 New Revision: 367519 URL: https://svnweb.freebsd.org/changeset/base/367519 Log: MFC r367420: Use Cm macros instead of Ar when referring to a specific memory disk type Modified: stable/11/sbin/mdconfig/mdconfig.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/mdconfig/mdconfig.8 ============================================================================== --- stable/11/sbin/mdconfig/mdconfig.8 Mon Nov 9 09:30:49 2020 (r367518) +++ stable/11/sbin/mdconfig/mdconfig.8 Mon Nov 9 09:31:21 2020 (r367519) @@ -126,7 +126,7 @@ Filename to use for the vnode type memory disk. The .Fl a and -.Fl t Ar vnode +.Fl t Cm vnode options are implied if not specified. .It Fl l List configured devices. @@ -169,7 +169,7 @@ When used without the option, the .Fl a and -.Fl t Ar swap +.Fl t Cm swap options are implied if not specified. .It Fl S Ar sectorsize Sectorsize to use for the memory disk, in bytes. @@ -231,7 +231,7 @@ The last form, is provided for convenience as an abbreviation of .Nm .Fl a -.Fl t Ar vnode +.Fl t Cm vnode .Fl f Ar file . .Sh EXAMPLES Create a disk with From owner-svn-src-stable@freebsd.org Mon Nov 9 13:54:30 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31C004645A6; Mon, 9 Nov 2020 13:54:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVCCp0qhmz4rKM; Mon, 9 Nov 2020 13:54:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B21A1261B; Mon, 9 Nov 2020 13:54:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A9DsTRt075217; Mon, 9 Nov 2020 13:54:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9DsTUW075216; Mon, 9 Nov 2020 13:54:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011091354.0A9DsTUW075216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 9 Nov 2020 13:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367523 - stable/12/usr.sbin/syslogd X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.sbin/syslogd X-SVN-Commit-Revision: 367523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 13:54:30 -0000 Author: markj Date: Mon Nov 9 13:54:29 2020 New Revision: 367523 URL: https://svnweb.freebsd.org/changeset/base/367523 Log: MFC r366576: syslogd: Avoid trimming host names in RFC 5424 mode PR: 250014 Modified: stable/12/usr.sbin/syslogd/syslogd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/12/usr.sbin/syslogd/syslogd.c Mon Nov 9 13:20:44 2020 (r367522) +++ stable/12/usr.sbin/syslogd/syslogd.c Mon Nov 9 13:54:29 2020 (r367523) @@ -2226,7 +2226,9 @@ cvthname(struct sockaddr *f) hl = strlen(hname); if (hl > 0 && hname[hl-1] == '.') hname[--hl] = '\0'; - trimdomain(hname, hl); + /* RFC 5424 prefers logging FQDNs. */ + if (RFC3164OutputFormat) + trimdomain(hname, hl); return (hname); } @@ -2853,7 +2855,9 @@ cfline(const char *line, const char *prog, const char hl = strlen(f->f_host); if (hl > 0 && f->f_host[hl-1] == '.') f->f_host[--hl] = '\0'; - trimdomain(f->f_host, hl); + /* RFC 5424 prefers logging FQDNs. */ + if (RFC3164OutputFormat) + trimdomain(f->f_host, hl); } /* save program name if any */ From owner-svn-src-stable@freebsd.org Mon Nov 9 14:15:07 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B99C464D57; Mon, 9 Nov 2020 14:15:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVCgb34w6z4sZw; Mon, 9 Nov 2020 14:15:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5284512A45; Mon, 9 Nov 2020 14:15:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A9EF7qI087539; Mon, 9 Nov 2020 14:15:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9EF6kt087538; Mon, 9 Nov 2020 14:15:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011091415.0A9EF6kt087538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 9 Nov 2020 14:15:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367524 - stable/12/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/opencrypto X-SVN-Commit-Revision: 367524 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 14:15:07 -0000 Author: markj Date: Mon Nov 9 14:15:06 2020 New Revision: 367524 URL: https://svnweb.freebsd.org/changeset/base/367524 Log: Add hmac_init_ipad() and hmac_init_opad() This is a merge of a small portion of r359374 which makes it easier to maintain OpenCrypto drivers in stable/12. No functional change intended; this is a direct commit to stable/12. Discussed with: jhb Modified: stable/12/sys/opencrypto/crypto.c stable/12/sys/opencrypto/cryptodev.h Modified: stable/12/sys/opencrypto/crypto.c ============================================================================== --- stable/12/sys/opencrypto/crypto.c Mon Nov 9 13:54:29 2020 (r367523) +++ stable/12/sys/opencrypto/crypto.c Mon Nov 9 14:15:06 2020 (r367524) @@ -380,6 +380,53 @@ crypto_terminate(struct proc **pp, void *q) } static void +hmac_init_pad(const struct auth_hash *axf, const char *key, int klen, + void *auth_ctx, uint8_t padval) +{ + uint8_t hmac_key[HMAC_MAX_BLOCK_LEN]; + u_int i; + + KASSERT(axf->blocksize <= sizeof(hmac_key), + ("Invalid HMAC block size %d", axf->blocksize)); + + /* + * If the key is larger than the block size, use the digest of + * the key as the key instead. + */ + memset(hmac_key, 0, sizeof(hmac_key)); + if (klen > axf->blocksize) { + axf->Init(auth_ctx); + axf->Update(auth_ctx, key, klen); + axf->Final(hmac_key, auth_ctx); + klen = axf->hashsize; + } else + memcpy(hmac_key, key, klen); + + for (i = 0; i < axf->blocksize; i++) + hmac_key[i] ^= padval; + + axf->Init(auth_ctx); + axf->Update(auth_ctx, hmac_key, axf->blocksize); + explicit_bzero(hmac_key, sizeof(hmac_key)); +} + +void +hmac_init_ipad(const struct auth_hash *axf, const char *key, int klen, + void *auth_ctx) +{ + + hmac_init_pad(axf, key, klen, auth_ctx, HMAC_IPAD_VAL); +} + +void +hmac_init_opad(const struct auth_hash *axf, const char *key, int klen, + void *auth_ctx) +{ + + hmac_init_pad(axf, key, klen, auth_ctx, HMAC_OPAD_VAL); +} + +static void crypto_destroy(void) { struct crypto_ret_worker *ret_worker; Modified: stable/12/sys/opencrypto/cryptodev.h ============================================================================== --- stable/12/sys/opencrypto/cryptodev.h Mon Nov 9 13:54:29 2020 (r367523) +++ stable/12/sys/opencrypto/cryptodev.h Mon Nov 9 14:15:06 2020 (r367524) @@ -546,6 +546,14 @@ extern int crypto_usercrypto; /* userland may do cryp extern int crypto_userasymcrypto; /* userland may do asym crypto reqs */ extern int crypto_devallowsoft; /* only use hardware crypto */ +/* Helper routines for drivers to initialize auth contexts for HMAC. */ +struct auth_hash; + +void hmac_init_ipad(const struct auth_hash *axf, const char *key, int klen, + void *auth_ctx); +void hmac_init_opad(const struct auth_hash *axf, const char *key, int klen, + void *auth_ctx); + /* * Crypto-related utility routines used mainly by drivers. * From owner-svn-src-stable@freebsd.org Mon Nov 9 15:36:13 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0718A466486; Mon, 9 Nov 2020 15:36:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVFT86lYbz3D1t; Mon, 9 Nov 2020 15:36:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA3261383F; Mon, 9 Nov 2020 15:36:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A9FaCW7037108; Mon, 9 Nov 2020 15:36:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9FaB4j037101; Mon, 9 Nov 2020 15:36:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011091536.0A9FaB4j037101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 9 Nov 2020 15:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367525 - in stable/12: share/man/man4 sys/amd64/conf sys/conf sys/dev/qat sys/modules sys/modules/qat X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/amd64/conf sys/conf sys/dev/qat sys/modules sys/modules/qat X-SVN-Commit-Revision: 367525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 15:36:13 -0000 Author: markj Date: Mon Nov 9 15:36:11 2020 New Revision: 367525 URL: https://svnweb.freebsd.org/changeset/base/367525 Log: MFC r367386: Add qat(4) Added: stable/12/share/man/man4/qat.4 - copied unchanged from r367386, head/share/man/man4/qat.4 stable/12/sys/dev/qat/ - copied from r367386, head/sys/dev/qat/ stable/12/sys/modules/qat/ - copied from r367386, head/sys/modules/qat/ Modified: stable/12/share/man/man4/Makefile stable/12/sys/amd64/conf/NOTES stable/12/sys/conf/files.amd64 stable/12/sys/dev/qat/qat.c stable/12/sys/dev/qat/qat_hw15.c stable/12/sys/dev/qat/qat_hw15var.h stable/12/sys/dev/qat/qat_hw17.c stable/12/sys/dev/qat/qat_hw17var.h stable/12/sys/dev/qat/qatvar.h stable/12/sys/modules/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/Makefile ============================================================================== --- stable/12/share/man/man4/Makefile Mon Nov 9 14:15:06 2020 (r367524) +++ stable/12/share/man/man4/Makefile Mon Nov 9 15:36:11 2020 (r367525) @@ -442,6 +442,7 @@ MAN= aac.4 \ pty.4 \ puc.4 \ pwmc.4 \ + ${_qat.4} \ ${_qlxge.4} \ ${_qlxgb.4} \ ${_qlxgbe.4} \ @@ -845,6 +846,7 @@ _nvd.4= nvd.4 _nvme.4= nvme.4 _nvram.4= nvram.4 _padlock.4= padlock.4 +_qat.4= qat.4 _rr232x.4= rr232x.4 _speaker.4= speaker.4 _spkr.4= spkr.4 Copied: stable/12/share/man/man4/qat.4 (from r367386, head/share/man/man4/qat.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/man/man4/qat.4 Mon Nov 9 15:36:11 2020 (r367525, copy of r367386, head/share/man/man4/qat.4) @@ -0,0 +1,99 @@ +.\"- +.\" Copyright (c) 2020 Rubicon Communications, LLC (Netgate) +.\" +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dd November 5, 2020 +.Dt QAT 4 +.Os +.Sh NAME +.Nm qat +.Nd Intel QuickAssist Technology (QAT) driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device crypto" +.Cd "device cryptodev" +.Cd "device qat" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following lines in +.Xr loader.conf 5 : +.Bd -literal -offset indent +qat_load="YES" +qat_c2xxxfw_load="YES" +qat_c3xxxfw_load="YES" +qat_c63xfw_load="YES" +qat_d15xxfw_load="YES" +qat_dh895xcc_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver implements +.Xr crypto 4 +support for some of the cryptographic acceleration functions of the Intel +QuickAssist device. +The +.Nm +driver supports the QAT devices integrated with Atom C2000 and C3000 and Xeon +C620 and D-1500 chipsets, and the Intel QAT Adapter 8950. +It can accelerate AES in CBC, CTR, XTS (except for the C2000) and GCM modes, +and can perform authenticated encryption combining the CBC, CTR and XTS modes +with SHA1-HMAC and SHA2-HMAC. +The +.Nm +driver can also compute SHA1 and SHA2 digests. +.Sh SEE ALSO +.Xr crypto 4 , +.Xr ipsec 4 , +.Xr pci 4 , +.Xr random 4 , +.Xr crypto 7 , +.Xr crypto 9 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 13.0 . +.Sh AUTHORS +The +.Nm +driver was written for +.Nx +by +.An Hikaru Abe Aq Mt hikaru@iij.ad.jp +and ported to +.Fx +by +.An Mark Johnston Aq Mt markj@FreeBSD.org . +.Sh BUGS +Some Atom C2000 QAT devices have two acceleration engines instead of one. +The +.Nm +driver currently misbehaves when both are enabled and thus does not enable +the second acceleration engine if one is present. Modified: stable/12/sys/amd64/conf/NOTES ============================================================================== --- stable/12/sys/amd64/conf/NOTES Mon Nov 9 14:15:06 2020 (r367524) +++ stable/12/sys/amd64/conf/NOTES Mon Nov 9 15:36:11 2020 (r367525) @@ -496,6 +496,10 @@ device nvd # expose NVMe namespaces as dis device pmspcv # +# Intel QuickAssist +device qat + +# # SafeNet crypto driver: can be moved to the MI NOTES as soon as # it's tested on a big-endian machine # Modified: stable/12/sys/conf/files.amd64 ============================================================================== --- stable/12/sys/conf/files.amd64 Mon Nov 9 14:15:06 2020 (r367524) +++ stable/12/sys/conf/files.amd64 Mon Nov 9 15:36:11 2020 (r367525) @@ -419,6 +419,15 @@ dev/nvme/nvme_util.c optional nvme dev/nvram/nvram.c optional nvram isa dev/random/ivy.c optional rdrand_rng dev/random/nehemiah.c optional padlock_rng +dev/qat/qat.c optional qat +dev/qat/qat_ae.c optional qat +dev/qat/qat_c2xxx.c optional qat +dev/qat/qat_c3xxx.c optional qat +dev/qat/qat_c62x.c optional qat +dev/qat/qat_d15xx.c optional qat +dev/qat/qat_dh895xcc.c optional qat +dev/qat/qat_hw15.c optional qat +dev/qat/qat_hw17.c optional qat dev/qlxge/qls_dbg.c optional qlxge pci dev/qlxge/qls_dump.c optional qlxge pci dev/qlxge/qls_hw.c optional qlxge pci Modified: stable/12/sys/dev/qat/qat.c ============================================================================== --- head/sys/dev/qat/qat.c Thu Nov 5 15:55:23 2020 (r367386) +++ stable/12/sys/dev/qat/qat.c Mon Nov 9 15:36:11 2020 (r367525) @@ -281,7 +281,7 @@ static int qat_start(struct device *); static int qat_detach(device_t); static int qat_newsession(device_t dev, crypto_session_t cses, - const struct crypto_session_params *csp); + struct cryptoini *cri); static void qat_freesession(device_t dev, crypto_session_t cses); static int qat_setup_msix_intr(struct qat_softc *); @@ -1259,11 +1259,11 @@ static enum hw_cipher_algo qat_aes_cipher_algo(int klen) { switch (klen) { - case HW_AES_128_KEY_SZ: + case HW_AES_128_KEY_SZ * 8: return HW_CIPHER_ALGO_AES128; - case HW_AES_192_KEY_SZ: + case HW_AES_192_KEY_SZ * 8: return HW_CIPHER_ALGO_AES192; - case HW_AES_256_KEY_SZ: + case HW_AES_256_KEY_SZ * 8: return HW_CIPHER_ALGO_AES256; default: panic("invalid key length %d", klen); @@ -1341,10 +1341,33 @@ qat_crypto_load_auth_session(const struct qat_crypto_d (*hash_def)->qshd_alg->qshai_digest_len); } +static bool +qat_is_hash(int alg) +{ + switch (alg) { + case CRYPTO_SHA1: + case CRYPTO_SHA1_HMAC: + case CRYPTO_SHA2_256: + case CRYPTO_SHA2_256_HMAC: + case CRYPTO_SHA2_384: + case CRYPTO_SHA2_384_HMAC: + case CRYPTO_SHA2_512: + case CRYPTO_SHA2_512_HMAC: + case CRYPTO_AES_128_NIST_GMAC: + case CRYPTO_AES_192_NIST_GMAC: + case CRYPTO_AES_256_NIST_GMAC: + return true; + default: + return false; + } +} + struct qat_crypto_load_cb_arg { struct qat_session *qs; struct qat_sym_cookie *qsc; struct cryptop *crp; + struct cryptodesc *enc; + struct cryptodesc *mac; int error; }; @@ -1353,6 +1376,7 @@ qat_crypto_load_cb(void *_arg, bus_dma_segment_t *segs int error) { struct cryptop *crp; + struct cryptodesc *enc, *mac; struct flat_buffer_desc *flatbuf; struct qat_crypto_load_cb_arg *arg; struct qat_session *qs; @@ -1368,6 +1392,8 @@ qat_crypto_load_cb(void *_arg, bus_dma_segment_t *segs } crp = arg->crp; + enc = arg->enc; + mac = arg->mac; qs = arg->qs; qsc = arg->qsc; @@ -1377,16 +1403,16 @@ qat_crypto_load_cb(void *_arg, bus_dma_segment_t *segs * padded to a multiple of 16 bytes. To satisfy these * constraints we bounce the AAD into a per-request buffer. */ - crypto_copydata(crp, crp->crp_aad_start, crp->crp_aad_length, - qsc->qsc_gcm_aad); - memset(qsc->qsc_gcm_aad + crp->crp_aad_length, 0, - roundup2(crp->crp_aad_length, QAT_AES_GCM_AAD_ALIGN) - - crp->crp_aad_length); - skip = crp->crp_payload_start; - } else if (crp->crp_aad_length > 0) { - skip = crp->crp_aad_start; + crypto_copydata(crp->crp_flags, crp->crp_buf, mac->crd_skip, + mac->crd_len, qsc->qsc_gcm_aad); + memset(qsc->qsc_gcm_aad + mac->crd_len, 0, + roundup2(mac->crd_len, QAT_AES_GCM_AAD_ALIGN) - + mac->crd_len); + skip = enc->crd_skip; + } else if (mac != NULL) { + skip = mac->crd_skip; } else { - skip = crp->crp_payload_start; + skip = enc->crd_skip; } for (iseg = oseg = 0; iseg < nseg; iseg++) { @@ -1411,21 +1437,59 @@ qat_crypto_load_cb(void *_arg, bus_dma_segment_t *segs qsc->qsc_buf_list.num_buffers = oseg; } +static void +qat_crypto_load_cb2(void *arg, bus_dma_segment_t *segs, int nseg, + bus_size_t mapsize __unused, int error) +{ + qat_crypto_load_cb(arg, segs, nseg, error); +} + static int qat_crypto_load(struct qat_session *qs, struct qat_sym_cookie *qsc, - struct qat_crypto_desc const *desc, struct cryptop *crp) + struct cryptop *crp, struct cryptodesc *enc, struct cryptodesc *mac) { struct qat_crypto_load_cb_arg arg; int error; - crypto_read_iv(crp, qsc->qsc_iv_buf); + if (enc != NULL && (enc->crd_flags & CRD_F_ENCRYPT) != 0) { + if ((enc->crd_flags & CRD_F_IV_EXPLICIT) != 0) + memcpy(qsc->qsc_iv_buf, enc->crd_iv, qs->qs_ivlen); + else + arc4rand(qsc->qsc_iv_buf, qs->qs_ivlen, 0); + if ((enc->crd_flags & CRD_F_IV_PRESENT) == 0) { + crypto_copyback(crp->crp_flags, crp->crp_buf, + enc->crd_inject, qs->qs_ivlen, qsc->qsc_iv_buf); + } + } else if (enc != NULL) { + if ((enc->crd_flags & CRD_F_IV_EXPLICIT) != 0) { + memcpy(qsc->qsc_iv_buf, enc->crd_iv, qs->qs_ivlen); + } else { + crypto_copydata(crp->crp_flags, crp->crp_buf, + enc->crd_inject, qs->qs_ivlen, qsc->qsc_iv_buf); + } + } + arg.crp = crp; + arg.enc = enc; + arg.mac = mac; arg.qs = qs; arg.qsc = qsc; arg.error = 0; - error = bus_dmamap_load_crp(qsc->qsc_buf_dma_tag, qsc->qsc_buf_dmamap, - crp, qat_crypto_load_cb, &arg, BUS_DMA_NOWAIT); + + if ((crp->crp_flags & CRYPTO_F_IOV) != 0) { + error = bus_dmamap_load_uio(qsc->qsc_buf_dma_tag, + qsc->qsc_buf_dmamap, crp->crp_uio, + qat_crypto_load_cb2, &arg, BUS_DMA_NOWAIT); + } else if ((crp->crp_flags & CRYPTO_F_IMBUF) != 0) { + error = bus_dmamap_load_mbuf(qsc->qsc_buf_dma_tag, + qsc->qsc_buf_dmamap, crp->crp_mbuf, + qat_crypto_load_cb2, &arg, BUS_DMA_NOWAIT); + } else { + error = bus_dmamap_load(qsc->qsc_buf_dma_tag, + qsc->qsc_buf_dmamap, crp->crp_buf, crp->crp_ilen, + qat_crypto_load_cb, &arg, BUS_DMA_NOWAIT); + } if (error == 0) error = arg.error; return error; @@ -1615,6 +1679,12 @@ qat_crypto_deinit(struct qat_softc *sc) } } +static void +qat_crypto_register(struct qat_softc *sc, int alg) +{ + (void)crypto_register(sc->sc_crypto.qcy_cid, alg, QAT_MAXLEN, 0); +} + static int qat_crypto_start(struct qat_softc *sc) { @@ -1629,6 +1699,22 @@ qat_crypto_start(struct qat_softc *sc) return ENOENT; } + qat_crypto_register(sc, CRYPTO_AES_CBC); + qat_crypto_register(sc, CRYPTO_AES_ICM); + qat_crypto_register(sc, CRYPTO_AES_XTS); + qat_crypto_register(sc, CRYPTO_AES_NIST_GCM_16); + qat_crypto_register(sc, CRYPTO_AES_128_NIST_GMAC); + qat_crypto_register(sc, CRYPTO_AES_192_NIST_GMAC); + qat_crypto_register(sc, CRYPTO_AES_256_NIST_GMAC); + qat_crypto_register(sc, CRYPTO_SHA1); + qat_crypto_register(sc, CRYPTO_SHA1_HMAC); + qat_crypto_register(sc, CRYPTO_SHA2_256); + qat_crypto_register(sc, CRYPTO_SHA2_256_HMAC); + qat_crypto_register(sc, CRYPTO_SHA2_384); + qat_crypto_register(sc, CRYPTO_SHA2_384_HMAC); + qat_crypto_register(sc, CRYPTO_SHA2_512); + qat_crypto_register(sc, CRYPTO_SHA2_512_HMAC); + return 0; } @@ -1671,16 +1757,19 @@ qat_crypto_sym_rxintr(struct qat_softc *sc, void *arg, error = 0; if ((auth_sz = qs->qs_auth_mlen) != 0) { - if ((crp->crp_op & CRYPTO_OP_VERIFY_DIGEST) != 0) { - crypto_copydata(crp, crp->crp_digest_start, - auth_sz, icv); + if (qs->qs_auth_algo == HW_AUTH_ALGO_GALOIS_128 && + (qsc->qsc_enc->crd_flags & CRD_F_ENCRYPT) == 0) { + crypto_copydata(crp->crp_flags, crp->crp_buf, + qsc->qsc_mac->crd_inject, auth_sz, + icv); if (timingsafe_bcmp(icv, qsc->qsc_auth_res, auth_sz) != 0) { error = EBADMSG; } } else { - crypto_copyback(crp, crp->crp_digest_start, - auth_sz, qsc->qsc_auth_res); + crypto_copyback(crp->crp_flags, crp->crp_buf, + qsc->qsc_mac->crd_inject, auth_sz, + qsc->qsc_auth_res); } } @@ -1706,9 +1795,9 @@ qat_crypto_sym_rxintr(struct qat_softc *sc, void *arg, } static int -qat_probesession(device_t dev, const struct crypto_session_params *csp) +qat_probesession(device_t dev, struct cryptoini *enc, struct cryptoini *mac) { - if (csp->csp_cipher_alg == CRYPTO_AES_XTS && + if (enc != NULL && enc->cri_alg == CRYPTO_AES_XTS && qat_lookup(dev)->qatp_chip == QAT_CHIP_C2XXX) { /* * AES-XTS is not supported by the NanoQAT. @@ -1716,24 +1805,30 @@ qat_probesession(device_t dev, const struct crypto_ses return EINVAL; } - switch (csp->csp_mode) { - case CSP_MODE_CIPHER: - switch (csp->csp_cipher_alg) { - case CRYPTO_AES_CBC: - case CRYPTO_AES_ICM: - if (csp->csp_ivlen != AES_BLOCK_LEN) + if (enc != NULL) { + switch (enc->cri_alg) { + case CRYPTO_AES_NIST_GCM_16: + if (mac == NULL || + (mac->cri_alg != CRYPTO_AES_128_NIST_GMAC && + mac->cri_alg != CRYPTO_AES_192_NIST_GMAC && + mac->cri_alg != CRYPTO_AES_256_NIST_GMAC)) return EINVAL; break; + case CRYPTO_AES_CBC: + case CRYPTO_AES_ICM: case CRYPTO_AES_XTS: - if (csp->csp_ivlen != AES_XTS_IV_LEN) + if (mac != NULL && + mac->cri_alg != CRYPTO_SHA1_HMAC && + mac->cri_alg != CRYPTO_SHA2_256_HMAC && + mac->cri_alg != CRYPTO_SHA2_384_HMAC && + mac->cri_alg != CRYPTO_SHA2_512_HMAC) return EINVAL; break; default: return EINVAL; } - break; - case CSP_MODE_DIGEST: - switch (csp->csp_auth_alg) { + } else { + switch (mac->cri_alg) { case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_256: @@ -1743,59 +1838,18 @@ qat_probesession(device_t dev, const struct crypto_ses case CRYPTO_SHA2_512: case CRYPTO_SHA2_512_HMAC: break; - case CRYPTO_AES_NIST_GMAC: - if (csp->csp_ivlen != AES_GCM_IV_LEN) - return EINVAL; - break; default: return EINVAL; } - break; - case CSP_MODE_AEAD: - switch (csp->csp_cipher_alg) { - case CRYPTO_AES_NIST_GCM_16: - if (csp->csp_ivlen != AES_GCM_IV_LEN) - return EINVAL; - break; - default: - return EINVAL; - } - break; - case CSP_MODE_ETA: - switch (csp->csp_auth_alg) { - case CRYPTO_SHA1_HMAC: - case CRYPTO_SHA2_256_HMAC: - case CRYPTO_SHA2_384_HMAC: - case CRYPTO_SHA2_512_HMAC: - switch (csp->csp_cipher_alg) { - case CRYPTO_AES_CBC: - case CRYPTO_AES_ICM: - if (csp->csp_ivlen != AES_BLOCK_LEN) - return EINVAL; - break; - case CRYPTO_AES_XTS: - if (csp->csp_ivlen != AES_XTS_IV_LEN) - return EINVAL; - break; - default: - return EINVAL; - } - break; - default: - return EINVAL; - } - break; - default: - return EINVAL; } - return CRYPTODEV_PROBE_HARDWARE; + return 0; } static int -qat_newsession(device_t dev, crypto_session_t cses, - const struct crypto_session_params *csp) +qat_newsession(device_t dev, crypto_session_t cses, struct cryptoini *cri) { + struct cryptoini *enc, *mac; struct qat_crypto *qcy; struct qat_dmamem *qdm; struct qat_session *qs; @@ -1807,6 +1861,26 @@ qat_newsession(device_t dev, crypto_session_t cses, qs = crypto_get_driver_session(cses); qcy = &sc->sc_crypto; + enc = mac = NULL; + if (qat_is_hash(cri->cri_alg)) + mac = cri; + else + enc = cri; + cri = cri->cri_next; + + if (cri != NULL) { + if (enc == NULL && !qat_is_hash(cri->cri_alg)) + enc = cri; + if (mac == NULL && qat_is_hash(cri->cri_alg)) + mac = cri; + if (cri->cri_next != NULL || !(enc != NULL && mac != NULL)) + return EINVAL; + } + + error = qat_probesession(dev, enc, mac); + if (error != 0) + return error; + qdm = &qs->qs_desc_mem; error = qat_alloc_dmamem(sc, qdm, QAT_MAXSEG, sizeof(struct qat_crypto_desc) * 2, QAT_OPTIMAL_ALIGN); @@ -1830,91 +1904,103 @@ qat_newsession(device_t dev, crypto_session_t cses, qs->qs_status = QAT_SESSION_STATUS_ACTIVE; qs->qs_inflight = 0; - qs->qs_cipher_key = csp->csp_cipher_key; - qs->qs_cipher_klen = csp->csp_cipher_klen; - qs->qs_auth_key = csp->csp_auth_key; - qs->qs_auth_klen = csp->csp_auth_klen; + if (enc != NULL) { + qs->qs_cipher_key = enc->cri_key; + qs->qs_cipher_klen = enc->cri_klen / 8; + } + if (mac != NULL) { + qs->qs_auth_key = mac->cri_key; + qs->qs_auth_klen = mac->cri_klen / 8; + } - switch (csp->csp_cipher_alg) { - case CRYPTO_AES_CBC: - qs->qs_cipher_algo = qat_aes_cipher_algo(csp->csp_cipher_klen); - qs->qs_cipher_mode = HW_CIPHER_CBC_MODE; - break; - case CRYPTO_AES_ICM: - qs->qs_cipher_algo = qat_aes_cipher_algo(csp->csp_cipher_klen); - qs->qs_cipher_mode = HW_CIPHER_CTR_MODE; - break; - case CRYPTO_AES_XTS: - qs->qs_cipher_algo = - qat_aes_cipher_algo(csp->csp_cipher_klen / 2); - qs->qs_cipher_mode = HW_CIPHER_XTS_MODE; - break; - case CRYPTO_AES_NIST_GCM_16: - qs->qs_cipher_algo = qat_aes_cipher_algo(csp->csp_cipher_klen); - qs->qs_cipher_mode = HW_CIPHER_CTR_MODE; - qs->qs_auth_algo = HW_AUTH_ALGO_GALOIS_128; - qs->qs_auth_mode = HW_AUTH_MODE1; - break; - case 0: - break; - default: - panic("%s: unhandled cipher algorithm %d", __func__, - csp->csp_cipher_alg); + if (enc != NULL) { + switch (enc->cri_alg) { + case CRYPTO_AES_CBC: + qs->qs_cipher_algo = qat_aes_cipher_algo(enc->cri_klen); + qs->qs_cipher_mode = HW_CIPHER_CBC_MODE; + qs->qs_ivlen = AES_BLOCK_LEN; + break; + case CRYPTO_AES_ICM: + qs->qs_cipher_algo = qat_aes_cipher_algo(enc->cri_klen); + qs->qs_cipher_mode = HW_CIPHER_CTR_MODE; + qs->qs_ivlen = AES_BLOCK_LEN; + break; + case CRYPTO_AES_XTS: + qs->qs_cipher_algo = + qat_aes_cipher_algo(enc->cri_klen / 2); + qs->qs_cipher_mode = HW_CIPHER_XTS_MODE; + qs->qs_ivlen = AES_XTS_IV_LEN; + break; + case CRYPTO_AES_NIST_GCM_16: + qs->qs_cipher_algo = qat_aes_cipher_algo(enc->cri_klen); + qs->qs_cipher_mode = HW_CIPHER_CTR_MODE; + qs->qs_auth_algo = HW_AUTH_ALGO_GALOIS_128; + qs->qs_auth_mode = HW_AUTH_MODE1; + qs->qs_ivlen = AES_GCM_IV_LEN; + break; + case 0: + break; + default: + panic("%s: unhandled cipher algorithm %d", __func__, + enc->cri_alg); + } } - switch (csp->csp_auth_alg) { - case CRYPTO_SHA1_HMAC: - qs->qs_auth_algo = HW_AUTH_ALGO_SHA1; - qs->qs_auth_mode = HW_AUTH_MODE1; - break; - case CRYPTO_SHA1: - qs->qs_auth_algo = HW_AUTH_ALGO_SHA1; - qs->qs_auth_mode = HW_AUTH_MODE0; - break; - case CRYPTO_SHA2_256_HMAC: - qs->qs_auth_algo = HW_AUTH_ALGO_SHA256; - qs->qs_auth_mode = HW_AUTH_MODE1; - break; - case CRYPTO_SHA2_256: - qs->qs_auth_algo = HW_AUTH_ALGO_SHA256; - qs->qs_auth_mode = HW_AUTH_MODE0; - break; - case CRYPTO_SHA2_384_HMAC: - qs->qs_auth_algo = HW_AUTH_ALGO_SHA384; - qs->qs_auth_mode = HW_AUTH_MODE1; - break; - case CRYPTO_SHA2_384: - qs->qs_auth_algo = HW_AUTH_ALGO_SHA384; - qs->qs_auth_mode = HW_AUTH_MODE0; - break; - case CRYPTO_SHA2_512_HMAC: - qs->qs_auth_algo = HW_AUTH_ALGO_SHA512; - qs->qs_auth_mode = HW_AUTH_MODE1; - break; - case CRYPTO_SHA2_512: - qs->qs_auth_algo = HW_AUTH_ALGO_SHA512; - qs->qs_auth_mode = HW_AUTH_MODE0; - break; - case CRYPTO_AES_NIST_GMAC: - qs->qs_cipher_algo = qat_aes_cipher_algo(csp->csp_auth_klen); - qs->qs_cipher_mode = HW_CIPHER_CTR_MODE; - qs->qs_auth_algo = HW_AUTH_ALGO_GALOIS_128; - qs->qs_auth_mode = HW_AUTH_MODE1; + if (mac != NULL) { + switch (mac->cri_alg) { + case CRYPTO_SHA1_HMAC: + qs->qs_auth_algo = HW_AUTH_ALGO_SHA1; + qs->qs_auth_mode = HW_AUTH_MODE1; + break; + case CRYPTO_SHA1: + qs->qs_auth_algo = HW_AUTH_ALGO_SHA1; + qs->qs_auth_mode = HW_AUTH_MODE0; + break; + case CRYPTO_SHA2_256_HMAC: + qs->qs_auth_algo = HW_AUTH_ALGO_SHA256; + qs->qs_auth_mode = HW_AUTH_MODE1; + break; + case CRYPTO_SHA2_256: + qs->qs_auth_algo = HW_AUTH_ALGO_SHA256; + qs->qs_auth_mode = HW_AUTH_MODE0; + break; + case CRYPTO_SHA2_384_HMAC: + qs->qs_auth_algo = HW_AUTH_ALGO_SHA384; + qs->qs_auth_mode = HW_AUTH_MODE1; + break; + case CRYPTO_SHA2_384: + qs->qs_auth_algo = HW_AUTH_ALGO_SHA384; + qs->qs_auth_mode = HW_AUTH_MODE0; + break; + case CRYPTO_SHA2_512_HMAC: + qs->qs_auth_algo = HW_AUTH_ALGO_SHA512; + qs->qs_auth_mode = HW_AUTH_MODE1; + break; + case CRYPTO_SHA2_512: + qs->qs_auth_algo = HW_AUTH_ALGO_SHA512; + qs->qs_auth_mode = HW_AUTH_MODE0; + break; + case CRYPTO_AES_128_NIST_GMAC: + case CRYPTO_AES_192_NIST_GMAC: + case CRYPTO_AES_256_NIST_GMAC: + qs->qs_cipher_algo = qat_aes_cipher_algo(mac->cri_klen); + qs->qs_cipher_mode = HW_CIPHER_CTR_MODE; + qs->qs_auth_algo = HW_AUTH_ALGO_GALOIS_128; + qs->qs_auth_mode = HW_AUTH_MODE1; - qs->qs_cipher_key = qs->qs_auth_key; - qs->qs_cipher_klen = qs->qs_auth_klen; - break; - case 0: - break; - default: - panic("%s: unhandled auth algorithm %d", __func__, - csp->csp_auth_alg); + qs->qs_cipher_key = qs->qs_auth_key; + qs->qs_cipher_klen = qs->qs_auth_klen; + break; + case 0: + break; + default: + panic("%s: unhandled auth algorithm %d", __func__, + mac->cri_alg); + } } slices = 0; - switch (csp->csp_mode) { - case CSP_MODE_AEAD: - case CSP_MODE_ETA: + if (enc != NULL && mac != NULL) { /* auth then decrypt */ ddesc->qcd_slices[0] = FW_SLICE_AUTH; ddesc->qcd_slices[1] = FW_SLICE_CIPHER; @@ -1926,8 +2012,7 @@ qat_newsession(device_t dev, crypto_session_t cses, edesc->qcd_cipher_dir = HW_CIPHER_ENCRYPT; edesc->qcd_cmd_id = FW_LA_CMD_CIPHER_HASH; slices = 2; - break; - case CSP_MODE_CIPHER: + } else if (enc != NULL) { /* decrypt */ ddesc->qcd_slices[0] = FW_SLICE_CIPHER; ddesc->qcd_cipher_dir = HW_CIPHER_DECRYPT; @@ -1937,8 +2022,7 @@ qat_newsession(device_t dev, crypto_session_t cses, edesc->qcd_cipher_dir = HW_CIPHER_ENCRYPT; edesc->qcd_cmd_id = FW_LA_CMD_CIPHER; slices = 1; - break; - case CSP_MODE_DIGEST: + } else if (mac != NULL) { if (qs->qs_auth_algo == HW_AUTH_ALGO_GALOIS_128) { /* auth then decrypt */ ddesc->qcd_slices[0] = FW_SLICE_AUTH; @@ -1958,10 +2042,6 @@ qat_newsession(device_t dev, crypto_session_t cses, edesc->qcd_cmd_id = FW_LA_CMD_AUTH; slices = 1; } - break; - default: - panic("%s: unhandled crypto algorithm %d, %d", __func__, - csp->csp_cipher_alg, csp->csp_auth_alg); } ddesc->qcd_slices[slices] = FW_SLICE_DRAM_WR; edesc->qcd_slices[slices] = FW_SLICE_DRAM_WR; @@ -1969,13 +2049,13 @@ qat_newsession(device_t dev, crypto_session_t cses, qcy->qcy_sc->sc_hw.qhw_crypto_setup_desc(qcy, qs, ddesc); qcy->qcy_sc->sc_hw.qhw_crypto_setup_desc(qcy, qs, edesc); - if (csp->csp_auth_mlen != 0) - qs->qs_auth_mlen = csp->csp_auth_mlen; + if (mac != NULL && mac->cri_mlen != 0) + qs->qs_auth_mlen = mac->cri_mlen; else qs->qs_auth_mlen = edesc->qcd_auth_sz; /* Compute the GMAC by specifying a null cipher payload. */ - if (csp->csp_auth_alg == CRYPTO_AES_NIST_GMAC) + if (mac != NULL && mac->cri_alg == CRYPTO_AES_NIST_GMAC) ddesc->qcd_cmd_id = edesc->qcd_cmd_id = FW_LA_CMD_AUTH; return 0; @@ -2008,6 +2088,7 @@ qat_freesession(device_t dev, crypto_session_t cses) static int qat_process(device_t dev, struct cryptop *crp, int hint) { + struct cryptodesc *crd, *enc, *mac; struct qat_crypto *qcy; struct qat_crypto_bank *qcb; struct qat_crypto_desc const *desc; @@ -2022,14 +2103,31 @@ qat_process(device_t dev, struct cryptop *crp, int hin qs = crypto_get_driver_session(crp->crp_session); qsc = NULL; - if (__predict_false(crypto_buffer_len(&crp->crp_buf) > QAT_MAXLEN)) { + if (__predict_false(crp->crp_ilen > QAT_MAXLEN)) { error = E2BIG; goto fail1; } + crd = crp->crp_desc; + enc = mac = NULL; + if (qat_is_hash(crd->crd_alg)) + mac = crd; + else + enc = crd; + crd = crd->crd_next; + + if (crd != NULL) { + if (enc == NULL && !qat_is_hash(crd->crd_alg)) + enc = crd; + if (mac == NULL && qat_is_hash(crd->crd_alg)) + mac = crd; + if (crd->crd_next != NULL || !(enc != NULL && mac != NULL)) + return EINVAL; + } + mtx_lock(&qs->qs_session_mtx); if (qs->qs_auth_algo == HW_AUTH_ALGO_GALOIS_128) { - if (crp->crp_aad_length > QAT_GCM_AAD_SIZE_MAX) { + if (mac->crd_len > QAT_GCM_AAD_SIZE_MAX) { error = E2BIG; mtx_unlock(&qs->qs_session_mtx); goto fail1; @@ -2044,13 +2142,13 @@ qat_process(device_t dev, struct cryptop *crp, int hin * size updates here so that the device code can safely update * the session's recorded AAD size. */ - if (__predict_false(crp->crp_aad_length != qs->qs_aad_length)) { + if (__predict_false(mac->crd_len != qs->qs_aad_length)) { if (qs->qs_inflight == 0) { if (qs->qs_aad_length != -1) { counter_u64_add(sc->sc_gcm_aad_updates, 1); } - qs->qs_aad_length = crp->crp_aad_length; + qs->qs_aad_length = mac->crd_len; } else { qs->qs_need_wakeup = true; mtx_unlock(&qs->qs_session_mtx); @@ -2071,12 +2169,14 @@ qat_process(device_t dev, struct cryptop *crp, int hin goto fail2; } - if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) + if (enc != NULL && (enc->crd_flags & CRD_F_ENCRYPT) != 0) desc = qs->qs_enc_desc; else desc = qs->qs_dec_desc; - error = qat_crypto_load(qs, qsc, desc, crp); + qsc->qsc_enc = enc; + qsc->qsc_mac = mac; + error = qat_crypto_load(qs, qsc, crp, enc, mac); if (error != 0) goto fail2; @@ -2085,7 +2185,7 @@ qat_process(device_t dev, struct cryptop *crp, int hin qsbc->qsbc_session = qs; qsbc->qsbc_cb_tag = crp; - sc->sc_hw.qhw_crypto_setup_req_params(qcb, qs, desc, qsc, crp); + sc->sc_hw.qhw_crypto_setup_req_params(qcb, qs, desc, qsc, enc, mac); bus_dmamap_sync(qsc->qsc_buf_dma_tag, qsc->qsc_buf_dmamap, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); @@ -2118,7 +2218,6 @@ static device_method_t qat_methods[] = { DEVMETHOD(device_detach, qat_detach), /* Cryptodev interface */ - DEVMETHOD(cryptodev_probesession, qat_probesession), DEVMETHOD(cryptodev_newsession, qat_newsession), DEVMETHOD(cryptodev_freesession, qat_freesession), DEVMETHOD(cryptodev_process, qat_process), Modified: stable/12/sys/dev/qat/qat_hw15.c ============================================================================== --- head/sys/dev/qat/qat_hw15.c Thu Nov 5 15:55:23 2020 (r367386) +++ stable/12/sys/dev/qat/qat_hw15.c Mon Nov 9 15:36:11 2020 (r367525) @@ -546,19 +546,16 @@ qat_hw15_crypto_setup_cipher_desc(struct qat_crypto_de static void qat_hw15_crypto_setup_cipher_config(const struct qat_crypto_desc *desc, - const struct qat_session *qs, const struct cryptop *crp, + const struct qat_session *qs, const uint8_t *key, struct hw_cipher_config *cipher_config) { - const uint8_t *key; uint8_t *cipher_key; cipher_config->val = qat_crypto_load_cipher_session(desc, qs); cipher_config->reserved = 0; cipher_key = (uint8_t *)(cipher_config + 1); - if (crp != NULL && crp->crp_cipher_key != NULL) - key = crp->crp_cipher_key; - else + if (key == NULL) key = qs->qs_cipher_key; memcpy(cipher_key, key, qs->qs_cipher_klen); } @@ -610,11 +607,10 @@ qat_hw15_crypto_setup_auth_desc(struct qat_crypto_desc static void qat_hw15_crypto_setup_auth_setup(const struct qat_crypto_desc *desc, - const struct qat_session *qs, const struct cryptop *crp, + const struct qat_session *qs, const uint8_t *key, struct hw_auth_setup *auth_setup) { const struct qat_sym_hash_def *hash_def; - const uint8_t *key; uint8_t *state1, *state2; uint32_t state_sz, state1_sz, state2_sz, state1_pad_len, state2_pad_len; @@ -657,9 +653,7 @@ qat_hw15_crypto_setup_auth_setup(const struct qat_cryp auth_setup->auth_counter.counter = 0; break; case HW_AUTH_MODE1: - if (crp != NULL && crp->crp_auth_key != NULL) - key = crp->crp_auth_key; - else + if (key == NULL) key = qs->qs_auth_key; if (key != NULL) { qat_crypto_hmac_precompute(desc, key, @@ -769,7 +763,8 @@ qat_hw15_crypto_setup_desc(struct qat_crypto *qcy, str static void qat_hw15_crypto_req_setkey(const struct qat_crypto_desc *desc, const struct qat_session *qs, struct qat_sym_cookie *qsc, - struct fw_la_bulk_req *bulk_req, struct cryptop *crp) + struct fw_la_bulk_req *bulk_req, const struct cryptodesc *enc, + const struct cryptodesc *mac) { struct hw_auth_setup *auth_setup; struct hw_cipher_config *cipher_config; @@ -783,14 +778,14 @@ qat_hw15_crypto_req_setkey(const struct qat_crypto_des case FW_SLICE_CIPHER: cipher_config = (struct hw_cipher_config *) (cdesc + desc->qcd_cipher_offset); - qat_hw15_crypto_setup_cipher_config(desc, qs, crp, - cipher_config); + qat_hw15_crypto_setup_cipher_config(desc, qs, + enc->crd_key, cipher_config); break; case FW_SLICE_AUTH: auth_setup = (struct hw_auth_setup *) (cdesc + desc->qcd_auth_offset); - qat_hw15_crypto_setup_auth_setup(desc, qs, crp, - auth_setup); + qat_hw15_crypto_setup_auth_setup(desc, qs, + mac->crd_key, auth_setup); break; case FW_SLICE_DRAM_WR: i = MAX_FW_SLICE; /* end of chain */ @@ -806,7 +801,7 @@ qat_hw15_crypto_req_setkey(const struct qat_crypto_des void qat_hw15_crypto_setup_req_params(struct qat_crypto_bank *qcb, struct qat_session *qs, struct qat_crypto_desc const *desc, - struct qat_sym_cookie *qsc, struct cryptop *crp) + struct qat_sym_cookie *qsc, struct cryptodesc *enc, struct cryptodesc *mac) { struct qat_sym_bulk_cookie *qsbc; struct fw_la_bulk_req *bulk_req; @@ -830,9 +825,10 @@ qat_hw15_crypto_setup_req_params(struct qat_crypto_ban bulk_req->req_params_addr = qsc->qsc_bulk_req_params_buf_paddr; bulk_req->comn_ftr.next_request_addr = 0; bulk_req->comn_mid.opaque_data = (uint64_t)(uintptr_t)qsc; - if (__predict_false(crp->crp_cipher_key != NULL || - crp->crp_auth_key != NULL)) { - qat_hw15_crypto_req_setkey(desc, qs, qsc, bulk_req, crp); + if (__predict_false( + (enc != NULL && (enc->crd_flags & CRD_F_KEY_EXPLICIT) != 0) || + (mac != NULL && (mac->crd_flags & CRD_F_KEY_EXPLICIT) != 0))) { + qat_hw15_crypto_req_setkey(desc, qs, qsc, bulk_req, enc, mac); } digest_paddr = 0; @@ -865,7 +861,7 @@ qat_hw15_crypto_setup_req_params(struct qat_crypto_ban * only. */ cipher_req->cipher_off = 0; - cipher_req->cipher_len = crp->crp_payload_length; + cipher_req->cipher_len = enc->crd_len; } auth_req->curr_id = FW_SLICE_AUTH; if (cmd_id == FW_LA_CMD_HASH_CIPHER || cmd_id == FW_LA_CMD_AUTH) @@ -877,11 +873,11 @@ qat_hw15_crypto_setup_req_params(struct qat_crypto_ban auth_req->auth_res_sz = desc->qcd_auth_sz; auth_req->auth_off = 0; - auth_req->auth_len = crp->crp_payload_length; + auth_req->auth_len = enc->crd_len; auth_req->hash_state_sz = - roundup2(crp->crp_aad_length, QAT_AES_GCM_AAD_ALIGN) >> 3; - auth_req->u1.aad_addr = crp->crp_aad_length > 0 ? + roundup2(mac->crd_len, QAT_AES_GCM_AAD_ALIGN) >> 3; + auth_req->u1.aad_addr = mac->crd_len > 0 ? qsc->qsc_gcm_aad_paddr : 0; /* @@ -889,7 +885,7 @@ qat_hw15_crypto_setup_req_params(struct qat_crypto_ban * when the AAD length changes between requests in a session and * is synchronized by qat_process(). */ - aad_sz = htobe32(crp->crp_aad_length); + aad_sz = htobe32(mac->crd_len); aad_szp1 = (uint32_t *)( __DECONST(uint8_t *, desc->qcd_content_desc) + desc->qcd_gcm_aad_sz_offset1); @@ -897,7 +893,7 @@ qat_hw15_crypto_setup_req_params(struct qat_crypto_ban desc->qcd_gcm_aad_sz_offset2; if (__predict_false(*aad_szp1 != aad_sz)) { *aad_szp1 = aad_sz; - *aad_szp2 = (uint8_t)roundup2(crp->crp_aad_length, + *aad_szp2 = (uint8_t)roundup2(mac->crd_len, QAT_AES_GCM_AAD_ALIGN); bus_dmamap_sync(qs->qs_desc_mem.qdm_dma_tag, qs->qs_desc_mem.qdm_dma_map, @@ -918,9 +914,9 @@ qat_hw15_crypto_setup_req_params(struct qat_crypto_ban cipher_req->curr_id = FW_SLICE_CIPHER; cipher_req->next_id = next_slice; - cipher_req->cipher_off = crp->crp_aad_length == 0 ? 0 : - crp->crp_payload_start - crp->crp_aad_start; - cipher_req->cipher_len = crp->crp_payload_length; + cipher_req->cipher_off = mac != NULL ? + mac->crd_len - enc->crd_len : 0; + cipher_req->cipher_len = enc->crd_len; cipher_req->state_address = qsc->qsc_iv_buf_paddr; } if (cmd_id != FW_LA_CMD_CIPHER) { @@ -941,8 +937,7 @@ qat_hw15_crypto_setup_req_params(struct qat_crypto_ban *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Mon Nov 9 15:37:13 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25099465E67; Mon, 9 Nov 2020 15:37:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVFVK0XHrz3DK1; Mon, 9 Nov 2020 15:37:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 054D413A6C; Mon, 9 Nov 2020 15:37:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A9FbC6I037202; Mon, 9 Nov 2020 15:37:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9FbCx6037201; Mon, 9 Nov 2020 15:37:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011091537.0A9FbCx6037201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 9 Nov 2020 15:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367526 - in stable/12/sys: contrib/dev/qat modules modules/qatfw X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: contrib/dev/qat modules modules/qatfw X-SVN-Commit-Revision: 367526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 15:37:13 -0000 Author: markj Date: Mon Nov 9 15:37:12 2020 New Revision: 367526 URL: https://svnweb.freebsd.org/changeset/base/367526 Log: MFC r367387, r367422: Add firmware modules for qat(4) Added: stable/12/sys/contrib/dev/qat/ - copied from r367387, head/sys/contrib/dev/qat/ stable/12/sys/modules/qatfw/ - copied from r367387, head/sys/modules/qatfw/ Modified: stable/12/sys/contrib/dev/qat/mmp_firmware_c2xxx.bin (contents, props changed) stable/12/sys/contrib/dev/qat/mof_firmware_c2xxx.bin (contents, props changed) stable/12/sys/contrib/dev/qat/qat_895xcc.bin (contents, props changed) stable/12/sys/contrib/dev/qat/qat_895xcc_mmp.bin (contents, props changed) stable/12/sys/contrib/dev/qat/qat_c3xxx.bin (contents, props changed) stable/12/sys/contrib/dev/qat/qat_c3xxx_mmp.bin (contents, props changed) stable/12/sys/contrib/dev/qat/qat_c62x.bin (contents, props changed) stable/12/sys/contrib/dev/qat/qat_c62x_mmp.bin (contents, props changed) stable/12/sys/contrib/dev/qat/qat_d15xx.bin (contents, props changed) stable/12/sys/contrib/dev/qat/qat_d15xx_mmp.bin (contents, props changed) stable/12/sys/modules/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/contrib/dev/qat/mmp_firmware_c2xxx.bin ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/12/sys/contrib/dev/qat/mof_firmware_c2xxx.bin ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/12/sys/contrib/dev/qat/qat_895xcc.bin ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/12/sys/contrib/dev/qat/qat_895xcc_mmp.bin ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/12/sys/contrib/dev/qat/qat_c3xxx.bin ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/12/sys/contrib/dev/qat/qat_c3xxx_mmp.bin ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/12/sys/contrib/dev/qat/qat_c62x.bin ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/12/sys/contrib/dev/qat/qat_c62x_mmp.bin ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/12/sys/contrib/dev/qat/qat_d15xx.bin ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/12/sys/contrib/dev/qat/qat_d15xx_mmp.bin ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/12/sys/modules/Makefile ============================================================================== --- stable/12/sys/modules/Makefile Mon Nov 9 15:36:11 2020 (r367525) +++ stable/12/sys/modules/Makefile Mon Nov 9 15:37:12 2020 (r367526) @@ -324,6 +324,7 @@ SUBDIR= \ puc \ pwm \ ${_qat} \ + ${_qatfw} \ ${_qlxge} \ ${_qlxgb} \ ${_qlxgbe} \ @@ -663,6 +664,7 @@ _ndis= ndis _ocs_fc= ocs_fc _pccard= pccard _qat= qat +_qatfw= qatfw .if ${MK_OFED} != "no" || defined(ALL_MODULES) _rdma= rdma .endif From owner-svn-src-stable@freebsd.org Mon Nov 9 15:37:58 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E6494662CE; Mon, 9 Nov 2020 15:37:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVFWB1q2kz3DRQ; Mon, 9 Nov 2020 15:37:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 313CF137FD; Mon, 9 Nov 2020 15:37:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A9FbvOv037294; Mon, 9 Nov 2020 15:37:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9Fbvtl037293; Mon, 9 Nov 2020 15:37:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011091537.0A9Fbvtl037293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 9 Nov 2020 15:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367527 - stable/12/tests/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/tests/sys/opencrypto X-SVN-Commit-Revision: 367527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 15:37:58 -0000 Author: markj Date: Mon Nov 9 15:37:57 2020 New Revision: 367527 URL: https://svnweb.freebsd.org/changeset/base/367527 Log: MFC r367388: cryptotest: Add qat(4) coverage Modified: stable/12/tests/sys/opencrypto/cryptotest.py Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/opencrypto/cryptotest.py ============================================================================== --- stable/12/tests/sys/opencrypto/cryptotest.py Mon Nov 9 15:37:12 2020 (r367526) +++ stable/12/tests/sys/opencrypto/cryptotest.py Mon Nov 9 15:37:57 2020 (r367527) @@ -49,9 +49,9 @@ def katg(base, glob): raise unittest.SkipTest("Missing %s test vectors" % (base)) return iglob(os.path.join(katdir, base, glob)) -aesmodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0', 'safexcel0' ] +aesmodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0', 'safexcel0', 'qat0' ] desmodules = [ 'cryptosoft0', ] -shamodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0', 'safexcel0' ] +shamodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0', 'safexcel0', 'qat0' ] def GenTestCase(cname): try: @@ -471,6 +471,7 @@ aesni = GenTestCase('aesni0') ccr = GenTestCase('ccr0') ccp = GenTestCase('ccp0') safexcel = GenTestCase('safexcel0') +qat = GenTestCase('qat0') if __name__ == '__main__': unittest.main() From owner-svn-src-stable@freebsd.org Mon Nov 9 18:07:21 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAD31469EF8; Mon, 9 Nov 2020 18:07:21 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVJqY4RBVz3hdl; Mon, 9 Nov 2020 18:07:21 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B3BF15842; Mon, 9 Nov 2020 18:07:21 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A9I7L0d038100; Mon, 9 Nov 2020 18:07:21 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9I7LAO038099; Mon, 9 Nov 2020 18:07:21 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202011091807.0A9I7LAO038099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Mon, 9 Nov 2020 18:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367528 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 367528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 18:07:21 -0000 Author: mhorne Date: Mon Nov 9 18:07:21 2020 New Revision: 367528 URL: https://svnweb.freebsd.org/changeset/base/367528 Log: MFC r366526: Handle kmod local relocation failures gracefully Modified: stable/12/sys/kern/link_elf_obj.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/link_elf_obj.c ============================================================================== --- stable/12/sys/kern/link_elf_obj.c Mon Nov 9 15:37:57 2020 (r367527) +++ stable/12/sys/kern/link_elf_obj.c Mon Nov 9 18:07:21 2020 (r367528) @@ -1660,9 +1660,11 @@ link_elf_reloc_local(linker_file_t lf, bool ifuncs) if (ELF_ST_BIND(sym->st_info) != STB_LOCAL) continue; if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC || - elf_is_ifunc_reloc(rel->r_info)) == ifuncs) - elf_reloc_local(lf, base, rel, ELF_RELOC_REL, - elf_obj_lookup); + elf_is_ifunc_reloc(rel->r_info)) != ifuncs) + continue; + if (elf_reloc_local(lf, base, rel, ELF_RELOC_REL, + elf_obj_lookup) != 0) + return (ENOEXEC); } } @@ -1688,9 +1690,11 @@ link_elf_reloc_local(linker_file_t lf, bool ifuncs) if (ELF_ST_BIND(sym->st_info) != STB_LOCAL) continue; if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC || - elf_is_ifunc_reloc(rela->r_info)) == ifuncs) - elf_reloc_local(lf, base, rela, ELF_RELOC_RELA, - elf_obj_lookup); + elf_is_ifunc_reloc(rela->r_info)) != ifuncs) + continue; + if (elf_reloc_local(lf, base, rela, ELF_RELOC_RELA, + elf_obj_lookup) != 0) + return (ENOEXEC); } } return (0); From owner-svn-src-stable@freebsd.org Mon Nov 9 21:19:18 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12AE346D971; Mon, 9 Nov 2020 21:19:18 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVP5204zCz3tcx; Mon, 9 Nov 2020 21:19:18 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9F7A17C71; Mon, 9 Nov 2020 21:19:17 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A9LJHGu051377; Mon, 9 Nov 2020 21:19:17 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9LJHkQ051376; Mon, 9 Nov 2020 21:19:17 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202011092119.0A9LJHkQ051376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 9 Nov 2020 21:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367529 - stable/12/sys/mips/mips X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/sys/mips/mips X-SVN-Commit-Revision: 367529 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 21:19:18 -0000 Author: jhibbits Date: Mon Nov 9 21:19:17 2020 New Revision: 367529 URL: https://svnweb.freebsd.org/changeset/base/367529 Log: MFC r367355: Fix UMA alignment for COP2 context structure. Modified: stable/12/sys/mips/mips/octeon_cop2.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/mips/mips/octeon_cop2.c ============================================================================== --- stable/12/sys/mips/mips/octeon_cop2.c Mon Nov 9 18:07:21 2020 (r367528) +++ stable/12/sys/mips/mips/octeon_cop2.c Mon Nov 9 21:19:17 2020 (r367529) @@ -46,7 +46,7 @@ octeon_cop2_init(void* dummy) printf("Create COP2 context zone\n"); ctxzone = uma_zcreate("COP2 context", sizeof(struct octeon_cop2_state), - NULL, NULL, NULL, NULL, 8, 0); + NULL, NULL, NULL, NULL, UMA_ALIGN_LONG, 0); } struct octeon_cop2_state * From owner-svn-src-stable@freebsd.org Mon Nov 9 23:38:39 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1E262D05BA; Mon, 9 Nov 2020 23:38:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVS9q4dQQz4Wt6; Mon, 9 Nov 2020 23:38:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D5C5195A2; Mon, 9 Nov 2020 23:38:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A9Ncdsm033671; Mon, 9 Nov 2020 23:38:39 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A9NcdZj033670; Mon, 9 Nov 2020 23:38:39 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202011092338.0A9NcdZj033670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 9 Nov 2020 23:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367540 - stable/12/sys/dev/usb X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/12/sys/dev/usb X-SVN-Commit-Revision: 367540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 23:38:39 -0000 Author: bz Date: Mon Nov 9 23:38:39 2020 New Revision: 367540 URL: https://svnweb.freebsd.org/changeset/base/367540 Log: MFC r367435,367539: usb_hub: giving up port reset - device vanished Improve the output of the recently often experienced debug message in order to gather further data. PR: 237666 Modified: stable/12/sys/dev/usb/usb_hub.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/usb_hub.c ============================================================================== --- stable/12/sys/dev/usb/usb_hub.c Mon Nov 9 23:36:51 2020 (r367539) +++ stable/12/sys/dev/usb/usb_hub.c Mon Nov 9 23:38:39 2020 (r367540) @@ -756,8 +756,10 @@ repeat: if ((sc->sc_st.port_change & UPS_C_CONNECT_STATUS) || (!(sc->sc_st.port_status & UPS_CURRENT_CONNECT_STATUS))) { if (timeout) { - DPRINTFN(0, "giving up port reset " - "- device vanished\n"); + DPRINTFN(0, "giving up port %d reset - " + "device vanished: change %#x status %#x\n", + portno, sc->sc_st.port_change, + sc->sc_st.port_status); goto error; } timeout = 1; From owner-svn-src-stable@freebsd.org Tue Nov 10 07:47:25 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 322CC2E61D2; Tue, 10 Nov 2020 07:47:25 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVg1n0xWFz3FwJ; Tue, 10 Nov 2020 07:47:25 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1343B1F4A8; Tue, 10 Nov 2020 07:47:25 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AA7lO19032508; Tue, 10 Nov 2020 07:47:24 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AA7lOEh032507; Tue, 10 Nov 2020 07:47:24 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011100747.0AA7lOEh032507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Tue, 10 Nov 2020 07:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367546 - stable/12/libexec/rc/rc.d X-SVN-Group: stable-12 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/12/libexec/rc/rc.d X-SVN-Commit-Revision: 367546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 07:47:25 -0000 Author: 0mp (doc,ports committer) Date: Tue Nov 10 07:47:24 2020 New Revision: 367546 URL: https://svnweb.freebsd.org/changeset/base/367546 Log: MFC r367291: rc.d/zfs: Add shutdown to KEYWORDS The problem is that without walling /etc/rc.d/zfs on shutdown, resources associated with ZFS mounts are not freed and the jails will remain in dying state. In addition, the dataset is now in a dangling state, as the jail it is attached to is dying. A known workaround for jails was to add the following lines to /etc/jail.conf, to make sure that "service zfs stop" is run when the jail is stopped: exec.stop = "/bin/sh /etc/rc.shutdown"; exec.stop += "/usr/sbin/service zfs stop || /usr/bin/true"; While the workaround seems to be okay-ish for the jail situation, it is still unclean. However, for physical hosts this may wreak havoc with the pool if shared spares are used, as "zfs unshare" is never invoked on shutdown. PR: 147444 Submitted by: Markus Stoff Reported by: Mykah Reviewed by: cy Approved by: cy (src) Relnotes: yes Modified: stable/12/libexec/rc/rc.d/zfs Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.d/zfs ============================================================================== --- stable/12/libexec/rc/rc.d/zfs Tue Nov 10 02:26:44 2020 (r367545) +++ stable/12/libexec/rc/rc.d/zfs Tue Nov 10 07:47:24 2020 (r367546) @@ -6,6 +6,7 @@ # PROVIDE: zfs # REQUIRE: zfsbe # BEFORE: FILESYSTEMS var +# KEYWORD: shutdown . /etc/rc.subr From owner-svn-src-stable@freebsd.org Tue Nov 10 08:33:46 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FA202E7333; Tue, 10 Nov 2020 08:33:46 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVh3G0Nm0z3JTC; Tue, 10 Nov 2020 08:33:46 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0007D20031; Tue, 10 Nov 2020 08:33:45 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AA8Xj55063452; Tue, 10 Nov 2020 08:33:45 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AA8XjNR063451; Tue, 10 Nov 2020 08:33:45 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011100833.0AA8XjNR063451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Tue, 10 Nov 2020 08:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367547 - stable/12/tools/build X-SVN-Group: stable-12 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/12/tools/build X-SVN-Commit-Revision: 367547 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 08:33:46 -0000 Author: 0mp (doc,ports committer) Date: Tue Nov 10 08:33:45 2020 New Revision: 367547 URL: https://svnweb.freebsd.org/changeset/base/367547 Log: MFC r367072: Mount devfs inside a beinstall(8) chroot It turns out that without /dev/null beinstall is not able to complete and instead exits with messages similar to these: -------------------------------------------------------------- >>> Installing kernel GENERIC completed on Sun Oct 25 17:47:37 CET 2020 -------------------------------------------------------------- /tmp/beinstall.JleGoP/mnt: Inspecting dirs /usr/src /usr/obj/usr/src/amd64.amd64 --- installworld --- make[1]: "/usr/obj/usr/src/amd64.amd64/toolchain-metadata.mk" line 1: Using cached toolchain metadata from build at t480 on Sun Oct 25 15:53:28 CET 2020 make[2]: "/dev/null" line 2: Need an operator make[2]: Fatal errors encountered -- cannot continuemake[1]: "/usr/src/Makefile.inc1" line 593: CPUTYPE global should be set with ?=. Cleaning up ... umount -f /tmp/beinstall.JleGoP/mnt/usr/src /tmp/beinstall.JleGoP/mnt/usr/obj/usr/src/amd64.amd64 /tmp/beinstall.JleGoP/mnt Destroyed successfully error: Installworld failed! Upon a bit of debugging, it turns out that /dev/null inside the chroot environment is full random bytes, which cause "make -f /dev/null" to misbehave. Mounting a proper devfs inside the chroot seems to be the most appropriate way to fix it. will@ also noted that this change requires that whatever is needed in devfs must exist in the old kernel. Approved by: will Modified: stable/12/tools/build/beinstall.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/build/beinstall.sh ============================================================================== --- stable/12/tools/build/beinstall.sh Tue Nov 10 07:47:24 2020 (r367546) +++ stable/12/tools/build/beinstall.sh Tue Nov 10 08:33:45 2020 (r367547) @@ -216,6 +216,7 @@ fi create_be_dirs "${srcdir}" "${objdir}" || errx "Unable to create BE dirs" mount -t nullfs "${srcdir}" "${BE_MNTPT}${srcdir}" || errx "Unable to mount src" mount -t nullfs "${objdir}" "${BE_MNTPT}${objdir}" || errx "Unable to mount obj" +mount -t devfs devfs "${BE_MNTPT}/dev" || errx "Unable to mount devfs" chroot ${BE_MNTPT} make "$@" -C ${srcdir} installworld || \ errx "Installworld failed!" From owner-svn-src-stable@freebsd.org Tue Nov 10 08:59:56 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46D9C2E7F8F; Tue, 10 Nov 2020 08:59:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVhdS1cQjz3Kys; Tue, 10 Nov 2020 08:59:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A29720583; Tue, 10 Nov 2020 08:59:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AA8xtd6077325; Tue, 10 Nov 2020 08:59:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AA8xtmY077324; Tue, 10 Nov 2020 08:59:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011100859.0AA8xtmY077324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 10 Nov 2020 08:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367548 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 367548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 08:59:56 -0000 Author: kib Date: Tue Nov 10 08:59:55 2020 New Revision: 367548 URL: https://svnweb.freebsd.org/changeset/base/367548 Log: MFC r367296: if_media.c SIOCGMEDIAX handler: improve loop Modified: stable/12/sys/net/if_media.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_media.c ============================================================================== --- stable/12/sys/net/if_media.c Tue Nov 10 08:33:45 2020 (r367547) +++ stable/12/sys/net/if_media.c Tue Nov 10 08:59:55 2020 (r367548) @@ -301,15 +301,17 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, st * allocate. */ i = 0; - LIST_FOREACH(ep, &ifm->ifm_list, ifm_list) - if (i++ < ifmr->ifm_count) { + LIST_FOREACH(ep, &ifm->ifm_list, ifm_list) { + if (i < ifmr->ifm_count) { error = copyout(&ep->ifm_media, - ifmr->ifm_ulist + i - 1, sizeof(int)); - if (error) + ifmr->ifm_ulist + i, sizeof(int)); + if (error != 0) break; } + i++; + } if (error == 0 && i > ifmr->ifm_count) - error = ifmr->ifm_count ? E2BIG : 0; + error = ifmr->ifm_count != 0 ? E2BIG : 0; ifmr->ifm_count = i; break; } From owner-svn-src-stable@freebsd.org Tue Nov 10 10:19:56 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 092C92EA45A; Tue, 10 Nov 2020 10:19:56 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVkPl6xkTz3Qp3; Tue, 10 Nov 2020 10:19:55 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1557211D8; Tue, 10 Nov 2020 10:19:55 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AAAJt1h027451; Tue, 10 Nov 2020 10:19:55 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AAAJtTF027449; Tue, 10 Nov 2020 10:19:55 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011101019.0AAAJtTF027449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Tue, 10 Nov 2020 10:19:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367550 - in stable/12: libexec/rc share/man/man8 X-SVN-Group: stable-12 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: in stable/12: libexec/rc share/man/man8 X-SVN-Commit-Revision: 367550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 10:19:56 -0000 Author: 0mp (doc,ports committer) Date: Tue Nov 10 10:19:55 2020 New Revision: 367550 URL: https://svnweb.freebsd.org/changeset/base/367550 Log: MFC r351863: rc: Honor ${name}_env when a custom *_cmd is defined (e.g., start_cmd) A user may set ${name}_env variable in rc.conf(5) in order to set additional environment variables for a service command. Unfortunately, at the moment this variable is only honored when the command is specified via the command variable. Those additional environment variables coming from ${name}_env are never set if the service is started via the ${rc_arg}_cmd variable (for example start_cmd). PR: 239692 Reviewed by: bcr, jilles Approved by: src (jilles) Requested by: koobs Modified: stable/12/libexec/rc/rc.subr stable/12/share/man/man8/rc.subr.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.subr ============================================================================== --- stable/12/libexec/rc/rc.subr Tue Nov 10 10:17:11 2020 (r367549) +++ stable/12/libexec/rc/rc.subr Tue Nov 10 10:19:55 2020 (r367550) @@ -1024,6 +1024,9 @@ run_rc_command() _postcmd=\$${rc_arg}_postcmd if [ -n "$_cmd" ]; then + if [ -n "$_env" ]; then + eval "export -- $_env" + fi _run_rc_precmd || return 1 _run_rc_doit "$_cmd $rc_extra_args" || return 1 _run_rc_postcmd Modified: stable/12/share/man/man8/rc.subr.8 ============================================================================== --- stable/12/share/man/man8/rc.subr.8 Tue Nov 10 10:17:11 2020 (r367549) +++ stable/12/share/man/man8/rc.subr.8 Tue Nov 10 10:19:55 2020 (r367550) @@ -556,9 +556,19 @@ is mounted. A list of environment variables to run .Va command with. -This will be passed as arguments to the +Those variables will be passed as arguments to the .Xr env 1 -utility. +utility unless +.Ar argument Ns Va _cmd +is defined. +In that case the contents of +.Va ${name}_env +will be exported via the +.Xr export 1 +builtin of +.Xr sh 1 , +which puts some limitations on the names of variables +(e.g., a variable name may not start with a digit). .It Va ${name}_env_file A file to source for environmental variables to run .Va command From owner-svn-src-stable@freebsd.org Tue Nov 10 12:13:19 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A7D02EE4A0; Tue, 10 Nov 2020 12:13:19 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVmwb3VFFz3pX0; Tue, 10 Nov 2020 12:13:19 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B19422B47; Tue, 10 Nov 2020 12:13:19 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AACDJPP001281; Tue, 10 Nov 2020 12:13:19 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AACDIS2001278; Tue, 10 Nov 2020 12:13:18 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202011101213.0AACDIS2001278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 10 Nov 2020 12:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367553 - in stable/12: share/dtrace sys/netpfil/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/12: share/dtrace sys/netpfil/ipfw X-SVN-Commit-Revision: 367553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 12:13:19 -0000 Author: ae Date: Tue Nov 10 12:13:18 2020 New Revision: 367553 URL: https://svnweb.freebsd.org/changeset/base/367553 Log: MFC r366908 (modified for stable/12 KBI): Add dtrace SDT probe ipfw:::rule-matched. It helps to reduce complexity with debugging of large ipfw rulesets. Also define several constants and translators, that can by used by dtrace scripts with this probe. Obtained from: Yandex LLC Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D26879 Added: stable/12/share/dtrace/ipfw.d - copied, changed from r366908, head/share/dtrace/ipfw.d Modified: stable/12/share/dtrace/Makefile stable/12/sys/netpfil/ipfw/ip_fw2.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/dtrace/Makefile ============================================================================== --- stable/12/share/dtrace/Makefile Tue Nov 10 11:32:01 2020 (r367552) +++ stable/12/share/dtrace/Makefile Tue Nov 10 12:13:18 2020 (r367553) @@ -21,7 +21,7 @@ SCRIPTS= blocking \ SCRIPTSDIR= ${SHAREDIR}/dtrace -DSRCS= mbuf.d +DSRCS= mbuf.d ipfw.d FILES= ${DSRCS} FILESDIR= /usr/lib/dtrace Copied and modified: stable/12/share/dtrace/ipfw.d (from r366908, head/share/dtrace/ipfw.d) ============================================================================== --- head/share/dtrace/ipfw.d Wed Oct 21 15:01:33 2020 (r366908, copy source) +++ stable/12/share/dtrace/ipfw.d Tue Nov 10 12:13:18 2020 (r367553) @@ -68,29 +68,17 @@ inline string ipfw_retcodes[int ret] = /* ip_fw_args flags */ #pragma D binding "1.0" IPFW_ARGS_ETHER -inline int IPFW_ARGS_ETHER = 0x00010000; /* valid ethernet header */ +inline int IPFW_ARGS_ETHER = 0x0001; /* valid ethernet header */ #pragma D binding "1.0" IPFW_ARGS_NH4 -inline int IPFW_ARGS_NH4 = 0x00020000; /* IPv4 next hop in hopstore */ +inline int IPFW_ARGS_NH4 = 0x0002; /* IPv4 next hop in hopstore */ #pragma D binding "1.0" IPFW_ARGS_NH6 -inline int IPFW_ARGS_NH6 = 0x00040000; /* IPv6 next hop in hopstore */ +inline int IPFW_ARGS_NH6 = 0x0004; /* IPv6 next hop in hopstore */ #pragma D binding "1.0" IPFW_ARGS_NH4PTR -inline int IPFW_ARGS_NH4PTR = 0x00080000; /* IPv4 next hop in next_hop */ +inline int IPFW_ARGS_NH4PTR = 0x0008; /* IPv4 next hop in next_hop */ #pragma D binding "1.0" IPFW_ARGS_NH6PTR -inline int IPFW_ARGS_NH6PTR = 0x00100000; /* IPv6 next hop in next_hop6 */ +inline int IPFW_ARGS_NH6PTR = 0x0010; /* IPv6 next hop in next_hop6 */ #pragma D binding "1.0" IPFW_ARGS_REF -inline int IPFW_ARGS_REF = 0x00200000; /* valid ipfw_rule_ref */ -#pragma D binding "1.0" IPFW_ARGS_IN -inline int IPFW_ARGS_IN = 0x00400000; /* called on input */ -#pragma D binding "1.0" IPFW_ARGS_OUT -inline int IPFW_ARGS_OUT = 0x00800000; /* called on output */ -#pragma D binding "1.0" IPFW_ARGS_IP4 -inline int IPFW_ARGS_IP4 = 0x01000000; /* belongs to v4 ISR */ -#pragma D binding "1.0" IPFW_ARGS_IP6 -inline int IPFW_ARGS_IP6 = 0x02000000; /* belongs to v6 ISR */ -#pragma D binding "1.0" IPFW_ARGS_DROP -inline int IPFW_ARGS_DROP = 0x04000000; /* drop it (dummynet) */ -#pragma D binding "1.0" IPFW_ARGS_LENMASK -inline int IPFW_ARGS_LENMASK = 0x0000ffff; /* length of data in *mem */ +inline int IPFW_ARGS_REF = 0x0020; /* valid ipfw_rule_ref */ /* ipfw_rule_ref.info */ #pragma D binding "1.0" IPFW_INFO_MASK @@ -147,17 +135,13 @@ typedef struct ipfw_match_info { #pragma D binding "1.0" translator translator ipfw_match_info_t < struct ip_fw_args *p > { flags = p->flags; - m = (p->flags & IPFW_ARGS_LENMASK) ? NULL : p->m; - mem = (p->flags & IPFW_ARGS_LENMASK) ? p->mem : NULL; + m = p->m; + mem = NULL; inp = p->inp; - ifp = p->ifp; + ifp = p->oif; /* Initialize IP pointer corresponding to addr_type */ - ipp = (p->flags & IPFW_ARGS_IP4) ? - (p->flags & IPFW_ARGS_LENMASK) ? (struct ip *)p->mem : - (p->m != NULL) ? (struct ip *)p->m->m_data : NULL : NULL; - ip6p = (p->flags & IPFW_ARGS_IP6) ? - (p->flags & IPFW_ARGS_LENMASK) ? (struct ip6_hdr *)p->mem : - (p->m != NULL) ? (struct ip6_hdr *)p->m->m_data : NULL : NULL; + ipp = (p->m != NULL) ? (struct ip *)p->m->m_data : NULL; + ip6p = (p->m != NULL) ? (struct ip6_hdr *)p->m->m_data : NULL; /* fill f_id fields */ addr_type = p->f_id.addr_type; Modified: stable/12/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw2.c Tue Nov 10 11:32:01 2020 (r367552) +++ stable/12/sys/netpfil/ipfw/ip_fw2.c Tue Nov 10 12:13:18 2020 (r367553) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -105,6 +106,18 @@ __FBSDID("$FreeBSD$"); #include #endif +#define IPFW_PROBE(probe, arg0, arg1, arg2, arg3, arg4, arg5) \ + SDT_PROBE6(ipfw, , , probe, arg0, arg1, arg2, arg3, arg4, arg5) + +SDT_PROVIDER_DEFINE(ipfw); +SDT_PROBE_DEFINE6(ipfw, , , rule__matched, + "int", /* retval */ + "int", /* af */ + "void *", /* src addr */ + "void *", /* dst addr */ + "struct ip_fw_args *", /* args */ + "struct ip_fw *" /* rule */); + /* * static variables followed by global ones. * All ipfw global variables are here. @@ -3188,6 +3201,13 @@ do { \ struct ip_fw *rule = chain->map[f_pos]; /* Update statistics */ IPFW_INC_RULE_COUNTER(rule, pktlen); + IPFW_PROBE(rule__matched, retval, + is_ipv4 ? AF_INET : AF_INET6, + is_ipv4 ? (uintptr_t)&src_ip : + (uintptr_t)&args->f_id.src_ip6, + is_ipv4 ? (uintptr_t)&dst_ip : + (uintptr_t)&args->f_id.dst_ip6, + args, rule); } else { retval = IP_FW_DENY; printf("ipfw: ouch!, skip past end of rules, denying packet\n"); From owner-svn-src-stable@freebsd.org Tue Nov 10 12:46:00 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3EE802EF617; Tue, 10 Nov 2020 12:46:00 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVnfJ17Kdz3rmL; Tue, 10 Nov 2020 12:46:00 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 199B922E49; Tue, 10 Nov 2020 12:46:00 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AACjxrq019970; Tue, 10 Nov 2020 12:45:59 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AACjxJN019967; Tue, 10 Nov 2020 12:45:59 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202011101245.0AACjxJN019967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 10 Nov 2020 12:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367554 - in stable/12: share/man/man4 sys/netinet sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/netinet sys/sys X-SVN-Commit-Revision: 367554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 12:46:00 -0000 Author: ae Date: Tue Nov 10 12:45:59 2020 New Revision: 367554 URL: https://svnweb.freebsd.org/changeset/base/367554 Log: MFC r366695: Implement SIOCGIFALIAS. It is lightweight way to check if an IPv4 address exists. Submitted by: Roy Marples Differential Revision: https://reviews.freebsd.org/D26636 Modified: stable/12/share/man/man4/netintro.4 stable/12/sys/netinet/in.c stable/12/sys/sys/sockio.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/netintro.4 ============================================================================== --- stable/12/share/man/man4/netintro.4 Tue Nov 10 12:13:18 2020 (r367553) +++ stable/12/share/man/man4/netintro.4 Tue Nov 10 12:45:59 2020 (r367554) @@ -28,7 +28,7 @@ .\" @(#)netintro.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd January 26, 2012 +.Dd October 14, 2020 .Dt NETINTRO 4 .Os .Sh NAME @@ -349,6 +349,13 @@ multiple masks or destination addresses, and also adop convention that specification of the default address means to delete the first address for the interface belonging to the address family in which the original socket was opened. +.It Dv SIOCGIFALIAS +This request provides means to get additional addresses +together with netmask and broadcast/destination from an +interface. +It also uses the +.Vt ifaliasreq +structure. .It Dv SIOCGIFCONF Get interface configuration list. This request takes an Modified: stable/12/sys/netinet/in.c ============================================================================== --- stable/12/sys/netinet/in.c Tue Nov 10 12:13:18 2020 (r367553) +++ stable/12/sys/netinet/in.c Tue Nov 10 12:45:59 2020 (r367554) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); static int in_aifaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *); static int in_difaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *); +static int in_gifaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *); static void in_socktrim(struct sockaddr_in *); static void in_purgemaddrs(struct ifnet *); @@ -240,6 +241,11 @@ in_control(struct socket *so, u_long cmd, caddr_t data case SIOCGIFDSTADDR: case SIOCGIFNETMASK: break; + case SIOCGIFALIAS: + sx_xlock(&in_control_sx); + error = in_gifaddr_ioctl(cmd, data, ifp, td); + sx_xunlock(&in_control_sx); + return (error); case SIOCDIFADDR: sx_xlock(&in_control_sx); error = in_difaddr_ioctl(cmd, data, ifp, td); @@ -648,6 +654,60 @@ in_difaddr_ioctl(u_long cmd, caddr_t data, struct ifne IFADDR_EVENT_DEL); ifa_free(&ia->ia_ifa); /* in_ifaddrhead */ + return (0); +} + +static int +in_gifaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct thread *td) +{ + struct in_aliasreq *ifra = (struct in_aliasreq *)data; + const struct sockaddr_in *addr = &ifra->ifra_addr; + struct epoch_tracker et; + struct ifaddr *ifa; + struct in_ifaddr *ia; + + /* + * ifra_addr must be present and be of INET family. + */ + if (addr->sin_len != sizeof(struct sockaddr_in) || + addr->sin_family != AF_INET) + return (EINVAL); + + /* + * See whether address exist. + */ + ia = NULL; + NET_EPOCH_ENTER_ET(et); + CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + struct in_ifaddr *it; + + if (ifa->ifa_addr->sa_family != AF_INET) + continue; + + it = (struct in_ifaddr *)ifa; + if (it->ia_addr.sin_addr.s_addr == addr->sin_addr.s_addr && + prison_check_ip4(td->td_ucred, &addr->sin_addr) == 0) { + ia = it; + break; + } + } + if (ia == NULL) { + NET_EPOCH_EXIT_ET(et); + return (EADDRNOTAVAIL); + } + + ifra->ifra_mask = ia->ia_sockmask; + if ((ifp->if_flags & IFF_POINTOPOINT) && + ia->ia_dstaddr.sin_family == AF_INET) + ifra->ifra_dstaddr = ia->ia_dstaddr; + else if ((ifp->if_flags & IFF_BROADCAST) && + ia->ia_broadaddr.sin_family == AF_INET) + ifra->ifra_broadaddr = ia->ia_broadaddr; + else + memset(&ifra->ifra_broadaddr, 0, + sizeof(ifra->ifra_broadaddr)); + + NET_EPOCH_EXIT_ET(et); return (0); } Modified: stable/12/sys/sys/sockio.h ============================================================================== --- stable/12/sys/sys/sockio.h Tue Nov 10 12:13:18 2020 (r367553) +++ stable/12/sys/sys/sockio.h Tue Nov 10 12:45:59 2020 (r367554) @@ -83,6 +83,7 @@ #define SIOCSIFDESCR _IOW('i', 41, struct ifreq) /* set ifnet descr */ #define SIOCGIFDESCR _IOWR('i', 42, struct ifreq) /* get ifnet descr */ #define SIOCAIFADDR _IOW('i', 43, struct ifaliasreq)/* add/chg IF alias */ +#define SIOCGIFALIAS _IOWR('i', 45, struct ifaliasreq)/* get IF alias */ #define SIOCADDMULTI _IOW('i', 49, struct ifreq) /* add m'cast addr */ #define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* del m'cast addr */ From owner-svn-src-stable@freebsd.org Tue Nov 10 13:10:17 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1E932EFDAD; Tue, 10 Nov 2020 13:10:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVpBJ6YDrz3t8B; Tue, 10 Nov 2020 13:10:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D384723234; Tue, 10 Nov 2020 13:10:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AADAGBZ033064; Tue, 10 Nov 2020 13:10:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AADAG6d033060; Tue, 10 Nov 2020 13:10:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202011101310.0AADAG6d033060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Nov 2020 13:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367556 - in stable/12/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi X-SVN-Commit-Revision: 367556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 13:10:17 -0000 Author: hselasky Date: Tue Nov 10 13:10:15 2020 New Revision: 367556 URL: https://svnweb.freebsd.org/changeset/base/367556 Log: MFC r364860 and r366996: Implement extensible arrays API using the existing radix tree implementation in the LinuxKPI. Differential Revision: https://reviews.freebsd.org/D25101 Reviewed by: kib @ Sponsored by: Mellanox Technologies // NVIDIA Networking Added: stable/12/sys/compat/linuxkpi/common/include/linux/xarray.h - copied, changed from r364860, head/sys/compat/linuxkpi/common/include/linux/xarray.h stable/12/sys/compat/linuxkpi/common/src/linux_xarray.c - copied unchanged from r364860, head/sys/compat/linuxkpi/common/src/linux_xarray.c Modified: stable/12/sys/conf/files stable/12/sys/modules/linuxkpi/Makefile Directory Properties: stable/12/ (props changed) Copied and modified: stable/12/sys/compat/linuxkpi/common/include/linux/xarray.h (from r364860, head/sys/compat/linuxkpi/common/include/linux/xarray.h) ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/xarray.h Thu Aug 27 10:28:12 2020 (r364860, copy source) +++ stable/12/sys/compat/linuxkpi/common/include/linux/xarray.h Tue Nov 10 13:10:15 2020 (r367556) @@ -91,4 +91,10 @@ xa_err(void *ptr) return (PTR_ERR_OR_ZERO(ptr)); } +static inline void +xa_init(struct xarray *xa) +{ + xa_init_flags(xa, 0); +} + #endif /* _LINUX_XARRAY_H_ */ Copied: stable/12/sys/compat/linuxkpi/common/src/linux_xarray.c (from r364860, head/sys/compat/linuxkpi/common/src/linux_xarray.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/compat/linuxkpi/common/src/linux_xarray.c Tue Nov 10 13:10:15 2020 (r367556, copy of r364860, head/sys/compat/linuxkpi/common/src/linux_xarray.c) @@ -0,0 +1,391 @@ +/*- + * Copyright (c) 2020 Mellanox Technologies, Ltd. + * 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 unmodified, 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 ``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 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 + +/* + * This function removes the element at the given index and returns + * the pointer to the removed element, if any. + */ +void * +__xa_erase(struct xarray *xa, uint32_t index) +{ + XA_ASSERT_LOCKED(xa); + + return (radix_tree_delete(&xa->root, index)); +} + +void * +xa_erase(struct xarray *xa, uint32_t index) +{ + void *retval; + + xa_lock(xa); + retval = __xa_erase(xa, index); + xa_unlock(xa); + + return (retval); +} + +/* + * This function returns the element pointer at the given index. A + * value of NULL is returned if the element does not exist. + */ +void * +xa_load(struct xarray *xa, uint32_t index) +{ + void *retval; + + xa_lock(xa); + retval = radix_tree_lookup(&xa->root, index); + xa_unlock(xa); + + return (retval); +} + +/* + * This is an internal function used to sleep until more memory + * becomes available. + */ +static void +xa_vm_wait_locked(struct xarray *xa) +{ + xa_unlock(xa); + vm_wait(NULL); + xa_lock(xa); +} + +/* + * This function iterates the xarray until it finds a free slot where + * it can insert the element pointer to by "ptr". It starts at the + * index pointed to by "pindex" and updates this value at return. The + * "mask" argument defines the maximum index allowed, inclusivly, and + * must be a power of two minus one value. The "gfp" argument + * basically tells if we can wait for more memory to become available + * or not. This function returns zero upon success or a negative error + * code on failure. A typical error code is -ENOMEM which means either + * the xarray is full, or there was not enough internal memory + * available to complete the radix tree insertion. + */ +int +__xa_alloc(struct xarray *xa, uint32_t *pindex, void *ptr, uint32_t mask, gfp_t gfp) +{ + int retval; + + XA_ASSERT_LOCKED(xa); + + /* mask cannot be zero */ + MPASS(mask != 0); + + /* mask can be any power of two value minus one */ + MPASS((mask & (mask + 1)) == 0); + + *pindex = 0; +retry: + retval = radix_tree_insert(&xa->root, *pindex, ptr); + + switch (retval) { + case -EEXIST: + if (likely(*pindex != mask)) { + (*pindex)++; + goto retry; + } + retval = -ENOMEM; + break; + case -ENOMEM: + if (likely(gfp & M_WAITOK)) { + xa_vm_wait_locked(xa); + goto retry; + } + break; + default: + break; + } + return (retval); +} + +int +xa_alloc(struct xarray *xa, uint32_t *pindex, void *ptr, uint32_t mask, gfp_t gfp) +{ + int retval; + + xa_lock(xa); + retval = __xa_alloc(xa, pindex, ptr, mask, gfp); + xa_unlock(xa); + + return (retval); +} + +/* + * This function works the same like the "xa_alloc" function, except + * it wraps the next index value to zero when there are no entries + * left at the end of the xarray searching for a free slot from the + * beginning of the array. If the xarray is full -ENOMEM is returned. + */ +int +__xa_alloc_cyclic(struct xarray *xa, uint32_t *pindex, void *ptr, uint32_t mask, + uint32_t *pnext_index, gfp_t gfp) +{ + int retval; + int timeout = 1; + + XA_ASSERT_LOCKED(xa); + + /* mask cannot be zero */ + MPASS(mask != 0); + + /* mask can be any power of two value minus one */ + MPASS((mask & (mask + 1)) == 0); + + *pnext_index = 0; +retry: + retval = radix_tree_insert(&xa->root, *pnext_index, ptr); + + switch (retval) { + case -EEXIST: + if (unlikely(*pnext_index == mask) && !timeout--) { + retval = -ENOMEM; + break; + } + (*pnext_index)++; + (*pnext_index) &= mask; + goto retry; + case -ENOMEM: + if (likely(gfp & M_WAITOK)) { + xa_vm_wait_locked(xa); + goto retry; + } + break; + default: + break; + } + *pindex = *pnext_index; + + return (retval); +} + +int +xa_alloc_cyclic(struct xarray *xa, uint32_t *pindex, void *ptr, uint32_t mask, + uint32_t *pnext_index, gfp_t gfp) +{ + int retval; + + xa_lock(xa); + retval = __xa_alloc_cyclic(xa, pindex, ptr, mask, pnext_index, gfp); + xa_unlock(xa); + + return (retval); +} + +/* + * This function tries to insert an element at the given index. The + * "gfp" argument basically decides of this function can sleep or not + * trying to allocate internal memory for its radix tree. The + * function returns an error code upon failure. Typical error codes + * are element exists (-EEXIST) or out of memory (-ENOMEM). + */ +int +__xa_insert(struct xarray *xa, uint32_t index, void *ptr, gfp_t gfp) +{ + int retval; + + XA_ASSERT_LOCKED(xa); +retry: + retval = radix_tree_insert(&xa->root, index, ptr); + + switch (retval) { + case -ENOMEM: + if (likely(gfp & M_WAITOK)) { + xa_vm_wait_locked(xa); + goto retry; + } + break; + default: + break; + } + return (retval); +} + +int +xa_insert(struct xarray *xa, uint32_t index, void *ptr, gfp_t gfp) +{ + int retval; + + xa_lock(xa); + retval = __xa_insert(xa, index, ptr, gfp); + xa_unlock(xa); + + return (retval); +} + +/* + * This function updates the element at the given index and returns a + * pointer to the old element. The "gfp" argument basically decides of + * this function can sleep or not trying to allocate internal memory + * for its radix tree. The function returns an XA_ERROR() pointer code + * upon failure. Code using this function must always check if the + * return value is an XA_ERROR() code before using the returned value. + */ +void * +__xa_store(struct xarray *xa, uint32_t index, void *ptr, gfp_t gfp) +{ + int retval; + + XA_ASSERT_LOCKED(xa); +retry: + retval = radix_tree_store(&xa->root, index, &ptr); + + switch (retval) { + case 0: + break; + case -ENOMEM: + if (likely(gfp & M_WAITOK)) { + xa_vm_wait_locked(xa); + goto retry; + } + ptr = XA_ERROR(retval); + break; + default: + ptr = XA_ERROR(retval); + break; + } + return (ptr); +} + +void * +xa_store(struct xarray *xa, uint32_t index, void *ptr, gfp_t gfp) +{ + void *retval; + + xa_lock(xa); + retval = __xa_store(xa, index, ptr, gfp); + xa_unlock(xa); + + return (retval); +} + +/* + * This function initialize an xarray structure. + */ +void +xa_init_flags(struct xarray *xa, uint32_t flags) +{ + memset(xa, 0, sizeof(*xa)); + + mtx_init(&xa->mtx, "lkpi-xarray", NULL, MTX_DEF | MTX_RECURSE); + xa->root.gfp_mask = GFP_NOWAIT; +} + +/* + * This function destroys an xarray structure and all its internal + * memory and locks. + */ +void +xa_destroy(struct xarray *xa) +{ + struct radix_tree_iter iter; + void **ppslot; + + radix_tree_for_each_slot(ppslot, &xa->root, &iter, 0) + radix_tree_iter_delete(&xa->root, &iter, ppslot); + mtx_destroy(&xa->mtx); +} + +/* + * This function checks if an xarray is empty or not. + * It returns true if empty, else false. + */ +bool +__xa_empty(struct xarray *xa) +{ + struct radix_tree_iter iter = {}; + void **temp; + + XA_ASSERT_LOCKED(xa); + + return (!radix_tree_iter_find(&xa->root, &iter, &temp)); +} + +bool +xa_empty(struct xarray *xa) +{ + bool retval; + + xa_lock(xa); + retval = __xa_empty(xa); + xa_unlock(xa); + + return (retval); +} + +/* + * This function returns the next valid xarray entry based on the + * index given by "pindex". The valued pointed to by "pindex" is + * updated before return. + */ +void * +__xa_next(struct xarray *xa, unsigned long *pindex, bool not_first) +{ + struct radix_tree_iter iter = { .index = *pindex }; + void **ppslot; + void *retval; + bool found; + + XA_ASSERT_LOCKED(xa); + + if (not_first) { + /* advance to next index, if any */ + iter.index++; + if (iter.index == 0) + return (NULL); + } + + found = radix_tree_iter_find(&xa->root, &iter, &ppslot); + if (likely(found)) { + retval = *ppslot; + *pindex = iter.index; + } else { + retval = NULL; + } + return (retval); +} + +void * +xa_next(struct xarray *xa, unsigned long *pindex, bool not_first) +{ + void *retval; + + xa_lock(xa); + retval = __xa_next(xa, pindex, not_first); + xa_unlock(xa); + + return (retval); +} Modified: stable/12/sys/conf/files ============================================================================== --- stable/12/sys/conf/files Tue Nov 10 12:58:25 2020 (r367555) +++ stable/12/sys/conf/files Tue Nov 10 13:10:15 2020 (r367556) @@ -4568,6 +4568,9 @@ compat/linuxkpi/common/src/linux_usb.c optional compa compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_work.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" +compat/linuxkpi/common/src/linux_xarray.c optional compat_linuxkpi \ + compile-with "${LINUXKPI_C}" + compat/linuxkpi/common/src/linux_seq_file.c optional compat_linuxkpi | lindebugfs \ compile-with "${LINUXKPI_C}" Modified: stable/12/sys/modules/linuxkpi/Makefile ============================================================================== --- stable/12/sys/modules/linuxkpi/Makefile Tue Nov 10 12:58:25 2020 (r367555) +++ stable/12/sys/modules/linuxkpi/Makefile Tue Nov 10 13:10:15 2020 (r367556) @@ -17,7 +17,8 @@ SRCS= linux_compat.c \ linux_slab.c \ linux_tasklet.c \ linux_usb.c \ - linux_work.c + linux_work.c \ + linux_xarray.c SRCS+= ${LINUXKPI_GENSRCS} From owner-svn-src-stable@freebsd.org Tue Nov 10 13:13:38 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C536430307; Tue, 10 Nov 2020 13:13:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVpGB2bR5z3tMg; Tue, 10 Nov 2020 13:13:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BF572362D; Tue, 10 Nov 2020 13:13:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AADDc0T038869; Tue, 10 Nov 2020 13:13:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AADDbrR038865; Tue, 10 Nov 2020 13:13:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202011101313.0AADDbrR038865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Nov 2020 13:13:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367557 - in stable/11/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi X-SVN-Commit-Revision: 367557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 13:13:38 -0000 Author: hselasky Date: Tue Nov 10 13:13:37 2020 New Revision: 367557 URL: https://svnweb.freebsd.org/changeset/base/367557 Log: MFC r364860 and r366996: Implement extensible arrays API using the existing radix tree implementation in the LinuxKPI. Differential Revision: https://reviews.freebsd.org/D25101 Reviewed by: kib @ Sponsored by: Mellanox Technologies // NVIDIA Networking Added: stable/11/sys/compat/linuxkpi/common/include/linux/xarray.h - copied, changed from r364860, head/sys/compat/linuxkpi/common/include/linux/xarray.h stable/11/sys/compat/linuxkpi/common/src/linux_xarray.c - copied, changed from r364860, head/sys/compat/linuxkpi/common/src/linux_xarray.c Modified: stable/11/sys/conf/files stable/11/sys/modules/linuxkpi/Makefile Directory Properties: stable/11/ (props changed) Copied and modified: stable/11/sys/compat/linuxkpi/common/include/linux/xarray.h (from r364860, head/sys/compat/linuxkpi/common/include/linux/xarray.h) ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/xarray.h Thu Aug 27 10:28:12 2020 (r364860, copy source) +++ stable/11/sys/compat/linuxkpi/common/include/linux/xarray.h Tue Nov 10 13:13:37 2020 (r367557) @@ -91,4 +91,10 @@ xa_err(void *ptr) return (PTR_ERR_OR_ZERO(ptr)); } +static inline void +xa_init(struct xarray *xa) +{ + xa_init_flags(xa, 0); +} + #endif /* _LINUX_XARRAY_H_ */ Copied and modified: stable/11/sys/compat/linuxkpi/common/src/linux_xarray.c (from r364860, head/sys/compat/linuxkpi/common/src/linux_xarray.c) ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_xarray.c Thu Aug 27 10:28:12 2020 (r364860, copy source) +++ stable/11/sys/compat/linuxkpi/common/src/linux_xarray.c Tue Nov 10 13:13:37 2020 (r367557) @@ -79,7 +79,7 @@ static void xa_vm_wait_locked(struct xarray *xa) { xa_unlock(xa); - vm_wait(NULL); + vm_wait(); xa_lock(xa); } Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Tue Nov 10 13:10:15 2020 (r367556) +++ stable/11/sys/conf/files Tue Nov 10 13:13:37 2020 (r367557) @@ -4332,6 +4332,8 @@ compat/linuxkpi/common/src/linux_usb.c optional compa compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_work.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" +compat/linuxkpi/common/src/linux_xarray.c optional compat_linuxkpi \ + compile-with "${LINUXKPI_C}" # OpenFabrics Enterprise Distribution (Infiniband) ofed/drivers/infiniband/core/ib_addr.c optional ofed \ Modified: stable/11/sys/modules/linuxkpi/Makefile ============================================================================== --- stable/11/sys/modules/linuxkpi/Makefile Tue Nov 10 13:10:15 2020 (r367556) +++ stable/11/sys/modules/linuxkpi/Makefile Tue Nov 10 13:13:37 2020 (r367557) @@ -17,7 +17,8 @@ SRCS= linux_compat.c \ linux_slab.c \ linux_tasklet.c \ linux_usb.c \ - linux_work.c + linux_work.c \ + linux_xarray.c SRCS+= ${LINUXKPI_GENSRCS} From owner-svn-src-stable@freebsd.org Tue Nov 10 13:15:54 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 428354301E1; Tue, 10 Nov 2020 13:15:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVpJp1GR5z3tmp; Tue, 10 Nov 2020 13:15:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E3B92362E; Tue, 10 Nov 2020 13:15:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AADFrfs039045; Tue, 10 Nov 2020 13:15:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AADFrZw039042; Tue, 10 Nov 2020 13:15:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202011101315.0AADFrZw039042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Nov 2020 13:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367558 - in stable/12/sys/dev/usb: . serial X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys/dev/usb: . serial X-SVN-Commit-Revision: 367558 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 13:15:54 -0000 Author: hselasky Date: Tue Nov 10 13:15:53 2020 New Revision: 367558 URL: https://svnweb.freebsd.org/changeset/base/367558 Log: MFC r367096: Add new USB IDs. Submitted by: aleksi.kaalinpaa@kapsi.fi PR: 250675 Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/sys/dev/usb/serial/uftdi.c stable/12/sys/dev/usb/usbdevs Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/12/sys/dev/usb/serial/uftdi.c Tue Nov 10 13:13:37 2020 (r367557) +++ stable/12/sys/dev/usb/serial/uftdi.c Tue Nov 10 13:15:53 2020 (r367558) @@ -293,6 +293,8 @@ static const STRUCT_USB_HOST_ID uftdi_devs[] = { UFTDI_DEV(BBELECTRONICS, USPTL4, 0), UFTDI_DEV(BBELECTRONICS, USTL4, 0), UFTDI_DEV(BBELECTRONICS, ZZ_PROG1_USB, 0), + UFTDI_DEV(BRAINBOXES, US257, 0), + UFTDI_DEV(BRAINBOXES, US25701, 0), UFTDI_DEV(CONTEC, COM1USBH, 0), UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, 0), UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, 0), Modified: stable/12/sys/dev/usb/usbdevs ============================================================================== --- stable/12/sys/dev/usb/usbdevs Tue Nov 10 13:13:37 2020 (r367557) +++ stable/12/sys/dev/usb/usbdevs Tue Nov 10 13:15:53 2020 (r367558) @@ -1416,6 +1416,10 @@ product BILLIONTON USBEL100 0x0988 USB100EL product BILLIONTON USBE100 0x8511 USBE100 product BILLIONTON USB2AR 0x90ff USB2AR Ethernet +/* Brainboxes Limited products */ +product BRAINBOXES US257 0x5001 US-257 USB2Serial 2xRS232 +product BRAINBOXES US25701 0x5002 US-25701 USB2Serial 2xRS232 + /* Broadcom products */ product BROADCOM BCM2033 0x2033 BCM2033 Bluetooth USB dongle From owner-svn-src-stable@freebsd.org Tue Nov 10 13:16:37 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C53C4430439; Tue, 10 Nov 2020 13:16:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVpKd5CQxz3thr; Tue, 10 Nov 2020 13:16:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5C1223799; Tue, 10 Nov 2020 13:16:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AADGbJ5039153; Tue, 10 Nov 2020 13:16:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AADGbE6039151; Tue, 10 Nov 2020 13:16:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202011101316.0AADGbE6039151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Nov 2020 13:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367559 - in stable/11/sys/dev/usb: . serial X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/usb: . serial X-SVN-Commit-Revision: 367559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 13:16:37 -0000 Author: hselasky Date: Tue Nov 10 13:16:37 2020 New Revision: 367559 URL: https://svnweb.freebsd.org/changeset/base/367559 Log: MFC r367096: Add new USB IDs. Submitted by: aleksi.kaalinpaa@kapsi.fi PR: 250675 Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/sys/dev/usb/serial/uftdi.c stable/11/sys/dev/usb/usbdevs Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/11/sys/dev/usb/serial/uftdi.c Tue Nov 10 13:15:53 2020 (r367558) +++ stable/11/sys/dev/usb/serial/uftdi.c Tue Nov 10 13:16:37 2020 (r367559) @@ -291,6 +291,8 @@ static const STRUCT_USB_HOST_ID uftdi_devs[] = { UFTDI_DEV(BBELECTRONICS, USPTL4, 0), UFTDI_DEV(BBELECTRONICS, USTL4, 0), UFTDI_DEV(BBELECTRONICS, ZZ_PROG1_USB, 0), + UFTDI_DEV(BRAINBOXES, US257, 0), + UFTDI_DEV(BRAINBOXES, US25701, 0), UFTDI_DEV(CONTEC, COM1USBH, 0), UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, 0), UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, 0), Modified: stable/11/sys/dev/usb/usbdevs ============================================================================== --- stable/11/sys/dev/usb/usbdevs Tue Nov 10 13:15:53 2020 (r367558) +++ stable/11/sys/dev/usb/usbdevs Tue Nov 10 13:16:37 2020 (r367559) @@ -1355,6 +1355,10 @@ product BILLIONTON USBEL100 0x0988 USB100EL product BILLIONTON USBE100 0x8511 USBE100 product BILLIONTON USB2AR 0x90ff USB2AR Ethernet +/* Brainboxes Limited products */ +product BRAINBOXES US257 0x5001 US-257 USB2Serial 2xRS232 +product BRAINBOXES US25701 0x5002 US-25701 USB2Serial 2xRS232 + /* Broadcom products */ product BROADCOM BCM2033 0x2033 BCM2033 Bluetooth USB dongle From owner-svn-src-stable@freebsd.org Tue Nov 10 13:18:46 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56F7843035F; Tue, 10 Nov 2020 13:18:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVpN61zlYz3tjl; Tue, 10 Nov 2020 13:18:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3709F2379B; Tue, 10 Nov 2020 13:18:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AADIjWu039321; Tue, 10 Nov 2020 13:18:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AADIjwn039317; Tue, 10 Nov 2020 13:18:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202011101318.0AADIjwn039317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Nov 2020 13:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367560 - in stable/12: share/man/man4 sys/dev/usb sys/dev/usb/input X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/dev/usb sys/dev/usb/input X-SVN-Commit-Revision: 367560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 13:18:46 -0000 Author: hselasky Date: Tue Nov 10 13:18:44 2020 New Revision: 367560 URL: https://svnweb.freebsd.org/changeset/base/367560 Log: MFC r367236: Implement the USB_GET_DEVICEINFO ioctl(2) for uhid(4). Submitted by: pedro martelletto Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/share/man/man4/uhid.4 stable/12/sys/dev/usb/input/uhid.c stable/12/sys/dev/usb/usb_generic.c stable/12/sys/dev/usb/usb_generic.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/uhid.4 ============================================================================== --- stable/12/share/man/man4/uhid.4 Tue Nov 10 13:16:37 2020 (r367559) +++ stable/12/share/man/man4/uhid.4 Tue Nov 10 13:18:44 2020 (r367560) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2018 +.Dd Oct 31, 2020 .Dt UHID 4 .Os .Sh NAME @@ -131,6 +131,11 @@ and the .Va ugd_maxlen fields. This call may fail if the device does not support this feature. +.It Dv USB_GET_DEVICEINFO Pq Vt "struct usb_device_info" +Returns information about the device, like USB vendor ID and USB product ID. +This call will not issue any USB transactions. +Also refer to +.Xr ugen 4 . .El .Pp Use Modified: stable/12/sys/dev/usb/input/uhid.c ============================================================================== --- stable/12/sys/dev/usb/input/uhid.c Tue Nov 10 13:16:37 2020 (r367559) +++ stable/12/sys/dev/usb/input/uhid.c Tue Nov 10 13:18:44 2020 (r367560) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define USB_DEBUG_VAR uhid_debug #include @@ -143,11 +144,13 @@ static usb_fifo_cmd_t uhid_stop_write; static usb_fifo_open_t uhid_open; static usb_fifo_close_t uhid_close; static usb_fifo_ioctl_t uhid_ioctl; +static usb_fifo_ioctl_t uhid_ioctl_post; static struct usb_fifo_methods uhid_fifo_methods = { .f_open = &uhid_open, .f_close = &uhid_close, .f_ioctl = &uhid_ioctl, + .f_ioctl_post = &uhid_ioctl_post, .f_start_read = &uhid_start_read, .f_stop_read = &uhid_stop_read, .f_start_write = &uhid_start_write, @@ -644,6 +647,24 @@ uhid_ioctl(struct usb_fifo *fifo, u_long cmd, void *ad case USB_GET_REPORT_ID: *(int *)addr = 0; /* XXX: we only support reportid 0? */ + break; + + default: + error = ENOIOCTL; + break; + } + return (error); +} + +static int +uhid_ioctl_post(struct usb_fifo *fifo, u_long cmd, void *addr, + int fflags) +{ + int error; + + switch (cmd) { + case USB_GET_DEVICEINFO: + error = ugen_fill_deviceinfo(fifo, addr); break; default: Modified: stable/12/sys/dev/usb/usb_generic.c ============================================================================== --- stable/12/sys/dev/usb/usb_generic.c Tue Nov 10 13:16:37 2020 (r367559) +++ stable/12/sys/dev/usb/usb_generic.c Tue Nov 10 13:18:44 2020 (r367560) @@ -109,8 +109,6 @@ static int ugen_set_interface(struct usb_fifo *, uint8 static int ugen_get_cdesc(struct usb_fifo *, struct usb_gen_descriptor *); static int ugen_get_sdesc(struct usb_fifo *, struct usb_gen_descriptor *); static int ugen_get_iface_driver(struct usb_fifo *f, struct usb_gen_descriptor *ugd); -static int usb_gen_fill_deviceinfo(struct usb_fifo *, - struct usb_device_info *); static int ugen_re_enumerate(struct usb_fifo *); static int ugen_iface_ioctl(struct usb_fifo *, u_long, void *, int); static uint8_t ugen_fs_get_complete(struct usb_fifo *, uint8_t *); @@ -817,7 +815,7 @@ ugen_get_iface_driver(struct usb_fifo *f, struct usb_g } /*------------------------------------------------------------------------* - * usb_gen_fill_deviceinfo + * ugen_fill_deviceinfo * * This function dumps information about an USB device to the * structure pointed to by the "di" argument. @@ -826,8 +824,8 @@ ugen_get_iface_driver(struct usb_fifo *f, struct usb_g * 0: Success * Else: Failure *------------------------------------------------------------------------*/ -static int -usb_gen_fill_deviceinfo(struct usb_fifo *f, struct usb_device_info *di) +int +ugen_fill_deviceinfo(struct usb_fifo *f, struct usb_device_info *di) { struct usb_device *udev; struct usb_device *hub; @@ -2216,7 +2214,7 @@ ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void * case USB_DEVICEINFO: case USB_GET_DEVICEINFO: - error = usb_gen_fill_deviceinfo(f, addr); + error = ugen_fill_deviceinfo(f, addr); break; case USB_DEVICESTATS: Modified: stable/12/sys/dev/usb/usb_generic.h ============================================================================== --- stable/12/sys/dev/usb/usb_generic.h Tue Nov 10 13:16:37 2020 (r367559) +++ stable/12/sys/dev/usb/usb_generic.h Tue Nov 10 13:18:44 2020 (r367560) @@ -31,5 +31,6 @@ extern struct usb_fifo_methods usb_ugen_methods; int ugen_do_request(struct usb_fifo *f, struct usb_ctl_request *ur); +int ugen_fill_deviceinfo(struct usb_fifo *f, struct usb_device_info *di); #endif /* _USB_GENERIC_H_ */ From owner-svn-src-stable@freebsd.org Tue Nov 10 13:21:06 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27B5C430797; Tue, 10 Nov 2020 13:21:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVpQm2WC3z3vH3; Tue, 10 Nov 2020 13:21:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A569C234F5; Tue, 10 Nov 2020 13:21:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AADL3CZ041500; Tue, 10 Nov 2020 13:21:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AADL280041497; Tue, 10 Nov 2020 13:21:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202011101321.0AADL280041497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Nov 2020 13:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367561 - in stable/11: share/man/man4 sys/dev/usb sys/dev/usb/input X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/dev/usb sys/dev/usb/input X-SVN-Commit-Revision: 367561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 13:21:06 -0000 Author: hselasky Date: Tue Nov 10 13:21:02 2020 New Revision: 367561 URL: https://svnweb.freebsd.org/changeset/base/367561 Log: MFC r367236: Implement the USB_GET_DEVICEINFO ioctl(2) for uhid(4). Submitted by: pedro martelletto Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/share/man/man4/uhid.4 stable/11/sys/dev/usb/input/uhid.c stable/11/sys/dev/usb/usb_generic.c stable/11/sys/dev/usb/usb_generic.h Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/uhid.4 ============================================================================== --- stable/11/share/man/man4/uhid.4 Tue Nov 10 13:18:44 2020 (r367560) +++ stable/11/share/man/man4/uhid.4 Tue Nov 10 13:21:02 2020 (r367561) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd Oct 31, 2020 .Dt UHID 4 .Os .Sh NAME @@ -114,6 +114,11 @@ It should be or .Dv UHID_FEATURE_REPORT . This call may fail if the device does not support this feature. +.It Dv USB_GET_DEVICEINFO Pq Vt "struct usb_device_info" +Returns information about the device, like USB vendor ID and USB product ID. +This call will not issue any USB transactions. +Also refer to +.Xr ugen 4 . .El .Pp Use Modified: stable/11/sys/dev/usb/input/uhid.c ============================================================================== --- stable/11/sys/dev/usb/input/uhid.c Tue Nov 10 13:18:44 2020 (r367560) +++ stable/11/sys/dev/usb/input/uhid.c Tue Nov 10 13:21:02 2020 (r367561) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define USB_DEBUG_VAR uhid_debug #include @@ -141,11 +142,13 @@ static usb_fifo_cmd_t uhid_stop_write; static usb_fifo_open_t uhid_open; static usb_fifo_close_t uhid_close; static usb_fifo_ioctl_t uhid_ioctl; +static usb_fifo_ioctl_t uhid_ioctl_post; static struct usb_fifo_methods uhid_fifo_methods = { .f_open = &uhid_open, .f_close = &uhid_close, .f_ioctl = &uhid_ioctl, + .f_ioctl_post = &uhid_ioctl_post, .f_start_read = &uhid_start_read, .f_stop_read = &uhid_stop_read, .f_start_write = &uhid_start_write, @@ -642,6 +645,24 @@ uhid_ioctl(struct usb_fifo *fifo, u_long cmd, void *ad case USB_GET_REPORT_ID: *(int *)addr = 0; /* XXX: we only support reportid 0? */ + break; + + default: + error = ENOIOCTL; + break; + } + return (error); +} + +static int +uhid_ioctl_post(struct usb_fifo *fifo, u_long cmd, void *addr, + int fflags) +{ + int error; + + switch (cmd) { + case USB_GET_DEVICEINFO: + error = ugen_fill_deviceinfo(fifo, addr); break; default: Modified: stable/11/sys/dev/usb/usb_generic.c ============================================================================== --- stable/11/sys/dev/usb/usb_generic.c Tue Nov 10 13:18:44 2020 (r367560) +++ stable/11/sys/dev/usb/usb_generic.c Tue Nov 10 13:21:02 2020 (r367561) @@ -107,8 +107,6 @@ static int ugen_set_interface(struct usb_fifo *, uint8 static int ugen_get_cdesc(struct usb_fifo *, struct usb_gen_descriptor *); static int ugen_get_sdesc(struct usb_fifo *, struct usb_gen_descriptor *); static int ugen_get_iface_driver(struct usb_fifo *f, struct usb_gen_descriptor *ugd); -static int usb_gen_fill_deviceinfo(struct usb_fifo *, - struct usb_device_info *); static int ugen_re_enumerate(struct usb_fifo *); static int ugen_iface_ioctl(struct usb_fifo *, u_long, void *, int); static uint8_t ugen_fs_get_complete(struct usb_fifo *, uint8_t *); @@ -815,7 +813,7 @@ ugen_get_iface_driver(struct usb_fifo *f, struct usb_g } /*------------------------------------------------------------------------* - * usb_gen_fill_deviceinfo + * ugen_fill_deviceinfo * * This function dumps information about an USB device to the * structure pointed to by the "di" argument. @@ -824,8 +822,8 @@ ugen_get_iface_driver(struct usb_fifo *f, struct usb_g * 0: Success * Else: Failure *------------------------------------------------------------------------*/ -static int -usb_gen_fill_deviceinfo(struct usb_fifo *f, struct usb_device_info *di) +int +ugen_fill_deviceinfo(struct usb_fifo *f, struct usb_device_info *di) { struct usb_device *udev; struct usb_device *hub; @@ -2214,7 +2212,7 @@ ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void * case USB_DEVICEINFO: case USB_GET_DEVICEINFO: - error = usb_gen_fill_deviceinfo(f, addr); + error = ugen_fill_deviceinfo(f, addr); break; case USB_DEVICESTATS: Modified: stable/11/sys/dev/usb/usb_generic.h ============================================================================== --- stable/11/sys/dev/usb/usb_generic.h Tue Nov 10 13:18:44 2020 (r367560) +++ stable/11/sys/dev/usb/usb_generic.h Tue Nov 10 13:21:02 2020 (r367561) @@ -29,5 +29,6 @@ extern struct usb_fifo_methods usb_ugen_methods; int ugen_do_request(struct usb_fifo *f, struct usb_ctl_request *ur); +int ugen_fill_deviceinfo(struct usb_fifo *f, struct usb_device_info *di); #endif /* _USB_GENERIC_H_ */ From owner-svn-src-stable@freebsd.org Tue Nov 10 13:22:53 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 530FC430646; Tue, 10 Nov 2020 13:22:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVpSs1wjFz3vR0; Tue, 10 Nov 2020 13:22:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34EB723574; Tue, 10 Nov 2020 13:22:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AADMr01045464; Tue, 10 Nov 2020 13:22:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AADMrvO045463; Tue, 10 Nov 2020 13:22:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202011101322.0AADMrvO045463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Nov 2020 13:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367562 - stable/12/sys/ofed/drivers/infiniband/core X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 367562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 13:22:53 -0000 Author: hselasky Date: Tue Nov 10 13:22:52 2020 New Revision: 367562 URL: https://svnweb.freebsd.org/changeset/base/367562 Log: MFC r367269: Fix for referencing file via its vnode in ibore. Use the native vnode lookup functions, instead of going via the LinuxKPI, because the file referenced is typically created outside the LinuxKPI, and the LinuxKPI's fdget() can only resolve file descriptor numbers which were created by itself. The vnode pointer is used as an identifier to identify XRCD handles which are sharing resources. This patch fixes the so-called XRCD support in ibcore for FreeBSD. Refer to ibv_open_xrcd(3) for more information how the file descriptor argument is used. Reviewed by: kib@ Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c ============================================================================== --- stable/12/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Tue Nov 10 13:21:02 2020 (r367561) +++ stable/12/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Tue Nov 10 13:22:52 2020 (r367562) @@ -666,11 +666,11 @@ err_put: struct xrcd_table_entry { struct rb_node node; struct ib_xrcd *xrcd; - struct inode *inode; + struct vnode *vnode; }; static int xrcd_table_insert(struct ib_uverbs_device *dev, - struct inode *inode, + struct vnode *vnode, struct ib_xrcd *xrcd) { struct xrcd_table_entry *entry, *scan; @@ -682,15 +682,15 @@ static int xrcd_table_insert(struct ib_uverbs_device * return -ENOMEM; entry->xrcd = xrcd; - entry->inode = inode; + entry->vnode = vnode; while (*p) { parent = *p; scan = rb_entry(parent, struct xrcd_table_entry, node); - if (inode < scan->inode) { + if ((uintptr_t)vnode < (uintptr_t)scan->vnode) { p = &(*p)->rb_left; - } else if (inode > scan->inode) { + } else if ((uintptr_t)vnode > (uintptr_t)scan->vnode) { p = &(*p)->rb_right; } else { kfree(entry); @@ -700,12 +700,12 @@ static int xrcd_table_insert(struct ib_uverbs_device * rb_link_node(&entry->node, parent, p); rb_insert_color(&entry->node, &dev->xrcd_tree); - igrab(inode); + vrefact(vnode); return 0; } static struct xrcd_table_entry *xrcd_table_search(struct ib_uverbs_device *dev, - struct inode *inode) + struct vnode *vnode) { struct xrcd_table_entry *entry; struct rb_node *p = dev->xrcd_tree.rb_node; @@ -713,9 +713,9 @@ static struct xrcd_table_entry *xrcd_table_search(stru while (p) { entry = rb_entry(p, struct xrcd_table_entry, node); - if (inode < entry->inode) + if ((uintptr_t)vnode < (uintptr_t)entry->vnode) p = p->rb_left; - else if (inode > entry->inode) + else if ((uintptr_t)vnode > (uintptr_t)entry->vnode) p = p->rb_right; else return entry; @@ -724,11 +724,11 @@ static struct xrcd_table_entry *xrcd_table_search(stru return NULL; } -static struct ib_xrcd *find_xrcd(struct ib_uverbs_device *dev, struct inode *inode) +static struct ib_xrcd *find_xrcd(struct ib_uverbs_device *dev, struct vnode *vnode) { struct xrcd_table_entry *entry; - entry = xrcd_table_search(dev, inode); + entry = xrcd_table_search(dev, vnode); if (!entry) return NULL; @@ -736,13 +736,13 @@ static struct ib_xrcd *find_xrcd(struct ib_uverbs_devi } static void xrcd_table_delete(struct ib_uverbs_device *dev, - struct inode *inode) + struct vnode *vnode) { struct xrcd_table_entry *entry; - entry = xrcd_table_search(dev, inode); + entry = xrcd_table_search(dev, vnode); if (entry) { - iput(inode); + vrele(vnode); rb_erase(&entry->node, &dev->xrcd_tree); kfree(entry); } @@ -758,8 +758,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *fil struct ib_udata udata; struct ib_uxrcd_object *obj; struct ib_xrcd *xrcd = NULL; - struct fd f = {NULL}; - struct inode *inode = NULL; + struct vnode *vnode = NULL; int ret = 0; int new_xrcd = 0; @@ -777,14 +776,11 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *fil if (cmd.fd != -1) { /* search for file descriptor */ - f = fdget(cmd.fd); - if (!f.file) { - ret = -EBADF; + ret = -fgetvp(curthread, cmd.fd, &cap_no_rights, &vnode); + if (ret != 0) goto err_tree_mutex_unlock; - } - inode = f.file->f_dentry->d_inode; - xrcd = find_xrcd(file->device, inode); + xrcd = find_xrcd(file->device, vnode); if (!xrcd && !(cmd.oflags & O_CREAT)) { /* no file descriptor. Need CREATE flag */ ret = -EAGAIN; @@ -814,7 +810,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *fil goto err; } - xrcd->inode = inode; + xrcd->vnode = vnode; xrcd->device = ib_dev; atomic_set(&xrcd->usecnt, 0); mutex_init(&xrcd->tgt_qp_mutex); @@ -831,10 +827,10 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *fil memset(&resp, 0, sizeof resp); resp.xrcd_handle = obj->uobject.id; - if (inode) { + if (vnode != NULL) { if (new_xrcd) { - /* create new inode/xrcd table entry */ - ret = xrcd_table_insert(file->device, inode, xrcd); + /* create new vnode/xrcd table entry */ + ret = xrcd_table_insert(file->device, vnode, xrcd); if (ret) goto err_insert_xrcd; } @@ -847,8 +843,8 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *fil goto err_copy; } - if (f.file) - fdput(f); + if (vnode != NULL) + vrele(vnode); mutex_lock(&file->mutex); list_add_tail(&obj->uobject.list, &file->ucontext->xrcd_list); @@ -861,9 +857,9 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *fil return in_len; err_copy: - if (inode) { + if (vnode != NULL) { if (new_xrcd) - xrcd_table_delete(file->device, inode); + xrcd_table_delete(file->device, vnode); atomic_dec(&xrcd->usecnt); } @@ -877,8 +873,8 @@ err: put_uobj_write(&obj->uobject); err_tree_mutex_unlock: - if (f.file) - fdput(f); + if (vnode != NULL) + vrele(vnode); mutex_unlock(&file->device->xrcd_tree_mutex); @@ -893,7 +889,7 @@ ssize_t ib_uverbs_close_xrcd(struct ib_uverbs_file *fi struct ib_uverbs_close_xrcd cmd; struct ib_uobject *uobj; struct ib_xrcd *xrcd = NULL; - struct inode *inode = NULL; + struct vnode *vnode = NULL; struct ib_uxrcd_object *obj; int live; int ret = 0; @@ -909,7 +905,7 @@ ssize_t ib_uverbs_close_xrcd(struct ib_uverbs_file *fi } xrcd = uobj->object; - inode = xrcd->inode; + vnode = xrcd->vnode; obj = container_of(uobj, struct ib_uxrcd_object, uobject); if (atomic_read(&obj->refcnt)) { put_uobj_write(uobj); @@ -917,14 +913,14 @@ ssize_t ib_uverbs_close_xrcd(struct ib_uverbs_file *fi goto out; } - if (!inode || atomic_dec_and_test(&xrcd->usecnt)) { + if (!vnode || atomic_dec_and_test(&xrcd->usecnt)) { ret = ib_dealloc_xrcd(uobj->object); if (!ret) uobj->live = 0; } live = uobj->live; - if (inode && ret) + if (vnode && ret) atomic_inc(&xrcd->usecnt); put_uobj_write(uobj); @@ -932,8 +928,8 @@ ssize_t ib_uverbs_close_xrcd(struct ib_uverbs_file *fi if (ret) goto out; - if (inode && !live) - xrcd_table_delete(file->device, inode); + if (vnode && !live) + xrcd_table_delete(file->device, vnode); idr_remove_uobj(&ib_uverbs_xrcd_idr, uobj); mutex_lock(&file->mutex); @@ -951,16 +947,16 @@ out: void ib_uverbs_dealloc_xrcd(struct ib_uverbs_device *dev, struct ib_xrcd *xrcd) { - struct inode *inode; + struct vnode *vnode; - inode = xrcd->inode; - if (inode && !atomic_dec_and_test(&xrcd->usecnt)) + vnode = xrcd->vnode; + if (vnode && !atomic_dec_and_test(&xrcd->usecnt)) return; ib_dealloc_xrcd(xrcd); - if (inode) - xrcd_table_delete(dev, inode); + if (vnode) + xrcd_table_delete(dev, vnode); } ssize_t ib_uverbs_reg_mr(struct ib_uverbs_file *file, From owner-svn-src-stable@freebsd.org Tue Nov 10 13:31:02 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 49FAE43085C; Tue, 10 Nov 2020 13:31:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVpfG1Cwrz3vkj; Tue, 10 Nov 2020 13:31:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CF8B2326A; Tue, 10 Nov 2020 13:31:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AADV1oD047392; Tue, 10 Nov 2020 13:31:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AADV1oA047391; Tue, 10 Nov 2020 13:31:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202011101331.0AADV1oA047391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Nov 2020 13:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367563 - stable/11/sys/ofed/drivers/infiniband/core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 367563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 13:31:02 -0000 Author: hselasky Date: Tue Nov 10 13:31:01 2020 New Revision: 367563 URL: https://svnweb.freebsd.org/changeset/base/367563 Log: MFC r367269: Fix for referencing file via its vnode in ibore. Use the native vnode lookup functions, instead of going via the LinuxKPI, because the file referenced is typically created outside the LinuxKPI, and the LinuxKPI's fdget() can only resolve file descriptor numbers which were created by itself. The vnode pointer is used as an identifier to identify XRCD handles which are sharing resources. This patch fixes the so-called XRCD support in ibcore for FreeBSD. Refer to ibv_open_xrcd(3) for more information how the file descriptor argument is used. Reviewed by: kib@ Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Tue Nov 10 13:22:52 2020 (r367562) +++ stable/11/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Tue Nov 10 13:31:01 2020 (r367563) @@ -666,11 +666,11 @@ err_put: struct xrcd_table_entry { struct rb_node node; struct ib_xrcd *xrcd; - struct inode *inode; + struct vnode *vnode; }; static int xrcd_table_insert(struct ib_uverbs_device *dev, - struct inode *inode, + struct vnode *vnode, struct ib_xrcd *xrcd) { struct xrcd_table_entry *entry, *scan; @@ -682,15 +682,15 @@ static int xrcd_table_insert(struct ib_uverbs_device * return -ENOMEM; entry->xrcd = xrcd; - entry->inode = inode; + entry->vnode = vnode; while (*p) { parent = *p; scan = rb_entry(parent, struct xrcd_table_entry, node); - if (inode < scan->inode) { + if ((uintptr_t)vnode < (uintptr_t)scan->vnode) { p = &(*p)->rb_left; - } else if (inode > scan->inode) { + } else if ((uintptr_t)vnode > (uintptr_t)scan->vnode) { p = &(*p)->rb_right; } else { kfree(entry); @@ -700,12 +700,12 @@ static int xrcd_table_insert(struct ib_uverbs_device * rb_link_node(&entry->node, parent, p); rb_insert_color(&entry->node, &dev->xrcd_tree); - igrab(inode); + vrefact(vnode); return 0; } static struct xrcd_table_entry *xrcd_table_search(struct ib_uverbs_device *dev, - struct inode *inode) + struct vnode *vnode) { struct xrcd_table_entry *entry; struct rb_node *p = dev->xrcd_tree.rb_node; @@ -713,9 +713,9 @@ static struct xrcd_table_entry *xrcd_table_search(stru while (p) { entry = rb_entry(p, struct xrcd_table_entry, node); - if (inode < entry->inode) + if ((uintptr_t)vnode < (uintptr_t)entry->vnode) p = p->rb_left; - else if (inode > entry->inode) + else if ((uintptr_t)vnode > (uintptr_t)entry->vnode) p = p->rb_right; else return entry; @@ -724,11 +724,11 @@ static struct xrcd_table_entry *xrcd_table_search(stru return NULL; } -static struct ib_xrcd *find_xrcd(struct ib_uverbs_device *dev, struct inode *inode) +static struct ib_xrcd *find_xrcd(struct ib_uverbs_device *dev, struct vnode *vnode) { struct xrcd_table_entry *entry; - entry = xrcd_table_search(dev, inode); + entry = xrcd_table_search(dev, vnode); if (!entry) return NULL; @@ -736,13 +736,13 @@ static struct ib_xrcd *find_xrcd(struct ib_uverbs_devi } static void xrcd_table_delete(struct ib_uverbs_device *dev, - struct inode *inode) + struct vnode *vnode) { struct xrcd_table_entry *entry; - entry = xrcd_table_search(dev, inode); + entry = xrcd_table_search(dev, vnode); if (entry) { - iput(inode); + vrele(vnode); rb_erase(&entry->node, &dev->xrcd_tree); kfree(entry); } @@ -758,8 +758,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *fil struct ib_udata udata; struct ib_uxrcd_object *obj; struct ib_xrcd *xrcd = NULL; - struct fd f = {NULL}; - struct inode *inode = NULL; + struct vnode *vnode = NULL; int ret = 0; int new_xrcd = 0; @@ -776,15 +775,15 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *fil mutex_lock(&file->device->xrcd_tree_mutex); if (cmd.fd != -1) { + cap_rights_t cap_no_rights; + cap_rights_init(&cap_no_rights); + /* search for file descriptor */ - f = fdget(cmd.fd); - if (!f.file) { - ret = -EBADF; + ret = -fgetvp(curthread, cmd.fd, &cap_no_rights, &vnode); + if (ret != 0) goto err_tree_mutex_unlock; - } - inode = f.file->f_dentry->d_inode; - xrcd = find_xrcd(file->device, inode); + xrcd = find_xrcd(file->device, vnode); if (!xrcd && !(cmd.oflags & O_CREAT)) { /* no file descriptor. Need CREATE flag */ ret = -EAGAIN; @@ -814,7 +813,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *fil goto err; } - xrcd->inode = inode; + xrcd->vnode = vnode; xrcd->device = ib_dev; atomic_set(&xrcd->usecnt, 0); mutex_init(&xrcd->tgt_qp_mutex); @@ -831,10 +830,10 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *fil memset(&resp, 0, sizeof resp); resp.xrcd_handle = obj->uobject.id; - if (inode) { + if (vnode != NULL) { if (new_xrcd) { - /* create new inode/xrcd table entry */ - ret = xrcd_table_insert(file->device, inode, xrcd); + /* create new vnode/xrcd table entry */ + ret = xrcd_table_insert(file->device, vnode, xrcd); if (ret) goto err_insert_xrcd; } @@ -847,8 +846,8 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *fil goto err_copy; } - if (f.file) - fdput(f); + if (vnode != NULL) + vrele(vnode); mutex_lock(&file->mutex); list_add_tail(&obj->uobject.list, &file->ucontext->xrcd_list); @@ -861,9 +860,9 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *fil return in_len; err_copy: - if (inode) { + if (vnode != NULL) { if (new_xrcd) - xrcd_table_delete(file->device, inode); + xrcd_table_delete(file->device, vnode); atomic_dec(&xrcd->usecnt); } @@ -877,8 +876,8 @@ err: put_uobj_write(&obj->uobject); err_tree_mutex_unlock: - if (f.file) - fdput(f); + if (vnode != NULL) + vrele(vnode); mutex_unlock(&file->device->xrcd_tree_mutex); @@ -893,7 +892,7 @@ ssize_t ib_uverbs_close_xrcd(struct ib_uverbs_file *fi struct ib_uverbs_close_xrcd cmd; struct ib_uobject *uobj; struct ib_xrcd *xrcd = NULL; - struct inode *inode = NULL; + struct vnode *vnode = NULL; struct ib_uxrcd_object *obj; int live; int ret = 0; @@ -909,7 +908,7 @@ ssize_t ib_uverbs_close_xrcd(struct ib_uverbs_file *fi } xrcd = uobj->object; - inode = xrcd->inode; + vnode = xrcd->vnode; obj = container_of(uobj, struct ib_uxrcd_object, uobject); if (atomic_read(&obj->refcnt)) { put_uobj_write(uobj); @@ -917,14 +916,14 @@ ssize_t ib_uverbs_close_xrcd(struct ib_uverbs_file *fi goto out; } - if (!inode || atomic_dec_and_test(&xrcd->usecnt)) { + if (!vnode || atomic_dec_and_test(&xrcd->usecnt)) { ret = ib_dealloc_xrcd(uobj->object); if (!ret) uobj->live = 0; } live = uobj->live; - if (inode && ret) + if (vnode && ret) atomic_inc(&xrcd->usecnt); put_uobj_write(uobj); @@ -932,8 +931,8 @@ ssize_t ib_uverbs_close_xrcd(struct ib_uverbs_file *fi if (ret) goto out; - if (inode && !live) - xrcd_table_delete(file->device, inode); + if (vnode && !live) + xrcd_table_delete(file->device, vnode); idr_remove_uobj(&ib_uverbs_xrcd_idr, uobj); mutex_lock(&file->mutex); @@ -951,16 +950,16 @@ out: void ib_uverbs_dealloc_xrcd(struct ib_uverbs_device *dev, struct ib_xrcd *xrcd) { - struct inode *inode; + struct vnode *vnode; - inode = xrcd->inode; - if (inode && !atomic_dec_and_test(&xrcd->usecnt)) + vnode = xrcd->vnode; + if (vnode && !atomic_dec_and_test(&xrcd->usecnt)) return; ib_dealloc_xrcd(xrcd); - if (inode) - xrcd_table_delete(dev, inode); + if (vnode) + xrcd_table_delete(dev, vnode); } ssize_t ib_uverbs_reg_mr(struct ib_uverbs_file *file, From owner-svn-src-stable@freebsd.org Tue Nov 10 13:32:50 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F00BE430CE9; Tue, 10 Nov 2020 13:32:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVphL6VDpz3wDP; Tue, 10 Nov 2020 13:32:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD4FA2391E; Tue, 10 Nov 2020 13:32:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AADWoNA051512; Tue, 10 Nov 2020 13:32:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AADWo9i051510; Tue, 10 Nov 2020 13:32:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202011101332.0AADWo9i051510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Nov 2020 13:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367564 - in stable/12/sys/dev/usb: . quirk X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys/dev/usb: . quirk X-SVN-Commit-Revision: 367564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 13:32:51 -0000 Author: hselasky Date: Tue Nov 10 13:32:50 2020 New Revision: 367564 URL: https://svnweb.freebsd.org/changeset/base/367564 Log: MFC r366806: Add new USB quirk. PR: 250422 Submitted by: vidwer+fbsdbugs@gmail.com Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/sys/dev/usb/quirk/usb_quirk.c stable/12/sys/dev/usb/usbdevs Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/12/sys/dev/usb/quirk/usb_quirk.c Tue Nov 10 13:31:01 2020 (r367563) +++ stable/12/sys/dev/usb/quirk/usb_quirk.c Tue Nov 10 13:32:50 2020 (r367564) @@ -221,6 +221,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE), USB_QUIRK(CYPRESS, XX6830XX, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(EMTEC, DANEELEC4GB, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(DESKNOTE, UCR_61S2B, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(DMI, CFSM_RW, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI, Modified: stable/12/sys/dev/usb/usbdevs ============================================================================== --- stable/12/sys/dev/usb/usbdevs Tue Nov 10 13:31:01 2020 (r367563) +++ stable/12/sys/dev/usb/usbdevs Tue Nov 10 13:32:50 2020 (r367564) @@ -1885,6 +1885,7 @@ product ELV USBI2C 0xe00f USB-I2C interface product EMS DUAL_SHOOTER 0x0003 PSX gun controller converter /* Emtec products */ +product EMTEC DANEELEC4GB 0x1e20 USB DISK Pro PMAP product EMTEC RUF2PS 0x2240 Flash Drive /* Encore products */ From owner-svn-src-stable@freebsd.org Tue Nov 10 13:33:40 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F9D8430D28; Tue, 10 Nov 2020 13:33:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVpjJ00vfz3wFR; Tue, 10 Nov 2020 13:33:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7234237EE; Tue, 10 Nov 2020 13:33:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AADXd0H051629; Tue, 10 Nov 2020 13:33:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AADXdIs051627; Tue, 10 Nov 2020 13:33:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202011101333.0AADXdIs051627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Nov 2020 13:33:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367565 - in stable/11/sys/dev/usb: . quirk X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/usb: . quirk X-SVN-Commit-Revision: 367565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 13:33:40 -0000 Author: hselasky Date: Tue Nov 10 13:33:39 2020 New Revision: 367565 URL: https://svnweb.freebsd.org/changeset/base/367565 Log: MFC r366806: Add new USB quirk. PR: 250422 Submitted by: vidwer+fbsdbugs@gmail.com Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/sys/dev/usb/quirk/usb_quirk.c stable/11/sys/dev/usb/usbdevs Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/11/sys/dev/usb/quirk/usb_quirk.c Tue Nov 10 13:32:50 2020 (r367564) +++ stable/11/sys/dev/usb/quirk/usb_quirk.c Tue Nov 10 13:33:39 2020 (r367565) @@ -191,6 +191,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE), USB_QUIRK(CYPRESS, XX6830XX, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(EMTEC, DANEELEC4GB, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(DESKNOTE, UCR_61S2B, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(DMI, CFSM_RW, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI, Modified: stable/11/sys/dev/usb/usbdevs ============================================================================== --- stable/11/sys/dev/usb/usbdevs Tue Nov 10 13:32:50 2020 (r367564) +++ stable/11/sys/dev/usb/usbdevs Tue Nov 10 13:33:39 2020 (r367565) @@ -1811,6 +1811,7 @@ product ELV USBI2C 0xe00f USB-I2C interface product EMS DUAL_SHOOTER 0x0003 PSX gun controller converter /* Emtec products */ +product EMTEC DANEELEC4GB 0x1e20 USB DISK Pro PMAP product EMTEC RUF2PS 0x2240 Flash Drive /* Encore products */ From owner-svn-src-stable@freebsd.org Tue Nov 10 13:36:07 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE76C430DD2; Tue, 10 Nov 2020 13:36:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVpm75Wytz4QpB; Tue, 10 Nov 2020 13:36:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B07FB236E2; Tue, 10 Nov 2020 13:36:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AADa7Rv051739; Tue, 10 Nov 2020 13:36:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AADa7i0051738; Tue, 10 Nov 2020 13:36:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202011101336.0AADa7i0051738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Nov 2020 13:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367566 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 367566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 13:36:07 -0000 Author: hselasky Date: Tue Nov 10 13:36:07 2020 New Revision: 367566 URL: https://svnweb.freebsd.org/changeset/base/367566 Log: MFC r366751: Remove ifdefs around IS_ALIGNED() definition in the LinuxKPI. Discussed with: manu@ Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Nov 10 13:33:39 2020 (r367565) +++ stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Nov 10 13:36:07 2020 (r367566) @@ -135,10 +135,7 @@ extern const volatile int lkpi_build_bug_on_zero; #define ALIGN(x, y) roundup2((x), (y)) #undef PTR_ALIGN #define PTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a))) -#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 -/* Moved from linuxkpi_gplv2 */ #define IS_ALIGNED(x, a) (((x) & ((__typeof(x))(a) - 1)) == 0) -#endif #define DIV_ROUND_UP(x, n) howmany(x, n) #define __KERNEL_DIV_ROUND_UP(x, n) howmany(x, n) #define DIV_ROUND_UP_ULL(x, n) DIV_ROUND_UP((unsigned long long)(x), (n)) From owner-svn-src-stable@freebsd.org Tue Nov 10 18:07:14 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9878437AFF; Tue, 10 Nov 2020 18:07:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVwmy3S8nz4jMt; Tue, 10 Nov 2020 18:07:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6523827071; Tue, 10 Nov 2020 18:07:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AAI7EjO016101; Tue, 10 Nov 2020 18:07:14 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AAI7ECb016100; Tue, 10 Nov 2020 18:07:14 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202011101807.0AAI7ECb016100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 10 Nov 2020 18:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367571 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 367571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 18:07:14 -0000 Author: brooks Date: Tue Nov 10 18:07:13 2020 New Revision: 367571 URL: https://svnweb.freebsd.org/changeset/base/367571 Log: MFC r367302: sysvshm: pass relevant uap members as arguments Alter shmget_allocate_segment and shmget_existing to take the values they want from struct shmget_args rather than passing the struct around. In general, uap structures should only be the interface to sys_ functions. This makes one small functional change and records the allocated space rather than the requested space. If this turns out to be a problem (e.g. if software tries to find undersized segments by exact size rather than using keys), we can correct that easily. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27077 Modified: stable/12/sys/kern/sysv_shm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/sysv_shm.c ============================================================================== --- stable/12/sys/kern/sysv_shm.c Tue Nov 10 18:05:17 2020 (r367570) +++ stable/12/sys/kern/sysv_shm.c Tue Nov 10 18:07:13 2020 (r367571) @@ -111,11 +111,6 @@ FEATURE(sysv_shm, "System V shared memory segments sup static MALLOC_DEFINE(M_SHM, "shm", "SVID compatible shared memory segments"); -static int shmget_allocate_segment(struct thread *td, - struct shmget_args *uap, int mode); -static int shmget_existing(struct thread *td, struct shmget_args *uap, - int mode, int segnum); - #define SHMSEG_FREE 0x0200 #define SHMSEG_REMOVED 0x0400 #define SHMSEG_ALLOCATED 0x0800 @@ -134,6 +129,10 @@ static void shm_deallocate_segment(struct shmid_kernel static int shm_find_segment_by_key(struct prison *, key_t); static struct shmid_kernel *shm_find_segment(struct prison *, int, bool); static int shm_delete_mapping(struct vmspace *vm, struct shmmap_state *); +static int shmget_allocate_segment(struct thread *td, key_t key, size_t size, + int mode); +static int shmget_existing(struct thread *td, size_t size, int shmflg, + int mode, int segnum); static void shmrealloc(void); static int shminit(void); static int sysvshm_modload(struct module *, int, void *); @@ -659,7 +658,7 @@ done: static int -shmget_existing(struct thread *td, struct shmget_args *uap, int mode, +shmget_existing(struct thread *td, size_t size, int shmflg, int mode, int segnum) { struct shmid_kernel *shmseg; @@ -671,35 +670,34 @@ shmget_existing(struct thread *td, struct shmget_args KASSERT(segnum >= 0 && segnum < shmalloced, ("segnum %d shmalloced %d", segnum, shmalloced)); shmseg = &shmsegs[segnum]; - if ((uap->shmflg & (IPC_CREAT | IPC_EXCL)) == (IPC_CREAT | IPC_EXCL)) + if ((shmflg & (IPC_CREAT | IPC_EXCL)) == (IPC_CREAT | IPC_EXCL)) return (EEXIST); #ifdef MAC - error = mac_sysvshm_check_shmget(td->td_ucred, shmseg, uap->shmflg); + error = mac_sysvshm_check_shmget(td->td_ucred, shmseg, shmflg); if (error != 0) return (error); #endif - if (uap->size != 0 && uap->size > shmseg->u.shm_segsz) + if (size != 0 && size > shmseg->u.shm_segsz) return (EINVAL); td->td_retval[0] = IXSEQ_TO_IPCID(segnum, shmseg->u.shm_perm); return (0); } static int -shmget_allocate_segment(struct thread *td, struct shmget_args *uap, int mode) +shmget_allocate_segment(struct thread *td, key_t key, size_t size, int mode) { struct ucred *cred = td->td_ucred; struct shmid_kernel *shmseg; vm_object_t shm_object; int i, segnum; - size_t size; SYSVSHM_ASSERT_LOCKED(); - if (uap->size < shminfo.shmmin || uap->size > shminfo.shmmax) + if (size < shminfo.shmmin || size > shminfo.shmmax) return (EINVAL); if (shm_nused >= shminfo.shmmni) /* Any shmids left? */ return (ENOSPC); - size = round_page(uap->size); + size = round_page(size); if (shm_committed + btoc(size) > shminfo.shmall) return (ENOMEM); if (shm_last_free < 0) { @@ -760,10 +758,10 @@ shmget_allocate_segment(struct thread *td, struct shmg shmseg->u.shm_perm.cuid = shmseg->u.shm_perm.uid = cred->cr_uid; shmseg->u.shm_perm.cgid = shmseg->u.shm_perm.gid = cred->cr_gid; shmseg->u.shm_perm.mode = (mode & ACCESSPERMS) | SHMSEG_ALLOCATED; - shmseg->u.shm_perm.key = uap->key; + shmseg->u.shm_perm.key = key; shmseg->u.shm_perm.seq = (shmseg->u.shm_perm.seq + 1) & 0x7fff; shmseg->cred = crhold(cred); - shmseg->u.shm_segsz = uap->size; + shmseg->u.shm_segsz = size; shmseg->u.shm_cpid = td->td_proc->p_pid; shmseg->u.shm_lpid = shmseg->u.shm_nattch = 0; shmseg->u.shm_atime = shmseg->u.shm_dtime = 0; @@ -796,16 +794,18 @@ sys_shmget(struct thread *td, struct shmget_args *uap) mode = uap->shmflg & ACCESSPERMS; SYSVSHM_LOCK(); if (uap->key == IPC_PRIVATE) { - error = shmget_allocate_segment(td, uap, mode); + error = shmget_allocate_segment(td, uap->key, uap->size, mode); } else { segnum = shm_find_segment_by_key(td->td_ucred->cr_prison, uap->key); if (segnum >= 0) - error = shmget_existing(td, uap, mode, segnum); + error = shmget_existing(td, uap->size, uap->shmflg, + mode, segnum); else if ((uap->shmflg & IPC_CREAT) == 0) error = ENOENT; else - error = shmget_allocate_segment(td, uap, mode); + error = shmget_allocate_segment(td, uap->key, + uap->size, mode); } SYSVSHM_UNLOCK(); return (error); From owner-svn-src-stable@freebsd.org Wed Nov 11 00:43:14 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F3A322D06A8; Wed, 11 Nov 2020 00:43:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CW5Ys6bbwz3Nkj; Wed, 11 Nov 2020 00:43:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D33C43EA5; Wed, 11 Nov 2020 00:43:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AB0hD0U064081; Wed, 11 Nov 2020 00:43:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AB0hDtt064080; Wed, 11 Nov 2020 00:43:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011110043.0AB0hDtt064080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 11 Nov 2020 00:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367582 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 367582 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2020 00:43:14 -0000 Author: kib Date: Wed Nov 11 00:43:13 2020 New Revision: 367582 URL: https://svnweb.freebsd.org/changeset/base/367582 Log: MFC r367120: Check for process group change in tty_wait_background(). PR: 250701 Modified: stable/12/sys/kern/tty.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/tty.c ============================================================================== --- stable/12/sys/kern/tty.c Tue Nov 10 23:25:16 2020 (r367581) +++ stable/12/sys/kern/tty.c Wed Nov 11 00:43:13 2020 (r367582) @@ -464,6 +464,19 @@ tty_wait_background(struct tty *tp, struct thread *td, sig = 0; } PGRP_LOCK(pg); + + /* + * pg may no longer be our process group. + * Re-check after locking process group. + */ + PROC_LOCK(p); + if (p->p_pgrp != pg) { + PROC_UNLOCK(p); + PGRP_UNLOCK(pg); + continue; + } + + PROC_UNLOCK(p); pgsignal(pg, ksi.ksi_signo, 1, &ksi); PGRP_UNLOCK(pg); From owner-svn-src-stable@freebsd.org Wed Nov 11 11:25:15 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E48C2E63A4; Wed, 11 Nov 2020 11:25:15 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWMpg398Kz4f2q; Wed, 11 Nov 2020 11:25:15 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F8F013B5C; Wed, 11 Nov 2020 11:25:15 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ABBPFSW060292; Wed, 11 Nov 2020 11:25:15 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABBPFA3060291; Wed, 11 Nov 2020 11:25:15 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011111125.0ABBPFA3060291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Wed, 11 Nov 2020 11:25:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367586 - stable/12/usr.bin/usbhidaction X-SVN-Group: stable-12 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/12/usr.bin/usbhidaction X-SVN-Commit-Revision: 367586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2020 11:25:15 -0000 Author: 0mp (doc,ports committer) Date: Wed Nov 11 11:25:14 2020 New Revision: 367586 URL: https://svnweb.freebsd.org/changeset/base/367586 Log: MFC r367097: Correct USB HID item in examples It turns out that examples were incorrectly referring to Volume_Up and Volume_Down, which are not defined at all. PR: 250683 Modified: stable/12/usr.bin/usbhidaction/usbhidaction.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/usbhidaction/usbhidaction.1 ============================================================================== --- stable/12/usr.bin/usbhidaction/usbhidaction.1 Wed Nov 11 08:51:04 2020 (r367585) +++ stable/12/usr.bin/usbhidaction/usbhidaction.1 Wed Nov 11 11:25:14 2020 (r367586) @@ -28,7 +28,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 9, 2003 +.Dd October 28, 2020 .Dt USBHIDACTION 1 .Os .Sh NAME @@ -139,8 +139,8 @@ The following configuration file can be used to contro of Philips USB speakers with the HID controls on the speakers. .Bd -literal -offset indent # Configuration for various Philips USB speakers -Consumer:Volume_Up 1 0 mixer -f $1 vol +1 -Consumer:Volume_Down 1 0 mixer -f $1 vol -1 +Consumer:Volume_Increment 1 0 mixer -f $1 vol +1 +Consumer:Volume_Decrement 1 0 mixer -f $1 vol -1 # mute not supported #Consumer:Mute 1 0 mixer -f $1 mute Consumer:Channel_Top.Microsoft:Base_Up 1 0 mixer -f $1 bass +1 From owner-svn-src-stable@freebsd.org Wed Nov 11 11:26:37 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EAE02E62EF; Wed, 11 Nov 2020 11:26:37 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWMrF2kV1z4fQl; Wed, 11 Nov 2020 11:26:37 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FDE013E91; Wed, 11 Nov 2020 11:26:37 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ABBQb1E060410; Wed, 11 Nov 2020 11:26:37 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABBQbXO060409; Wed, 11 Nov 2020 11:26:37 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011111126.0ABBQbXO060409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Wed, 11 Nov 2020 11:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367587 - stable/11/usr.bin/usbhidaction X-SVN-Group: stable-11 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/11/usr.bin/usbhidaction X-SVN-Commit-Revision: 367587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2020 11:26:37 -0000 Author: 0mp (doc,ports committer) Date: Wed Nov 11 11:26:36 2020 New Revision: 367587 URL: https://svnweb.freebsd.org/changeset/base/367587 Log: MFC r367097: Correct USB HID item in examples It turns out that examples were incorrectly referring to Volume_Up and Volume_Down, which are not defined at all. PR: 250683 Modified: stable/11/usr.bin/usbhidaction/usbhidaction.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/usbhidaction/usbhidaction.1 ============================================================================== --- stable/11/usr.bin/usbhidaction/usbhidaction.1 Wed Nov 11 11:25:14 2020 (r367586) +++ stable/11/usr.bin/usbhidaction/usbhidaction.1 Wed Nov 11 11:26:36 2020 (r367587) @@ -28,7 +28,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 9, 2003 +.Dd October 28, 2020 .Dt USBHIDACTION 1 .Os .Sh NAME @@ -139,8 +139,8 @@ The following configuration file can be used to contro of Philips USB speakers with the HID controls on the speakers. .Bd -literal -offset indent # Configuration for various Philips USB speakers -Consumer:Volume_Up 1 0 mixer -f $1 vol +1 -Consumer:Volume_Down 1 0 mixer -f $1 vol -1 +Consumer:Volume_Increment 1 0 mixer -f $1 vol +1 +Consumer:Volume_Decrement 1 0 mixer -f $1 vol -1 # mute not supported #Consumer:Mute 1 0 mixer -f $1 mute Consumer:Channel_Top.Microsoft:Base_Up 1 0 mixer -f $1 bass +1 From owner-svn-src-stable@freebsd.org Wed Nov 11 14:06:46 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC4602EB05F; Wed, 11 Nov 2020 14:06:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWRP25pyqz4qB8; Wed, 11 Nov 2020 14:06:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA6BD15AC1; Wed, 11 Nov 2020 14:06:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ABE6kdO060543; Wed, 11 Nov 2020 14:06:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABE6jJ0060539; Wed, 11 Nov 2020 14:06:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011111406.0ABE6jJ0060539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Nov 2020 14:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367591 - in stable/12/sys/amd64: amd64 include X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys/amd64: amd64 include X-SVN-Commit-Revision: 367591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2020 14:06:47 -0000 Author: markj Date: Wed Nov 11 14:06:45 2020 New Revision: 367591 URL: https://svnweb.freebsd.org/changeset/base/367591 Log: MFC r367335: amd64: Make it easier to configure exception stack sizes Modified: stable/12/sys/amd64/amd64/machdep.c stable/12/sys/amd64/amd64/mp_machdep.c stable/12/sys/amd64/amd64/pmap.c stable/12/sys/amd64/include/intr_machdep.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/machdep.c Wed Nov 11 14:03:49 2020 (r367590) +++ stable/12/sys/amd64/amd64/machdep.c Wed Nov 11 14:06:45 2020 (r367591) @@ -679,10 +679,10 @@ struct user_segment_descriptor gdt[NGDT * MAXCPU];/* g static struct gate_descriptor idt0[NIDT]; struct gate_descriptor *idt = &idt0[0]; /* interrupt descriptor table */ -static char dblfault_stack[PAGE_SIZE] __aligned(16); -static char mce0_stack[PAGE_SIZE] __aligned(16); -static char nmi0_stack[PAGE_SIZE] __aligned(16); -static char dbg0_stack[PAGE_SIZE] __aligned(16); +static char dblfault_stack[DBLFAULT_STACK_SIZE] __aligned(16); +static char mce0_stack[MCE_STACK_SIZE] __aligned(16); +static char nmi0_stack[NMI_STACK_SIZE] __aligned(16); +static char dbg0_stack[DBG_STACK_SIZE] __aligned(16); CTASSERT(sizeof(struct nmi_pcpu) == 16); struct amd64tss common_tss[MAXCPU]; Modified: stable/12/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/mp_machdep.c Wed Nov 11 14:03:49 2020 (r367590) +++ stable/12/sys/amd64/amd64/mp_machdep.c Wed Nov 11 14:06:45 2020 (r367591) @@ -300,18 +300,19 @@ init_secondary(void) common_tss[cpu] = common_tss[0]; common_tss[cpu].tss_iobase = sizeof(struct amd64tss) + IOPERM_BITMAP_SIZE; - common_tss[cpu].tss_ist1 = (long)&doublefault_stack[PAGE_SIZE]; + common_tss[cpu].tss_ist1 = + (long)&doublefault_stack[DBLFAULT_STACK_SIZE]; /* The NMI stack runs on IST2. */ - np = ((struct nmi_pcpu *) &nmi_stack[PAGE_SIZE]) - 1; + np = ((struct nmi_pcpu *)&nmi_stack[NMI_STACK_SIZE]) - 1; common_tss[cpu].tss_ist2 = (long) np; /* The MC# stack runs on IST3. */ - np = ((struct nmi_pcpu *) &mce_stack[PAGE_SIZE]) - 1; + np = ((struct nmi_pcpu *)&mce_stack[MCE_STACK_SIZE]) - 1; common_tss[cpu].tss_ist3 = (long) np; /* The DB# stack runs on IST4. */ - np = ((struct nmi_pcpu *) &dbg_stack[PAGE_SIZE]) - 1; + np = ((struct nmi_pcpu *)&dbg_stack[DBG_STACK_SIZE]) - 1; common_tss[cpu].tss_ist4 = (long) np; /* Prepare private GDT */ @@ -353,15 +354,15 @@ init_secondary(void) common_tss[cpu].tss_rsp0 = 0; /* Save the per-cpu pointer for use by the NMI handler. */ - np = ((struct nmi_pcpu *) &nmi_stack[PAGE_SIZE]) - 1; + np = ((struct nmi_pcpu *)&nmi_stack[NMI_STACK_SIZE]) - 1; np->np_pcpu = (register_t) pc; /* Save the per-cpu pointer for use by the MC# handler. */ - np = ((struct nmi_pcpu *) &mce_stack[PAGE_SIZE]) - 1; + np = ((struct nmi_pcpu *)&mce_stack[MCE_STACK_SIZE]) - 1; np->np_pcpu = (register_t) pc; /* Save the per-cpu pointer for use by the DB# handler. */ - np = ((struct nmi_pcpu *) &dbg_stack[PAGE_SIZE]) - 1; + np = ((struct nmi_pcpu *)&dbg_stack[DBG_STACK_SIZE]) - 1; np->np_pcpu = (register_t) pc; wrmsr(MSR_FSBASE, 0); /* User value */ @@ -488,13 +489,14 @@ native_start_all_aps(void) /* allocate and set up an idle stack data page */ bootstacks[cpu] = (void *)kmem_malloc(kstack_pages * PAGE_SIZE, M_WAITOK | M_ZERO); - doublefault_stack = (char *)kmem_malloc(PAGE_SIZE, M_WAITOK | - M_ZERO); - mce_stack = (char *)kmem_malloc(PAGE_SIZE, M_WAITOK | M_ZERO); + doublefault_stack = (char *)kmem_malloc(DBLFAULT_STACK_SIZE, + M_WAITOK | M_ZERO); + mce_stack = (char *)kmem_malloc(MCE_STACK_SIZE, + M_WAITOK | M_ZERO); nmi_stack = (char *)kmem_malloc_domainset( - DOMAINSET_PREF(domain), PAGE_SIZE, M_WAITOK | M_ZERO); + DOMAINSET_PREF(domain), NMI_STACK_SIZE, M_WAITOK | M_ZERO); dbg_stack = (char *)kmem_malloc_domainset( - DOMAINSET_PREF(domain), PAGE_SIZE, M_WAITOK | M_ZERO); + DOMAINSET_PREF(domain), DBG_STACK_SIZE, M_WAITOK | M_ZERO); dpcpu = (void *)kmem_malloc_domainset(DOMAINSET_PREF(domain), DPCPU_SIZE, M_WAITOK | M_ZERO); Modified: stable/12/sys/amd64/amd64/pmap.c ============================================================================== --- stable/12/sys/amd64/amd64/pmap.c Wed Nov 11 14:03:49 2020 (r367590) +++ stable/12/sys/amd64/amd64/pmap.c Wed Nov 11 14:06:45 2020 (r367591) @@ -156,6 +156,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -9637,16 +9638,16 @@ pmap_pti_init(void) CPU_FOREACH(i) { /* Doublefault stack IST 1 */ va = common_tss[i].tss_ist1; - pmap_pti_add_kva_locked(va - PAGE_SIZE, va, false); + pmap_pti_add_kva_locked(va - DBLFAULT_STACK_SIZE, va, false); /* NMI stack IST 2 */ va = common_tss[i].tss_ist2 + sizeof(struct nmi_pcpu); - pmap_pti_add_kva_locked(va - PAGE_SIZE, va, false); + pmap_pti_add_kva_locked(va - NMI_STACK_SIZE, va, false); /* MC# stack IST 3 */ va = common_tss[i].tss_ist3 + sizeof(struct nmi_pcpu); - pmap_pti_add_kva_locked(va - PAGE_SIZE, va, false); + pmap_pti_add_kva_locked(va - MCE_STACK_SIZE, va, false); /* DB# stack IST 4 */ va = common_tss[i].tss_ist4 + sizeof(struct nmi_pcpu); - pmap_pti_add_kva_locked(va - PAGE_SIZE, va, false); + pmap_pti_add_kva_locked(va - DBG_STACK_SIZE, va, false); } pmap_pti_add_kva_locked((vm_offset_t)kernphys + KERNBASE, (vm_offset_t)etext, true); Modified: stable/12/sys/amd64/include/intr_machdep.h ============================================================================== --- stable/12/sys/amd64/include/intr_machdep.h Wed Nov 11 14:03:49 2020 (r367590) +++ stable/12/sys/amd64/include/intr_machdep.h Wed Nov 11 14:06:45 2020 (r367591) @@ -41,4 +41,9 @@ struct nmi_pcpu { register_t __padding; /* pad to 16 bytes */ }; +#define DBLFAULT_STACK_SIZE PAGE_SIZE +#define NMI_STACK_SIZE PAGE_SIZE +#define MCE_STACK_SIZE PAGE_SIZE +#define DBG_STACK_SIZE PAGE_SIZE + #endif /* !__MACHINE_INTR_MACHDEP_H__ */ From owner-svn-src-stable@freebsd.org Wed Nov 11 21:27:17 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E62246617E; Wed, 11 Nov 2020 21:27:17 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWd9K2ccLz3pdX; Wed, 11 Nov 2020 21:27:17 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CA8B1B072; Wed, 11 Nov 2020 21:27:17 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ABLRHLf024897; Wed, 11 Nov 2020 21:27:17 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABLRHTB024896; Wed, 11 Nov 2020 21:27:17 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202011112127.0ABLRHTB024896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 11 Nov 2020 21:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367599 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 367599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2020 21:27:17 -0000 Author: vmaffione Date: Wed Nov 11 21:27:16 2020 New Revision: 367599 URL: https://svnweb.freebsd.org/changeset/base/367599 Log: MFC r367093, r367117 iflib: add per-tx-queue netmap timer The way netmap TX is handled in iflib when TX interrupts are not used (IFC_NETMAP_TX_IRQ not set) has some issues: - The netmap_tx_irq() function gets called by iflib_timer(), which gets scheduled with tick granularity (hz). This is not frequent enough for 10Gbps NICs and beyond (e.g., ixgbe or ixl). The end result is that the transmitting netmap application is not woken up fast enough to saturate the link with small packets. - The iflib_timer() functions also calls isc_txd_credits_update() to ask for more TX completion updates. However, this violates the netmap requirement that only txsync can access the TX queue for datapath operations. Only netmap_tx_irq() may be called out of the txsync context. This change introduces per-tx-queue netmap timers, using microsecond granularity to ensure that netmap_tx_irq() can be called often enough to allow for maximum packet rate. The timer routine simply calls netmap_tx_irq() to wake up the netmap application. The latter will wake up and call txsync to collect TX completion updates. This change brings back line rate speed with small packets for ixgbe. For the time being, timer expiration is hardcoded to 90 microseconds, in order to avoid introducing a new sysctl. We may eventually implement an adaptive expiration period or use another deferred work mechanism in place of timers. Also, fix the timers usage to make sure that each queue is serviced by a different CPU. PR: 248652 Reported by: sg@efficientip.com Modified: stable/12/sys/net/iflib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Wed Nov 11 18:45:06 2020 (r367598) +++ stable/12/sys/net/iflib.c Wed Nov 11 21:27:16 2020 (r367599) @@ -348,6 +348,9 @@ struct iflib_txq { qidx_t ift_size; uint16_t ift_id; struct callout ift_timer; +#ifdef DEV_NETMAP + struct callout ift_netmap_timer; +#endif /* DEV_NETMAP */ if_txsd_vec_t ift_sds; uint8_t ift_qstatus; @@ -763,6 +766,7 @@ iflib_num_tx_descs(if_ctx_t ctx) MODULE_DEPEND(iflib, netmap, 1, 1, 1); static int netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring *kring, bool init); +static void iflib_netmap_timer(void *arg); /* * device-specific sysctl variables: @@ -928,6 +932,8 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring return (0); } +#define NETMAP_TX_TIMER_US 90 + /* * Reconcile kernel and user view of the transmit ring. * @@ -1057,9 +1063,8 @@ iflib_netmap_txsync(struct netmap_kring *kring, int fl * Second part: reclaim buffers for completed transmissions. * * If there are unclaimed buffers, attempt to reclaim them. - * If none are reclaimed, and TX IRQs are not in use, do an initial - * minimal delay, then trigger the tx handler which will spin in the - * group task queue. + * If we don't manage to reclaim them all, and TX IRQs are not in use, + * trigger a per-tx-queue timer to try again later. */ if (kring->nr_hwtail != nm_prev(kring->nr_hwcur, lim)) { if (iflib_tx_credits_update(ctx, txq)) { @@ -1068,11 +1073,14 @@ iflib_netmap_txsync(struct netmap_kring *kring, int fl kring->nr_hwtail = nm_prev(netmap_idx_n2k(kring, nic_i), lim); } } + if (!(ctx->ifc_flags & IFC_NETMAP_TX_IRQ)) if (kring->nr_hwtail != nm_prev(kring->nr_hwcur, lim)) { - callout_reset_on(&txq->ift_timer, hz < 2000 ? 1 : hz / 1000, - iflib_timer, txq, txq->ift_timer.c_cpu); - } + callout_reset_sbt_on(&txq->ift_netmap_timer, + NETMAP_TX_TIMER_US * SBT_1US, SBT_1US, + iflib_netmap_timer, txq, + txq->ift_netmap_timer.c_cpu, 0); + } return (0); } @@ -1275,28 +1283,16 @@ iflib_netmap_rxq_init(if_ctx_t ctx, iflib_rxq_t rxq) } static void -iflib_netmap_timer_adjust(if_ctx_t ctx, iflib_txq_t txq, uint32_t *reset_on) +iflib_netmap_timer(void *arg) { - struct netmap_kring *kring; - uint16_t txqid; + iflib_txq_t txq = arg; + if_ctx_t ctx = txq->ift_ctx; - txqid = txq->ift_id; - kring = netmap_kring_on(NA(ctx->ifc_ifp), txqid, NR_TX); - if (kring == NULL) - return; - - if (kring->nr_hwcur != nm_next(kring->nr_hwtail, kring->nkr_num_slots - 1)) { - bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, - BUS_DMASYNC_POSTREAD); - if (ctx->isc_txd_credits_update(ctx->ifc_softc, txqid, false)) - netmap_tx_irq(ctx->ifc_ifp, txqid); - if (!(ctx->ifc_flags & IFC_NETMAP_TX_IRQ)) { - if (hz < 2000) - *reset_on = 1; - else - *reset_on = hz / 1000; - } - } + /* + * Wake up the netmap application, to give it a chance to + * call txsync and reclaim more completed TX buffers. + */ + netmap_tx_irq(ctx->ifc_ifp, txq->ift_id); } #define iflib_netmap_detach(ifp) netmap_detach(ifp) @@ -1308,8 +1304,6 @@ iflib_netmap_timer_adjust(if_ctx_t ctx, iflib_txq_t tx #define iflib_netmap_attach(ctx) (0) #define netmap_rx_irq(ifp, qid, budget) (0) -#define netmap_tx_irq(ifp, qid) do {} while (0) -#define iflib_netmap_timer_adjust(ctx, txq, reset_on) #endif @@ -2367,7 +2361,6 @@ iflib_timer(void *arg) if_ctx_t ctx = txq->ift_ctx; if_softc_ctx_t sctx = &ctx->ifc_softc_ctx; uint64_t this_tick = ticks; - uint32_t reset_on = hz / 2; if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) return; @@ -2392,17 +2385,13 @@ iflib_timer(void *arg) } txq->ift_cleaned_prev = txq->ift_cleaned; } -#ifdef DEV_NETMAP - if (if_getcapenable(ctx->ifc_ifp) & IFCAP_NETMAP) - iflib_netmap_timer_adjust(ctx, txq, &reset_on); -#endif /* handle any laggards */ if (txq->ift_db_pending) GROUPTASK_ENQUEUE(&txq->ift_task); sctx->isc_pause_frames = 0; if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) - callout_reset_on(&txq->ift_timer, reset_on, iflib_timer, txq, txq->ift_timer.c_cpu); + callout_reset_on(&txq->ift_timer, hz / 2, iflib_timer, txq, txq->ift_timer.c_cpu); return; hung: @@ -2476,6 +2465,9 @@ iflib_init_locked(if_ctx_t ctx) for (i = 0, txq = ctx->ifc_txqs; i < sctx->isc_ntxqsets; i++, txq++) { CALLOUT_LOCK(txq); callout_stop(&txq->ift_timer); +#ifdef DEV_NETMAP + callout_stop(&txq->ift_netmap_timer); +#endif /* DEV_NETMAP */ CALLOUT_UNLOCK(txq); iflib_netmap_txq_init(ctx, txq); } @@ -2565,6 +2557,9 @@ iflib_stop(if_ctx_t ctx) CALLOUT_LOCK(txq); callout_stop(&txq->ift_timer); +#ifdef DEV_NETMAP + callout_stop(&txq->ift_netmap_timer); +#endif /* DEV_NETMAP */ CALLOUT_UNLOCK(txq); /* clean any enqueued buffers */ @@ -3904,7 +3899,6 @@ _task_fn_admin(void *context) iflib_txq_t txq; int i; bool oactive, running, do_reset, do_watchdog, in_detach; - uint32_t reset_on = hz / 2; STATE_LOCK(ctx); running = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING); @@ -3932,12 +3926,8 @@ _task_fn_admin(void *context) } IFDI_UPDATE_ADMIN_STATUS(ctx); for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) { -#ifdef DEV_NETMAP - reset_on = hz / 2; - if (if_getcapenable(ctx->ifc_ifp) & IFCAP_NETMAP) - iflib_netmap_timer_adjust(ctx, txq, &reset_on); -#endif - callout_reset_on(&txq->ift_timer, reset_on, iflib_timer, txq, txq->ift_timer.c_cpu); + callout_reset_on(&txq->ift_timer, hz / 2, iflib_timer, txq, + txq->ift_timer.c_cpu); } IFDI_LINK_INTR_ENABLE(ctx); if (do_reset) @@ -5090,6 +5080,9 @@ iflib_pseudo_deregister(if_ctx_t ctx) tqg = qgroup_if_io_tqg; for (txq = ctx->ifc_txqs, i = 0; i < NTXQSETS(ctx); i++, txq++) { callout_drain(&txq->ift_timer); +#ifdef DEV_NETMAP + callout_drain(&txq->ift_netmap_timer); +#endif /* DEV_NETMAP */ if (txq->ift_task.gt_uniq != NULL) taskqgroup_detach(tqg, &txq->ift_task); } @@ -5175,6 +5168,9 @@ iflib_device_deregister(if_ctx_t ctx) tqg = qgroup_if_io_tqg; for (txq = ctx->ifc_txqs, i = 0; i < NTXQSETS(ctx); i++, txq++) { callout_drain(&txq->ift_timer); +#ifdef DEV_NETMAP + callout_drain(&txq->ift_netmap_timer); +#endif /* DEV_NETMAP */ if (txq->ift_task.gt_uniq != NULL) taskqgroup_detach(tqg, &txq->ift_task); } @@ -5584,8 +5580,6 @@ iflib_queues_alloc(if_ctx_t ctx) } else { txq->ift_br_offset = 0; } - /* XXX fix this */ - txq->ift_timer.c_cpu = cpu; if (iflib_txsd_alloc(txq)) { device_printf(dev, "Critical Failure setting up TX buffers\n"); @@ -5598,6 +5592,11 @@ iflib_queues_alloc(if_ctx_t ctx) device_get_nameunit(dev), txq->ift_id); mtx_init(&txq->ift_mtx, txq->ift_mtx_name, NULL, MTX_DEF); callout_init_mtx(&txq->ift_timer, &txq->ift_mtx, 0); + txq->ift_timer.c_cpu = cpu; +#ifdef DEV_NETMAP + callout_init_mtx(&txq->ift_netmap_timer, &txq->ift_mtx, 0); + txq->ift_netmap_timer.c_cpu = cpu; +#endif /* DEV_NETMAP */ err = ifmp_ring_alloc(&txq->ift_br, 2048, txq, iflib_txq_drain, iflib_txq_can_drain, M_IFLIB, M_WAITOK); From owner-svn-src-stable@freebsd.org Wed Nov 11 22:00:31 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 810BA4674B2; Wed, 11 Nov 2020 22:00:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWdvg3J2lz3rZw; Wed, 11 Nov 2020 22:00:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 641551B7F4; Wed, 11 Nov 2020 22:00:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ABM0VEs043793; Wed, 11 Nov 2020 22:00:31 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABM0Vx4043792; Wed, 11 Nov 2020 22:00:31 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202011112200.0ABM0Vx4043792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 11 Nov 2020 22:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367601 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 367601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2020 22:00:31 -0000 Author: brooks Date: Wed Nov 11 22:00:30 2020 New Revision: 367601 URL: https://svnweb.freebsd.org/changeset/base/367601 Log: MFC r367302: sysvshm: pass relevant uap members as arguments Alter shmget_allocate_segment and shmget_existing to take the values they want from struct shmget_args rather than passing the struct around. In general, uap structures should only be the interface to sys_ functions. This makes one small functional change and records the allocated space rather than the requested space. If this turns out to be a problem (e.g. if software tries to find undersized segments by exact size rather than using keys), we can correct that easily. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27077 Modified: stable/11/sys/kern/sysv_shm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/sysv_shm.c ============================================================================== --- stable/11/sys/kern/sysv_shm.c Wed Nov 11 21:59:39 2020 (r367600) +++ stable/11/sys/kern/sysv_shm.c Wed Nov 11 22:00:30 2020 (r367601) @@ -102,11 +102,6 @@ FEATURE(sysv_shm, "System V shared memory segments sup static MALLOC_DEFINE(M_SHM, "shm", "SVID compatible shared memory segments"); -static int shmget_allocate_segment(struct thread *td, - struct shmget_args *uap, int mode); -static int shmget_existing(struct thread *td, struct shmget_args *uap, - int mode, int segnum); - #define SHMSEG_FREE 0x0200 #define SHMSEG_REMOVED 0x0400 #define SHMSEG_ALLOCATED 0x0800 @@ -125,6 +120,10 @@ static void shm_deallocate_segment(struct shmid_kernel static int shm_find_segment_by_key(struct prison *, key_t); static struct shmid_kernel *shm_find_segment(struct prison *, int, bool); static int shm_delete_mapping(struct vmspace *vm, struct shmmap_state *); +static int shmget_allocate_segment(struct thread *td, key_t key, size_t size, + int mode); +static int shmget_existing(struct thread *td, size_t size, int shmflg, + int mode, int segnum); static void shmrealloc(void); static int shminit(void); static int sysvshm_modload(struct module *, int, void *); @@ -643,7 +642,7 @@ done: static int -shmget_existing(struct thread *td, struct shmget_args *uap, int mode, +shmget_existing(struct thread *td, size_t size, int shmflg, int mode, int segnum) { struct shmid_kernel *shmseg; @@ -655,35 +654,34 @@ shmget_existing(struct thread *td, struct shmget_args KASSERT(segnum >= 0 && segnum < shmalloced, ("segnum %d shmalloced %d", segnum, shmalloced)); shmseg = &shmsegs[segnum]; - if ((uap->shmflg & (IPC_CREAT | IPC_EXCL)) == (IPC_CREAT | IPC_EXCL)) + if ((shmflg & (IPC_CREAT | IPC_EXCL)) == (IPC_CREAT | IPC_EXCL)) return (EEXIST); #ifdef MAC - error = mac_sysvshm_check_shmget(td->td_ucred, shmseg, uap->shmflg); + error = mac_sysvshm_check_shmget(td->td_ucred, shmseg, shmflg); if (error != 0) return (error); #endif - if (uap->size != 0 && uap->size > shmseg->u.shm_segsz) + if (size != 0 && size > shmseg->u.shm_segsz) return (EINVAL); td->td_retval[0] = IXSEQ_TO_IPCID(segnum, shmseg->u.shm_perm); return (0); } static int -shmget_allocate_segment(struct thread *td, struct shmget_args *uap, int mode) +shmget_allocate_segment(struct thread *td, key_t key, size_t size, int mode) { struct ucred *cred = td->td_ucred; struct shmid_kernel *shmseg; vm_object_t shm_object; int i, segnum; - size_t size; SYSVSHM_ASSERT_LOCKED(); - if (uap->size < shminfo.shmmin || uap->size > shminfo.shmmax) + if (size < shminfo.shmmin || size > shminfo.shmmax) return (EINVAL); if (shm_nused >= shminfo.shmmni) /* Any shmids left? */ return (ENOSPC); - size = round_page(uap->size); + size = round_page(size); if (shm_committed + btoc(size) > shminfo.shmall) return (ENOMEM); if (shm_last_free < 0) { @@ -744,10 +742,10 @@ shmget_allocate_segment(struct thread *td, struct shmg shmseg->u.shm_perm.cuid = shmseg->u.shm_perm.uid = cred->cr_uid; shmseg->u.shm_perm.cgid = shmseg->u.shm_perm.gid = cred->cr_gid; shmseg->u.shm_perm.mode = (mode & ACCESSPERMS) | SHMSEG_ALLOCATED; - shmseg->u.shm_perm.key = uap->key; + shmseg->u.shm_perm.key = key; shmseg->u.shm_perm.seq = (shmseg->u.shm_perm.seq + 1) & 0x7fff; shmseg->cred = crhold(cred); - shmseg->u.shm_segsz = uap->size; + shmseg->u.shm_segsz = size; shmseg->u.shm_cpid = td->td_proc->p_pid; shmseg->u.shm_lpid = shmseg->u.shm_nattch = 0; shmseg->u.shm_atime = shmseg->u.shm_dtime = 0; @@ -780,16 +778,18 @@ sys_shmget(struct thread *td, struct shmget_args *uap) mode = uap->shmflg & ACCESSPERMS; SYSVSHM_LOCK(); if (uap->key == IPC_PRIVATE) { - error = shmget_allocate_segment(td, uap, mode); + error = shmget_allocate_segment(td, uap->key, uap->size, mode); } else { segnum = shm_find_segment_by_key(td->td_ucred->cr_prison, uap->key); if (segnum >= 0) - error = shmget_existing(td, uap, mode, segnum); + error = shmget_existing(td, uap->size, uap->shmflg, + mode, segnum); else if ((uap->shmflg & IPC_CREAT) == 0) error = ENOENT; else - error = shmget_allocate_segment(td, uap, mode); + error = shmget_allocate_segment(td, uap->key, + uap->size, mode); } SYSVSHM_UNLOCK(); return (error); From owner-svn-src-stable@freebsd.org Wed Nov 11 22:15:26 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34944467948; Wed, 11 Nov 2020 22:15:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWfDt0XVnz3sXh; Wed, 11 Nov 2020 22:15:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 052AD1BD9D; Wed, 11 Nov 2020 22:15:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ABMFPCp055896; Wed, 11 Nov 2020 22:15:25 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABMFPGj055895; Wed, 11 Nov 2020 22:15:25 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202011112215.0ABMFPGj055895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Nov 2020 22:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367602 - in stable: 11/contrib/llvm-project/clang/lib/Sema 12/contrib/llvm-project/clang/lib/Sema X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/clang/lib/Sema 12/contrib/llvm-project/clang/lib/Sema X-SVN-Commit-Revision: 367602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2020 22:15:26 -0000 Author: dim Date: Wed Nov 11 22:15:25 2020 New Revision: 367602 URL: https://svnweb.freebsd.org/changeset/base/367602 Log: MFC r366683: Merge commit 35ecc7fe4 from llvm git (by Hubert Tong): [clang][Sema] Fix PR47676: Handle dependent AltiVec C-style cast Fix premature decision in the presence of type-dependent expression operands on whether AltiVec vector initializations from single expressions are "splat" operations. Verify that the instantiation is able to determine the correct cast semantics for both the scalar type and the vector type case. Note that, because the change only affects the single-expression case (and the target type is an AltiVec-style vector type), the replacement of a parenthesized list with a parenthesized expression does not change the semantics of the program in a program-observable manner. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D88526 This should fix 'Assertion failed: (isScalarType()), function getScalarTypeKind, file /usr/src/contrib/llvm-project/clang/lib/AST /Type.cpp, line 2146', when building the graphics/opencv-core port for powerpc64le. Requested by: pkubaj Modified: stable/12/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp ============================================================================== --- stable/12/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp Wed Nov 11 22:00:30 2020 (r367601) +++ stable/12/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp Wed Nov 11 22:15:25 2020 (r367602) @@ -6809,7 +6809,7 @@ Sema::ActOnCastExpr(Scope *S, SourceLocation LParenLoc } if (PE || PLE->getNumExprs() == 1) { Expr *E = (PE ? PE->getSubExpr() : PLE->getExpr(0)); - if (!E->getType()->isVectorType()) + if (!E->isTypeDependent() && !E->getType()->isVectorType()) isVectorLiteral = true; } else From owner-svn-src-stable@freebsd.org Wed Nov 11 22:15:26 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 924234678E6; Wed, 11 Nov 2020 22:15:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWfDt3ny3z3shb; Wed, 11 Nov 2020 22:15:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74F0C1BF0C; Wed, 11 Nov 2020 22:15:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ABMFQLx055902; Wed, 11 Nov 2020 22:15:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABMFQFF055901; Wed, 11 Nov 2020 22:15:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202011112215.0ABMFQFF055901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Nov 2020 22:15:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367602 - in stable: 11/contrib/llvm-project/clang/lib/Sema 12/contrib/llvm-project/clang/lib/Sema X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/clang/lib/Sema 12/contrib/llvm-project/clang/lib/Sema X-SVN-Commit-Revision: 367602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2020 22:15:26 -0000 Author: dim Date: Wed Nov 11 22:15:25 2020 New Revision: 367602 URL: https://svnweb.freebsd.org/changeset/base/367602 Log: MFC r366683: Merge commit 35ecc7fe4 from llvm git (by Hubert Tong): [clang][Sema] Fix PR47676: Handle dependent AltiVec C-style cast Fix premature decision in the presence of type-dependent expression operands on whether AltiVec vector initializations from single expressions are "splat" operations. Verify that the instantiation is able to determine the correct cast semantics for both the scalar type and the vector type case. Note that, because the change only affects the single-expression case (and the target type is an AltiVec-style vector type), the replacement of a parenthesized list with a parenthesized expression does not change the semantics of the program in a program-observable manner. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D88526 This should fix 'Assertion failed: (isScalarType()), function getScalarTypeKind, file /usr/src/contrib/llvm-project/clang/lib/AST /Type.cpp, line 2146', when building the graphics/opencv-core port for powerpc64le. Requested by: pkubaj Modified: stable/11/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp ============================================================================== --- stable/11/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp Wed Nov 11 22:00:30 2020 (r367601) +++ stable/11/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp Wed Nov 11 22:15:25 2020 (r367602) @@ -6809,7 +6809,7 @@ Sema::ActOnCastExpr(Scope *S, SourceLocation LParenLoc } if (PE || PLE->getNumExprs() == 1) { Expr *E = (PE ? PE->getSubExpr() : PLE->getExpr(0)); - if (!E->getType()->isVectorType()) + if (!E->isTypeDependent() && !E->getType()->isVectorType()) isVectorLiteral = true; } else From owner-svn-src-stable@freebsd.org Wed Nov 11 22:18:25 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A0B7467D4A; Wed, 11 Nov 2020 22:18:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWfJJ6rbHz3swB; Wed, 11 Nov 2020 22:18:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDCC81BF0E; Wed, 11 Nov 2020 22:18:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ABMIOWT056113; Wed, 11 Nov 2020 22:18:24 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABMIOhp056112; Wed, 11 Nov 2020 22:18:24 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202011112218.0ABMIOhp056112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Nov 2020 22:18:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367603 - in stable: 11/contrib/llvm-project/llvm/lib/Target/PowerPC 12/contrib/llvm-project/llvm/lib/Target/PowerPC X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/llvm/lib/Target/PowerPC 12/contrib/llvm-project/llvm/lib/Target/PowerPC X-SVN-Commit-Revision: 367603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2020 22:18:25 -0000 Author: dim Date: Wed Nov 11 22:18:24 2020 New Revision: 367603 URL: https://svnweb.freebsd.org/changeset/base/367603 Log: MFC r367485: Merge commit 354d3106c from llvm git (by Kai Luo): [PowerPC] Skip combining (uint_to_fp x) if x is not simple type Current powerpc64le backend hits ``` Combining: t7: f64 = uint_to_fp t6 llc: llvm-project/llvm/include/llvm/CodeGen/ValueTypes.h:291: llvm::MVT llvm::EVT::getSimpleVT() const: Assertion `isSimple() && "Expected a SimpleValueType!"' failed. ``` This patch fixes it by skipping combination if `t6` is not simple type. Fixed https://bugs.llvm.org/show_bug.cgi?id=47660. Reviewed By: #powerpc, steven.zhang Differential Revision: https://reviews.llvm.org/D88388 This should fix the llvm assertion mentioned above when building the following ports for powerpc64le: * audio/traverso * databases/percona57-pam-for-mysql * databases/percona57-server * emulators/citra * emulators/citra-qt5 * games/7kaa * graphics/dia * graphics/mandelbulber * graphics/pcl-pointclouds * net-p2p/libtorrent-rasterbar * textproc/htmldoc Requested by: pkubaj Modified: stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp ============================================================================== --- stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp Wed Nov 11 22:15:25 2020 (r367602) +++ stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp Wed Nov 11 22:18:24 2020 (r367603) @@ -13371,6 +13371,8 @@ SDValue PPCTargetLowering::combineFPToIntToFP(SDNode * // from the hardware. if (Op.getValueType() != MVT::f32 && Op.getValueType() != MVT::f64) return SDValue(); + if (!Op.getOperand(0).getValueType().isSimple()) + return SDValue(); if (Op.getOperand(0).getValueType().getSimpleVT() <= MVT(MVT::i1) || Op.getOperand(0).getValueType().getSimpleVT() > MVT(MVT::i64)) return SDValue(); From owner-svn-src-stable@freebsd.org Wed Nov 11 22:18:25 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58EE3467D4B; Wed, 11 Nov 2020 22:18:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CWfJK24mVz3t0m; Wed, 11 Nov 2020 22:18:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A3061BEF7; Wed, 11 Nov 2020 22:18:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ABMIPJI056119; Wed, 11 Nov 2020 22:18:25 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ABMIPKL056118; Wed, 11 Nov 2020 22:18:25 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202011112218.0ABMIPKL056118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Nov 2020 22:18:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367603 - in stable: 11/contrib/llvm-project/llvm/lib/Target/PowerPC 12/contrib/llvm-project/llvm/lib/Target/PowerPC X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/llvm/lib/Target/PowerPC 12/contrib/llvm-project/llvm/lib/Target/PowerPC X-SVN-Commit-Revision: 367603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2020 22:18:25 -0000 Author: dim Date: Wed Nov 11 22:18:24 2020 New Revision: 367603 URL: https://svnweb.freebsd.org/changeset/base/367603 Log: MFC r367485: Merge commit 354d3106c from llvm git (by Kai Luo): [PowerPC] Skip combining (uint_to_fp x) if x is not simple type Current powerpc64le backend hits ``` Combining: t7: f64 = uint_to_fp t6 llc: llvm-project/llvm/include/llvm/CodeGen/ValueTypes.h:291: llvm::MVT llvm::EVT::getSimpleVT() const: Assertion `isSimple() && "Expected a SimpleValueType!"' failed. ``` This patch fixes it by skipping combination if `t6` is not simple type. Fixed https://bugs.llvm.org/show_bug.cgi?id=47660. Reviewed By: #powerpc, steven.zhang Differential Revision: https://reviews.llvm.org/D88388 This should fix the llvm assertion mentioned above when building the following ports for powerpc64le: * audio/traverso * databases/percona57-pam-for-mysql * databases/percona57-server * emulators/citra * emulators/citra-qt5 * games/7kaa * graphics/dia * graphics/mandelbulber * graphics/pcl-pointclouds * net-p2p/libtorrent-rasterbar * textproc/htmldoc Requested by: pkubaj Modified: stable/11/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp ============================================================================== --- stable/11/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp Wed Nov 11 22:15:25 2020 (r367602) +++ stable/11/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp Wed Nov 11 22:18:24 2020 (r367603) @@ -13371,6 +13371,8 @@ SDValue PPCTargetLowering::combineFPToIntToFP(SDNode * // from the hardware. if (Op.getValueType() != MVT::f32 && Op.getValueType() != MVT::f64) return SDValue(); + if (!Op.getOperand(0).getValueType().isSimple()) + return SDValue(); if (Op.getOperand(0).getValueType().getSimpleVT() <= MVT(MVT::i1) || Op.getOperand(0).getValueType().getSimpleVT() > MVT(MVT::i64)) return SDValue(); From owner-svn-src-stable@freebsd.org Thu Nov 12 17:26:20 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E10D2EF36F; Thu, 12 Nov 2020 17:26:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CX7mr0KZDz4Xlt; Thu, 12 Nov 2020 17:26:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F20DD1E79; Thu, 12 Nov 2020 17:26:19 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ACHQJVg084810; Thu, 12 Nov 2020 17:26:19 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ACHQJUK084809; Thu, 12 Nov 2020 17:26:19 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202011121726.0ACHQJUK084809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 12 Nov 2020 17:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367620 - stable/12/sys/arm64/arm64 X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/12/sys/arm64/arm64 X-SVN-Commit-Revision: 367620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2020 17:26:20 -0000 Author: bz Date: Thu Nov 12 17:26:19 2020 New Revision: 367620 URL: https://svnweb.freebsd.org/changeset/base/367620 Log: MFC r367538: arm64: bs_sr_ take II In r367327 generic_bs_sr_ were derived from mips. Given we are calling generic_bs_w_ and no write directly, we do not have to do the address calculations ourselves as eneric_bs_w_ will do a str val [bsh, offset]. All we actually have to do is increment offset. Modified: stable/12/sys/arm64/arm64/bus_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/bus_machdep.c ============================================================================== --- stable/12/sys/arm64/arm64/bus_machdep.c Thu Nov 12 16:44:56 2020 (r367619) +++ stable/12/sys/arm64/arm64/bus_machdep.c Thu Nov 12 17:26:19 2020 (r367620) @@ -124,40 +124,36 @@ static void generic_bs_sr_1(void *t, bus_space_handle_t bsh, bus_size_t offset, uint8_t value, size_t count) { - bus_addr_t addr = bsh + offset; - for (; count != 0; count--, addr++) - generic_bs_w_1(t, bsh, addr, value); + for (; count != 0; count--, offset++) + generic_bs_w_1(t, bsh, offset, value); } static void generic_bs_sr_2(void *t, bus_space_handle_t bsh, bus_size_t offset, uint16_t value, size_t count) { - bus_addr_t addr = bsh + offset; - for (; count != 0; count--, addr += 2) - generic_bs_w_2(t, bsh, addr, value); + for (; count != 0; count--, offset += 2) + generic_bs_w_2(t, bsh, offset, value); } static void generic_bs_sr_4(void *t, bus_space_handle_t bsh, bus_size_t offset, uint32_t value, size_t count) { - bus_addr_t addr = bsh + offset; - for (; count != 0; count--, addr += 4) - generic_bs_w_4(t, bsh, addr, value); + for (; count != 0; count--, offset += 4) + generic_bs_w_4(t, bsh, offset, value); } static void generic_bs_sr_8(void *t, bus_space_handle_t bsh, bus_size_t offset, uint64_t value, size_t count) { - bus_addr_t addr = bsh + offset; - for (; count != 0; count--, addr += 8) - generic_bs_w_8(t, bsh, addr, value); + for (; count != 0; count--, offset += 8) + generic_bs_w_8(t, bsh, offset, value); } struct bus_space memmap_bus = { From owner-svn-src-stable@freebsd.org Fri Nov 13 09:48:55 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 788372D580A; Fri, 13 Nov 2020 09:48:55 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXYZb2yMKz3hGg; Fri, 13 Nov 2020 09:48:55 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 584DB16681; Fri, 13 Nov 2020 09:48:55 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AD9mtrD091103; Fri, 13 Nov 2020 09:48:55 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AD9mt8V091102; Fri, 13 Nov 2020 09:48:55 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011130948.0AD9mt8V091102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Fri, 13 Nov 2020 09:48:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367633 - stable/12/sbin/reboot X-SVN-Group: stable-12 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/12/sbin/reboot X-SVN-Commit-Revision: 367633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2020 09:48:55 -0000 Author: 0mp (doc,ports committer) Date: Fri Nov 13 09:48:54 2020 New Revision: 367633 URL: https://svnweb.freebsd.org/changeset/base/367633 Log: MFC r367567: Address a mandoc warning Modified: stable/12/sbin/reboot/boot_i386.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/reboot/boot_i386.8 ============================================================================== --- stable/12/sbin/reboot/boot_i386.8 Fri Nov 13 09:42:32 2020 (r367632) +++ stable/12/sbin/reboot/boot_i386.8 Fri Nov 13 09:48:54 2020 (r367633) @@ -107,7 +107,7 @@ from partition of either the floppy or the hard disk. This boot may be aborted by typing any character on the keyboard at the -.Ql boot: +.Ql boot\&: prompt. At this time, the following input will be accepted: .Bl -tag -width indent From owner-svn-src-stable@freebsd.org Fri Nov 13 09:49:23 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F55C2D581D; Fri, 13 Nov 2020 09:49:23 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXYb735Mrz3hNH; Fri, 13 Nov 2020 09:49:23 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C8F8164BA; Fri, 13 Nov 2020 09:49:23 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AD9nNmh091172; Fri, 13 Nov 2020 09:49:23 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AD9nNjC091171; Fri, 13 Nov 2020 09:49:23 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011130949.0AD9nNjC091171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Fri, 13 Nov 2020 09:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r367634 - stable/11/sbin/reboot X-SVN-Group: stable-11 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/11/sbin/reboot X-SVN-Commit-Revision: 367634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2020 09:49:23 -0000 Author: 0mp (doc,ports committer) Date: Fri Nov 13 09:49:22 2020 New Revision: 367634 URL: https://svnweb.freebsd.org/changeset/base/367634 Log: MFC r367567: Address a mandoc warning Modified: stable/11/sbin/reboot/boot_i386.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/reboot/boot_i386.8 ============================================================================== --- stable/11/sbin/reboot/boot_i386.8 Fri Nov 13 09:48:54 2020 (r367633) +++ stable/11/sbin/reboot/boot_i386.8 Fri Nov 13 09:49:22 2020 (r367634) @@ -107,7 +107,7 @@ from partition of either the floppy or the hard disk. This boot may be aborted by typing any character on the keyboard at the -.Ql boot: +.Ql boot\&: prompt. At this time, the following input will be accepted: .Bl -tag -width indent From owner-svn-src-stable@freebsd.org Fri Nov 13 13:36:47 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 748A82E35B5; Fri, 13 Nov 2020 13:36:47 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXfdW2swWz3wLh; Fri, 13 Nov 2020 13:36:47 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5593B1912B; Fri, 13 Nov 2020 13:36:47 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ADDalfP034140; Fri, 13 Nov 2020 13:36:47 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADDalsp034139; Fri, 13 Nov 2020 13:36:47 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011131336.0ADDalsp034139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 13 Nov 2020 13:36:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367637 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 367637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2020 13:36:47 -0000 Author: mjg Date: Fri Nov 13 13:36:46 2020 New Revision: 367637 URL: https://svnweb.freebsd.org/changeset/base/367637 Log: MFC r367352,r367353: pipe: fix POLLHUP handling if no events were specified pipe: whitespace nit in previous Modified: stable/12/sys/kern/sys_pipe.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/sys_pipe.c ============================================================================== --- stable/12/sys/kern/sys_pipe.c Fri Nov 13 13:18:48 2020 (r367636) +++ stable/12/sys/kern/sys_pipe.c Fri Nov 13 13:36:46 2020 (r367637) @@ -1446,13 +1446,17 @@ pipe_poll(struct file *fp, int events, struct ucred *a } if (revents == 0) { - if (fp->f_flag & FREAD && events & (POLLIN | POLLRDNORM)) { + /* + * Add ourselves regardless of eventmask as we have to return + * POLLHUP even if it was not asked for. + */ + if ((fp->f_flag & FREAD) != 0) { selrecord(td, &rpipe->pipe_sel); if (SEL_WAITING(&rpipe->pipe_sel)) rpipe->pipe_state |= PIPE_SEL; } - if (fp->f_flag & FWRITE && events & (POLLOUT | POLLWRNORM)) { + if ((fp->f_flag & FWRITE) != 0) { selrecord(td, &wpipe->pipe_sel); if (SEL_WAITING(&wpipe->pipe_sel)) wpipe->pipe_state |= PIPE_SEL; From owner-svn-src-stable@freebsd.org Fri Nov 13 13:38:08 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C97AE2E381B; Fri, 13 Nov 2020 13:38:08 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXfg45PK5z4QxZ; Fri, 13 Nov 2020 13:38:08 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC25D18F40; Fri, 13 Nov 2020 13:38:08 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ADDc816034258; Fri, 13 Nov 2020 13:38:08 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADDc82O034257; Fri, 13 Nov 2020 13:38:08 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202011131338.0ADDc82O034257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 13 Nov 2020 13:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367638 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 367638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2020 13:38:08 -0000 Author: mjg Date: Fri Nov 13 13:38:08 2020 New Revision: 367638 URL: https://svnweb.freebsd.org/changeset/base/367638 Log: MFC r367572: Allow rtprio_thread to operate on threads of any process Modified: stable/12/sys/kern/kern_resource.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_resource.c ============================================================================== --- stable/12/sys/kern/kern_resource.c Fri Nov 13 13:36:46 2020 (r367637) +++ stable/12/sys/kern/kern_resource.c Fri Nov 13 13:38:08 2020 (r367638) @@ -303,8 +303,7 @@ sys_rtprio_thread(struct thread *td, struct rtprio_thr td1 = td; PROC_LOCK(p); } else { - /* Only look up thread in current process */ - td1 = tdfind(uap->lwpid, curproc->p_pid); + td1 = tdfind(uap->lwpid, -1); if (td1 == NULL) return (ESRCH); p = td1->td_proc; From owner-svn-src-stable@freebsd.org Fri Nov 13 16:38:31 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B6EC2E7297; Fri, 13 Nov 2020 16:38:31 +0000 (UTC) (envelope-from martin@vx.sk) Received: from mail.vx.sk (mail.vx.sk [IPv6:2a01:4f8:191:9029::4]) by mx1.freebsd.org (Postfix) with ESMTP id 4CXkg94CjXz4bCT; Fri, 13 Nov 2020 16:38:29 +0000 (UTC) (envelope-from martin@vx.sk) Received: from mail.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id EE7621D9BDF; Fri, 13 Nov 2020 17:38:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=vx.sk; h= content-transfer-encoding:mime-version:content-type:content-type :user-agent:in-reply-to:subject:subject:from:from:message-id :date:date:received:received:received; s=1; t=1605285501; x= 1607099902; bh=Du8iAPMSEvWijtnChlun4boFtUp6gASBvA0or8WvVJM=; b=l jfEHBpSzI8ZxztM7kogZMb4bLcoFIpWPBtofp8erj5Aroox92OAx4WIUt/ueEii9 +NGRjRb06f9PSr45tX23HPfFPgk6LOTqGo68ebuDJvgGWiDA0EZtUeCNBoDXIG2l ufAqNuiCYljgWT7QanInatbvxSZKzfmrZtO1TZb/mWM/Ik8qoSffmtPBq4pLBp0B 1f3A78JVTJ1ypMm0XfoBa6MrWkD6z0XhLYwqAY81kcPQFSgWVwbrsMwJHkPSs/6N R5LoV8yrbm8Pt1POhgvHquRki0scz6qPaUo9KVogeKD1l6Z7ymxWkydf3JFQJ9qE lRHnWmWrLRYjjT4mcwbbA== X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk by mail.vx.sk (amavisd-new, unix socket) with LMTP id jR8_fe4ZpbcX; Fri, 13 Nov 2020 17:38:21 +0100 (CET) Received: from mail.vx.sk (localhost [IPv6:::1]) by mail.vx.sk (Postfix) with ESMTPSA id A01CD1D9C49; Fri, 13 Nov 2020 17:38:21 +0100 (CET) Received: from 188-167-136-198.dynamic.chello.sk (188-167-136-198.dynamic.chello.sk [188.167.136.198]) by mail.vx.sk (Horde Framework) with HTTPS; Fri, 13 Nov 2020 17:38:21 +0100 Date: Fri, 13 Nov 2020 17:38:21 +0100 Message-ID: <20201113173821.Horde.jq1A9wp72tHUvM10uhYxhOq@mail.vx.sk> From: martin@vx.sk To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r367359 - stable/12/sys/dev/pci In-Reply-To: <202011050257.0A52veoR086637@repo.freebsd.org> User-Agent: Horde Application Framework 5 MIME-Version: 1.0 X-Rspamd-Queue-Id: 4CXkg94CjXz4bCT X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=vx.sk header.s=1 header.b=l jfEHBp; dmarc=none; spf=pass (mx1.freebsd.org: domain of martin@vx.sk designates 2a01:4f8:191:9029::4 as permitted sender) smtp.mailfrom=martin@vx.sk X-Spamd-Result: default: False [-3.40 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; FREEFALL_USER(0.00)[martin]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[vx.sk]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCPT_COUNT_FIVE(0.00)[5]; SPAMHAUS_ZRD(0.00)[2a01:4f8:191:9029::4:from:127.0.2.255]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DKIM_TRACE(0.00)[vx.sk:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_NO_DN(0.00)[]; R_DKIM_ALLOW(-0.20)[vx.sk:s=1]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a01:4f8:191:9029::4:from]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-stable-12,svn-src-stable]; RECEIVED_SPAMHAUS_PBL(0.00)[188.167.136.198:received] Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-Description: =?utf-8?b?U3Byw6F2YQ==?= s =?utf-8?b?xI1pc3TDvW0=?= textom X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2020 16:38:31 -0000 I am encountering a problem with hw.pci.enable_aspm: System: ASUS RS500A-E10-RS12U CPU: AMD EPYC 7502 32-Core. NVMe drive model: Micron 9300 PRO Number of NVMe drives: 10 Using X2APIC When hw.pci.enable_aspm is enabled, PCIe hot plug of Micron NVMe =20 drives does not work (including detection on boot) and the system =20 reports the following errors for the vast majority of the drives: Nov 13 15:11:30 xxx kernel: pcib9: Timed out waiting for Data Link =20 Layer Active Nov 13 15:12:17 xxx kernel: pcib30: Timed out waiting for Data Link =20 Layer Active Nov 13 15:12:44 xxx kernel: pcib29: Timed out waiting for Data Link =20 Layer Active Nov 13 15:13:04 xxx kernel: pcib11: Timed out waiting for Data Link =20 Layer Active ... Flipping the tunable back to 0 workarounds the problem. Reproduced both on latest head and stable/12. Best regards, mm Quoting Alexander Motin : > Author: mav > Date: Thu Nov=C2=A0 5 02:57:40 2020 > New Revision: 367359 > URL: https://svnweb.freebsd.org/changeset/base/367359 > > Log: > MFC r364038: Enable hw.pci.enable_aspm tunable by default. > > While effects on power saving is only a guess, effects on hot-plug are > clearly visible.=C2=A0 Lets try to enable it and see what happen. > > Modified: > stable/12/sys/dev/pci/pci.c > Directory Properties: > stable/12/=C2=A0 =C2=A0(props changed) > > Modified: stable/12/sys/dev/pci/pci.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/12/sys/dev/pci/pci.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 Thu Nov=C2=A0= 5 02:12:33 2020=C2=A0 =C2=A0 =C2=A0 =20 > =C2=A0 (r367358) > +++ stable/12/sys/dev/pci/pci.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 Thu Nov=C2=A0= 5 02:57:40 2020=C2=A0 =C2=A0 =C2=A0 =20 > =C2=A0 (r367359) > @@ -411,7 +411,7 @@ static int pci_enable_ari =3D 1; > SYSCTL_INT(_hw_pci, OID_AUTO, enable_ari, CTLFLAG_RDTUN, &pci_enable_ar= i, > =C2=A0 =C2=A0 0, "Enable support for PCIe Alternative RID Interpretatio= n"); > > -int pci_enable_aspm; > +int pci_enable_aspm =3D 1; > SYSCTL_INT(_hw_pci, OID_AUTO, enable_aspm, CTLFLAG_RDTUN, =20 > &pci_enable_aspm,=C2=A0 =C2=A0 0, "Enable support for PCIe Active State= Power =20 > Management"); From owner-svn-src-stable@freebsd.org Sat Nov 14 00:59:55 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B716A463EAF; Sat, 14 Nov 2020 00:59:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXxnl4LHhz3Q3L; Sat, 14 Nov 2020 00:59:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87FDE2170C; Sat, 14 Nov 2020 00:59:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AE0xtKr058009; Sat, 14 Nov 2020 00:59:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AE0xtT1058008; Sat, 14 Nov 2020 00:59:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011140059.0AE0xtT1058008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 14 Nov 2020 00:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367656 - stable/12/usr.bin/diff X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/usr.bin/diff X-SVN-Commit-Revision: 367656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 00:59:55 -0000 Author: kevans Date: Sat Nov 14 00:59:55 2020 New Revision: 367656 URL: https://svnweb.freebsd.org/changeset/base/367656 Log: MFC r367076: diff: don't force the format to 'context' with -p immediately Instead, leave the fomat as unspecified (if it hasn't been) and use the -p flag as a hint to 'context' if no other formatting option is specified. This fixes `diff -purw`, used frequently by emaste, and matches the behavior of its GNU counterpart. PR: 250015 Modified: stable/12/usr.bin/diff/diff.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/diff/diff.c ============================================================================== --- stable/12/usr.bin/diff/diff.c Fri Nov 13 23:18:04 2020 (r367655) +++ stable/12/usr.bin/diff/diff.c Sat Nov 14 00:59:55 2020 (r367656) @@ -210,17 +210,6 @@ main(int argc, char **argv) diff_format = D_NREVERSE; break; case 'p': - /* - * If it's not unset and it's not set to context or - * unified, we'll error out here as a conflicting - * format. If it's unset, we'll go ahead and set it to - * context. - */ - if (FORMAT_MISMATCHED(D_CONTEXT) && - FORMAT_MISMATCHED(D_UNIFIED)) - conflicting_format(); - if (diff_format == D_UNSET) - diff_format = D_CONTEXT; dflags |= D_PROTOTYPE; break; case 'P': @@ -320,6 +309,8 @@ main(int argc, char **argv) newarg = optind != prevoptind; prevoptind = optind; } + if (diff_format == D_UNSET && (dflags & D_PROTOTYPE) != 0) + diff_format = D_CONTEXT; if (diff_format == D_UNSET) diff_format = D_NORMAL; argc -= optind; From owner-svn-src-stable@freebsd.org Sat Nov 14 01:28:05 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A60C1466483; Sat, 14 Nov 2020 01:28:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXyQF4CMzz3jDk; Sat, 14 Nov 2020 01:28:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8170F2196F; Sat, 14 Nov 2020 01:28:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AE1S57V076371; Sat, 14 Nov 2020 01:28:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AE1S4WH076368; Sat, 14 Nov 2020 01:28:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011140128.0AE1S4WH076368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 14 Nov 2020 01:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367657 - in stable/12: sys/kern sys/sys usr.sbin/binmiscctl X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12: sys/kern sys/sys usr.sbin/binmiscctl X-SVN-Commit-Revision: 367657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 01:28:05 -0000 Author: kevans Date: Sat Nov 14 01:28:04 2020 New Revision: 367657 URL: https://svnweb.freebsd.org/changeset/base/367657 Log: MFC imgact_binmisc housecleaning: r367361, r367439, r367441-r367442, r367444, r367452, r367456, r367477 r367361: imgact_binmisc: fix up some minor nits - Removed a bunch of redundant headers - Don't explicitly initialize to 0 - The !error check prior to setting imgp->interpreter_name is redundant, all error paths should and do return or go to 'done'. We have larger problems otherwise. r367439: imgact_binmisc: minor re-organization of imgact_binmisc_exec exits Notably, streamline error paths through the existing 'done' label, making it easier to quickly verify correct cleanup. Future work might add a kernel-only flag to indicate that a interpreter uses #a. Currently, all executions via imgact_binmisc pay the penalty of constructing sname/fname, even if they will not use it. qemu-user-static doesn't need it, the stock rc script for qemu-user-static certainly doesn't use it, and I suspect these are the vast majority of (if not the only) current users. r367441: binmiscctl(8): miscellaneous cleanup - Bad whitespace in Makefile. - Reordered headers, sys/ first. - Annotated fatal/usage __dead2 to help `make analyze` out a little bit. - Spell a couple of sizeof constructs as "nitems" and "howmany" instead. r367442: imgact_binmisc: validate flags coming from userland We may want to reserve bits in the future for kernel-only use, so start rejecting any that aren't the two that we're currently expecting from userland. r367444: imgact_binmisc: abstract away the list lock (NFC) This module handles relatively few execs (initial qemu-user-static, then qemu-user-static handles exec'ing itself for binaries it's already running), but all execs pay the price of at least taking the relatively expensive sx/slock to check for a match when this module is loaded. Future work will almost certainly swap this out for another lock, perhaps an rmslock. The RLOCK/WLOCK phrasing was chosen based on what the callers are really wanting, rather than using the verbiage typically appropriate for an sx. r367452: imgact_binmisc: reorder members of struct imgact_binmisc_entry (NFC) This doesn't change anything at the moment since the out-of-order elements were a pair of uint32_t, but future additions may have caused unnecessary padding by following the existing precedent. r367456: imgact_binmisc: move some calculations out of the exec path The offset we need to account for in the interpreter string comes in two variants: 1. Fixed - macros other than #a that will not vary from invocation to invocation 2. Variable - #a, which is substitued with the argv0 that we're replacing Note that we don't have a mechanism to modify an existing entry. By recording both of these offset requirements when the interpreter is added, we can avoid some unnecessary calculations in the exec path. Most importantly, we can know up-front whether we need to grab calculate/grab the the filename for this interpreter. We also get to avoid walking the string a first time looking for macros. For most invocations, it's a swift exit as they won't have any, but there's no point entering a loop and searching for the macro indicator if we already know there will not be one. While we're here, go ahead and only calculate the argv0 name length once per invocation. While it's unlikely that we'll have more than one #a, there's no reason to recalculate it every time we encounter an #a when it will not change. I have not bothered trying to benchmark this at all, because it's arguably a minor and straightforward/obvious improvement. r367477: imgact_binmisc: limit the extent of match on incoming entries imgact_binmisc matches magic/mask from imgp->image_header, which is only a single page in size mapped from the first page of an image. One can specify an interpreter that matches on, e.g., --offset 4096 --size 256 to read up to 256 bytes past the mapped first page. The limitation is that we cannot specify a magic string that exceeds a single page, and we can't allow offset + size to exceed a single page either. A static assert has been added in case someone finds it useful to try and expand the size, but it does seem a little unlikely. While this looks kind of exploitable at a sideways squinty-glance, there are a couple of mitigating factors: 1.) imgact_binmisc is not enabled by default, 2.) entries may only be added by the superuser, 3.) trying to exploit this information to read what's mapped past the end would be worse than a root canal or some other relatably painful experience, and 4.) there's no way one could pull this off without it being completely obvious. The first page is mapped out of an sf_buf, the implementation of which (or lack thereof) depends on your platform. Modified: stable/12/sys/kern/imgact_binmisc.c stable/12/sys/sys/imgact_binmisc.h stable/12/usr.sbin/binmiscctl/Makefile stable/12/usr.sbin/binmiscctl/binmiscctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/imgact_binmisc.c ============================================================================== --- stable/12/sys/kern/imgact_binmisc.c Sat Nov 14 00:59:55 2020 (r367656) +++ stable/12/sys/kern/imgact_binmisc.c Sat Nov 14 01:28:04 2020 (r367657) @@ -29,17 +29,14 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include #include #include #include #include -#include #include #include #include +#include #include #include @@ -61,16 +58,18 @@ __FBSDID("$FreeBSD$"); * Node of the interpreter list. */ typedef struct imgact_binmisc_entry { + SLIST_ENTRY(imgact_binmisc_entry) link; char *ibe_name; uint8_t *ibe_magic; - uint32_t ibe_moffset; - uint32_t ibe_msize; uint8_t *ibe_mask; uint8_t *ibe_interpreter; + ssize_t ibe_interp_offset; uint32_t ibe_interp_argcnt; uint32_t ibe_interp_length; + uint32_t ibe_argv0_cnt; uint32_t ibe_flags; - SLIST_ENTRY(imgact_binmisc_entry) link; + uint32_t ibe_moffset; + uint32_t ibe_msize; } imgact_binmisc_entry_t; /* @@ -97,10 +96,20 @@ MALLOC_DEFINE(M_BINMISC, KMOD_NAME, "misc binary image static SLIST_HEAD(, imgact_binmisc_entry) interpreter_list = SLIST_HEAD_INITIALIZER(interpreter_list); -static int interp_list_entry_count = 0; +static int interp_list_entry_count; static struct sx interp_list_sx; +#define INTERP_LIST_WLOCK() sx_xlock(&interp_list_sx) +#define INTERP_LIST_RLOCK() sx_slock(&interp_list_sx) +#define INTERP_LIST_WUNLOCK() sx_xunlock(&interp_list_sx) +#define INTERP_LIST_RUNLOCK() sx_sunlock(&interp_list_sx) + +#define INTERP_LIST_LOCK_INIT() sx_init(&interp_list_sx, KMOD_NAME) +#define INTERP_LIST_LOCK_DESTROY() sx_destroy(&interp_list_sx) + +#define INTERP_LIST_ASSERT_LOCKED() sx_assert(&interp_list_sx, SA_LOCKED) + /* * Populate the entry with the information about the interpreter. */ @@ -147,7 +156,8 @@ imgact_binmisc_populate_interp(char *str, imgact_binmi * Allocate memory and populate a new entry for the interpreter table. */ static imgact_binmisc_entry_t * -imgact_binmisc_new_entry(ximgact_binmisc_entry_t *xbe) +imgact_binmisc_new_entry(ximgact_binmisc_entry_t *xbe, ssize_t interp_offset, + int argv0_cnt) { imgact_binmisc_entry_t *ibe = NULL; size_t namesz = min(strlen(xbe->xbe_name) + 1, IBE_NAME_MAX); @@ -168,7 +178,8 @@ imgact_binmisc_new_entry(ximgact_binmisc_entry_t *xbe) ibe->ibe_moffset = xbe->xbe_moffset; ibe->ibe_msize = xbe->xbe_msize; ibe->ibe_flags = xbe->xbe_flags; - + ibe->ibe_interp_offset = interp_offset; + ibe->ibe_argv0_cnt = argv0_cnt; return (ibe); } @@ -201,7 +212,7 @@ imgact_binmisc_find_entry(char *name) { imgact_binmisc_entry_t *ibe; - sx_assert(&interp_list_sx, SA_LOCKED); + INTERP_LIST_ASSERT_LOCKED(); SLIST_FOREACH(ibe, &interpreter_list, link) { if (strncmp(name, ibe->ibe_name, IBE_NAME_MAX) == 0) @@ -220,10 +231,13 @@ imgact_binmisc_add_entry(ximgact_binmisc_entry_t *xbe) { imgact_binmisc_entry_t *ibe; char *p; - int cnt; + ssize_t interp_offset; + int argv0_cnt, cnt; if (xbe->xbe_msize > IBE_MAGIC_MAX) return (EINVAL); + if (xbe->xbe_moffset + xbe->xbe_msize > IBE_MATCH_MAX) + return (EINVAL); for(cnt = 0, p = xbe->xbe_name; *p != 0; cnt++, p++) if (cnt >= IBE_NAME_MAX || !isascii((int)*p)) @@ -235,23 +249,21 @@ imgact_binmisc_add_entry(ximgact_binmisc_entry_t *xbe) /* Make sure we don't have any invalid #'s. */ p = xbe->xbe_interpreter; - while (1) { - p = strchr(p, '#'); - if (!p) - break; - + interp_offset = 0; + argv0_cnt = 0; + while ((p = strchr(p, '#')) != NULL) { p++; switch(*p) { case ISM_POUND: /* "##" */ p++; + interp_offset--; break; - case ISM_OLD_ARGV0: /* "#a" */ p++; + argv0_cnt++; break; - case 0: default: /* Anything besides the above is invalid. */ @@ -259,18 +271,18 @@ imgact_binmisc_add_entry(ximgact_binmisc_entry_t *xbe) } } - sx_xlock(&interp_list_sx); + INTERP_LIST_WLOCK(); if (imgact_binmisc_find_entry(xbe->xbe_name) != NULL) { - sx_xunlock(&interp_list_sx); + INTERP_LIST_WUNLOCK(); return (EEXIST); } /* Preallocate a new entry. */ - ibe = imgact_binmisc_new_entry(xbe); + ibe = imgact_binmisc_new_entry(xbe, interp_offset, argv0_cnt); SLIST_INSERT_HEAD(&interpreter_list, ibe, link); interp_list_entry_count++; - sx_xunlock(&interp_list_sx); + INTERP_LIST_WUNLOCK(); return (0); } @@ -284,14 +296,14 @@ imgact_binmisc_remove_entry(char *name) { imgact_binmisc_entry_t *ibe; - sx_xlock(&interp_list_sx); + INTERP_LIST_WLOCK(); if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { - sx_xunlock(&interp_list_sx); + INTERP_LIST_WUNLOCK(); return (ENOENT); } SLIST_REMOVE(&interpreter_list, ibe, imgact_binmisc_entry, link); interp_list_entry_count--; - sx_xunlock(&interp_list_sx); + INTERP_LIST_WUNLOCK(); imgact_binmisc_destroy_entry(ibe); @@ -307,14 +319,14 @@ imgact_binmisc_disable_entry(char *name) { imgact_binmisc_entry_t *ibe; - sx_xlock(&interp_list_sx); + INTERP_LIST_WLOCK(); if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { - sx_xunlock(&interp_list_sx); + INTERP_LIST_WUNLOCK(); return (ENOENT); } ibe->ibe_flags &= ~IBF_ENABLED; - sx_xunlock(&interp_list_sx); + INTERP_LIST_WUNLOCK(); return (0); } @@ -328,14 +340,14 @@ imgact_binmisc_enable_entry(char *name) { imgact_binmisc_entry_t *ibe; - sx_xlock(&interp_list_sx); + INTERP_LIST_WLOCK(); if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { - sx_xunlock(&interp_list_sx); + INTERP_LIST_WUNLOCK(); return (ENOENT); } ibe->ibe_flags |= IBF_ENABLED; - sx_xunlock(&interp_list_sx); + INTERP_LIST_WUNLOCK(); return (0); } @@ -346,8 +358,7 @@ imgact_binmisc_populate_xbe(ximgact_binmisc_entry_t *x { uint32_t i; - sx_assert(&interp_list_sx, SA_LOCKED); - + INTERP_LIST_ASSERT_LOCKED(); memset(xbe, 0, sizeof(*xbe)); strlcpy(xbe->xbe_name, ibe->ibe_name, IBE_NAME_MAX); @@ -378,14 +389,14 @@ imgact_binmisc_lookup_entry(char *name, ximgact_binmis imgact_binmisc_entry_t *ibe; int error = 0; - sx_slock(&interp_list_sx); + INTERP_LIST_RLOCK(); if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { - sx_sunlock(&interp_list_sx); + INTERP_LIST_RUNLOCK(); return (ENOENT); } error = imgact_binmisc_populate_xbe(xbe, ibe); - sx_sunlock(&interp_list_sx); + INTERP_LIST_RUNLOCK(); return (error); } @@ -400,7 +411,7 @@ imgact_binmisc_get_all_entries(struct sysctl_req *req) imgact_binmisc_entry_t *ibe; int error = 0, count; - sx_slock(&interp_list_sx); + INTERP_LIST_RLOCK(); count = interp_list_entry_count; xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_WAITOK|M_ZERO); @@ -410,7 +421,7 @@ imgact_binmisc_get_all_entries(struct sysctl_req *req) if (error) break; } - sx_sunlock(&interp_list_sx); + INTERP_LIST_RUNLOCK(); if (!error) error = SYSCTL_OUT(req, xbe, sizeof(*xbe) * count); @@ -437,6 +448,8 @@ sysctl_kern_binmisc(SYSCTL_HANDLER_ARGS) return (error); if (IBE_VERSION != xbe.xbe_version) return (EINVAL); + if ((xbe.xbe_flags & ~IBF_VALID_UFLAGS) != 0) + return (EINVAL); if (interp_list_entry_count == IBE_MAX_ENTRIES) return (ENOSPC); error = imgact_binmisc_add_entry(&xbe); @@ -547,7 +560,7 @@ imgact_binmisc_find_interpreter(const char *image_head int i; size_t sz; - sx_assert(&interp_list_sx, SA_LOCKED); + INTERP_LIST_ASSERT_LOCKED(); SLIST_FOREACH(ibe, &interpreter_list, link) { if (!(IBF_ENABLED & ibe->ibe_flags)) @@ -578,35 +591,47 @@ imgact_binmisc_exec(struct image_params *imgp) const char *image_header = imgp->image_header; const char *fname = NULL; int error = 0; - size_t offset, l; +#ifdef INVARIANTS + int argv0_cnt = 0; +#endif + size_t namelen, offset; imgact_binmisc_entry_t *ibe; struct sbuf *sname; char *s, *d; + sname = NULL; + namelen = 0; /* Do we have an interpreter for the given image header? */ - sx_slock(&interp_list_sx); + INTERP_LIST_RLOCK(); if ((ibe = imgact_binmisc_find_interpreter(image_header)) == NULL) { - sx_sunlock(&interp_list_sx); - return (-1); + error = -1; + goto done; } /* No interpreter nesting allowed. */ if (imgp->interpreted & IMGACT_BINMISC) { - sx_sunlock(&interp_list_sx); - return (ENOEXEC); + error = ENOEXEC; + goto done; } imgp->interpreted |= IMGACT_BINMISC; - if (imgp->args->fname != NULL) { - fname = imgp->args->fname; - sname = NULL; - } else { - /* Use the fdescfs(5) path for fexecve(2). */ - sname = sbuf_new_auto(); - sbuf_printf(sname, "/dev/fd/%d", imgp->args->fd); - sbuf_finish(sname); - fname = sbuf_data(sname); + /* + * Don't bother with the overhead of putting fname together if we're not + * using #a. + */ + if (ibe->ibe_argv0_cnt != 0) { + if (imgp->args->fname != NULL) { + fname = imgp->args->fname; + } else { + /* Use the fdescfs(5) path for fexecve(2). */ + sname = sbuf_new_auto(); + sbuf_printf(sname, "/dev/fd/%d", imgp->args->fd); + sbuf_finish(sname); + fname = sbuf_data(sname); + } + + namelen = strlen(fname); } @@ -615,43 +640,17 @@ imgact_binmisc_exec(struct image_params *imgp) * we first shift all the other values in the `begin_argv' area to * provide the exact amount of room for the values added. Set up * `offset' as the number of bytes to be added to the `begin_argv' - * area. + * area. ibe_interp_offset is the fixed offset from macros present in + * the interpreter string. */ - offset = ibe->ibe_interp_length; + offset = ibe->ibe_interp_length + ibe->ibe_interp_offset; - /* Adjust the offset for #'s. */ - s = ibe->ibe_interpreter; - while (1) { - s = strchr(s, '#'); - if (!s) - break; + /* Variable offset to be added from macros to the interpreter string. */ + MPASS(ibe->ibe_argv0_cnt == 0 || namelen > 0); + offset += ibe->ibe_argv0_cnt * (namelen - 2); - s++; - switch(*s) { - case ISM_POUND: - /* "##" -> "#": reduce offset by one. */ - offset--; - break; - - case ISM_OLD_ARGV0: - /* "#a" -> (old argv0): increase offset to fit fname */ - offset += strlen(fname) - 2; - break; - - default: - /* Hmm... This shouldn't happen. */ - sx_sunlock(&interp_list_sx); - printf("%s: Unknown macro #%c sequence in " - "interpreter string\n", KMOD_NAME, *(s + 1)); - error = EINVAL; - goto done; - } - s++; - } - /* Check to make sure we won't overrun the stringspace. */ if (offset > imgp->args->stringspace) { - sx_sunlock(&interp_list_sx); error = E2BIG; goto done; } @@ -684,26 +683,20 @@ imgact_binmisc_exec(struct image_params *imgp) /* "##": Replace with a single '#' */ *d++ = '#'; break; - case ISM_OLD_ARGV0: /* "#a": Replace with old arg0 (fname). */ - if ((l = strlen(fname)) != 0) { - memcpy(d, fname, l); - d += l; - } + MPASS(ibe->ibe_argv0_cnt >= ++argv0_cnt); + memcpy(d, fname, namelen); + d += namelen; break; - default: - /* Shouldn't happen but skip it if it does. */ - break; + __assert_unreachable(); } break; - case ' ': /* Replace space with NUL to separate arguments. */ *d++ = '\0'; break; - default: *d++ = *s; break; @@ -711,13 +704,14 @@ imgact_binmisc_exec(struct image_params *imgp) s++; } *d = '\0'; - sx_sunlock(&interp_list_sx); - if (!error) - imgp->interpreter_name = imgp->args->begin_argv; + /* Catch ibe->ibe_argv0_cnt counting more #a than we did. */ + MPASS(ibe->ibe_argv0_cnt == argv0_cnt); + imgp->interpreter_name = imgp->args->begin_argv; done: + INTERP_LIST_RUNLOCK(); if (sname) sbuf_delete(sname); return (error); @@ -727,7 +721,7 @@ static void imgact_binmisc_init(void *arg) { - sx_init(&interp_list_sx, KMOD_NAME); + INTERP_LIST_LOCK_INIT(); } static void @@ -736,15 +730,15 @@ imgact_binmisc_fini(void *arg) imgact_binmisc_entry_t *ibe, *ibe_tmp; /* Free all the interpreters. */ - sx_xlock(&interp_list_sx); + INTERP_LIST_WLOCK(); SLIST_FOREACH_SAFE(ibe, &interpreter_list, link, ibe_tmp) { SLIST_REMOVE(&interpreter_list, ibe, imgact_binmisc_entry, link); imgact_binmisc_destroy_entry(ibe); } - sx_xunlock(&interp_list_sx); + INTERP_LIST_WUNLOCK(); - sx_destroy(&interp_list_sx); + INTERP_LIST_LOCK_DESTROY(); } SYSINIT(imgact_binmisc, SI_SUB_EXEC, SI_ORDER_MIDDLE, imgact_binmisc_init, Modified: stable/12/sys/sys/imgact_binmisc.h ============================================================================== --- stable/12/sys/sys/imgact_binmisc.h Sat Nov 14 00:59:55 2020 (r367656) +++ stable/12/sys/sys/imgact_binmisc.h Sat Nov 14 01:28:04 2020 (r367657) @@ -47,11 +47,18 @@ #define IBE_INTERP_LEN_MAX (MAXPATHLEN + IBE_ARG_LEN_MAX) #define IBE_MAX_ENTRIES 64 /* Max number of interpreter entries. */ +/* We only map the first page for identification purposes. */ +#define IBE_MATCH_MAX PAGE_SIZE +_Static_assert(IBE_MAGIC_MAX <= IBE_MATCH_MAX, + "Cannot identify binaries past the first page."); + /* * Imgact bin misc interpreter entry flags. */ #define IBF_ENABLED 0x0001 /* Entry is active. */ #define IBF_USE_MASK 0x0002 /* Use mask on header magic field. */ + +#define IBF_VALID_UFLAGS 0x0003 /* Bits allowed from userland. */ /* * Used with sysctlbyname() to pass imgact bin misc entries in and out of the Modified: stable/12/usr.sbin/binmiscctl/Makefile ============================================================================== --- stable/12/usr.sbin/binmiscctl/Makefile Sat Nov 14 00:59:55 2020 (r367656) +++ stable/12/usr.sbin/binmiscctl/Makefile Sat Nov 14 01:28:04 2020 (r367657) @@ -3,7 +3,7 @@ # .include - + PROG= binmiscctl MAN= binmiscctl.8 Modified: stable/12/usr.sbin/binmiscctl/binmiscctl.c ============================================================================== --- stable/12/usr.sbin/binmiscctl/binmiscctl.c Sat Nov 14 00:59:55 2020 (r367656) +++ stable/12/usr.sbin/binmiscctl/binmiscctl.c Sat Nov 14 01:28:04 2020 (r367657) @@ -28,6 +28,12 @@ #include __FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include + #include #include #include @@ -37,12 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include - enum cmd { CMD_ADD = 0, CMD_REMOVE, @@ -134,7 +134,7 @@ static char const *cmd_sysctl_name[] = { IBE_SYSCTL_NAME_LIST }; -static void +static void __dead2 usage(const char *format, ...) { va_list args; @@ -150,7 +150,7 @@ usage(const char *format, ...) fprintf(stderr, "\n"); fprintf(stderr, "usage: %s command [args...]\n\n", __progname); - for(i = 0; i < ( sizeof (cmds) / sizeof (cmds[0])); i++) { + for(i = 0; i < nitems(cmds); i++) { fprintf(stderr, "%s:\n", cmds[i].desc); fprintf(stderr, "\t%s %s %s\n\n", __progname, cmds[i].name, cmds[i].args); @@ -159,7 +159,7 @@ usage(const char *format, ...) exit (error); } -static void +static void __dead2 fatal(const char *format, ...) { va_list args; @@ -232,7 +232,7 @@ demux_cmd(__unused int argc, char *const argv[]) optind = 1; optreset = 1; - for(i = 0; i < ( sizeof (cmds) / sizeof (cmds[0])); i++) { + for(i = 0; i < nitems(cmds); i++) { if (!strcasecmp(cmds[i].name, argv[0])) { return (i); } @@ -505,7 +505,7 @@ main(int argc, char **argv) free(xbe_outp); fatal("Fatal: %s", strerror(errno)); } - for(i = 0; i < (xbe_out_sz / sizeof(xbe_out)); i++) + for(i = 0; i < howmany(xbe_out_sz, sizeof(xbe_out)); i++) printxbe(&xbe_outp[i]); } From owner-svn-src-stable@freebsd.org Sat Nov 14 01:55:54 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF25B467D0C; Sat, 14 Nov 2020 01:55:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXz2L5VYcz3lxl; Sat, 14 Nov 2020 01:55:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF19722506; Sat, 14 Nov 2020 01:55:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AE1tsYm095118; Sat, 14 Nov 2020 01:55:54 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AE1ts7P095117; Sat, 14 Nov 2020 01:55:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011140155.0AE1ts7P095117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 14 Nov 2020 01:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367662 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 367662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 01:55:54 -0000 Author: kevans Date: Sat Nov 14 01:55:54 2020 New Revision: 367662 URL: https://svnweb.freebsd.org/changeset/base/367662 Log: MFC r367440: epoch: support non-preemptible epochs checking in_epoch() Previously, non-preemptible epochs could not check; in_epoch() would always fail, usually because non-preemptible epochs don't imply THREAD_NO_SLEEPING. For default epochs, it's easy enough to verify that we're in the given epoch: if we're in a critical section and our record for the given epoch is active, then we're in it. This patch also adds some additional INVARIANTS bookkeeping. Notably, we set and check the recorded thread in epoch_enter/epoch_exit to try and catch some edge-cases for the caller. It also checks upon freeing that none of the records had a thread in the epoch, which may make it a little easier to diagnose some improper use if epoch_free() took place while some other thread was inside. This version differs slightly from what was just previously reviewed by the below-listed, in that in_epoch() will assert that no CPU has this thread recorded even if it *is* currently in a critical section. This is intended to catch cases where the caller might have somehow messed up critical section nesting, we can catch both if they exited the critical section or if they exited, migrated, then re-entered (on the wrong CPU). Modified: stable/12/sys/kern/subr_epoch.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/subr_epoch.c ============================================================================== --- stable/12/sys/kern/subr_epoch.c Sat Nov 14 01:55:02 2020 (r367661) +++ stable/12/sys/kern/subr_epoch.c Sat Nov 14 01:55:54 2020 (r367662) @@ -69,6 +69,10 @@ typedef struct epoch_record { /* fields above are part of KBI and cannot be modified */ struct epoch_context er_drain_ctx; struct epoch *er_parent; +#ifdef INVARIANTS + /* Used to verify record ownership for non-preemptible epochs. */ + struct thread *er_td; +#endif } __aligned(EPOCH_ALIGN) *epoch_record_t; struct epoch { @@ -251,6 +255,9 @@ done: void epoch_free(epoch_t epoch) { +#ifdef INVARIANTS + int cpu; +#endif EPOCH_LOCK(); @@ -264,6 +271,21 @@ epoch_free(epoch_t epoch) * to zero, by calling epoch_wait() on the global_epoch: */ epoch_wait(global_epoch); +#ifdef INVARIANTS + CPU_FOREACH(cpu) { + epoch_record_t er; + + er = zpcpu_get_cpu(epoch->e_pcpu_record, cpu); + + /* + * Sanity check: none of the records should be in use anymore. + * We drained callbacks above and freeing the pcpu records is + * imminent. + */ + MPASS(er->er_td == NULL); + MPASS(TAILQ_EMPTY(&er->er_tdlist)); + } +#endif uma_zfree_pcpu(pcpu_zone_record, epoch->e_pcpu_record); mtx_destroy(&epoch->e_drain_mtx); sx_destroy(&epoch->e_drain_sx); @@ -306,6 +328,8 @@ epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et) td->td_pre_epoch_prio = td->td_priority; er = epoch_currecord(epoch); + /* Record-level tracking is reserved for non-preemptible epochs. */ + MPASS(er->er_td == NULL); TAILQ_INSERT_TAIL(&er->er_tdlist, et, et_link); ck_epoch_begin(&er->er_record, &et->et_section); critical_exit(); @@ -324,6 +348,15 @@ epoch_enter(epoch_t epoch) td->td_epochnest++; critical_enter(); er = epoch_currecord(epoch); +#ifdef INVARIANTS + if (er->er_record.active == 0) { + MPASS(er->er_td == NULL); + er->er_td = curthread; + } else { + /* We've recursed, just make sure our accounting isn't wrong. */ + MPASS(er->er_td == curthread); + } +#endif ck_epoch_begin(&er->er_record, NULL); } @@ -351,6 +384,8 @@ epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et) #endif #ifdef INVARIANTS et->et_td = (void*)0xDEADBEEF; + /* Record-level tracking is reserved for non-preemptible epochs. */ + MPASS(er->er_td == NULL); #endif ck_epoch_end(&er->er_record, &et->et_section); TAILQ_REMOVE(&er->er_tdlist, et, et_link); @@ -372,6 +407,11 @@ epoch_exit(epoch_t epoch) td->td_epochnest--; er = epoch_currecord(epoch); ck_epoch_end(&er->er_record, NULL); +#ifdef INVARIANTS + MPASS(er->er_td == curthread); + if (er->er_record.active == 0) + er->er_td = NULL; +#endif critical_exit(); } @@ -662,18 +702,18 @@ epoch_call_task(void *arg __unused) } } -int -in_epoch_verbose(epoch_t epoch, int dump_onfail) +static int +in_epoch_verbose_preempt(epoch_t epoch, int dump_onfail) { + epoch_record_t er; struct epoch_tracker *tdwait; struct thread *td; - epoch_record_t er; + MPASS(epoch != NULL); + MPASS((epoch->e_flags & EPOCH_PREEMPT) != 0); td = curthread; if (td->td_epochnest == 0) return (0); - if (__predict_false((epoch) == NULL)) - return (0); critical_enter(); er = epoch_currecord(epoch); TAILQ_FOREACH(tdwait, &er->er_tdlist, et_link) @@ -692,6 +732,66 @@ in_epoch_verbose(epoch_t epoch, int dump_onfail) #endif critical_exit(); return (0); +} + +#ifdef INVARIANTS +static void +epoch_assert_nocpu(epoch_t epoch, struct thread *td) +{ + epoch_record_t er; + int cpu; + bool crit; + + crit = td->td_critnest > 0; + + /* Check for a critical section mishap. */ + CPU_FOREACH(cpu) { + er = zpcpu_get_cpu(epoch->e_pcpu_record, cpu); + KASSERT(er->er_td != td, + ("%s critical section in epoch from cpu %d", + (crit ? "exited" : "re-entered"), cpu)); + } +} +#else +#define epoch_assert_nocpu(e, td) +#endif + +int +in_epoch_verbose(epoch_t epoch, int dump_onfail) +{ + epoch_record_t er; + struct thread *td; + + if (__predict_false((epoch) == NULL)) + return (0); + if ((epoch->e_flags & EPOCH_PREEMPT) != 0) + return (in_epoch_verbose_preempt(epoch, dump_onfail)); + + /* + * The thread being in a critical section is a necessary + * condition to be correctly inside a non-preemptible epoch, + * so it's definitely not in this epoch. + */ + td = curthread; + if (td->td_critnest == 0) { + epoch_assert_nocpu(epoch, td); + return (0); + } + + /* + * The current cpu is in a critical section, so the epoch record will be + * stable for the rest of this function. Knowing that the record is not + * active is sufficient for knowing whether we're in this epoch or not, + * since it's a pcpu record. + */ + er = epoch_currecord(epoch); + if (er->er_record.active == 0) { + epoch_assert_nocpu(epoch, td); + return (0); + } + + MPASS(er->er_td == td); + return (1); } int From owner-svn-src-stable@freebsd.org Sat Nov 14 01:58:35 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E820A2D0310; Sat, 14 Nov 2020 01:58:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXz5Q5lBKz3lyf; Sat, 14 Nov 2020 01:58:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 929C02231C; Sat, 14 Nov 2020 01:58:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AE1wYdS095290; Sat, 14 Nov 2020 01:58:34 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AE1wYWG095289; Sat, 14 Nov 2020 01:58:34 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011140158.0AE1wYWG095289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 14 Nov 2020 01:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367663 - stable/12/sys/dev/vt X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/dev/vt X-SVN-Commit-Revision: 367663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 01:58:35 -0000 Author: kevans Date: Sat Nov 14 01:58:33 2020 New Revision: 367663 URL: https://svnweb.freebsd.org/changeset/base/367663 Log: MFC r367448: vt: resolve conflict between VT_ALT_TO_ESC_HACK and DBG When using the ALT+CTRL+ESC sequence to break into kdb, the keyboard is completely borked when you return. watch(8) shows that it's working, but it's inserting escape sequences. Further investigation revealed that VT_ALT_TO_ESC_HACK is the default and directly conflicts with this sequence, so upon return from the debugger ALKED is set. If they triggered the break to debugger, it's safe to assume they didn't mean to use VT_ALT_TO_ESC_HACK, so just unset it to reduce the surprise when the keyboard seems non-functional upon return. Modified: stable/12/sys/dev/vt/vt_core.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/vt/vt_core.c ============================================================================== --- stable/12/sys/dev/vt/vt_core.c Sat Nov 14 01:55:54 2020 (r367662) +++ stable/12/sys/dev/vt/vt_core.c Sat Nov 14 01:58:33 2020 (r367663) @@ -725,13 +725,22 @@ vt_scroll(struct vt_window *vw, int offset, int whence } static int -vt_machine_kbdevent(int c) +vt_machine_kbdevent(struct vt_device *vd, int c) { switch (c) { case SPCLKEY | DBG: /* kbdmap(5) keyword `debug`. */ - if (vt_kbd_debug) + if (vt_kbd_debug) { kdb_enter(KDB_WHY_BREAK, "manual escape to debugger"); +#if VT_ALT_TO_ESC_HACK + /* + * There's an unfortunate conflict between SPCLKEY|DBG + * and VT_ALT_TO_ESC_HACK. Just assume they didn't mean + * it if we got to here. + */ + vd->vd_kbstate &= ~ALKED; +#endif + } return (1); case SPCLKEY | HALT: /* kbdmap(5) keyword `halt`. */ if (vt_kbd_halt) @@ -864,7 +873,7 @@ vt_processkey(keyboard_t *kbd, struct vt_device *vd, i return (0); #endif - if (vt_machine_kbdevent(c)) + if (vt_machine_kbdevent(vd, c)) return (0); if (vw->vw_flags & VWF_SCROLL) { From owner-svn-src-stable@freebsd.org Sat Nov 14 02:00:50 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B982C2D0531; Sat, 14 Nov 2020 02:00:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXz824nqSz3mPl; Sat, 14 Nov 2020 02:00:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9762D220DA; Sat, 14 Nov 2020 02:00:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AE20oR4097835; Sat, 14 Nov 2020 02:00:50 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AE20ovq097834; Sat, 14 Nov 2020 02:00:50 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011140200.0AE20ovq097834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 14 Nov 2020 02:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367664 - stable/12/usr.sbin/ngctl X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/usr.sbin/ngctl X-SVN-Commit-Revision: 367664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 02:00:50 -0000 Author: kevans Date: Sat Nov 14 02:00:50 2020 New Revision: 367664 URL: https://svnweb.freebsd.org/changeset/base/367664 Log: MFC r366430: ngctl: add -c (compact output) for the dot command The output of "ngctl dot" is suitable for small netgraph networks. Even moderate complex netgraph setups (about a dozen nodes) are hard to understand from the .dot output, because each node and each hook are shown as a full blown structure. This patch allows to generate much more compact output and graphs by omitting the extra structures for the individual hooks. Instead the names of the hooks are labels to the edges. Modified: stable/12/usr.sbin/ngctl/dot.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/ngctl/dot.c ============================================================================== --- stable/12/usr.sbin/ngctl/dot.c Sat Nov 14 01:58:33 2020 (r367663) +++ stable/12/usr.sbin/ngctl/dot.c Sat Nov 14 02:00:50 2020 (r367664) @@ -2,6 +2,7 @@ /* * dot.c * + * Copyright (c) 2019 Lutz Donnerhacke * Copyright (c) 2004 Brian Fundakowski Feldman * Copyright (c) 1996-1999 Whistle Communications, Inc. * All rights reserved. @@ -53,9 +54,11 @@ static int DotCmd(int ac, char **av); const struct ngcmd dot_cmd = { DotCmd, - "dot [outputfile]", + "dot [-c] [outputfile]", "Produce a GraphViz (.dot) of the entire netgraph.", - "If no outputfile is specified, stdout will be assumed.", + "If no outputfile is specified, stdout will be assumed." + " The optional -c argument generates a graph without separate" + " structures for edge names. Such a graph is more compact.", { "graphviz", "confdot" } }; @@ -66,12 +69,16 @@ DotCmd(int ac, char **av) struct namelist *nlist; FILE *f = stdout; int ch; + int compact = 0; u_int i; /* Get options */ optind = 1; - while ((ch = getopt(ac, av, "")) != -1) { + while ((ch = getopt(ac, av, "c")) != -1) { switch (ch) { + case 'c': + compact = 1; + break; case '?': default: return (CMDRTN_USAGE); @@ -109,9 +116,14 @@ DotCmd(int ac, char **av) } nlist = (struct namelist *)nlresp->data; - fprintf(f, "graph netgraph {\n"); - /* TODO: implement rank = same or subgraphs at some point */ - fprintf(f, "\tedge [ weight = 1.0 ];\n"); + if (compact) { + fprintf(f, "digraph netgraph {\n"); + fprintf(f, "\tedge [ dir = \"none\", fontsize = 10 ];\n"); + } else { + fprintf(f, "graph netgraph {\n"); + /* TODO: implement rank = same or subgraphs at some point */ + fprintf(f, "\tedge [ weight = 1.0 ];\n"); + } fprintf(f, "\tnode [ shape = record, fontsize = 12 ] {\n"); for (i = 0; i < nlist->numnames; i++) fprintf(f, "\t\t\"%jx\" [ label = \"{%s:|{%s|[%jx]:}}\" ];\n", @@ -159,30 +171,40 @@ DotCmd(int ac, char **av) continue; } - fprintf(f, "\tnode [ shape = octagon, fontsize = 10 ] {\n"); - for (j = 0; j < ninfo->hooks; j++) - fprintf(f, "\t\t\"%jx.%s\" [ label = \"%s\" ];\n", - (uintmax_t)nlist->nodeinfo[i].id, - hlist->link[j].ourhook, hlist->link[j].ourhook); - fprintf(f, "\t};\n"); + if (!compact) { + fprintf(f, "\tnode [ shape = octagon, fontsize = 10 ] {\n"); + for (j = 0; j < ninfo->hooks; j++) + fprintf(f, "\t\t\"%jx.%s\" [ label = \"%s\" ];\n", + (uintmax_t)nlist->nodeinfo[i].id, + hlist->link[j].ourhook, hlist->link[j].ourhook); + fprintf(f, "\t};\n"); - fprintf(f, "\t{\n\t\tedge [ weight = 2.0, style = bold ];\n"); - for (j = 0; j < ninfo->hooks; j++) - fprintf(f, "\t\t\"%jx\" -- \"%jx.%s\";\n", - (uintmax_t)nlist->nodeinfo[i].id, - (uintmax_t)nlist->nodeinfo[i].id, - hlist->link[j].ourhook); - fprintf(f, "\t};\n"); + fprintf(f, "\t{\n\t\tedge [ weight = 2.0, style = bold ];\n"); + for (j = 0; j < ninfo->hooks; j++) + fprintf(f, "\t\t\"%jx\" -- \"%jx.%s\";\n", + (uintmax_t)nlist->nodeinfo[i].id, + (uintmax_t)nlist->nodeinfo[i].id, + hlist->link[j].ourhook); + fprintf(f, "\t};\n"); + } for (j = 0; j < ninfo->hooks; j++) { /* Only print the edges going in one direction. */ if (hlist->link[j].nodeinfo.id > nlist->nodeinfo[i].id) continue; - fprintf(f, "\t\"%jx.%s\" -- \"%jx.%s\";\n", - (uintmax_t)nlist->nodeinfo[i].id, - hlist->link[j].ourhook, - (uintmax_t)hlist->link[j].nodeinfo.id, - hlist->link[j].peerhook); + if (compact) { + fprintf(f, "\t\"%jx\" -> \"%jx\" [ headlabel = \"%s\", taillabel = \"%s\" ] ;\n", + (uintmax_t)hlist->link[j].nodeinfo.id, + (uintmax_t)nlist->nodeinfo[i].id, + hlist->link[j].ourhook, + hlist->link[j].peerhook); + } else { + fprintf(f, "\t\"%jx.%s\" -- \"%jx.%s\";\n", + (uintmax_t)nlist->nodeinfo[i].id, + hlist->link[j].ourhook, + (uintmax_t)hlist->link[j].nodeinfo.id, + hlist->link[j].peerhook); + } } free(hlresp); } From owner-svn-src-stable@freebsd.org Sat Nov 14 02:03:35 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C8582D0578; Sat, 14 Nov 2020 02:03:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXzCC3216z3mkV; Sat, 14 Nov 2020 02:03:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AD1222684; Sat, 14 Nov 2020 02:03:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AE23ZSV001172; Sat, 14 Nov 2020 02:03:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AE23Zi1001171; Sat, 14 Nov 2020 02:03:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011140203.0AE23Zi1001171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 14 Nov 2020 02:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367665 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 367665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 02:03:35 -0000 Author: kevans Date: Sat Nov 14 02:03:34 2020 New Revision: 367665 URL: https://svnweb.freebsd.org/changeset/base/367665 Log: MFC r366275: Makefile.inc1: sysent: parallel subordinate sysent targets makesyscalls.lua (and indeed makesyscalls.sh) are both safe to be run in parallel, so let's do it. This is a trivial difference because runtime per-target is pretty small, but I like seeing it run in parallel when my muscle memory types `make -sj4`. Modified: stable/12/Makefile.inc1 Directory Properties: stable/12/ (props changed) Modified: stable/12/Makefile.inc1 ============================================================================== --- stable/12/Makefile.inc1 Sat Nov 14 02:00:50 2020 (r367664) +++ stable/12/Makefile.inc1 Sat Nov 14 02:03:34 2020 (r367665) @@ -1475,9 +1475,13 @@ _sysent_dirs+= sys/amd64/linux \ sys/amd64/linux32 \ sys/arm64/linux \ sys/i386/linux + sysent: .PHONY .for _dir in ${_sysent_dirs} +sysent-${_dir}: .PHONY ${_+_}${MAKE} -C ${.CURDIR}/${_dir} sysent + +sysent: sysent-${_dir} .endfor # From owner-svn-src-stable@freebsd.org Sat Nov 14 02:11:06 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 004662D09F7; Sat, 14 Nov 2020 02:11:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXzMs6Wg9z3myR; Sat, 14 Nov 2020 02:11:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D27062269C; Sat, 14 Nov 2020 02:11:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AE2B5kS002394; Sat, 14 Nov 2020 02:11:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AE2B4fv002385; Sat, 14 Nov 2020 02:11:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011140211.0AE2B4fv002385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 14 Nov 2020 02:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367666 - in stable/12: . stand/lua X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12: . stand/lua X-SVN-Commit-Revision: 367666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 02:11:06 -0000 Author: kevans Date: Sat Nov 14 02:11:04 2020 New Revision: 367666 URL: https://svnweb.freebsd.org/changeset/base/367666 Log: MFC r366435: lualoader: improve the design of the brand-/logo- mechanism In the previous world order, any brand/logo was forced to pull in the drawer and call drawer.add{Brand,Logo} with the name their brand/logo is taking and a table describing it. In the new world order, these files just need to return a table that maps out graphics types to a table of the exact same format as what was previously being passed back into the drawer. The appeal here is not needing to grab a reference back to the drawer module and having a cleaner data-driven looking format for these. The format has been renamed to 'gfx-*' prefixes and each one can provide a logo and a brand. drawer.addBrand/drawer.addLogo will remain in place until FreeBSD 13, as there's no overhead to them and it's not yet worth the break in compatibility with any pre-existing brands and logos. Added: stable/12/stand/lua/gfx-beastie.lua - copied unchanged from r366435, head/stand/lua/gfx-beastie.lua stable/12/stand/lua/gfx-beastiebw.lua - copied unchanged from r366435, head/stand/lua/gfx-beastiebw.lua stable/12/stand/lua/gfx-fbsdbw.lua - copied unchanged from r366435, head/stand/lua/gfx-fbsdbw.lua stable/12/stand/lua/gfx-orb.lua - copied unchanged from r366435, head/stand/lua/gfx-orb.lua stable/12/stand/lua/gfx-orbbw.lua - copied unchanged from r366435, head/stand/lua/gfx-orbbw.lua Deleted: stable/12/stand/lua/logo-beastie.lua stable/12/stand/lua/logo-beastiebw.lua stable/12/stand/lua/logo-fbsdbw.lua stable/12/stand/lua/logo-orb.lua stable/12/stand/lua/logo-orbbw.lua Modified: stable/12/ObsoleteFiles.inc stable/12/stand/lua/Makefile stable/12/stand/lua/drawer.lua Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Sat Nov 14 02:03:34 2020 (r367665) +++ stable/12/ObsoleteFiles.inc Sat Nov 14 02:11:04 2020 (r367666) @@ -38,6 +38,13 @@ # xargs -n1 | sort | uniq -d; # done +# 20201004: logo files renamed to type-agnostic gfx-*.lua +OLD_FILES+=boot/lua/logo-beastie.lua +OLD_FILES+=boot/lua/logo-beastiebw.lua +OLD_FILES+=boot/lua/logo-fbsdbw.lua +OLD_FILES+=boot/lua/logo-orb.lua +OLD_FILES+=boot/lua/logo-orbbw.lua + # 20200722: new clang import which bumps version from 10.0.0 to 10.0.1. OLD_FILES+=usr/lib/clang/10.0.0/include/cuda_wrappers/algorithm OLD_FILES+=usr/lib/clang/10.0.0/include/cuda_wrappers/complex Modified: stable/12/stand/lua/Makefile ============================================================================== --- stable/12/stand/lua/Makefile Sat Nov 14 02:03:34 2020 (r367665) +++ stable/12/stand/lua/Makefile Sat Nov 14 02:11:04 2020 (r367666) @@ -20,11 +20,11 @@ FILES= cli.lua \ drawer.lua \ hook.lua \ loader.lua \ - logo-beastie.lua \ - logo-beastiebw.lua \ - logo-fbsdbw.lua \ - logo-orb.lua \ - logo-orbbw.lua \ + gfx-beastie.lua \ + gfx-beastiebw.lua \ + gfx-fbsdbw.lua \ + gfx-orb.lua \ + gfx-orbbw.lua \ menu.lua \ password.lua \ screen.lua Modified: stable/12/stand/lua/drawer.lua ============================================================================== --- stable/12/stand/lua/drawer.lua Sat Nov 14 02:03:34 2020 (r367665) +++ stable/12/stand/lua/drawer.lua Sat Nov 14 02:11:04 2020 (r367666) @@ -61,6 +61,35 @@ local function menuEntryName(drawing_menu, entry) return entry.name end +local function processFile(gfxname) + if gfxname == nil then + return false, "Missing filename" + end + + local ret = try_include('gfx-' .. gfxname) + if ret == nil then + return false, "Failed to include gfx-" .. gfxname + end + + -- Legacy format + if type(ret) ~= "table" then + return true + end + + for gfxtype, def in pairs(ret) do + if gfxtype == "brand" then + drawer.addBrand(gfxname, def) + elseif gfxtype == "logo" then + drawer.addLogo(gfxname, def) + else + return false, "Unknown graphics type '" .. gfxtype .. + "'" + end + end + + return true +end + local function getBranddef(brand) if brand == nil then return nil @@ -70,7 +99,18 @@ local function getBranddef(brand) -- Try to pull it in if branddef == nil then - try_include('brand-' .. brand) + local res, err = processFile(brand) + if not res then + -- This fallback should go away after FreeBSD 13. + try_include('brand-' .. brand) + -- If the fallback also failed, print whatever error + -- we encountered in the original processing. + if branddefs[brand] == nil then + print(err) + return nil + end + end + branddef = branddefs[brand] end @@ -86,7 +126,18 @@ local function getLogodef(logo) -- Try to pull it in if logodef == nil then - try_include('logo-' .. logo) + local res, err = processFile(logo) + if not res then + -- This fallback should go away after FreeBSD 13. + try_include('logo-' .. logo) + -- If the fallback also failed, print whatever error + -- we encountered in the original processing. + if logodefs[logo] == nil then + print(err) + return nil + end + end + logodef = logodefs[logo] end @@ -364,6 +415,8 @@ drawer.default_bw_logodef = 'orbbw' -- drawer module in case it's a filesystem issue. drawer.default_fallback_logodef = 'none' +-- These should go away after FreeBSD 13; only available for backwards +-- compatibility with old logo- files. function drawer.addBrand(name, def) branddefs[name] = def end Copied: stable/12/stand/lua/gfx-beastie.lua (from r366435, head/stand/lua/gfx-beastie.lua) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/stand/lua/gfx-beastie.lua Sat Nov 14 02:11:04 2020 (r367666, copy of r366435, head/stand/lua/gfx-beastie.lua) @@ -0,0 +1,55 @@ +-- +-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD +-- +-- Copyright (c) 2018 Kyle Evans +-- +-- 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. +-- +-- $FreeBSD$ +-- + +return { + logo = { + graphic = { + " \027[31m, ,", + " /( )`", + " \\ \\___ / |", + " /- \027[37m_\027[31m `-/ '", + " (\027[37m/\\/ \\\027[31m \\ /\\", + " \027[37m/ / |\027[31m ` \\", + " \027[34mO O \027[37m) \027[31m/ |", + " \027[37m`-^--'\027[31m`< '", + " (_.) _ ) /", + " `.___/` /", + " `-----' /", + " \027[33m<----.\027[31m __ / __ \\", + " \027[33m<----|====\027[31mO)))\027[33m==\027[31m) \\) /\027[33m====|", + " \027[33m<----'\027[31m `--' `.__,' \\", + " | |", + " \\ / /\\", + " \027[36m______\027[31m( (_ / \\______/", + " \027[36m,' ,-----' |", + " `--{__________)\027[m", + }, + requires_color = true, + } +} Copied: stable/12/stand/lua/gfx-beastiebw.lua (from r366435, head/stand/lua/gfx-beastiebw.lua) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/stand/lua/gfx-beastiebw.lua Sat Nov 14 02:11:04 2020 (r367666, copy of r366435, head/stand/lua/gfx-beastiebw.lua) @@ -0,0 +1,54 @@ +-- +-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD +-- +-- Copyright (c) 2018 Kyle Evans +-- +-- 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. +-- +-- $FreeBSD$ +-- + +return { + logo = { + graphic = { + " , ,", + " /( )`", + " \\ \\___ / |", + " /- _ `-/ '", + " (/\\/ \\ \\ /\\", + " / / | ` \\", + " O O ) / |", + " `-^--'`< '", + " (_.) _ ) /", + " `.___/` /", + " `-----' /", + " <----. __ / __ \\", + " <----|====O)))==) \\) /====|", + " <----' `--' `.__,' \\", + " | |", + " \\ / /\\", + " ______( (_ / \\______/", + " ,' ,-----' |", + " `--{__________)", + }, + } +} Copied: stable/12/stand/lua/gfx-fbsdbw.lua (from r366435, head/stand/lua/gfx-fbsdbw.lua) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/stand/lua/gfx-fbsdbw.lua Sat Nov 14 02:11:04 2020 (r367666, copy of r366435, head/stand/lua/gfx-fbsdbw.lua) @@ -0,0 +1,49 @@ +-- +-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD +-- +-- Copyright (c) 2018 Kyle Evans +-- +-- 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. +-- +-- $FreeBSD$ +-- + +return { + logo = { + graphic = { + " ______", + " | ____| __ ___ ___ ", + " | |__ | '__/ _ \\/ _ \\", + " | __|| | | __/ __/", + " | | | | | | |", + " |_| |_| \\___|\\___|", + " ____ _____ _____", + " | _ \\ / ____| __ \\", + " | |_) | (___ | | | |", + " | _ < \\___ \\| | | |", + " | |_) |____) | |__| |", + " | | | |", + " |____/|_____/|_____/", + }, + shift = {x = 5, y = 4}, + } +} Copied: stable/12/stand/lua/gfx-orb.lua (from r366435, head/stand/lua/gfx-orb.lua) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/stand/lua/gfx-orb.lua Sat Nov 14 02:11:04 2020 (r367666, copy of r366435, head/stand/lua/gfx-orb.lua) @@ -0,0 +1,52 @@ +-- +-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD +-- +-- Copyright (c) 2018 Kyle Evans +-- +-- 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. +-- +-- $FreeBSD$ +-- + +return { + logo = { + graphic = { + " \027[31m``` \027[31;1m`\027[31m", + " s` `.....---...\027[31;1m....--.``` -/\027[31m", + " +o .--` \027[31;1m/y:` +.\027[31m", + " yo`:. \027[31;1m:o `+-\027[31m", + " y/ \027[31;1m-/` -o/\027[31m", + " .- \027[31;1m::/sy+:.\027[31m", + " / \027[31;1m`-- /\027[31m", + " `: \027[31;1m:`\027[31m", + " `: \027[31;1m:`\027[31m", + " / \027[31;1m/\027[31m", + " .- \027[31;1m-.\027[31m", + " -- \027[31;1m-.\027[31m", + " `:` \027[31;1m`:`", + " \027[31;1m.-- `--.", + " .---.....----.\027[m", + }, + requires_color = true, + shift = {x = 2, y = 4}, + } +} Copied: stable/12/stand/lua/gfx-orbbw.lua (from r366435, head/stand/lua/gfx-orbbw.lua) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/stand/lua/gfx-orbbw.lua Sat Nov 14 02:11:04 2020 (r367666, copy of r366435, head/stand/lua/gfx-orbbw.lua) @@ -0,0 +1,51 @@ +-- +-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD +-- +-- Copyright (c) 2018 Kyle Evans +-- +-- 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. +-- +-- $FreeBSD$ +-- + +return { + logo = { + graphic = { + " ``` `", + " s` `.....---.......--.``` -/", + " +o .--` /y:` +.", + " yo`:. :o `+-", + " y/ -/` -o/", + " .- ::/sy+:.", + " / `-- /", + " `: :`", + " `: :`", + " / /", + " .- -.", + " -- -.", + " `:` `:`", + " .-- `--.", + " .---.....----.", + }, + shift = {x = 2, y = 4}, + } +} From owner-svn-src-stable@freebsd.org Sat Nov 14 02:11:56 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A013E2D0F02; Sat, 14 Nov 2020 02:11:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXzNr49wGz3nLM; Sat, 14 Nov 2020 02:11:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 824B3224C0; Sat, 14 Nov 2020 02:11:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AE2BuEY003992; Sat, 14 Nov 2020 02:11:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AE2Bu06003991; Sat, 14 Nov 2020 02:11:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011140211.0AE2Bu06003991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 14 Nov 2020 02:11:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367667 - stable/12/lib/libc/stdlib X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/lib/libc/stdlib X-SVN-Commit-Revision: 367667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 02:11:56 -0000 Author: kevans Date: Sat Nov 14 02:11:56 2020 New Revision: 367667 URL: https://svnweb.freebsd.org/changeset/base/367667 Log: MFC r366770: libc: typo fix (s/involes/involves) Modified: stable/12/lib/libc/stdlib/bsearch.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/stdlib/bsearch.c ============================================================================== --- stable/12/lib/libc/stdlib/bsearch.c Sat Nov 14 02:11:04 2020 (r367666) +++ stable/12/lib/libc/stdlib/bsearch.c Sat Nov 14 02:11:56 2020 (r367667) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); * is odd, moving left simply involves halving lim: e.g., when lim * is 5 we look at item 2, so we change lim to 2 so that we will * look at items 0 & 1. If lim is even, the same applies. If lim - * is odd, moving right again involes halving lim, this time moving + * is odd, moving right again involves halving lim, this time moving * the base up one item past p: e.g., when lim is 5 we change base * to item 3 and make lim 2 so that we will look at items 3 and 4. * If lim is even, however, we have to shrink it by one before From owner-svn-src-stable@freebsd.org Sat Nov 14 11:48:28 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD3BA2E773F; Sat, 14 Nov 2020 11:48:28 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYDB45PP0z4qRp; Sat, 14 Nov 2020 11:48:28 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A19581575; Sat, 14 Nov 2020 11:48:28 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AEBmS7S065730; Sat, 14 Nov 2020 11:48:28 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEBmSmJ065729; Sat, 14 Nov 2020 11:48:28 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202011141148.0AEBmSmJ065729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 14 Nov 2020 11:48:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367675 - stable/12/sys/dev/ichiic X-SVN-Group: stable-12 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: stable/12/sys/dev/ichiic X-SVN-Commit-Revision: 367675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 11:48:28 -0000 Author: wulf Date: Sat Nov 14 11:48:28 2020 New Revision: 367675 URL: https://svnweb.freebsd.org/changeset/base/367675 Log: MFC r367230: ig4(4): Add PCI IDs for Intel Comet Lake I2C controllers. Modified: stable/12/sys/dev/ichiic/ig4_pci.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ichiic/ig4_pci.c ============================================================================== --- stable/12/sys/dev/ichiic/ig4_pci.c Sat Nov 14 10:56:40 2020 (r367674) +++ stable/12/sys/dev/ichiic/ig4_pci.c Sat Nov 14 11:48:28 2020 (r367675) @@ -107,6 +107,20 @@ static int ig4iic_pci_detach(device_t dev); #define PCI_CHIP_CANNONLAKE_H_I2C_1 0xa3698086 #define PCI_CHIP_CANNONLAKE_H_I2C_2 0xa36a8086 #define PCI_CHIP_CANNONLAKE_H_I2C_3 0xa36b8086 +#define PCI_CHIP_COMETLAKE_LP_I2C_0 0x02e88086 +#define PCI_CHIP_COMETLAKE_LP_I2C_1 0x02e98086 +#define PCI_CHIP_COMETLAKE_LP_I2C_2 0x02ea8086 +#define PCI_CHIP_COMETLAKE_LP_I2C_3 0x02eb8086 +#define PCI_CHIP_COMETLAKE_LP_I2C_4 0x02c58086 +#define PCI_CHIP_COMETLAKE_LP_I2C_5 0x02c68086 +#define PCI_CHIP_COMETLAKE_H_I2C_0 0x06e88086 +#define PCI_CHIP_COMETLAKE_H_I2C_1 0x06e98086 +#define PCI_CHIP_COMETLAKE_H_I2C_2 0x06ea8086 +#define PCI_CHIP_COMETLAKE_H_I2C_3 0x06eb8086 +#define PCI_CHIP_COMETLAKE_V_I2C_0 0xa3e08086 +#define PCI_CHIP_COMETLAKE_V_I2C_1 0xa3e18086 +#define PCI_CHIP_COMETLAKE_V_I2C_2 0xa3e28086 +#define PCI_CHIP_COMETLAKE_V_I2C_3 0xa3e38086 struct ig4iic_pci_device { uint32_t devid; @@ -156,6 +170,20 @@ static struct ig4iic_pci_device ig4iic_pci_devices[] = { PCI_CHIP_CANNONLAKE_H_I2C_1, "Intel Cannon Lake-H I2C Controller-1", IG4_CANNONLAKE}, { PCI_CHIP_CANNONLAKE_H_I2C_2, "Intel Cannon Lake-H I2C Controller-2", IG4_CANNONLAKE}, { PCI_CHIP_CANNONLAKE_H_I2C_3, "Intel Cannon Lake-H I2C Controller-3", IG4_CANNONLAKE}, + { PCI_CHIP_COMETLAKE_LP_I2C_0, "Intel Comet Lake-LP I2C Controller-0", IG4_CANNONLAKE}, + { PCI_CHIP_COMETLAKE_LP_I2C_1, "Intel Comet Lake-LP I2C Controller-1", IG4_CANNONLAKE}, + { PCI_CHIP_COMETLAKE_LP_I2C_2, "Intel Comet Lake-LP I2C Controller-2", IG4_CANNONLAKE}, + { PCI_CHIP_COMETLAKE_LP_I2C_3, "Intel Comet Lake-LP I2C Controller-3", IG4_CANNONLAKE}, + { PCI_CHIP_COMETLAKE_LP_I2C_4, "Intel Comet Lake-LP I2C Controller-4", IG4_CANNONLAKE}, + { PCI_CHIP_COMETLAKE_LP_I2C_5, "Intel Comet Lake-LP I2C Controller-5", IG4_CANNONLAKE}, + { PCI_CHIP_COMETLAKE_H_I2C_0, "Intel Comet Lake-H I2C Controller-0", IG4_CANNONLAKE}, + { PCI_CHIP_COMETLAKE_H_I2C_1, "Intel Comet Lake-H I2C Controller-1", IG4_CANNONLAKE}, + { PCI_CHIP_COMETLAKE_H_I2C_2, "Intel Comet Lake-H I2C Controller-2", IG4_CANNONLAKE}, + { PCI_CHIP_COMETLAKE_H_I2C_3, "Intel Comet Lake-H I2C Controller-3", IG4_CANNONLAKE}, + { PCI_CHIP_COMETLAKE_V_I2C_0, "Intel Comet Lake-V I2C Controller-0", IG4_CANNONLAKE}, + { PCI_CHIP_COMETLAKE_V_I2C_1, "Intel Comet Lake-V I2C Controller-1", IG4_CANNONLAKE}, + { PCI_CHIP_COMETLAKE_V_I2C_2, "Intel Comet Lake-V I2C Controller-2", IG4_CANNONLAKE}, + { PCI_CHIP_COMETLAKE_V_I2C_3, "Intel Comet Lake-V I2C Controller-3", IG4_CANNONLAKE}, }; static int From owner-svn-src-stable@freebsd.org Sat Nov 14 11:51:37 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF7B32E7B19; Sat, 14 Nov 2020 11:51:37 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYDFj5NC7z4qmK; Sat, 14 Nov 2020 11:51:37 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB6E31A00; Sat, 14 Nov 2020 11:51:37 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AEBpbBC067755; Sat, 14 Nov 2020 11:51:37 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEBpb7b067754; Sat, 14 Nov 2020 11:51:37 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202011141151.0AEBpb7b067754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 14 Nov 2020 11:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367676 - stable/12/sbin/devmatch X-SVN-Group: stable-12 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: stable/12/sbin/devmatch X-SVN-Commit-Revision: 367676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 11:51:37 -0000 Author: wulf Date: Sat Nov 14 11:51:37 2020 New Revision: 367676 URL: https://svnweb.freebsd.org/changeset/base/367676 Log: MFC r367237: devmatch(8): Respect mask field when matching strings of Z type. While here, add debug output for this action. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D26823 Modified: stable/12/sbin/devmatch/devmatch.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/devmatch/devmatch.c ============================================================================== --- stable/12/sbin/devmatch/devmatch.c Sat Nov 14 11:48:28 2020 (r367675) +++ stable/12/sbin/devmatch/devmatch.c Sat Nov 14 11:51:37 2020 (r367676) @@ -349,7 +349,12 @@ search_hints(const char *bus, const char *dev, const c } if (*cp == 'D') break; + if (bit >= 0 && ((1 << bit) & mask) == 0) + break; s = pnpval_as_str(cp + 2, pnpinfo); + if (verbose_flag) + printf("Matching %s (%c) table=%s tomatch=%s\n", + cp + 2, *cp, s, val1); if (strcmp(s, val1) != 0) notme++; break; From owner-svn-src-stable@freebsd.org Sat Nov 14 12:02:51 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B77E2E8A83; Sat, 14 Nov 2020 12:02:51 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYDVg1jtjz4rX6; Sat, 14 Nov 2020 12:02:51 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 242D41476; Sat, 14 Nov 2020 12:02:51 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AEC2pXo078581; Sat, 14 Nov 2020 12:02:51 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEC2o1Q078576; Sat, 14 Nov 2020 12:02:50 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202011141202.0AEC2o1Q078576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 14 Nov 2020 12:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367677 - in stable/12/sys/dev: acpi_support acpica iicbus X-SVN-Group: stable-12 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in stable/12/sys/dev: acpi_support acpica iicbus X-SVN-Commit-Revision: 367677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 12:02:51 -0000 Author: wulf Date: Sat Nov 14 12:02:50 2020 New Revision: 367677 URL: https://svnweb.freebsd.org/changeset/base/367677 Log: MFC r367239-367241: r367239: Add plug and play information macroses for ACPI and I2C buses. Matching table format is compatible with ACPI_ID_PROBE bus method. Note that while ACPI_ID_PROBE matches against _HID and all _CIDs, current acpi_pnpinfo_str() exports only _HID and first _CID. That means second and further _CIDs should be added to both acpi_pnpinfo_str() and ACPICOMPAT_PNP_INFO if device matching against them is required. r367240: acpi_wmi(4): Add ACPI_PNP_INFO r367241: acpi_dock(4): Add ACPI_PNP_INFO Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D26824 Modified: stable/12/sys/dev/acpi_support/acpi_wmi.c stable/12/sys/dev/acpica/acpi_dock.c stable/12/sys/dev/acpica/acpivar.h stable/12/sys/dev/iicbus/iicbus.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/acpi_support/acpi_wmi.c ============================================================================== --- stable/12/sys/dev/acpi_support/acpi_wmi.c Sat Nov 14 11:51:37 2020 (r367676) +++ stable/12/sys/dev/acpi_support/acpi_wmi.c Sat Nov 14 12:02:50 2020 (r367677) @@ -201,6 +201,7 @@ DRIVER_MODULE(acpi_wmi, acpi, acpi_wmi_driver, acpi_wm MODULE_VERSION(acpi_wmi, 1); MODULE_DEPEND(acpi_wmi, acpi, 1, 1, 1); static char *wmi_ids[] = {"PNP0C14", NULL}; +ACPI_PNP_INFO(wmi_ids); /* * Probe for the PNP0C14 ACPI node Modified: stable/12/sys/dev/acpica/acpi_dock.c ============================================================================== --- stable/12/sys/dev/acpica/acpi_dock.c Sat Nov 14 11:51:37 2020 (r367676) +++ stable/12/sys/dev/acpica/acpi_dock.c Sat Nov 14 12:02:50 2020 (r367677) @@ -64,6 +64,8 @@ struct acpi_dock_softc { ACPI_SERIAL_DECL(dock, "ACPI Docking Station"); +static char *acpi_dock_pnp_ids[] = {"PNP0C15", NULL}; + /* * Utility functions */ @@ -545,3 +547,4 @@ static devclass_t acpi_dock_devclass; DRIVER_MODULE(acpi_dock, acpi, acpi_dock_driver, acpi_dock_devclass, 0, 0); MODULE_DEPEND(acpi_dock, acpi, 1, 1, 1); +ACPI_PNP_INFO(acpi_dock_pnp_ids); Modified: stable/12/sys/dev/acpica/acpivar.h ============================================================================== --- stable/12/sys/dev/acpica/acpivar.h Sat Nov 14 11:51:37 2020 (r367676) +++ stable/12/sys/dev/acpica/acpivar.h Sat Nov 14 12:02:50 2020 (r367677) @@ -232,6 +232,20 @@ extern int acpi_quirks; #define ACPI_Q_MADT_IRQ0 (1 << 2) /* + * Plug and play information for device matching. Matching table format + * is compatible with ids parameter of ACPI_ID_PROBE bus method. + * + * XXX: While ACPI_ID_PROBE matches against _HID and all _CIDs, current + * acpi_pnpinfo_str() exports only _HID and first _CID. That means second + * and further _CIDs should be added to both acpi_pnpinfo_str() and + * ACPICOMPAT_PNP_INFO if device matching against them is required. + */ +#define ACPICOMPAT_PNP_INFO(t, busname) \ + MODULE_PNP_INFO("Z:_HID", busname, t##hid, t, nitems(t)-1); \ + MODULE_PNP_INFO("Z:_CID", busname, t##cid, t, nitems(t)-1); +#define ACPI_PNP_INFO(t) ACPICOMPAT_PNP_INFO(t, acpi) + +/* * Note that the low ivar values are reserved to provide * interface compatibility with ISA drivers which can also * attach to ACPI. Modified: stable/12/sys/dev/iicbus/iicbus.h ============================================================================== --- stable/12/sys/dev/iicbus/iicbus.h Sat Nov 14 11:51:37 2020 (r367676) +++ stable/12/sys/dev/iicbus/iicbus.h Sat Nov 14 12:02:50 2020 (r367677) @@ -77,6 +77,12 @@ IICBUS_ACCESSOR(addr, ADDR, uint32_t) #define IICBUS_FDT_PNP_INFO(t) #endif +#ifdef DEV_ACPI +#define IICBUS_ACPI_PNP_INFO(t) ACPICOMPAT_PNP_INFO(t, iicbus) +#else +#define IICBUS_ACPI_PNP_INFO(t) +#endif + int iicbus_generic_intr(device_t dev, int event, char *buf); void iicbus_init_frequency(device_t dev, u_int bus_freq); From owner-svn-src-stable@freebsd.org Sat Nov 14 13:39:45 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7A542EAB39; Sat, 14 Nov 2020 13:39:45 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYGfT3kr7z3CqM; Sat, 14 Nov 2020 13:39:45 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-ot1-x334.google.com with SMTP id n89so11527161otn.3; Sat, 14 Nov 2020 05:39:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Fxtvl5QMsbOXqPD+0tevMFm0pwpkdZCHNzXKLV392Oc=; b=myrTMA8AgTOoaJQFp+69m5ypIe9nJ5Znc9yY9HuixmAXHOmeVnri+z69BMHrpdCENl wAeMQSKVAwWCNIgNVHDewe5jaiLtOrFsaWGBRnmynQj/rW8pzz8CFL5q+zg3PPOR7+w4 JhTVJg8rdxhMQQt+6U5ow36uuegS9+iGO4UFB+mld68ohSFKVDdESfwHcVzTIHMss4+o whaKutDUxV85GrW1aN6J2cz2LzqABpkvhM70rHevA6sZZtEoq5hBtMB9W/oJqLUh4ljZ XHBCa2oRH/iL3zwzirmqOly+7GUKDFcdXzrlUB6b4lsvJ/qtEqJbPfpR8JLDf9SXRkk8 9tWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Fxtvl5QMsbOXqPD+0tevMFm0pwpkdZCHNzXKLV392Oc=; b=DONV5yDmLuzWNeaNxMt73v+paNkHTZYHeOC3Xato4SUsFpC+o5BkkAtIU+ZNC0eeFV kUGEkgdHCBJNeg2IumYgI3buQ4Ds1XWl6RKdUWA/4o9H4AC5F+Us0nVsU0q4fln57jI6 97OKTgQkF/tDuEi4BI3ibi5YI+RfVZHb6NUGycCjMgBfDtyHUNWgfCYbroYOJrymmRoy bxYVaB9zRlz1TX2Z9kUCtODmSrHs9nZbxvDdwXVklWkdWCeWfsx+FY6CVZMksYUiKB/n miNb9PVvelZp0ZjKI/GCpki8remh5G8pnaA1bteVDnHCpqVbTYlcoJl0CnUmsdeec/2L IuYA== X-Gm-Message-State: AOAM533vS4pRSv+RmwAmqjOl8TZpIGZ/0YuNLPzwPvk1+NAJ1322sAIw X76W0lqLvJO4QvxqOZqYHk2UrOVpKvNCEQ== X-Google-Smtp-Source: ABdhPJw7Kx/fkGjzSyIQxYoEXGok3uXhtedeiDHhV1PK47nGXFs0o7lu36EkA3s0CGrsw/NG2+sWdA== X-Received: by 2002:a05:6830:1002:: with SMTP id a2mr5014084otp.316.1605361184222; Sat, 14 Nov 2020 05:39:44 -0800 (PST) Received: from spectre.mavhome.dp.ua ([2600:1700:3580:3560:228:f8ff:fe04:d12]) by smtp.gmail.com with ESMTPSA id a5sm2346651oto.1.2020.11.14.05.39.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 14 Nov 2020 05:39:43 -0800 (PST) Sender: Alexander Motin Subject: Re: svn commit: r367359 - stable/12/sys/dev/pci To: martin@vx.sk Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <20201113173821.Horde.jq1A9wp72tHUvM10uhYxhOq@mail.vx.sk> From: Alexander Motin Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAG0IUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPokBVwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raS5AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczM AAoJEIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLq A6xe6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHu uC5vgPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15Gc sS9YcQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9 TevwGsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCg lz65AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6ZAXgD tmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8FlvmI/c 40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt3ytU 8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZR1Ed EIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm59R8A EQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczMAAoJ EIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLqA6xe 6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHuuC5v gPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15GcsS9Y cQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9Tevw Gsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCglz4= Message-ID: Date: Sat, 14 Nov 2020 08:39:42 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: <20201113173821.Horde.jq1A9wp72tHUvM10uhYxhOq@mail.vx.sk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CYGfT3kr7z3CqM X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 13:39:45 -0000 Martin, I've never seen such issues. Could you send me verbose `dmesg`, `devinfo -v` and `lspci -vv` outputs with and without the tunable set? I guess your BIOS sets some things differently from all I've tested. On 13.11.2020 11:38, martin@vx.sk wrote: > I am encountering a problem with hw.pci.enable_aspm: > > System: ASUS RS500A-E10-RS12U > CPU: AMD EPYC 7502 32-Core. > NVMe drive model: Micron 9300 PRO > Number of NVMe drives: 10 > > Using X2APIC > > When hw.pci.enable_aspm is enabled, PCIe hot plug of Micron NVMe drives > does not work (including detection on boot) and the system reports the > following errors for the vast majority of the drives: > > Nov 13 15:11:30 xxx kernel: pcib9: Timed out waiting for Data Link Layer > Active > Nov 13 15:12:17 xxx kernel: pcib30: Timed out waiting for Data Link > Layer Active > Nov 13 15:12:44 xxx kernel: pcib29: Timed out waiting for Data Link > Layer Active > Nov 13 15:13:04 xxx kernel: pcib11: Timed out waiting for Data Link > Layer Active > ... > > Flipping the tunable back to 0 workarounds the problem. > > Reproduced both on latest head and stable/12. -- Alexander Motin From owner-svn-src-stable@freebsd.org Sat Nov 14 14:15:50 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AEB02EB29F; Sat, 14 Nov 2020 14:15:50 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYHS62ZJYz3FHq; Sat, 14 Nov 2020 14:15:50 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B07D34AF; Sat, 14 Nov 2020 14:15:50 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AEEFoUf060572; Sat, 14 Nov 2020 14:15:50 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEEFomU060571; Sat, 14 Nov 2020 14:15:50 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202011141415.0AEEFomU060571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 14 Nov 2020 14:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367679 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 367679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 14:15:50 -0000 Author: gbe (doc committer) Date: Sat Nov 14 14:15:49 2020 New Revision: 367679 URL: https://svnweb.freebsd.org/changeset/base/367679 Log: MFC r366580: bpf(4): Update the man page to reflect reality PR: 131918 Submitted by: guy at alum dot mit dot edu Reviewed by: gnn, gbe Approved by: gnn Differential Revision: https://reviews.freebsd.org/D25993 Modified: stable/12/share/man/man4/bpf.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/bpf.4 ============================================================================== --- stable/12/share/man/man4/bpf.4 Sat Nov 14 13:07:41 2020 (r367678) +++ stable/12/share/man/man4/bpf.4 Sat Nov 14 14:15:49 2020 (r367679) @@ -49,7 +49,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 21, 2016 +.Dd October 9, 2020 .Dt BPF 4 .Os .Sh NAME @@ -73,12 +73,6 @@ ioctl. A given interface can be shared by multiple listeners, and the filter underlying each descriptor will see an identical packet stream. .Pp -A separate device file is required for each minor device. -If a file is in use, the open will fail and -.Va errno -will be set to -.Er EBUSY . -.Pp Associated with each open instance of a .Nm file is a user-settable packet filter. @@ -86,19 +80,6 @@ Whenever a packet is received by an interface, all file descriptors listening on that interface apply their filter. Each descriptor that accepts the packet receives its own copy. .Pp -The packet filter will support any link level protocol that has fixed length -headers. -Currently, only Ethernet, -.Tn SLIP , -and -.Tn PPP -drivers have been modified to interact with -.Nm . -.Pp -Since packet data is in network byte order, applications should use the -.Xr byteorder 3 -macros to extract multi-byte values. -.Pp A packet can be sent out on the network by writing to a .Nm file descriptor. @@ -313,7 +294,7 @@ with If the requested buffer size cannot be accommodated, the closest allowable size will be set and returned in the argument. A read call will result in -.Er EIO +.Er EINVAL if it is passed a buffer that is not this size. .It Dv BIOCGDLT .Pq Li u_int @@ -324,6 +305,43 @@ The device types, prefixed with .Dq Li DLT_ , are defined in .In net/bpf.h . +.It Dv BIOCGDLTLIST +.Pq Li "struct bpf_dltlist" +Returns an array of the available types of the data link layer +underlying the attached interface: +.Bd -literal -offset indent +struct bpf_dltlist { + u_int bfl_len; + u_int *bfl_list; +}; +.Ed +.Pp +The available types are returned in the array pointed to by the +.Va bfl_list +field while their length in u_int is supplied to the +.Va bfl_len +field. +.Er ENOMEM +is returned if there is not enough buffer space and +.Er EFAULT +is returned if a bad address is encountered. +The +.Va bfl_len +field is modified on return to indicate the actual length in u_int +of the array returned. +If +.Va bfl_list +is +.Dv NULL , +the +.Va bfl_len +field is set to indicate the required length of an array in u_int. +.It Dv BIOCSDLT +.Pq Li u_int +Changes the type of the data link layer underlying the attached interface. +.Er EINVAL +is returned if no interface has been specified or the specified +type is not available for the interface. .It Dv BIOCPROMISC Forces the interface into promiscuous mode. All packets, not just those destined for the local host, are processed. @@ -331,6 +349,9 @@ Since more than one file can be listening on a given i a listener that opened its interface non-promiscuously may receive packets promiscuously. This problem can be remedied with an appropriate filter. +.Pp +The interface remains in promiscuous mode until all files listening +promiscuously are closed. .It Dv BIOCFLUSH Flushes the buffer of incoming packets, and resets the statistics that are returned by BIOCGSTATS. @@ -344,7 +365,7 @@ structure. All other fields are undefined. .It Dv BIOCSETIF .Pq Li "struct ifreq" -Sets the hardware interface associate with the file. +Sets the hardware interface associated with the file. This command must be performed before any packets can be read. The device is indicated by name using the @@ -357,7 +378,7 @@ Additionally, performs the actions of .It Dv BIOCSRTIMEOUT .It Dv BIOCGRTIMEOUT .Pq Li "struct timeval" -Set or get the read timeout parameter. +Sets or gets the read timeout parameter. The argument specifies the length of time to wait before timing out on a read request. @@ -387,7 +408,7 @@ kernel because of buffer overflows .El .It Dv BIOCIMMEDIATE .Pq Li u_int -Enable or disable +Enables or disables .Dq immediate mode , based on the truth value of the argument. When immediate mode is enabled, reads return immediately upon packet @@ -407,7 +428,7 @@ An array of instructions and its length is passed in u the following structure: .Bd -literal struct bpf_program { - int bf_len; + u_int bf_len; struct bpf_insn *bf_insns; }; .Ed @@ -469,10 +490,18 @@ An incompatible filter may result in undefined behavior (most likely, an error returned by .Fn ioctl or haphazard packet matching). +.It Dv BIOCGRSIG +.It Dv BIOCSRSIG +.Pq Li u_int +Sets or gets the receive signal. +This signal will be sent to the process or process group specified by +.Dv FIOSETOWN . +It defaults to +.Dv SIGIO . .It Dv BIOCSHDRCMPLT .It Dv BIOCGHDRCMPLT .Pq Li u_int -Set or get the status of the +Sets or gets the status of the .Dq header complete flag. Set to zero if the link level source address should be filled in automatically @@ -489,7 +518,7 @@ Use and .Dv BIOCGDIRECTION instead. -Set or get the flag determining whether locally generated packets on the +Sets or gets the flag determining whether locally generated packets on the interface should be returned by BPF. Set to zero to see only incoming packets on the interface. Set to one to see packets originating locally and remotely on the interface. @@ -497,7 +526,7 @@ This flag is initialized to one by default. .It Dv BIOCSDIRECTION .It Dv BIOCGDIRECTION .Pq Li u_int -Set or get the setting determining whether incoming, outgoing, or all packets +Sets or gets the setting determining whether incoming, outgoing, or all packets on the interface should be returned by BPF. Set to .Dv BPF_D_IN @@ -631,6 +660,57 @@ therefore ownership is not assigned, the user process against .Vt bzh_user_gen . .El +.Sh STANDARD IOCTLS +.Nm +now supports several standard +.Xr ioctl 2 Ns 's +which allow the user to do async and/or non-blocking I/O to an open +.I bpf +file descriptor. +.Bl -tag -width SIOCGIFADDR +.It Dv FIONREAD +.Pq Li int +Returns the number of bytes that are immediately available for reading. +.It Dv SIOCGIFADDR +.Pq Li "struct ifreq" +Returns the address associated with the interface. +.It Dv FIONBIO +.Pq Li int +Sets or clears non-blocking I/O. +If arg is non-zero, then doing a +.Xr read 2 +when no data is available will return -1 and +.Va errno +will be set to +.Er EAGAIN . +If arg is zero, non-blocking I/O is disabled. +Note: setting this overrides the timeout set by +.Dv BIOCSRTIMEOUT . +.It Dv FIOASYNC +.Pq Li int +Enables or disables async I/O. +When enabled (arg is non-zero), the process or process group specified by +.Dv FIOSETOWN +will start receiving +.Dv SIGIO 's +when packets arrive. +Note that you must do an +.Dv FIOSETOWN +in order for this to take affect, +as the system will not default this for you. +The signal may be changed via +.Dv BIOCSRSIG . +.It Dv FIOSETOWN +.It Dv FIOGETOWN +.Pq Li int +Sets or gets the process or process group (if negative) that should +receive +.Dv SIGIO +when packets are available. +The signal may be changed using +.Dv BIOCSRSIG +(see above). +.El .Sh BPF HEADER One of the following structures is prepended to each packet returned by .Xr read 2 @@ -750,10 +830,10 @@ and implicit program counter. The following structure defines the instruction format: .Bd -literal struct bpf_insn { - u_short code; - u_char jt; - u_char jf; - u_long k; + u_short code; + u_char jt; + u_char jf; + bpf_u_int32 k; }; .Ed .Pp @@ -964,7 +1044,7 @@ variables controls the behaviour of the .Nm subsystem .Bl -tag -width indent -.It Va net.bpf.optimize_writers: No 0 +.It Va net.bpf.optimize_writers : No 0 Various programs use BPF to send (but not receive) raw packets (cdpd, lldpd, dhcpd, dhcp relays, etc. are good examples of such programs). They do not need incoming packets to be send to them. @@ -973,20 +1053,20 @@ makes new BPF users to be attached to write-only inter explicitly specifies read filter via .Fn pcap_set_filter . This removes any performance degradation for high-speed interfaces. -.It Va net.bpf.stats: +.It Va net.bpf.stats : Binary interface for retrieving general statistics. -.It Va net.bpf.zerocopy_enable: No 0 +.It Va net.bpf.zerocopy_enable : No 0 Permits zero-copy to be used with net BPF readers. Use with caution. -.It Va net.bpf.maxinsns: No 512 +.It Va net.bpf.maxinsns : No 512 Maximum number of instructions that BPF program can contain. Use .Xr tcpdump 1 .Fl d option to determine approximate number of instruction for any filter. -.It Va net.bpf.maxbufsize: No 524288 +.It Va net.bpf.maxbufsize : No 524288 Maximum buffer size to allocate for packets buffer. -.It Va net.bpf.bufsize: No 4096 +.It Va net.bpf.bufsize : No 4096 Default buffer size to allocate for packets buffer. .El .Sh EXAMPLES @@ -1052,7 +1132,6 @@ struct bpf_insn insns[] = { .Xr kqueue 2 , .Xr poll 2 , .Xr select 2 , -.Xr byteorder 3 , .Xr ng_bpf 4 , .Xr bpf 9 .Rs @@ -1100,8 +1179,6 @@ This could be fixed in the kernel with additional proc However, we favor the model where all files must assume that the interface is promiscuous, and if so desired, must utilize a filter to reject foreign packets. -.Pp -Data link protocols with variable length headers are not currently supported. .Pp The .Dv SEESENT , From owner-svn-src-stable@freebsd.org Sat Nov 14 15:19:40 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3371B2ECA58; Sat, 14 Nov 2020 15:19:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYJsm0h0bz3JpG; Sat, 14 Nov 2020 15:19:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09E7B4500; Sat, 14 Nov 2020 15:19:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AEFJe8A097676; Sat, 14 Nov 2020 15:19:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEFJauR097657; Sat, 14 Nov 2020 15:19:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011141519.0AEFJauR097657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 14 Nov 2020 15:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367681 - in stable/12/contrib/lua: . doc src X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12/contrib/lua: . doc src X-SVN-Commit-Revision: 367681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 15:19:40 -0000 Author: kevans Date: Sat Nov 14 15:19:36 2020 New Revision: 367681 URL: https://svnweb.freebsd.org/changeset/base/367681 Log: MFC r366769: MFC r366760: lua: update to 5.3.6 This release contains some minor bugfixes; notably: - 2x minor Makefile fixes (not used in base) - Long brackets with a huge number of '=' overflow some internal buffer arithmetic. - Joining an upvalue with itself can cause a use-after-free crash. See here for examples: http://www.lua.org/bugs.html#5.3.5 Modified: stable/12/contrib/lua/Makefile stable/12/contrib/lua/README stable/12/contrib/lua/doc/contents.html stable/12/contrib/lua/doc/manual.html stable/12/contrib/lua/doc/readme.html stable/12/contrib/lua/src/Makefile stable/12/contrib/lua/src/lapi.c stable/12/contrib/lua/src/lauxlib.c stable/12/contrib/lua/src/lcode.c stable/12/contrib/lua/src/ldebug.c stable/12/contrib/lua/src/liolib.c stable/12/contrib/lua/src/llex.c stable/12/contrib/lua/src/lobject.c stable/12/contrib/lua/src/lparser.c stable/12/contrib/lua/src/lua.h stable/12/contrib/lua/src/lundump.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/lua/Makefile ============================================================================== --- stable/12/contrib/lua/Makefile Sat Nov 14 14:50:34 2020 (r367680) +++ stable/12/contrib/lua/Makefile Sat Nov 14 15:19:36 2020 (r367681) @@ -46,7 +46,7 @@ TO_MAN= lua.1 luac.1 # Lua version and release. V= 5.3 -R= $V.4 +R= $V.6 # Targets start here. all: $(PLAT) Modified: stable/12/contrib/lua/README ============================================================================== --- stable/12/contrib/lua/README Sat Nov 14 14:50:34 2020 (r367680) +++ stable/12/contrib/lua/README Sat Nov 14 15:19:36 2020 (r367681) @@ -1,5 +1,5 @@ -This is Lua 5.3.5, released on 26 Jun 2018. +This is Lua 5.3.6, released on 14 Sep 2020. For installation instructions, license details, and further information about Lua, see doc/readme.html. Modified: stable/12/contrib/lua/doc/contents.html ============================================================================== --- stable/12/contrib/lua/doc/contents.html Sat Nov 14 14:50:34 2020 (r367680) +++ stable/12/contrib/lua/doc/contents.html Sat Nov 14 15:19:36 2020 (r367681) @@ -32,7 +32,7 @@ For a complete introduction to Lua programming, see th

-Copyright © 2015–2018 Lua.org, PUC-Rio. +Copyright © 2015–2020 Lua.org, PUC-Rio. Freely available under the terms of the Lua license. @@ -318,6 +318,37 @@ Freely available under the terms of the utf8.len
utf8.offset
+

metamethods

+

+__add
+__band
+__bnot
+__bor
+__bxor
+__call
+__concat
+__div
+__eq
+__gc
+__idiv
+__index
+__le
+__len
+__lt
+__metatable
+__mod
+__mode
+__mul
+__name
+__newindex
+__pairs
+__pow
+__shl
+__shr
+__sub
+__tostring
+__unm
+

environment
variables

LUA_CPATH
@@ -609,10 +640,10 @@ Freely available under the terms of the

Modified: stable/12/contrib/lua/doc/manual.html ============================================================================== --- stable/12/contrib/lua/doc/manual.html Sat Nov 14 14:50:34 2020 (r367680) +++ stable/12/contrib/lua/doc/manual.html Sat Nov 14 15:19:36 2020 (r367681) @@ -19,7 +19,7 @@ by Roberto Ierusalimschy, Luiz Henrique de Figueiredo,

-Copyright © 2015–2018 Lua.org, PUC-Rio. +Copyright © 2015–2020 Lua.org, PUC-Rio. Freely available under the terms of the Lua license. @@ -10972,10 +10972,10 @@ and LiteralString, see §3.1.)

Modified: stable/12/contrib/lua/doc/readme.html ============================================================================== --- stable/12/contrib/lua/doc/readme.html Sat Nov 14 14:50:34 2020 (r367680) +++ stable/12/contrib/lua/doc/readme.html Sat Nov 14 15:19:36 2020 (r367681) @@ -107,7 +107,7 @@ Here are the details.
  1. Open a terminal window and move to -the top-level directory, which is named lua-5.3.5. +the top-level directory, which is named lua-5.3.6. The Makefile there controls both the build process and the installation process.

  2. @@ -328,7 +328,7 @@ For details, see this.
    -Copyright © 1994–2017 Lua.org, PUC-Rio. +Copyright © 1994–2020 Lua.org, PUC-Rio.

    Permission is hereby granted, free of charge, to any person obtaining a copy @@ -355,10 +355,10 @@ THE SOFTWARE.

    Modified: stable/12/contrib/lua/src/Makefile ============================================================================== --- stable/12/contrib/lua/src/Makefile Sat Nov 14 14:50:34 2020 (r367680) +++ stable/12/contrib/lua/src/Makefile Sat Nov 14 15:19:36 2020 (r367681) @@ -102,7 +102,7 @@ c89: freebsd: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc" + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc" generic: $(ALL) Modified: stable/12/contrib/lua/src/lapi.c ============================================================================== --- stable/12/contrib/lua/src/lapi.c Sat Nov 14 14:50:34 2020 (r367680) +++ stable/12/contrib/lua/src/lapi.c Sat Nov 14 15:19:36 2020 (r367681) @@ -1254,13 +1254,12 @@ LUA_API const char *lua_setupvalue (lua_State *L, int } -static UpVal **getupvalref (lua_State *L, int fidx, int n, LClosure **pf) { +static UpVal **getupvalref (lua_State *L, int fidx, int n) { LClosure *f; StkId fi = index2addr(L, fidx); api_check(L, ttisLclosure(fi), "Lua function expected"); f = clLvalue(fi); api_check(L, (1 <= n && n <= f->p->sizeupvalues), "invalid upvalue index"); - if (pf) *pf = f; return &f->upvals[n - 1]; /* get its upvalue pointer */ } @@ -1269,7 +1268,7 @@ LUA_API void *lua_upvalueid (lua_State *L, int fidx, i StkId fi = index2addr(L, fidx); switch (ttype(fi)) { case LUA_TLCL: { /* lua closure */ - return *getupvalref(L, fidx, n, NULL); + return *getupvalref(L, fidx, n); } case LUA_TCCL: { /* C closure */ CClosure *f = clCvalue(fi); @@ -1286,9 +1285,10 @@ LUA_API void *lua_upvalueid (lua_State *L, int fidx, i LUA_API void lua_upvaluejoin (lua_State *L, int fidx1, int n1, int fidx2, int n2) { - LClosure *f1; - UpVal **up1 = getupvalref(L, fidx1, n1, &f1); - UpVal **up2 = getupvalref(L, fidx2, n2, NULL); + UpVal **up1 = getupvalref(L, fidx1, n1); + UpVal **up2 = getupvalref(L, fidx2, n2); + if (*up1 == *up2) + return; luaC_upvdeccount(L, *up1); *up1 = *up2; (*up1)->refcount++; Modified: stable/12/contrib/lua/src/lauxlib.c ============================================================================== --- stable/12/contrib/lua/src/lauxlib.c Sat Nov 14 14:50:34 2020 (r367680) +++ stable/12/contrib/lua/src/lauxlib.c Sat Nov 14 15:19:36 2020 (r367681) @@ -1011,8 +1011,13 @@ static void *l_alloc (void *ud, void *ptr, size_t osiz free(ptr); return NULL; } - else - return realloc(ptr, nsize); + else { /* cannot fail when shrinking a block */ + void *newptr = realloc(ptr, nsize); + if (newptr == NULL && ptr != NULL && nsize <= osize) + return ptr; /* keep the original block */ + else /* no fail or not shrinking */ + return newptr; /* use the new block */ + } } Modified: stable/12/contrib/lua/src/lcode.c ============================================================================== --- stable/12/contrib/lua/src/lcode.c Sat Nov 14 14:50:34 2020 (r367680) +++ stable/12/contrib/lua/src/lcode.c Sat Nov 14 15:19:36 2020 (r367681) @@ -1061,7 +1061,7 @@ static void codecomp (FuncState *fs, BinOpr opr, expde /* -** Aplly prefix operation 'op' to expression 'e'. +** Apply prefix operation 'op' to expression 'e'. */ void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e, int line) { static const expdesc ef = {VKINT, {0}, NO_JUMP, NO_JUMP}; Modified: stable/12/contrib/lua/src/ldebug.c ============================================================================== --- stable/12/contrib/lua/src/ldebug.c Sat Nov 14 14:50:34 2020 (r367680) +++ stable/12/contrib/lua/src/ldebug.c Sat Nov 14 15:19:36 2020 (r367681) @@ -133,10 +133,11 @@ static const char *upvalname (Proto *p, int uv) { static const char *findvararg (CallInfo *ci, int n, StkId *pos) { int nparams = clLvalue(ci->func)->p->numparams; - if (n >= cast_int(ci->u.l.base - ci->func) - nparams) + int nvararg = cast_int(ci->u.l.base - ci->func) - nparams; + if (n <= -nvararg) return NULL; /* no such vararg */ else { - *pos = ci->func + nparams + n; + *pos = ci->func + nparams - n; return "(*vararg)"; /* generic name for any vararg */ } } @@ -148,7 +149,7 @@ static const char *findlocal (lua_State *L, CallInfo * StkId base; if (isLua(ci)) { if (n < 0) /* access to vararg values? */ - return findvararg(ci, -n, pos); + return findvararg(ci, n, pos); else { base = ci->u.l.base; name = luaF_getlocalname(ci_func(ci)->p, n, currentpc(ci)); Modified: stable/12/contrib/lua/src/liolib.c ============================================================================== --- stable/12/contrib/lua/src/liolib.c Sat Nov 14 14:50:34 2020 (r367680) +++ stable/12/contrib/lua/src/liolib.c Sat Nov 14 15:19:36 2020 (r367681) @@ -277,6 +277,8 @@ static int io_popen (lua_State *L) { const char *filename = luaL_checkstring(L, 1); const char *mode = luaL_optstring(L, 2, "r"); LStream *p = newprefile(L); + luaL_argcheck(L, ((mode[0] == 'r' || mode[0] == 'w') && mode[1] == '\0'), + 2, "invalid mode"); p->f = l_popen(L, filename, mode); p->closef = &io_pclose; return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1; Modified: stable/12/contrib/lua/src/llex.c ============================================================================== --- stable/12/contrib/lua/src/llex.c Sat Nov 14 14:50:34 2020 (r367680) +++ stable/12/contrib/lua/src/llex.c Sat Nov 14 15:19:36 2020 (r367681) @@ -244,12 +244,12 @@ static int read_numeral (LexState *ls, SemInfo *seminf /* -** skip a sequence '[=*[' or ']=*]'; if sequence is well formed, return -** its number of '='s; otherwise, return a negative number (-1 iff there -** are no '='s after initial bracket) +** reads a sequence '[=*[' or ']=*]', leaving the last bracket. +** If sequence is well formed, return its number of '='s + 2; otherwise, +** return 1 if there is no '='s or 0 otherwise (an unfinished '[==...'). */ -static int skip_sep (LexState *ls) { - int count = 0; +static size_t skip_sep (LexState *ls) { + size_t count = 0; int s = ls->current; lua_assert(s == '[' || s == ']'); save_and_next(ls); @@ -257,11 +257,14 @@ static int skip_sep (LexState *ls) { save_and_next(ls); count++; } - return (ls->current == s) ? count : (-count) - 1; + return (ls->current == s) ? count + 2 + : (count == 0) ? 1 + : 0; + } -static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) { +static void read_long_string (LexState *ls, SemInfo *seminfo, size_t sep) { int line = ls->linenumber; /* initial line (for error message) */ save_and_next(ls); /* skip 2nd '[' */ if (currIsNewline(ls)) /* string starts with a newline? */ @@ -295,8 +298,8 @@ static void read_long_string (LexState *ls, SemInfo *s } } endloop: if (seminfo) - seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + (2 + sep), - luaZ_bufflen(ls->buff) - 2*(2 + sep)); + seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + sep, + luaZ_bufflen(ls->buff) - 2 * sep); } @@ -444,9 +447,9 @@ static int llex (LexState *ls, SemInfo *seminfo) { /* else is a comment */ next(ls); if (ls->current == '[') { /* long comment? */ - int sep = skip_sep(ls); + size_t sep = skip_sep(ls); luaZ_resetbuffer(ls->buff); /* 'skip_sep' may dirty the buffer */ - if (sep >= 0) { + if (sep >= 2) { read_long_string(ls, NULL, sep); /* skip long comment */ luaZ_resetbuffer(ls->buff); /* previous call may dirty the buff. */ break; @@ -458,12 +461,12 @@ static int llex (LexState *ls, SemInfo *seminfo) { break; } case '[': { /* long string or simply '[' */ - int sep = skip_sep(ls); - if (sep >= 0) { + size_t sep = skip_sep(ls); + if (sep >= 2) { read_long_string(ls, seminfo, sep); return TK_STRING; } - else if (sep != -1) /* '[=...' missing second bracket */ + else if (sep == 0) /* '[=...' missing second bracket */ lexerror(ls, "invalid long string delimiter", TK_STRING); return '['; } Modified: stable/12/contrib/lua/src/lobject.c ============================================================================== --- stable/12/contrib/lua/src/lobject.c Sat Nov 14 14:50:34 2020 (r367680) +++ stable/12/contrib/lua/src/lobject.c Sat Nov 14 15:19:36 2020 (r367681) @@ -266,7 +266,7 @@ static const char *l_str2dloc (const char *s, lua_Numb ** - 'n'/'N' means 'inf' or 'nan' (which should be rejected) ** - '.' just optimizes the search for the common case (nothing special) ** This function accepts both the current locale or a dot as the radix -** mark. If the convertion fails, it may mean number has a dot but +** mark. If the conversion fails, it may mean number has a dot but ** locale accepts something else. In that case, the code copies 's' ** to a buffer (because 's' is read-only), changes the dot to the ** current locale radix mark, and tries to convert again. Modified: stable/12/contrib/lua/src/lparser.c ============================================================================== --- stable/12/contrib/lua/src/lparser.c Sat Nov 14 14:50:34 2020 (r367680) +++ stable/12/contrib/lua/src/lparser.c Sat Nov 14 15:19:36 2020 (r367681) @@ -544,6 +544,7 @@ static void open_func (LexState *ls, FuncState *fs, Bl fs->bl = NULL; f = fs->f; f->source = ls->source; + luaC_objbarrier(ls->L, f, f->source); f->maxstacksize = 2; /* registers 0/1 are always valid */ enterblock(fs, bl, 0); } @@ -1616,6 +1617,7 @@ static void mainfunc (LexState *ls, FuncState *fs) { fs->f->is_vararg = 1; /* main function is always declared vararg */ init_exp(&v, VLOCAL, 0); /* create and... */ newupvalue(fs, ls->envn, &v); /* ...set environment upvalue */ + luaC_objbarrier(ls->L, fs->f, ls->envn); luaX_next(ls); /* read first token */ statlist(ls); /* parse main body */ check(ls, TK_EOS); @@ -1634,6 +1636,7 @@ LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer * sethvalue(L, L->top, lexstate.h); /* anchor it */ luaD_inctop(L); funcstate.f = cl->p = luaF_newproto(L); + luaC_objbarrier(L, cl, cl->p); funcstate.f->source = luaS_new(L, name); /* create and anchor TString */ lua_assert(iswhite(funcstate.f)); /* do not need barrier here */ lexstate.buff = buff; Modified: stable/12/contrib/lua/src/lua.h ============================================================================== --- stable/12/contrib/lua/src/lua.h Sat Nov 14 14:50:34 2020 (r367680) +++ stable/12/contrib/lua/src/lua.h Sat Nov 14 15:19:36 2020 (r367681) @@ -1,5 +1,4 @@ /* -** $Id: lua.h,v 1.332.1.2 2018/06/13 16:58:17 roberto Exp $ ** Lua - A Scripting Language ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) ** See Copyright Notice at the end of this file @@ -19,11 +18,11 @@ #define LUA_VERSION_MAJOR "5" #define LUA_VERSION_MINOR "3" #define LUA_VERSION_NUM 503 -#define LUA_VERSION_RELEASE "5" +#define LUA_VERSION_RELEASE "6" #define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR #define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE -#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2018 Lua.org, PUC-Rio" +#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2020 Lua.org, PUC-Rio" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes" @@ -460,7 +459,7 @@ struct lua_Debug { /****************************************************************************** -* Copyright (C) 1994-2018 Lua.org, PUC-Rio. +* Copyright (C) 1994-2020 Lua.org, PUC-Rio. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the Modified: stable/12/contrib/lua/src/lundump.c ============================================================================== --- stable/12/contrib/lua/src/lundump.c Sat Nov 14 14:50:34 2020 (r367680) +++ stable/12/contrib/lua/src/lundump.c Sat Nov 14 15:19:36 2020 (r367681) @@ -85,8 +85,10 @@ static lua_Integer LoadInteger (LoadState *S) { } -static TString *LoadString (LoadState *S) { +static TString *LoadString (LoadState *S, Proto *p) { + lua_State *L = S->L; size_t size = LoadByte(S); + TString *ts; if (size == 0xFF) LoadVar(S, size); if (size == 0) @@ -94,13 +96,17 @@ static TString *LoadString (LoadState *S) { else if (--size <= LUAI_MAXSHORTLEN) { /* short string? */ char buff[LUAI_MAXSHORTLEN]; LoadVector(S, buff, size); - return luaS_newlstr(S->L, buff, size); + ts = luaS_newlstr(L, buff, size); } else { /* long string */ - TString *ts = luaS_createlngstrobj(S->L, size); + ts = luaS_createlngstrobj(L, size); + setsvalue2s(L, L->top, ts); /* anchor it ('loadVector' can GC) */ + luaD_inctop(L); LoadVector(S, getstr(ts), size); /* load directly in final place */ - return ts; + L->top--; /* pop string */ } + luaC_objbarrier(L, p, ts); + return ts; } @@ -140,7 +146,7 @@ static void LoadConstants (LoadState *S, Proto *f) { break; case LUA_TSHRSTR: case LUA_TLNGSTR: - setsvalue2n(S->L, o, LoadString(S)); + setsvalue2n(S->L, o, LoadString(S, f)); break; default: lua_assert(0); @@ -158,6 +164,7 @@ static void LoadProtos (LoadState *S, Proto *f) { f->p[i] = NULL; for (i = 0; i < n; i++) { f->p[i] = luaF_newproto(S->L); + luaC_objbarrier(S->L, f, f->p[i]); LoadFunction(S, f->p[i], f->source); } } @@ -189,18 +196,18 @@ static void LoadDebug (LoadState *S, Proto *f) { for (i = 0; i < n; i++) f->locvars[i].varname = NULL; for (i = 0; i < n; i++) { - f->locvars[i].varname = LoadString(S); + f->locvars[i].varname = LoadString(S, f); f->locvars[i].startpc = LoadInt(S); f->locvars[i].endpc = LoadInt(S); } n = LoadInt(S); for (i = 0; i < n; i++) - f->upvalues[i].name = LoadString(S); + f->upvalues[i].name = LoadString(S, f); } static void LoadFunction (LoadState *S, Proto *f, TString *psource) { - f->source = LoadString(S); + f->source = LoadString(S, f); if (f->source == NULL) /* no source in dump? */ f->source = psource; /* reuse parent's source */ f->linedefined = LoadInt(S); @@ -271,6 +278,7 @@ LClosure *luaU_undump(lua_State *L, ZIO *Z, const char setclLvalue(L, L->top, cl); luaD_inctop(L); cl->p = luaF_newproto(L); + luaC_objbarrier(L, cl, cl->p); LoadFunction(&S, cl->p, NULL); lua_assert(cl->nupvalues == cl->p->sizeupvalues); luai_verifycode(L, buff, cl->p); From owner-svn-src-stable@freebsd.org Sat Nov 14 15:21:21 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D7752ECC71; Sat, 14 Nov 2020 15:21:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYJvj2Fcvz3KJc; Sat, 14 Nov 2020 15:21:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4027944CB; Sat, 14 Nov 2020 15:21:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AEFLLKT098626; Sat, 14 Nov 2020 15:21:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEFLKgU098624; Sat, 14 Nov 2020 15:21:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011141521.0AEFLKgU098624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 14 Nov 2020 15:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367682 - in stable/12: lib/libbe tools/build/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12: lib/libbe tools/build/mk X-SVN-Commit-Revision: 367682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 15:21:21 -0000 Author: kevans Date: Sat Nov 14 15:21:20 2020 New Revision: 367682 URL: https://svnweb.freebsd.org/changeset/base/367682 Log: MFC r366820-r366821: libbe(3) documentation improvements r366820: libbe(3): document be_snapshot() While toying around with lua bindings for libbe(3), I discovered that I apparently never documented this, despite having documented be_is_auto_snapshot_name that references it. r366821: libbe(3): install MLINKS for all of the functions provided Modified: stable/12/lib/libbe/Makefile stable/12/lib/libbe/libbe.3 stable/12/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libbe/Makefile ============================================================================== --- stable/12/lib/libbe/Makefile Sat Nov 14 15:19:36 2020 (r367681) +++ stable/12/lib/libbe/Makefile Sat Nov 14 15:21:20 2020 (r367682) @@ -12,6 +12,41 @@ SHLIB_MINOR= 0 SRCS= be.c be_access.c be_error.c be_info.c INCS= be.h MAN= libbe.3 +MLINKS+= libbe.3 be_activate.3 +MLINKS+= libbe.3 be_active_name.3 +MLINKS+= libbe.3 be_active_path.3 +MLINKS+= libbe.3 be_create_depth.3 +MLINKS+= libbe.3 be_create_from_existing_snap.3 +MLINKS+= libbe.3 be_create_from_existing.3 +MLINKS+= libbe.3 be_create.3 +MLINKS+= libbe.3 be_deactivate.3 +MLINKS+= libbe.3 be_destroy.3 +MLINKS+= libbe.3 be_exists.3 +MLINKS+= libbe.3 be_export.3 +MLINKS+= libbe.3 be_get_bootenv_props.3 +MLINKS+= libbe.3 be_get_dataset_props.3 +MLINKS+= libbe.3 be_get_dataset_snapshots.3 +MLINKS+= libbe.3 be_import.3 +MLINKS+= libbe.3 be_is_auto_snapshot_name.3 +MLINKS+= libbe.3 be_mount.3 +MLINKS+= libbe.3 be_mounted_at.3 +MLINKS+= libbe.3 be_nextboot_name.3 +MLINKS+= libbe.3 be_nextboot_path.3 +MLINKS+= libbe.3 be_nicenum.3 +MLINKS+= libbe.3 be_prop_list_alloc.3 +MLINKS+= libbe.3 be_prop_list_free.3 +MLINKS+= libbe.3 be_rename.3 +MLINKS+= libbe.3 be_root_concat.3 +MLINKS+= libbe.3 be_root_path.3 +MLINKS+= libbe.3 be_snapshot.3 +MLINKS+= libbe.3 be_unmount.3 +MLINKS+= libbe.3 be_validate_name.3 +MLINKS+= libbe.3 be_validate_snap.3 +MLINKS+= libbe.3 libbe_close.3 +MLINKS+= libbe.3 libbe_errno.3 +MLINKS+= libbe.3 libbe_error_description.3 +MLINKS+= libbe.3 libbe_init.3 +MLINKS+= libbe.3 libbe_print_on_error.3 WARNS?= 2 IGNORE_PRAGMA= yes Modified: stable/12/lib/libbe/libbe.3 ============================================================================== --- stable/12/lib/libbe/libbe.3 Sat Nov 14 15:19:36 2020 (r367681) +++ stable/12/lib/libbe/libbe.3 Sat Nov 14 15:21:20 2020 (r367682) @@ -58,6 +58,9 @@ .Ft const char * Ns .Fn be_root_path "libbe_handle_t *hdl" .Pp +.Ft int Ns +.Fn be_snapshot "libbe_handle_t *hdl" "const char *be_name" "const char *snap_name" "bool recursive" "char *result" +.Pp .Ft bool Ns .Fn be_is_auto_snapshot_name "libbe_handle_t *hdl" "const char *snap" .Pp @@ -214,6 +217,30 @@ active on reboot. The .Fn be_root_path function returns the boot environment root path. +.Pp +The +.Fn be_snapshot +function creates a snapshot of +.Fa be_name +named +.Fa snap_name . +A +.Dv NULL +.Fa snap_name +may be used, indicating that +.Fn be_snaphot +should derive the snapshot name from the current date and time. +If +.Fa recursive +is set, then +.Fn be_snapshot +will recursively snapshot the dataset. +If +.Fa result +is not +.Dv NULL , +then it will be populated with the final +.Dq Fa be_name Ns @ Ns Fa snap_name . .Pp The .Fn be_is_auto_snapshot_name Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/12/tools/build/mk/OptionalObsoleteFiles.inc Sat Nov 14 15:19:36 2020 (r367681) +++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc Sat Nov 14 15:21:20 2020 (r367682) @@ -1394,6 +1394,41 @@ OLD_LIBS+=usr/lib32/libzpool.so.2 OLD_FILES+=usr/sbin/zfsd OLD_FILES+=usr/sbin/zhack OLD_FILES+=usr/sbin/zdb +OLD_FILES+=usr/share/man/man3/be_activate.3.gz +OLD_FILES+=usr/share/man/man3/be_active_name.3.gz +OLD_FILES+=usr/share/man/man3/be_active_path.3.gz +OLD_FILES+=usr/share/man/man3/be_create_depth.3.gz +OLD_FILES+=usr/share/man/man3/be_create_from_existing_snap.3.gz +OLD_FILES+=usr/share/man/man3/be_create_from_existing.3.gz +OLD_FILES+=usr/share/man/man3/be_create.3.gz +OLD_FILES+=usr/share/man/man3/be_deactivate.3.gz +OLD_FILES+=usr/share/man/man3/be_destroy.3.gz +OLD_FILES+=usr/share/man/man3/be_exists.3.gz +OLD_FILES+=usr/share/man/man3/be_export.3.gz +OLD_FILES+=usr/share/man/man3/be_get_bootenv_props.3.gz +OLD_FILES+=usr/share/man/man3/be_get_dataset_props.3.gz +OLD_FILES+=usr/share/man/man3/be_get_dataset_snapshots.3.gz +OLD_FILES+=usr/share/man/man3/be_import.3.gz +OLD_FILES+=usr/share/man/man3/be_is_auto_snapshot_name.3.gz +OLD_FILES+=usr/share/man/man3/be_mount.3.gz +OLD_FILES+=usr/share/man/man3/be_mounted_at.3.gz +OLD_FILES+=usr/share/man/man3/be_nextboot_name.3.gz +OLD_FILES+=usr/share/man/man3/be_nextboot_path.3.gz +OLD_FILES+=usr/share/man/man3/be_nicenum.3.gz +OLD_FILES+=usr/share/man/man3/be_prop_list_alloc.3.gz +OLD_FILES+=usr/share/man/man3/be_prop_list_free.3.gz +OLD_FILES+=usr/share/man/man3/be_rename.3.gz +OLD_FILES+=usr/share/man/man3/be_root_concat.3.gz +OLD_FILES+=usr/share/man/man3/be_root_path.3.gz +OLD_FILES+=usr/share/man/man3/be_snapshot.3.gz +OLD_FILES+=usr/share/man/man3/be_unmount.3.gz +OLD_FILES+=usr/share/man/man3/be_validate_name.3.gz +OLD_FILES+=usr/share/man/man3/be_validate_snap.3.gz +OLD_FILES+=usr/share/man/man3/libbe_close.3.gz +OLD_FILES+=usr/share/man/man3/libbe_errno.3.gz +OLD_FILES+=usr/share/man/man3/libbe_error_description.3.gz +OLD_FILES+=usr/share/man/man3/libbe_init.3.gz +OLD_FILES+=usr/share/man/man3/libbe_print_on_error.3.gz OLD_FILES+=usr/share/man/man3/libbe.3.gz OLD_FILES+=usr/share/man/man7/zpool-features.7.gz OLD_FILES+=usr/share/man/man8/bectl.8.gz From owner-svn-src-stable@freebsd.org Sat Nov 14 15:26:19 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D9752ECA75; Sat, 14 Nov 2020 15:26:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYK1R3xYGz3KXp; Sat, 14 Nov 2020 15:26:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A27944DC; Sat, 14 Nov 2020 15:26:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AEFQJsa003847; Sat, 14 Nov 2020 15:26:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEFQIwS003844; Sat, 14 Nov 2020 15:26:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011141526.0AEFQIwS003844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 14 Nov 2020 15:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367683 - stable/12/lib/libbe X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/lib/libbe X-SVN-Commit-Revision: 367683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 15:26:19 -0000 Author: kevans Date: Sat Nov 14 15:26:18 2020 New Revision: 367683 URL: https://svnweb.freebsd.org/changeset/base/367683 Log: MFC r366819: libbe(3): const'ify a couple arguments libbe will never need to mutate these as we either process them into a local buffer or we just don't touch them and write to a separate out argument. Modified: stable/12/lib/libbe/be.h stable/12/lib/libbe/be_access.c stable/12/lib/libbe/be_info.c stable/12/lib/libbe/libbe.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libbe/be.h ============================================================================== --- stable/12/lib/libbe/be.h Sat Nov 14 15:21:20 2020 (r367682) +++ stable/12/lib/libbe/be.h Sat Nov 14 15:26:18 2020 (r367683) @@ -111,8 +111,8 @@ typedef enum { BE_MNT_DEEP = 1 << 1, } be_mount_opt_t; -int be_mount(libbe_handle_t *, char *, char *, int, char *); -int be_unmount(libbe_handle_t *, char *, int); +int be_mount(libbe_handle_t *, const char *, const char *, int, char *); +int be_unmount(libbe_handle_t *, const char *, int); int be_mounted_at(libbe_handle_t *, const char *path, nvlist_t *); /* Error related functions: be_error.c */ @@ -124,7 +124,7 @@ void libbe_print_on_error(libbe_handle_t *, bool); int be_root_concat(libbe_handle_t *, const char *, char *); int be_validate_name(libbe_handle_t * __unused, const char *); int be_validate_snap(libbe_handle_t *, const char *); -int be_exists(libbe_handle_t *, char *); +int be_exists(libbe_handle_t *, const char *); int be_export(libbe_handle_t *, const char *, int fd); int be_import(libbe_handle_t *, const char *, int fd); Modified: stable/12/lib/libbe/be_access.c ============================================================================== --- stable/12/lib/libbe/be_access.c Sat Nov 14 15:21:20 2020 (r367682) +++ stable/12/lib/libbe/be_access.c Sat Nov 14 15:26:18 2020 (r367683) @@ -232,8 +232,8 @@ be_mounted_at(libbe_handle_t *lbh, const char *path, n * usage */ int -be_mount(libbe_handle_t *lbh, char *bootenv, char *mountpoint, int flags, - char *result_loc) +be_mount(libbe_handle_t *lbh, const char *bootenv, const char *mountpoint, + int flags, char *result_loc) { char be[BE_MAXPATHLEN]; char mnt_temp[BE_MAXPATHLEN]; @@ -288,7 +288,7 @@ be_mount(libbe_handle_t *lbh, char *bootenv, char *mou * usage */ int -be_unmount(libbe_handle_t *lbh, char *bootenv, int flags) +be_unmount(libbe_handle_t *lbh, const char *bootenv, int flags) { int err; char be[BE_MAXPATHLEN]; Modified: stable/12/lib/libbe/be_info.c ============================================================================== --- stable/12/lib/libbe/be_info.c Sat Nov 14 15:21:20 2020 (r367682) +++ stable/12/lib/libbe/be_info.c Sat Nov 14 15:26:18 2020 (r367683) @@ -294,7 +294,7 @@ be_prop_list_free(nvlist_t *be_list) * Usage */ int -be_exists(libbe_handle_t *lbh, char *be) +be_exists(libbe_handle_t *lbh, const char *be) { char buf[BE_MAXPATHLEN]; Modified: stable/12/lib/libbe/libbe.3 ============================================================================== --- stable/12/lib/libbe/libbe.3 Sat Nov 14 15:21:20 2020 (r367682) +++ stable/12/lib/libbe/libbe.3 Sat Nov 14 15:26:18 2020 (r367683) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 16, 2019 +.Dd November 14, 2020 .Dt LIBBE 3 .Os .Sh NAME @@ -93,13 +93,13 @@ .\" BE_MNT_DEEP = 1 << 1, .\" } be_mount_opt_t .Ft int -.Fn be_mount "libbe_handle_t *hdl" "char *be_name" "char *mntpoint" "int flags" "char *result" +.Fn be_mount "libbe_handle_t *hdl" "const char *be_name" "const char *mntpoint" "int flags" "char *result" .Pp .Ft int .Fn be_mounted_at "libbe_handle_t *hdl" "const char *path" "nvlist_t *details" .Pp .Ft int -.Fn be_unmount "libbe_handle_t *hdl" "char *be_name" "int flags" +.Fn be_unmount "libbe_handle_t *hdl" "const char *be_name" "int flags" .Pp .Ft int .Fn libbe_errno "libbe_handle_t *hdl" @@ -120,7 +120,7 @@ .Fn be_validate_snap "libbe_handle_t *hdl" "const char *snap" .Pp .Ft int -.Fn be_exists "libbe_handle_t *hdl" "char *be_name" +.Fn be_exists "libbe_handle_t *hdl" "const char *be_name" .Pp .Ft int .Fn be_export "libbe_handle_t *hdl" "const char *be_name" "int fd" From owner-svn-src-stable@freebsd.org Sat Nov 14 15:33:40 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7579E2ED1F2; Sat, 14 Nov 2020 15:33:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYK9w2vd0z3KnS; Sat, 14 Nov 2020 15:33:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56B2C4808; Sat, 14 Nov 2020 15:33:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AEFXexj010281; Sat, 14 Nov 2020 15:33:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEFXedN010280; Sat, 14 Nov 2020 15:33:40 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011141533.0AEFXedN010280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 14 Nov 2020 15:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367684 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 367684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 15:33:40 -0000 Author: kevans Date: Sat Nov 14 15:33:39 2020 New Revision: 367684 URL: https://svnweb.freebsd.org/changeset/base/367684 Log: MFC r367604: umtx: drop incorrect timespec32 definition This works for amd64, but none others -- drop it, because we already have a proper definition in sys/compat/freebsd32/freebsd32.h that correctly uses time32_t. Modified: stable/12/sys/kern/kern_umtx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_umtx.c ============================================================================== --- stable/12/sys/kern/kern_umtx.c Sat Nov 14 15:26:18 2020 (r367683) +++ stable/12/sys/kern/kern_umtx.c Sat Nov 14 15:33:39 2020 (r367684) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef COMPAT_FREEBSD32 +#include #include #endif @@ -4121,11 +4122,6 @@ sys__umtx_op(struct thread *td, struct _umtx_op_args * } #ifdef COMPAT_FREEBSD32 - -struct timespec32 { - int32_t tv_sec; - int32_t tv_nsec; -}; struct umtx_time32 { struct timespec32 timeout; From owner-svn-src-stable@freebsd.org Sat Nov 14 20:44:34 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA02F465671; Sat, 14 Nov 2020 20:44:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYS4f5tVcz3vlp; Sat, 14 Nov 2020 20:44:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8655105A8; Sat, 14 Nov 2020 20:44:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AEKiYpt006551; Sat, 14 Nov 2020 20:44:34 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEKiYoK006550; Sat, 14 Nov 2020 20:44:34 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011142044.0AEKiYoK006550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 14 Nov 2020 20:44:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367698 - stable/12/release/packages X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/release/packages X-SVN-Commit-Revision: 367698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 20:44:35 -0000 Author: kevans Date: Sat Nov 14 20:44:34 2020 New Revision: 367698 URL: https://svnweb.freebsd.org/changeset/base/367698 Log: MFC r365883: pkgbase: use consistent annotation for object keys Everywhere else we use objects ("scripts", generally) we do specify the optional colon. Be consistent and do the same for directories. PR: 249273 Modified: stable/12/release/packages/runtime.ucl Directory Properties: stable/12/ (props changed) Modified: stable/12/release/packages/runtime.ucl ============================================================================== --- stable/12/release/packages/runtime.ucl Sat Nov 14 19:56:11 2020 (r367697) +++ stable/12/release/packages/runtime.ucl Sat Nov 14 20:44:34 2020 (r367698) @@ -30,7 +30,7 @@ deps: { version: "%VERSION%" } } -directories { +directories: { /dev = "y"; /tmp = "y"; } From owner-svn-src-stable@freebsd.org Sat Nov 14 20:45:12 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E56794651F7; Sat, 14 Nov 2020 20:45:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYS5N682Jz3wB0; Sat, 14 Nov 2020 20:45:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5BC510559; Sat, 14 Nov 2020 20:45:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AEKjC63006660; Sat, 14 Nov 2020 20:45:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEKjCKa006659; Sat, 14 Nov 2020 20:45:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202011142045.0AEKjCKa006659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 14 Nov 2020 20:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367699 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 367699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 20:45:13 -0000 Author: kevans Date: Sat Nov 14 20:45:12 2020 New Revision: 367699 URL: https://svnweb.freebsd.org/changeset/base/367699 Log: MFC r366231: Address whitespace nits in subr_rtc.c These were separated out from a nearby patch from Andrew Gierth. Modified: stable/12/sys/kern/subr_rtc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/subr_rtc.c ============================================================================== --- stable/12/sys/kern/subr_rtc.c Sat Nov 14 20:44:34 2020 (r367698) +++ stable/12/sys/kern/subr_rtc.c Sat Nov 14 20:45:12 2020 (r367699) @@ -164,7 +164,7 @@ clock_dbgprint_hdr(device_t dev, int rw) getnanotime(&now); device_printf(dev, "%s at ", (rw & CLOCK_DBG_READ) ? "read " : "write"); clock_print_ts(&now, 9); - printf(": "); + printf(": "); } void @@ -241,7 +241,7 @@ clock_register_flags(device_t clockdev, long resolutio } sx_xunlock(&rtc_list_lock); - device_printf(clockdev, + device_printf(clockdev, "registered as a time-of-day clock, resolution %d.%6.6ds\n", newrtc->resolution / 1000000, newrtc->resolution % 1000000); }