[xiang:xfs/end_cow 2/3] fs/xfs/libxfs/xfs_bmap.c:2459:13: warning: variable 'tmp_logflags' is used uninitialized whenever 'if' condition is false
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/xiang/linux.git xfs/end_cow
head: 20a175b5d3ff8ecb5be2451ce9dcdf82c4aa2afd
commit: 9d499a4f68f24f9dc7880e6f310c7488fe026610 [2/3] xfs: introduce xfs_bmap_update_extent_real()
config: arm-buildonly-randconfig-r001-20220214 (https://download.01.org/0day-ci/archive/20220214/202202141243.BLvjvLOP-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project ea071884b0cc7210b3cc5fe858f0e892a779a23b)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://git.kernel.org/pub/scm/linux/kernel/git/xiang/linux.git/commit/?i...
git remote add xiang https://git.kernel.org/pub/scm/linux/kernel/git/xiang/linux.git
git fetch --no-tags xiang xfs/end_cow
git checkout 9d499a4f68f24f9dc7880e6f310c7488fe026610
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash fs/xfs/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> fs/xfs/libxfs/xfs_bmap.c:2459:13: warning: variable 'tmp_logflags' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
} else if (!convert) {
^~~~~~~~
fs/xfs/libxfs/xfs_bmap.c:2464:16: note: uninitialized use occurs here
*logflagsp |= tmp_logflags;
^~~~~~~~~~~~
fs/xfs/libxfs/xfs_bmap.c:2459:9: note: remove the 'if' if its condition is always true
} else if (!convert) {
^~~~~~~~~~~~~~
fs/xfs/libxfs/xfs_bmap.c:1960:20: note: initialize the variable 'tmp_logflags' to silence this warning
int tmp_logflags; /* partial log flag return val */
^
= 0
1 warning generated.
vim +2459 fs/xfs/libxfs/xfs_bmap.c
1931
1932 /*
1933 * Update a real allocated extent (including converting an unwritten
1934 * allocation to a real allocation or vice versa.)
1935 */
1936 int /* error */
1937 xfs_bmap_update_extent_real(
1938 struct xfs_trans *tp,
1939 struct xfs_inode *ip, /* incore inode pointer */
1940 int whichfork,
1941 struct xfs_iext_cursor *icur,
1942 struct xfs_btree_cur **curp, /* if *curp is null, not a btree */
1943 struct xfs_bmbt_irec *new, /* new data to add to file extents */
1944 int *logflagsp, /* inode logging flags */
1945 bool convert)
1946 {
1947 struct xfs_btree_cur *cur; /* btree cursor */
1948 int error; /* error return value */
1949 int i; /* temp state */
1950 struct xfs_ifork *ifp; /* inode fork pointer */
1951 xfs_fileoff_t del_startoff; /* start offset of del entry */
1952 xfs_exntst_t del_state;
1953 xfs_fileoff_t new_endoff; /* end offset of new entry */
1954 struct xfs_bmbt_irec left, right; /* neighbor extent entries */
1955 struct xfs_bmbt_irec prev; /* previous old extent */
1956 int rval=0; /* return value (logging flags) */
1957 int state = xfs_bmap_fork_to_state(whichfork);
1958 struct xfs_mount *mp = ip->i_mount;
1959 struct xfs_bmbt_irec old;
1960 int tmp_logflags; /* partial log flag return val */
1961
1962 *logflagsp = 0;
1963
1964 cur = *curp;
1965 ifp = XFS_IFORK_PTR(ip, whichfork);
1966
1967 ASSERT(!isnullstartblock(new->br_startblock));
1968
1969 XFS_STATS_INC(mp, xs_add_exlist);
1970
1971 /*
1972 * Set up a bunch of variables to make the tests simpler.
1973 */
1974 error = 0;
1975 xfs_iext_get_extent(ifp, icur, &prev);
1976 ASSERT(!convert || new->br_state != prev.br_state);
1977 new_endoff = new->br_startoff + new->br_blockcount;
1978 del_startoff = prev.br_startblock +
1979 new->br_startoff - prev.br_startoff;
1980 del_state = prev.br_state;
1981 ASSERT(prev.br_startoff <= new->br_startoff);
1982 ASSERT(prev.br_startoff + prev.br_blockcount >= new_endoff);
1983
1984 /*
1985 * Set flags determining what part of the previous oldext allocation
1986 * extent is being replaced by a newext allocation.
1987 */
1988 if (prev.br_startoff == new->br_startoff)
1989 state |= BMAP_LEFT_FILLING;
1990 if (prev.br_startoff + prev.br_blockcount == new_endoff)
1991 state |= BMAP_RIGHT_FILLING;
1992
1993 /*
1994 * Check and set flags if this segment has a left neighbor.
1995 * Don't set contiguous if the combined extent would be too large.
1996 */
1997 if (xfs_iext_peek_prev_extent(ifp, icur, &left)) {
1998 state |= BMAP_LEFT_VALID;
1999 if (isnullstartblock(left.br_startblock))
2000 state |= BMAP_LEFT_DELAY;
2001 }
2002
2003 if ((state & BMAP_LEFT_VALID) && !(state & BMAP_LEFT_DELAY) &&
2004 left.br_startoff + left.br_blockcount == new->br_startoff &&
2005 left.br_startblock + left.br_blockcount == new->br_startblock &&
2006 left.br_state == new->br_state &&
2007 left.br_blockcount + new->br_blockcount <= MAXEXTLEN)
2008 state |= BMAP_LEFT_CONTIG;
2009
2010 /*
2011 * Check and set flags if this segment has a right neighbor.
2012 * Don't set contiguous if the combined extent would be too large.
2013 * Also check for all-three-contiguous being too large.
2014 */
2015 if (xfs_iext_peek_next_extent(ifp, icur, &right)) {
2016 state |= BMAP_RIGHT_VALID;
2017 if (isnullstartblock(right.br_startblock))
2018 state |= BMAP_RIGHT_DELAY;
2019 }
2020
2021 if ((state & BMAP_RIGHT_VALID) && !(state & BMAP_RIGHT_DELAY) &&
2022 new_endoff == right.br_startoff &&
2023 new->br_startblock + new->br_blockcount == right.br_startblock &&
2024 new->br_state == right.br_state &&
2025 new->br_blockcount + right.br_blockcount <= MAXEXTLEN &&
2026 ((state & (BMAP_LEFT_CONTIG | BMAP_LEFT_FILLING |
2027 BMAP_RIGHT_FILLING)) !=
2028 (BMAP_LEFT_CONTIG | BMAP_LEFT_FILLING |
2029 BMAP_RIGHT_FILLING) ||
2030 left.br_blockcount + new->br_blockcount + right.br_blockcount
2031 <= MAXEXTLEN))
2032 state |= BMAP_RIGHT_CONTIG;
2033
2034 /*
2035 * Switch out based on the FILLING and CONTIG state bits.
2036 */
2037 switch (state & (BMAP_LEFT_FILLING | BMAP_LEFT_CONTIG |
2038 BMAP_RIGHT_FILLING | BMAP_RIGHT_CONTIG)) {
2039 case BMAP_LEFT_FILLING | BMAP_LEFT_CONTIG |
2040 BMAP_RIGHT_FILLING | BMAP_RIGHT_CONTIG:
2041 /*
2042 * Setting all of a previous oldext extent to newext.
2043 * The left and right neighbors are both contiguous with new.
2044 */
2045 left.br_blockcount += prev.br_blockcount + right.br_blockcount;
2046
2047 xfs_iext_remove(ip, icur, state);
2048 xfs_iext_remove(ip, icur, state);
2049 xfs_iext_prev(ifp, icur);
2050 xfs_iext_update_extent(ip, state, icur, &left);
2051 ifp->if_nextents -= 2;
2052 if (cur == NULL) {
2053 rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
2054 } else {
2055 rval = XFS_ILOG_CORE;
2056 error = xfs_bmbt_lookup_eq(cur, &right, &i);
2057 if (error)
2058 goto done;
2059 if (XFS_IS_CORRUPT(mp, i != 1)) {
2060 error = -EFSCORRUPTED;
2061 goto done;
2062 }
2063 if ((error = xfs_btree_delete(cur, &i)))
2064 goto done;
2065 if (XFS_IS_CORRUPT(mp, i != 1)) {
2066 error = -EFSCORRUPTED;
2067 goto done;
2068 }
2069 if ((error = xfs_btree_decrement(cur, 0, &i)))
2070 goto done;
2071 if (XFS_IS_CORRUPT(mp, i != 1)) {
2072 error = -EFSCORRUPTED;
2073 goto done;
2074 }
2075 if ((error = xfs_btree_delete(cur, &i)))
2076 goto done;
2077 if (XFS_IS_CORRUPT(mp, i != 1)) {
2078 error = -EFSCORRUPTED;
2079 goto done;
2080 }
2081 if ((error = xfs_btree_decrement(cur, 0, &i)))
2082 goto done;
2083 if (XFS_IS_CORRUPT(mp, i != 1)) {
2084 error = -EFSCORRUPTED;
2085 goto done;
2086 }
2087 error = xfs_bmbt_update(cur, &left);
2088 if (error)
2089 goto done;
2090 }
2091 break;
2092
2093 case BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING | BMAP_LEFT_CONTIG:
2094 /*
2095 * Setting all of a previous oldext extent to newext.
2096 * The left neighbor is contiguous, the right is not.
2097 */
2098 left.br_blockcount += prev.br_blockcount;
2099
2100 xfs_iext_remove(ip, icur, state);
2101 xfs_iext_prev(ifp, icur);
2102 xfs_iext_update_extent(ip, state, icur, &left);
2103 ifp->if_nextents--;
2104 if (cur == NULL) {
2105 rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
2106 } else {
2107 rval = XFS_ILOG_CORE;
2108 error = xfs_bmbt_lookup_eq(cur, &prev, &i);
2109 if (error)
2110 goto done;
2111 if (XFS_IS_CORRUPT(mp, i != 1)) {
2112 error = -EFSCORRUPTED;
2113 goto done;
2114 }
2115 if ((error = xfs_btree_delete(cur, &i)))
2116 goto done;
2117 if (XFS_IS_CORRUPT(mp, i != 1)) {
2118 error = -EFSCORRUPTED;
2119 goto done;
2120 }
2121 if ((error = xfs_btree_decrement(cur, 0, &i)))
2122 goto done;
2123 if (XFS_IS_CORRUPT(mp, i != 1)) {
2124 error = -EFSCORRUPTED;
2125 goto done;
2126 }
2127 error = xfs_bmbt_update(cur, &left);
2128 if (error)
2129 goto done;
2130 }
2131 break;
2132
2133 case BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING | BMAP_RIGHT_CONTIG:
2134 /*
2135 * Setting all of a previous oldext extent to newext.
2136 * The right neighbor is contiguous, the left is not.
2137 */
2138 prev.br_blockcount += right.br_blockcount;
2139 prev.br_state = new->br_state;
2140 prev.br_startblock = new->br_startblock;
2141
2142 xfs_iext_next(ifp, icur);
2143 xfs_iext_remove(ip, icur, state);
2144 xfs_iext_prev(ifp, icur);
2145 xfs_iext_update_extent(ip, state, icur, &prev);
2146 ifp->if_nextents--;
2147
2148 if (cur == NULL) {
2149 rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
2150 } else {
2151 rval = XFS_ILOG_CORE;
2152 error = xfs_bmbt_lookup_eq(cur, &right, &i);
2153 if (error)
2154 goto done;
2155 if (XFS_IS_CORRUPT(mp, i != 1)) {
2156 error = -EFSCORRUPTED;
2157 goto done;
2158 }
2159 if ((error = xfs_btree_delete(cur, &i)))
2160 goto done;
2161 if (XFS_IS_CORRUPT(mp, i != 1)) {
2162 error = -EFSCORRUPTED;
2163 goto done;
2164 }
2165 if ((error = xfs_btree_decrement(cur, 0, &i)))
2166 goto done;
2167 if (XFS_IS_CORRUPT(mp, i != 1)) {
2168 error = -EFSCORRUPTED;
2169 goto done;
2170 }
2171 error = xfs_bmbt_update(cur, &prev);
2172 if (error)
2173 goto done;
2174 }
2175 break;
2176
2177 case BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING:
2178 /*
2179 * Setting all of a previous oldext extent to newext.
2180 * Neither the left nor right neighbors are contiguous with
2181 * the new one.
2182 */
2183 prev.br_startblock = new->br_startblock;
2184 prev.br_state = new->br_state;
2185 xfs_iext_update_extent(ip, state, icur, &prev);
2186
2187 if (cur == NULL) {
2188 rval = XFS_ILOG_DEXT;
2189 } else {
2190 rval = 0;
2191 error = xfs_bmbt_lookup_eq(cur, new, &i);
2192 if (error)
2193 goto done;
2194 if (XFS_IS_CORRUPT(mp, i != 1)) {
2195 error = -EFSCORRUPTED;
2196 goto done;
2197 }
2198 error = xfs_bmbt_update(cur, &prev);
2199 if (error)
2200 goto done;
2201 }
2202 break;
2203
2204 case BMAP_LEFT_FILLING | BMAP_LEFT_CONTIG:
2205 /*
2206 * Setting the first part of a previous oldext extent to newext.
2207 * The left neighbor is contiguous.
2208 */
2209 left.br_blockcount += new->br_blockcount;
2210
2211 old = prev;
2212 prev.br_startoff += new->br_blockcount;
2213 prev.br_startblock += new->br_blockcount;
2214 prev.br_blockcount -= new->br_blockcount;
2215
2216 xfs_iext_update_extent(ip, state, icur, &prev);
2217 xfs_iext_prev(ifp, icur);
2218 xfs_iext_update_extent(ip, state, icur, &left);
2219
2220 if (cur == NULL) {
2221 rval = XFS_ILOG_DEXT;
2222 } else {
2223 rval = 0;
2224 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2225 if (error)
2226 goto done;
2227 if (XFS_IS_CORRUPT(mp, i != 1)) {
2228 error = -EFSCORRUPTED;
2229 goto done;
2230 }
2231 error = xfs_bmbt_update(cur, &prev);
2232 if (error)
2233 goto done;
2234 error = xfs_btree_decrement(cur, 0, &i);
2235 if (error)
2236 goto done;
2237 error = xfs_bmbt_update(cur, &left);
2238 if (error)
2239 goto done;
2240 }
2241 break;
2242
2243 case BMAP_LEFT_FILLING:
2244 /*
2245 * Setting the first part of a previous oldext extent to newext.
2246 * The left neighbor is not contiguous.
2247 */
2248 old = prev;
2249 prev.br_startoff += new->br_blockcount;
2250 prev.br_startblock += new->br_blockcount;
2251 prev.br_blockcount -= new->br_blockcount;
2252
2253 xfs_iext_update_extent(ip, state, icur, &prev);
2254 xfs_iext_insert(ip, icur, new, state);
2255 ifp->if_nextents++;
2256
2257 if (cur == NULL) {
2258 rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
2259 } else {
2260 rval = XFS_ILOG_CORE;
2261 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2262 if (error)
2263 goto done;
2264 if (XFS_IS_CORRUPT(mp, i != 1)) {
2265 error = -EFSCORRUPTED;
2266 goto done;
2267 }
2268 error = xfs_bmbt_update(cur, &prev);
2269 if (error)
2270 goto done;
2271 cur->bc_rec.b = *new;
2272 if ((error = xfs_btree_insert(cur, &i)))
2273 goto done;
2274 if (XFS_IS_CORRUPT(mp, i != 1)) {
2275 error = -EFSCORRUPTED;
2276 goto done;
2277 }
2278 }
2279 break;
2280
2281 case BMAP_RIGHT_FILLING | BMAP_RIGHT_CONTIG:
2282 /*
2283 * Setting the last part of a previous oldext extent to newext.
2284 * The right neighbor is contiguous with the new allocation.
2285 */
2286 old = prev;
2287 prev.br_blockcount -= new->br_blockcount;
2288
2289 right.br_startoff = new->br_startoff;
2290 right.br_startblock = new->br_startblock;
2291 right.br_blockcount += new->br_blockcount;
2292
2293 xfs_iext_update_extent(ip, state, icur, &prev);
2294 xfs_iext_next(ifp, icur);
2295 xfs_iext_update_extent(ip, state, icur, &right);
2296
2297 if (cur == NULL) {
2298 rval = XFS_ILOG_DEXT;
2299 } else {
2300 rval = 0;
2301 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2302 if (error)
2303 goto done;
2304 if (XFS_IS_CORRUPT(mp, i != 1)) {
2305 error = -EFSCORRUPTED;
2306 goto done;
2307 }
2308 error = xfs_bmbt_update(cur, &prev);
2309 if (error)
2310 goto done;
2311 error = xfs_btree_increment(cur, 0, &i);
2312 if (error)
2313 goto done;
2314 error = xfs_bmbt_update(cur, &right);
2315 if (error)
2316 goto done;
2317 }
2318 break;
2319
2320 case BMAP_RIGHT_FILLING:
2321 /*
2322 * Setting the last part of a previous oldext extent to newext.
2323 * The right neighbor is not contiguous.
2324 */
2325 old = prev;
2326 prev.br_blockcount -= new->br_blockcount;
2327
2328 xfs_iext_update_extent(ip, state, icur, &prev);
2329 xfs_iext_next(ifp, icur);
2330 xfs_iext_insert(ip, icur, new, state);
2331 ifp->if_nextents++;
2332
2333 if (cur == NULL) {
2334 rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
2335 } else {
2336 rval = XFS_ILOG_CORE;
2337 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2338 if (error)
2339 goto done;
2340 if (XFS_IS_CORRUPT(mp, i != 1)) {
2341 error = -EFSCORRUPTED;
2342 goto done;
2343 }
2344 error = xfs_bmbt_update(cur, &prev);
2345 if (error)
2346 goto done;
2347 error = xfs_bmbt_lookup_eq(cur, new, &i);
2348 if (error)
2349 goto done;
2350 if (XFS_IS_CORRUPT(mp, i != 0)) {
2351 error = -EFSCORRUPTED;
2352 goto done;
2353 }
2354 if ((error = xfs_btree_insert(cur, &i)))
2355 goto done;
2356 if (XFS_IS_CORRUPT(mp, i != 1)) {
2357 error = -EFSCORRUPTED;
2358 goto done;
2359 }
2360 }
2361 break;
2362
2363 case 0:
2364 /*
2365 * Setting the middle part of a previous oldext extent to
2366 * newext. Contiguity is impossible here.
2367 * One extent becomes three extents.
2368 */
2369 old = prev;
2370 prev.br_blockcount = new->br_startoff - prev.br_startoff;
2371
2372 right.br_startoff = new_endoff;
2373 right.br_blockcount =
2374 old.br_startoff + old.br_blockcount - new_endoff;
2375 right.br_startblock = old.br_startblock + prev.br_blockcount +
2376 new->br_blockcount;
2377 right.br_state = prev.br_state;
2378
2379 xfs_iext_update_extent(ip, state, icur, &prev);
2380 xfs_iext_next(ifp, icur);
2381 xfs_iext_insert(ip, icur, &right, state);
2382 xfs_iext_insert(ip, icur, new, state);
2383 ifp->if_nextents += 2;
2384
2385 if (cur == NULL) {
2386 rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
2387 } else {
2388 rval = XFS_ILOG_CORE;
2389 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2390 if (error)
2391 goto done;
2392 if (XFS_IS_CORRUPT(mp, i != 1)) {
2393 error = -EFSCORRUPTED;
2394 goto done;
2395 }
2396 /* new right extent - oldext */
2397 error = xfs_bmbt_update(cur, &right);
2398 if (error)
2399 goto done;
2400 /* new left extent - oldext */
2401 cur->bc_rec.b = prev;
2402 if ((error = xfs_btree_insert(cur, &i)))
2403 goto done;
2404 if (XFS_IS_CORRUPT(mp, i != 1)) {
2405 error = -EFSCORRUPTED;
2406 goto done;
2407 }
2408 /*
2409 * Reset the cursor to the position of the new extent
2410 * we are about to insert as we can't trust it after
2411 * the previous insert.
2412 */
2413 error = xfs_bmbt_lookup_eq(cur, new, &i);
2414 if (error)
2415 goto done;
2416 if (XFS_IS_CORRUPT(mp, i != 0)) {
2417 error = -EFSCORRUPTED;
2418 goto done;
2419 }
2420 /* new middle extent - newext */
2421 if ((error = xfs_btree_insert(cur, &i)))
2422 goto done;
2423 if (XFS_IS_CORRUPT(mp, i != 1)) {
2424 error = -EFSCORRUPTED;
2425 goto done;
2426 }
2427 }
2428 break;
2429
2430 case BMAP_LEFT_FILLING | BMAP_LEFT_CONTIG | BMAP_RIGHT_CONTIG:
2431 case BMAP_RIGHT_FILLING | BMAP_LEFT_CONTIG | BMAP_RIGHT_CONTIG:
2432 case BMAP_LEFT_FILLING | BMAP_RIGHT_CONTIG:
2433 case BMAP_RIGHT_FILLING | BMAP_LEFT_CONTIG:
2434 case BMAP_LEFT_CONTIG | BMAP_RIGHT_CONTIG:
2435 case BMAP_LEFT_CONTIG:
2436 case BMAP_RIGHT_CONTIG:
2437 /*
2438 * These cases are all impossible.
2439 */
2440 ASSERT(0);
2441 }
2442
2443 /* update reverse mappings */
2444 if (!convert) {
2445 old = *new;
2446 old.br_startblock = del_startoff;
2447 old.br_state = del_state;
2448 xfs_rmap_unmap_extent(tp, ip, whichfork, &old);
2449 xfs_rmap_map_extent(tp, ip, whichfork, new);
2450 } else {
2451 xfs_rmap_convert_extent(mp, tp, ip, whichfork, new);
2452 }
2453
2454 /* convert to a btree or extents if necessary */
2455 if (xfs_bmap_needs_btree(ip, whichfork)) {
2456 ASSERT(cur == NULL);
2457 error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0,
2458 &tmp_logflags, whichfork);
> 2459 } else if (!convert) {
2460 error = xfs_bmap_btree_to_extents(tp, ip, cur,
2461 &tmp_logflags, whichfork);
2462 }
2463
2464 *logflagsp |= tmp_logflags;
2465 if (error)
2466 goto done;
2467
2468 /* clear out the allocated field, done with it now in any case. */
2469 if (cur) {
2470 cur->bc_ino.allocated = 0;
2471 *curp = cur;
2472 }
2473
2474 xfs_bmap_check_leaf_extents(*curp, ip, whichfork);
2475 done:
2476 *logflagsp |= rval;
2477 return error;
2478 }
2479
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[tip:locking/core 1/2] vmlinux.o: warning: objtool: mce_start()+0x69: call to ftrace_likely_update() leaves .noinstr.text section
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core
head: b008893b08dcc8c30d756db05c229a1491bcb992
commit: f5c54f77b07b278cfde4a654e111c39996ac8b5b [1/2] cpumask: Add a x86-specific cpumask_clear_cpu() helper
config: x86_64-randconfig-c002-20220214 (https://download.01.org/0day-ci/archive/20220214/202202141123.gFaMRI4k-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=f5...
git remote add tip https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
git fetch --no-tags tip locking/core
git checkout f5c54f77b07b278cfde4a654e111c39996ac8b5b
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
vmlinux.o: warning: objtool: __rdgsbase_inactive()+0x34: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: __wrgsbase_inactive()+0x39: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: fixup_bad_iret()+0x72: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: noist_exc_debug()+0x39: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: exc_nmi()+0x31: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: poke_int3_handler()+0x47: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: mce_check_crashing_cpu()+0x2c: call to ftrace_likely_update() leaves .noinstr.text section
>> vmlinux.o: warning: objtool: mce_start()+0x69: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: mce_read_aux()+0x41: call to mca_msr_reg() leaves .noinstr.text section
vmlinux.o: warning: objtool: do_machine_check()+0x49: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: exc_machine_check()+0x4f: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: rcu_dynticks_eqs_enter()+0x1a: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: rcu_dynticks_eqs_exit()+0x1a: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: rcu_eqs_exit.constprop.0()+0x37: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: rcu_eqs_enter.constprop.0()+0x3c: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: rcu_irq_exit()+0x34: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: rcu_nmi_enter()+0x2e: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: rcu_irq_enter()+0x34: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: irqentry_nmi_enter()+0x48: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: irqentry_nmi_exit()+0x73: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: enter_from_user_mode()+0x58: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: syscall_enter_from_user_mode()+0x5e: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: syscall_enter_from_user_mode_prepare()+0x58: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: irqentry_enter_from_user_mode()+0x58: call to ftrace_likely_update() leaves .noinstr.text section
vmlinux.o: warning: objtool: irqentry_exit()+0x3c: call to ftrace_likely_update() leaves .noinstr.text section
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
drivers/gpu/drm/tegra/vic.c:326:12: error: 'vic_runtime_suspend' defined but not used
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 754e0b0e35608ed5206d6a67a791563c631cec07
commit: 1e15f5b911d6a1b4a5677e88527610946bd314dd drm/tegra: vic: Stop channel on suspend
date: 9 weeks ago
config: arm-randconfig-r016-20220213 (https://download.01.org/0day-ci/archive/20220214/202202141114.QJqYTOhN-lk...)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 1e15f5b911d6a1b4a5677e88527610946bd314dd
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash drivers/gpu/drm/tegra/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/gpu/drm/tegra/vic.c:326:12: error: 'vic_runtime_suspend' defined but not used [-Werror=unused-function]
326 | static int vic_runtime_suspend(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/tegra/vic.c:292:12: error: 'vic_runtime_resume' defined but not used [-Werror=unused-function]
292 | static int vic_runtime_resume(struct device *dev)
| ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/vic_runtime_suspend +326 drivers/gpu/drm/tegra/vic.c
77a0b09dd993c8 Thierry Reding 2019-02-01 290
9916612311a777 Mikko Perttunen 2021-06-10 291
9916612311a777 Mikko Perttunen 2021-06-10 @292 static int vic_runtime_resume(struct device *dev)
0ae797a8ba05a2 Arto Merilainen 2016-12-14 293 {
9916612311a777 Mikko Perttunen 2021-06-10 294 struct vic *vic = dev_get_drvdata(dev);
0ae797a8ba05a2 Arto Merilainen 2016-12-14 295 int err;
0ae797a8ba05a2 Arto Merilainen 2016-12-14 296
9916612311a777 Mikko Perttunen 2021-06-10 297 err = clk_prepare_enable(vic->clk);
0ae797a8ba05a2 Arto Merilainen 2016-12-14 298 if (err < 0)
0ae797a8ba05a2 Arto Merilainen 2016-12-14 299 return err;
0ae797a8ba05a2 Arto Merilainen 2016-12-14 300
9916612311a777 Mikko Perttunen 2021-06-10 301 usleep_range(10, 20);
9916612311a777 Mikko Perttunen 2021-06-10 302
9916612311a777 Mikko Perttunen 2021-06-10 303 err = reset_control_deassert(vic->rst);
9916612311a777 Mikko Perttunen 2021-06-10 304 if (err < 0)
9916612311a777 Mikko Perttunen 2021-06-10 305 goto disable;
9916612311a777 Mikko Perttunen 2021-06-10 306
9916612311a777 Mikko Perttunen 2021-06-10 307 usleep_range(10, 20);
9916612311a777 Mikko Perttunen 2021-06-10 308
77a0b09dd993c8 Thierry Reding 2019-02-01 309 err = vic_load_firmware(vic);
77a0b09dd993c8 Thierry Reding 2019-02-01 310 if (err < 0)
9916612311a777 Mikko Perttunen 2021-06-10 311 goto assert;
77a0b09dd993c8 Thierry Reding 2019-02-01 312
0ae797a8ba05a2 Arto Merilainen 2016-12-14 313 err = vic_boot(vic);
77a0b09dd993c8 Thierry Reding 2019-02-01 314 if (err < 0)
9916612311a777 Mikko Perttunen 2021-06-10 315 goto assert;
0ae797a8ba05a2 Arto Merilainen 2016-12-14 316
9916612311a777 Mikko Perttunen 2021-06-10 317 return 0;
9916612311a777 Mikko Perttunen 2021-06-10 318
9916612311a777 Mikko Perttunen 2021-06-10 319 assert:
9916612311a777 Mikko Perttunen 2021-06-10 320 reset_control_assert(vic->rst);
9916612311a777 Mikko Perttunen 2021-06-10 321 disable:
9916612311a777 Mikko Perttunen 2021-06-10 322 clk_disable_unprepare(vic->clk);
9916612311a777 Mikko Perttunen 2021-06-10 323 return err;
0ae797a8ba05a2 Arto Merilainen 2016-12-14 324 }
0ae797a8ba05a2 Arto Merilainen 2016-12-14 325
9916612311a777 Mikko Perttunen 2021-06-10 @326 static int vic_runtime_suspend(struct device *dev)
9916612311a777 Mikko Perttunen 2021-06-10 327 {
9916612311a777 Mikko Perttunen 2021-06-10 328 struct vic *vic = dev_get_drvdata(dev);
9916612311a777 Mikko Perttunen 2021-06-10 329 int err;
9916612311a777 Mikko Perttunen 2021-06-10 330
1e15f5b911d6a1 Dmitry Osipenko 2021-12-01 331 host1x_channel_stop(vic->channel);
1e15f5b911d6a1 Dmitry Osipenko 2021-12-01 332
9916612311a777 Mikko Perttunen 2021-06-10 333 err = reset_control_assert(vic->rst);
9916612311a777 Mikko Perttunen 2021-06-10 334 if (err < 0)
9916612311a777 Mikko Perttunen 2021-06-10 335 return err;
9916612311a777 Mikko Perttunen 2021-06-10 336
9916612311a777 Mikko Perttunen 2021-06-10 337 usleep_range(2000, 4000);
9916612311a777 Mikko Perttunen 2021-06-10 338
9916612311a777 Mikko Perttunen 2021-06-10 339 clk_disable_unprepare(vic->clk);
9916612311a777 Mikko Perttunen 2021-06-10 340
0ae797a8ba05a2 Arto Merilainen 2016-12-14 341 return 0;
9916612311a777 Mikko Perttunen 2021-06-10 342 }
77a0b09dd993c8 Thierry Reding 2019-02-01 343
:::::: The code at line 326 was first introduced by commit
:::::: 9916612311a777cdf15a53491243589ea4fcc4e7 drm/tegra: Boot VIC during runtime PM resume
:::::: TO: Mikko Perttunen <mperttunen(a)nvidia.com>
:::::: CC: Thierry Reding <treding(a)nvidia.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[hnaz-mm:master 221/304] mm/migrate_device.c:236:3: error: implicit declaration of function 'flush_tlb_range'
by kernel test robot
tree: https://github.com/hnaz/linux-mm master
head: 31e523f69aa14a1f4ba298c63034d8dc62c4aae7
commit: 4dde2cf1e43ead900b72f260528ed42c2a13e266 [221/304] mm: build migrate_vma_* for all configs with ZONE_DEVICE support
config: x86_64-randconfig-a006-20220214 (https://download.01.org/0day-ci/archive/20220214/202202141000.yiusACzP-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project ea071884b0cc7210b3cc5fe858f0e892a779a23b)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/hnaz/linux-mm/commit/4dde2cf1e43ead900b72f260528ed42c2...
git remote add hnaz-mm https://github.com/hnaz/linux-mm
git fetch --no-tags hnaz-mm master
git checkout 4dde2cf1e43ead900b72f260528ed42c2a13e266
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> mm/migrate_device.c:236:3: error: implicit declaration of function 'flush_tlb_range' [-Werror,-Wimplicit-function-declaration]
flush_tlb_range(walk->vma, start, end);
^
mm/migrate_device.c:236:3: note: did you mean 'flush_cache_range'?
include/asm-generic/cacheflush.h:33:20: note: 'flush_cache_range' declared here
static inline void flush_cache_range(struct vm_area_struct *vma,
^
1 error generated.
vim +/flush_tlb_range +236 mm/migrate_device.c
85854f9b0061e4 Christoph Hellwig 2022-02-11 54
85854f9b0061e4 Christoph Hellwig 2022-02-11 55 static int migrate_vma_collect_pmd(pmd_t *pmdp,
85854f9b0061e4 Christoph Hellwig 2022-02-11 56 unsigned long start,
85854f9b0061e4 Christoph Hellwig 2022-02-11 57 unsigned long end,
85854f9b0061e4 Christoph Hellwig 2022-02-11 58 struct mm_walk *walk)
85854f9b0061e4 Christoph Hellwig 2022-02-11 59 {
85854f9b0061e4 Christoph Hellwig 2022-02-11 60 struct migrate_vma *migrate = walk->private;
85854f9b0061e4 Christoph Hellwig 2022-02-11 61 struct vm_area_struct *vma = walk->vma;
85854f9b0061e4 Christoph Hellwig 2022-02-11 62 struct mm_struct *mm = vma->vm_mm;
85854f9b0061e4 Christoph Hellwig 2022-02-11 63 unsigned long addr = start, unmapped = 0;
85854f9b0061e4 Christoph Hellwig 2022-02-11 64 spinlock_t *ptl;
85854f9b0061e4 Christoph Hellwig 2022-02-11 65 pte_t *ptep;
85854f9b0061e4 Christoph Hellwig 2022-02-11 66
85854f9b0061e4 Christoph Hellwig 2022-02-11 67 again:
85854f9b0061e4 Christoph Hellwig 2022-02-11 68 if (pmd_none(*pmdp))
85854f9b0061e4 Christoph Hellwig 2022-02-11 69 return migrate_vma_collect_hole(start, end, -1, walk);
85854f9b0061e4 Christoph Hellwig 2022-02-11 70
85854f9b0061e4 Christoph Hellwig 2022-02-11 71 if (pmd_trans_huge(*pmdp)) {
85854f9b0061e4 Christoph Hellwig 2022-02-11 72 struct page *page;
85854f9b0061e4 Christoph Hellwig 2022-02-11 73
85854f9b0061e4 Christoph Hellwig 2022-02-11 74 ptl = pmd_lock(mm, pmdp);
85854f9b0061e4 Christoph Hellwig 2022-02-11 75 if (unlikely(!pmd_trans_huge(*pmdp))) {
85854f9b0061e4 Christoph Hellwig 2022-02-11 76 spin_unlock(ptl);
85854f9b0061e4 Christoph Hellwig 2022-02-11 77 goto again;
85854f9b0061e4 Christoph Hellwig 2022-02-11 78 }
85854f9b0061e4 Christoph Hellwig 2022-02-11 79
85854f9b0061e4 Christoph Hellwig 2022-02-11 80 page = pmd_page(*pmdp);
85854f9b0061e4 Christoph Hellwig 2022-02-11 81 if (is_huge_zero_page(page)) {
85854f9b0061e4 Christoph Hellwig 2022-02-11 82 spin_unlock(ptl);
85854f9b0061e4 Christoph Hellwig 2022-02-11 83 split_huge_pmd(vma, pmdp, addr);
85854f9b0061e4 Christoph Hellwig 2022-02-11 84 if (pmd_trans_unstable(pmdp))
85854f9b0061e4 Christoph Hellwig 2022-02-11 85 return migrate_vma_collect_skip(start, end,
85854f9b0061e4 Christoph Hellwig 2022-02-11 86 walk);
85854f9b0061e4 Christoph Hellwig 2022-02-11 87 } else {
85854f9b0061e4 Christoph Hellwig 2022-02-11 88 int ret;
85854f9b0061e4 Christoph Hellwig 2022-02-11 89
85854f9b0061e4 Christoph Hellwig 2022-02-11 90 get_page(page);
85854f9b0061e4 Christoph Hellwig 2022-02-11 91 spin_unlock(ptl);
85854f9b0061e4 Christoph Hellwig 2022-02-11 92 if (unlikely(!trylock_page(page)))
85854f9b0061e4 Christoph Hellwig 2022-02-11 93 return migrate_vma_collect_skip(start, end,
85854f9b0061e4 Christoph Hellwig 2022-02-11 94 walk);
85854f9b0061e4 Christoph Hellwig 2022-02-11 95 ret = split_huge_page(page);
85854f9b0061e4 Christoph Hellwig 2022-02-11 96 unlock_page(page);
85854f9b0061e4 Christoph Hellwig 2022-02-11 97 put_page(page);
85854f9b0061e4 Christoph Hellwig 2022-02-11 98 if (ret)
85854f9b0061e4 Christoph Hellwig 2022-02-11 99 return migrate_vma_collect_skip(start, end,
85854f9b0061e4 Christoph Hellwig 2022-02-11 100 walk);
85854f9b0061e4 Christoph Hellwig 2022-02-11 101 if (pmd_none(*pmdp))
85854f9b0061e4 Christoph Hellwig 2022-02-11 102 return migrate_vma_collect_hole(start, end, -1,
85854f9b0061e4 Christoph Hellwig 2022-02-11 103 walk);
85854f9b0061e4 Christoph Hellwig 2022-02-11 104 }
85854f9b0061e4 Christoph Hellwig 2022-02-11 105 }
85854f9b0061e4 Christoph Hellwig 2022-02-11 106
85854f9b0061e4 Christoph Hellwig 2022-02-11 107 if (unlikely(pmd_bad(*pmdp)))
85854f9b0061e4 Christoph Hellwig 2022-02-11 108 return migrate_vma_collect_skip(start, end, walk);
85854f9b0061e4 Christoph Hellwig 2022-02-11 109
85854f9b0061e4 Christoph Hellwig 2022-02-11 110 ptep = pte_offset_map_lock(mm, pmdp, addr, &ptl);
85854f9b0061e4 Christoph Hellwig 2022-02-11 111 arch_enter_lazy_mmu_mode();
85854f9b0061e4 Christoph Hellwig 2022-02-11 112
85854f9b0061e4 Christoph Hellwig 2022-02-11 113 for (; addr < end; addr += PAGE_SIZE, ptep++) {
85854f9b0061e4 Christoph Hellwig 2022-02-11 114 unsigned long mpfn = 0, pfn;
85854f9b0061e4 Christoph Hellwig 2022-02-11 115 struct page *page;
85854f9b0061e4 Christoph Hellwig 2022-02-11 116 swp_entry_t entry;
85854f9b0061e4 Christoph Hellwig 2022-02-11 117 pte_t pte;
85854f9b0061e4 Christoph Hellwig 2022-02-11 118
85854f9b0061e4 Christoph Hellwig 2022-02-11 119 pte = *ptep;
85854f9b0061e4 Christoph Hellwig 2022-02-11 120
85854f9b0061e4 Christoph Hellwig 2022-02-11 121 if (pte_none(pte)) {
85854f9b0061e4 Christoph Hellwig 2022-02-11 122 if (vma_is_anonymous(vma)) {
85854f9b0061e4 Christoph Hellwig 2022-02-11 123 mpfn = MIGRATE_PFN_MIGRATE;
85854f9b0061e4 Christoph Hellwig 2022-02-11 124 migrate->cpages++;
85854f9b0061e4 Christoph Hellwig 2022-02-11 125 }
85854f9b0061e4 Christoph Hellwig 2022-02-11 126 goto next;
85854f9b0061e4 Christoph Hellwig 2022-02-11 127 }
85854f9b0061e4 Christoph Hellwig 2022-02-11 128
85854f9b0061e4 Christoph Hellwig 2022-02-11 129 if (!pte_present(pte)) {
85854f9b0061e4 Christoph Hellwig 2022-02-11 130 /*
85854f9b0061e4 Christoph Hellwig 2022-02-11 131 * Only care about unaddressable device page special
85854f9b0061e4 Christoph Hellwig 2022-02-11 132 * page table entry. Other special swap entries are not
85854f9b0061e4 Christoph Hellwig 2022-02-11 133 * migratable, and we ignore regular swapped page.
85854f9b0061e4 Christoph Hellwig 2022-02-11 134 */
85854f9b0061e4 Christoph Hellwig 2022-02-11 135 entry = pte_to_swp_entry(pte);
85854f9b0061e4 Christoph Hellwig 2022-02-11 136 if (!is_device_private_entry(entry))
85854f9b0061e4 Christoph Hellwig 2022-02-11 137 goto next;
85854f9b0061e4 Christoph Hellwig 2022-02-11 138
85854f9b0061e4 Christoph Hellwig 2022-02-11 139 page = pfn_swap_entry_to_page(entry);
85854f9b0061e4 Christoph Hellwig 2022-02-11 140 if (!(migrate->flags &
85854f9b0061e4 Christoph Hellwig 2022-02-11 141 MIGRATE_VMA_SELECT_DEVICE_PRIVATE) ||
85854f9b0061e4 Christoph Hellwig 2022-02-11 142 page->pgmap->owner != migrate->pgmap_owner)
85854f9b0061e4 Christoph Hellwig 2022-02-11 143 goto next;
85854f9b0061e4 Christoph Hellwig 2022-02-11 144
85854f9b0061e4 Christoph Hellwig 2022-02-11 145 mpfn = migrate_pfn(page_to_pfn(page)) |
85854f9b0061e4 Christoph Hellwig 2022-02-11 146 MIGRATE_PFN_MIGRATE;
85854f9b0061e4 Christoph Hellwig 2022-02-11 147 if (is_writable_device_private_entry(entry))
85854f9b0061e4 Christoph Hellwig 2022-02-11 148 mpfn |= MIGRATE_PFN_WRITE;
85854f9b0061e4 Christoph Hellwig 2022-02-11 149 } else {
85854f9b0061e4 Christoph Hellwig 2022-02-11 150 if (!(migrate->flags & MIGRATE_VMA_SELECT_SYSTEM))
85854f9b0061e4 Christoph Hellwig 2022-02-11 151 goto next;
85854f9b0061e4 Christoph Hellwig 2022-02-11 152 pfn = pte_pfn(pte);
85854f9b0061e4 Christoph Hellwig 2022-02-11 153 if (is_zero_pfn(pfn)) {
85854f9b0061e4 Christoph Hellwig 2022-02-11 154 mpfn = MIGRATE_PFN_MIGRATE;
85854f9b0061e4 Christoph Hellwig 2022-02-11 155 migrate->cpages++;
85854f9b0061e4 Christoph Hellwig 2022-02-11 156 goto next;
85854f9b0061e4 Christoph Hellwig 2022-02-11 157 }
85854f9b0061e4 Christoph Hellwig 2022-02-11 158 page = vm_normal_page(migrate->vma, addr, pte);
85854f9b0061e4 Christoph Hellwig 2022-02-11 159 mpfn = migrate_pfn(pfn) | MIGRATE_PFN_MIGRATE;
85854f9b0061e4 Christoph Hellwig 2022-02-11 160 mpfn |= pte_write(pte) ? MIGRATE_PFN_WRITE : 0;
85854f9b0061e4 Christoph Hellwig 2022-02-11 161 }
85854f9b0061e4 Christoph Hellwig 2022-02-11 162
85854f9b0061e4 Christoph Hellwig 2022-02-11 163 /* FIXME support THP */
85854f9b0061e4 Christoph Hellwig 2022-02-11 164 if (!page || !page->mapping || PageTransCompound(page)) {
85854f9b0061e4 Christoph Hellwig 2022-02-11 165 mpfn = 0;
85854f9b0061e4 Christoph Hellwig 2022-02-11 166 goto next;
85854f9b0061e4 Christoph Hellwig 2022-02-11 167 }
85854f9b0061e4 Christoph Hellwig 2022-02-11 168
85854f9b0061e4 Christoph Hellwig 2022-02-11 169 /*
85854f9b0061e4 Christoph Hellwig 2022-02-11 170 * By getting a reference on the page we pin it and that blocks
85854f9b0061e4 Christoph Hellwig 2022-02-11 171 * any kind of migration. Side effect is that it "freezes" the
85854f9b0061e4 Christoph Hellwig 2022-02-11 172 * pte.
85854f9b0061e4 Christoph Hellwig 2022-02-11 173 *
85854f9b0061e4 Christoph Hellwig 2022-02-11 174 * We drop this reference after isolating the page from the lru
85854f9b0061e4 Christoph Hellwig 2022-02-11 175 * for non device page (device page are not on the lru and thus
85854f9b0061e4 Christoph Hellwig 2022-02-11 176 * can't be dropped from it).
85854f9b0061e4 Christoph Hellwig 2022-02-11 177 */
85854f9b0061e4 Christoph Hellwig 2022-02-11 178 get_page(page);
85854f9b0061e4 Christoph Hellwig 2022-02-11 179
85854f9b0061e4 Christoph Hellwig 2022-02-11 180 /*
85854f9b0061e4 Christoph Hellwig 2022-02-11 181 * Optimize for the common case where page is only mapped once
85854f9b0061e4 Christoph Hellwig 2022-02-11 182 * in one process. If we can lock the page, then we can safely
85854f9b0061e4 Christoph Hellwig 2022-02-11 183 * set up a special migration page table entry now.
85854f9b0061e4 Christoph Hellwig 2022-02-11 184 */
85854f9b0061e4 Christoph Hellwig 2022-02-11 185 if (trylock_page(page)) {
85854f9b0061e4 Christoph Hellwig 2022-02-11 186 pte_t swp_pte;
85854f9b0061e4 Christoph Hellwig 2022-02-11 187
85854f9b0061e4 Christoph Hellwig 2022-02-11 188 migrate->cpages++;
85854f9b0061e4 Christoph Hellwig 2022-02-11 189 ptep_get_and_clear(mm, addr, ptep);
85854f9b0061e4 Christoph Hellwig 2022-02-11 190
85854f9b0061e4 Christoph Hellwig 2022-02-11 191 /* Setup special migration page table entry */
85854f9b0061e4 Christoph Hellwig 2022-02-11 192 if (mpfn & MIGRATE_PFN_WRITE)
85854f9b0061e4 Christoph Hellwig 2022-02-11 193 entry = make_writable_migration_entry(
85854f9b0061e4 Christoph Hellwig 2022-02-11 194 page_to_pfn(page));
85854f9b0061e4 Christoph Hellwig 2022-02-11 195 else
85854f9b0061e4 Christoph Hellwig 2022-02-11 196 entry = make_readable_migration_entry(
85854f9b0061e4 Christoph Hellwig 2022-02-11 197 page_to_pfn(page));
85854f9b0061e4 Christoph Hellwig 2022-02-11 198 swp_pte = swp_entry_to_pte(entry);
85854f9b0061e4 Christoph Hellwig 2022-02-11 199 if (pte_present(pte)) {
85854f9b0061e4 Christoph Hellwig 2022-02-11 200 if (pte_soft_dirty(pte))
85854f9b0061e4 Christoph Hellwig 2022-02-11 201 swp_pte = pte_swp_mksoft_dirty(swp_pte);
85854f9b0061e4 Christoph Hellwig 2022-02-11 202 if (pte_uffd_wp(pte))
85854f9b0061e4 Christoph Hellwig 2022-02-11 203 swp_pte = pte_swp_mkuffd_wp(swp_pte);
85854f9b0061e4 Christoph Hellwig 2022-02-11 204 } else {
85854f9b0061e4 Christoph Hellwig 2022-02-11 205 if (pte_swp_soft_dirty(pte))
85854f9b0061e4 Christoph Hellwig 2022-02-11 206 swp_pte = pte_swp_mksoft_dirty(swp_pte);
85854f9b0061e4 Christoph Hellwig 2022-02-11 207 if (pte_swp_uffd_wp(pte))
85854f9b0061e4 Christoph Hellwig 2022-02-11 208 swp_pte = pte_swp_mkuffd_wp(swp_pte);
85854f9b0061e4 Christoph Hellwig 2022-02-11 209 }
85854f9b0061e4 Christoph Hellwig 2022-02-11 210 set_pte_at(mm, addr, ptep, swp_pte);
85854f9b0061e4 Christoph Hellwig 2022-02-11 211
85854f9b0061e4 Christoph Hellwig 2022-02-11 212 /*
85854f9b0061e4 Christoph Hellwig 2022-02-11 213 * This is like regular unmap: we remove the rmap and
85854f9b0061e4 Christoph Hellwig 2022-02-11 214 * drop page refcount. Page won't be freed, as we took
85854f9b0061e4 Christoph Hellwig 2022-02-11 215 * a reference just above.
85854f9b0061e4 Christoph Hellwig 2022-02-11 216 */
85854f9b0061e4 Christoph Hellwig 2022-02-11 217 page_remove_rmap(page, vma, false);
85854f9b0061e4 Christoph Hellwig 2022-02-11 218 put_page(page);
85854f9b0061e4 Christoph Hellwig 2022-02-11 219
85854f9b0061e4 Christoph Hellwig 2022-02-11 220 if (pte_present(pte))
85854f9b0061e4 Christoph Hellwig 2022-02-11 221 unmapped++;
85854f9b0061e4 Christoph Hellwig 2022-02-11 222 } else {
85854f9b0061e4 Christoph Hellwig 2022-02-11 223 put_page(page);
85854f9b0061e4 Christoph Hellwig 2022-02-11 224 mpfn = 0;
85854f9b0061e4 Christoph Hellwig 2022-02-11 225 }
85854f9b0061e4 Christoph Hellwig 2022-02-11 226
85854f9b0061e4 Christoph Hellwig 2022-02-11 227 next:
85854f9b0061e4 Christoph Hellwig 2022-02-11 228 migrate->dst[migrate->npages] = 0;
85854f9b0061e4 Christoph Hellwig 2022-02-11 229 migrate->src[migrate->npages++] = mpfn;
85854f9b0061e4 Christoph Hellwig 2022-02-11 230 }
85854f9b0061e4 Christoph Hellwig 2022-02-11 231 arch_leave_lazy_mmu_mode();
85854f9b0061e4 Christoph Hellwig 2022-02-11 232 pte_unmap_unlock(ptep - 1, ptl);
85854f9b0061e4 Christoph Hellwig 2022-02-11 233
85854f9b0061e4 Christoph Hellwig 2022-02-11 234 /* Only flush the TLB if we actually modified any entries */
85854f9b0061e4 Christoph Hellwig 2022-02-11 235 if (unmapped)
85854f9b0061e4 Christoph Hellwig 2022-02-11 @236 flush_tlb_range(walk->vma, start, end);
85854f9b0061e4 Christoph Hellwig 2022-02-11 237
85854f9b0061e4 Christoph Hellwig 2022-02-11 238 return 0;
85854f9b0061e4 Christoph Hellwig 2022-02-11 239 }
85854f9b0061e4 Christoph Hellwig 2022-02-11 240
:::::: The code at line 236 was first introduced by commit
:::::: 85854f9b0061e47f43a835799780054c7f9c03b6 mm: move the migrate_vma_* device migration code into it's own file
:::::: TO: Christoph Hellwig <hch(a)lst.de>
:::::: CC: Johannes Weiner <hannes(a)cmpxchg.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[peterz-queue:x86/wip.ibt 14/15] include/linux/kern_levels.h:5:18: error: format '%d' expects argument of type 'int', but argument 2 has type 'long int'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/wip.ibt
head: ede73fa4e97e8f275401a989b8d9df192a2c3ec4
commit: 8c06569295c8df00e797ca406fc6b0919a473ee5 [14/15] x86/alternative: Use .ibt_endbr_sites to seal indirect calls
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220214/202202141009.F1MCaPz3-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?...
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue x86/wip.ibt
git checkout 8c06569295c8df00e797ca406fc6b0919a473ee5
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/kernel.h:29,
from arch/x86/include/asm/percpu.h:27,
from arch/x86/include/asm/current.h:6,
from arch/x86/include/asm/processor.h:17,
from arch/x86/include/asm/timex.h:5,
from include/linux/timex.h:65,
from include/linux/time32.h:13,
from include/linux/time.h:60,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from arch/x86/kernel/alternative.c:4:
arch/x86/kernel/alternative.c: In function 'apply_ibt_endbr':
>> include/linux/kern_levels.h:5:18: error: format '%d' expects argument of type 'int', but argument 2 has type 'long int' [-Werror=format=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
include/linux/printk.h:418:11: note: in definition of macro 'printk_index_wrap'
418 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~
include/linux/printk.h:489:2: note: in expansion of macro 'printk'
489 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~
include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
| ^~~~~~~~
include/linux/printk.h:489:9: note: in expansion of macro 'KERN_ERR'
489 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~
arch/x86/kernel/alternative.c:531:2: note: in expansion of macro 'pr_err'
531 | pr_err("XXX IBT: %d\n", end-start);
| ^~~~~~
arch/x86/kernel/alternative.c:531:20: note: format string is defined here
531 | pr_err("XXX IBT: %d\n", end-start);
| ~^
| |
| int
| %ld
cc1: all warnings being treated as errors
vim +5 include/linux/kern_levels.h
314ba3520e513a Joe Perches 2012-07-30 4
04d2c8c83d0e3a Joe Perches 2012-07-30 @5 #define KERN_SOH "\001" /* ASCII Start Of Header */
04d2c8c83d0e3a Joe Perches 2012-07-30 6 #define KERN_SOH_ASCII '\001'
04d2c8c83d0e3a Joe Perches 2012-07-30 7
:::::: The code at line 5 was first introduced by commit
:::::: 04d2c8c83d0e3ac5f78aeede51babb3236200112 printk: convert the format for KERN_<LEVEL> to a 2 byte pattern
:::::: TO: Joe Perches <joe(a)perches.com>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week