[mhiramat:kprobes/kretprobe-stackfix 8/10] kernel/kprobes.c:1901:32: warning: passing argument 2 of 'instruction_pointer_set' makes integer from pointer without a cast
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git kprobes/kretprobe-stackfix
head: 6e2b8966c87adc1be0fb4a386fb24ae438f4cb79
commit: 663b1b4caed9e4b0ad1be80b30851e68fb9a40eb [8/10] kprobes: Setup instruction pointer in __kretprobe_trampoline_handler
config: parisc-randconfig-r006-20210316 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.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/mhiramat/linux.git/commit...
git remote add mhiramat https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git
git fetch --no-tags mhiramat kprobes/kretprobe-stackfix
git checkout 663b1b4caed9e4b0ad1be80b30851e68fb9a40eb
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc
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 >>):
kernel/kprobes.c:1847:12: warning: no previous prototype for 'kprobe_exceptions_notify' [-Wmissing-prototypes]
1847 | int __weak kprobe_exceptions_notify(struct notifier_block *self,
| ^~~~~~~~~~~~~~~~~~~~~~~~
kernel/kprobes.c: In function '__kretprobe_trampoline_handler':
>> kernel/kprobes.c:1901:32: warning: passing argument 2 of 'instruction_pointer_set' makes integer from pointer without a cast [-Wint-conversion]
1901 | instruction_pointer_set(regs, correct_ret_addr);
| ^~~~~~~~~~~~~~~~
| |
| kprobe_opcode_t * {aka unsigned int *}
In file included from arch/parisc/include/asm/processor.h:18,
from arch/parisc/include/asm/spinlock.h:7,
from arch/parisc/include/asm/atomic.h:22,
from include/linux/atomic.h:7,
from arch/parisc/include/asm/bitops.h:13,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/kprobes.h:21,
from kernel/kprobes.c:21:
arch/parisc/include/asm/ptrace.h:29:21: note: expected 'long unsigned int' but argument is of type 'kprobe_opcode_t *' {aka 'unsigned int *'}
29 | unsigned long val)
| ~~~~~~~~~~~~~~^~~
vim +/instruction_pointer_set +1901 kernel/kprobes.c
1846
> 1847 int __weak kprobe_exceptions_notify(struct notifier_block *self,
1848 unsigned long val, void *data)
1849 {
1850 return NOTIFY_DONE;
1851 }
1852 NOKPROBE_SYMBOL(kprobe_exceptions_notify);
1853
1854 static struct notifier_block kprobe_exceptions_nb = {
1855 .notifier_call = kprobe_exceptions_notify,
1856 .priority = 0x7fffffff /* we need to be notified first */
1857 };
1858
1859 #ifdef CONFIG_KRETPROBES
1860
1861 /* This assumes the tsk is current or the task which is not running. */
1862 unsigned long kretprobe_find_ret_addr(struct task_struct *tsk,
1863 struct llist_node **cur)
1864 {
1865 struct kretprobe_instance *ri = NULL;
1866 struct llist_node *node = *cur;
1867
1868 if (!node)
1869 node = tsk->kretprobe_instances.first;
1870 else
1871 node = node->next;
1872
1873 while (node) {
1874 ri = container_of(node, struct kretprobe_instance, llist);
1875 if (ri->ret_addr != kretprobe_trampoline_addr()) {
1876 *cur = node;
1877 return (unsigned long)ri->ret_addr;
1878 }
1879 node = node->next;
1880 }
1881 return 0;
1882 }
1883 NOKPROBE_SYMBOL(kretprobe_find_ret_addr);
1884
1885 unsigned long __kretprobe_trampoline_handler(struct pt_regs *regs,
1886 void *frame_pointer)
1887 {
1888 kprobe_opcode_t *correct_ret_addr = NULL;
1889 struct kretprobe_instance *ri = NULL;
1890 struct llist_node *first, *node = NULL;
1891 struct kretprobe *rp;
1892
1893 /* Find correct address and all nodes for this frame. */
1894 correct_ret_addr = (void *)kretprobe_find_ret_addr(current, &node);
1895 if (!correct_ret_addr) {
1896 pr_err("Oops! Kretprobe fails to find correct return address.\n");
1897 BUG_ON(1);
1898 }
1899
1900 /* Set the instruction pointer to the correct address */
> 1901 instruction_pointer_set(regs, correct_ret_addr);
1902
1903 /* Run them. */
1904 first = current->kretprobe_instances.first;
1905 while (first) {
1906 ri = container_of(first, struct kretprobe_instance, llist);
1907
1908 BUG_ON(ri->fp != frame_pointer);
1909
1910 rp = get_kretprobe(ri);
1911 if (rp && rp->handler) {
1912 struct kprobe *prev = kprobe_running();
1913
1914 __this_cpu_write(current_kprobe, &rp->kp);
1915 ri->ret_addr = correct_ret_addr;
1916 rp->handler(ri, regs);
1917 __this_cpu_write(current_kprobe, prev);
1918 }
1919 if (first == node)
1920 break;
1921
1922 first = first->next;
1923 }
1924
1925 /* Unlink all nodes for this frame. */
1926 first = current->kretprobe_instances.first;
1927 current->kretprobe_instances.first = node->next;
1928 node->next = NULL;
1929
1930 /* Recycle them. */
1931 while (first) {
1932 ri = container_of(first, struct kretprobe_instance, llist);
1933 first = first->next;
1934
1935 recycle_rp_inst(ri);
1936 }
1937
1938 return (unsigned long)correct_ret_addr;
1939 }
1940 NOKPROBE_SYMBOL(__kretprobe_trampoline_handler)
1941
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[PATCH] memblock: fix section mismatch warning again
by Mike Rapoport
From: Mike Rapoport <rppt(a)linux.ibm.com>
Commit 34dc2efb39a2 ("memblock: fix section mismatch warning") marked
memblock_bottom_up() and memblock_set_bottom_up() as __init, but they could
be referenced from non-init functions like memblock_find_in_range_node() on
architectures that enable CONFIG_ARCH_KEEP_MEMBLOCK.
For such builds kernel test robot reports:
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> WARNING: modpost: vmlinux.o(.text+0x74fea4): Section mismatch in reference from the function memblock_find_in_range_node() to the function .init.text:memblock_bottom_up()
The function memblock_find_in_range_node() references
the function __init memblock_bottom_up().
This is often because memblock_find_in_range_node lacks a __init
annotation or the annotation of memblock_bottom_up is wrong.
Replace __init annotations with __init_memblock annotations so that the
appropriate section will be selected depending on
CONFIG_ARCH_KEEP_MEMBLOCK.
Link: https://lore.kernel.org/lkml/202103160133.UzhgY0wt-lkp@intel.com
Fixes: 34dc2efb39a2 ("memblock: fix section mismatch warning")
Signed-off-by: Mike Rapoport <rppt(a)linux.ibm.com>
Reported-by: kernel test robot <lkp(a)intel.com>
Reviewed-by: Arnd Bergmann <arnd(a)arndb.de>
---
@Andrew, please let me know if you'd prefer this merged via memblock tree.
include/linux/memblock.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index d13e3cd938b4..5984fff3f175 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -460,7 +460,7 @@ static inline void memblock_free_late(phys_addr_t base, phys_addr_t size)
/*
* Set the allocation direction to bottom-up or top-down.
*/
-static inline __init void memblock_set_bottom_up(bool enable)
+static inline __init_memblock void memblock_set_bottom_up(bool enable)
{
memblock.bottom_up = enable;
}
@@ -470,7 +470,7 @@ static inline __init void memblock_set_bottom_up(bool enable)
* if this is true, that said, memblock will allocate memory
* in bottom-up direction.
*/
-static inline __init bool memblock_bottom_up(void)
+static inline __init_memblock bool memblock_bottom_up(void)
{
return memblock.bottom_up;
}
--
2.28.0
1 year, 6 months
Re: [PATCH net] net: dsa: Centralize validation of VLAN configuration
by kernel test robot
Hi Tobias,
I love your patch! Perhaps something to improve:
[auto build test WARNING on net/master]
url: https://github.com/0day-ci/linux/commits/Tobias-Waldekranz/net-dsa-Centra...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git a25f822285420486f5da434efc8d940d42a83bce
config: powerpc-randconfig-r006-20210316 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 50c7504a93fdb90c26870db8c8ea7add895c7725)
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 powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# https://github.com/0day-ci/linux/commit/9a35f7597b676a3bdaa9dd753e0a7d11f...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Tobias-Waldekranz/net-dsa-Centralize-validation-of-VLAN-configuration/20210316-035618
git checkout 9a35f7597b676a3bdaa9dd753e0a7d11fb132ed5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
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 >>):
>> net/dsa/slave.c:2074:12: warning: variable 'err' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
else if (is_vlan_dev(info->upper_dev))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/dsa/slave.c:2077:7: note: uninitialized use occurs here
if (err)
^~~
net/dsa/slave.c:2074:8: note: remove the 'if' if its condition is always true
else if (is_vlan_dev(info->upper_dev))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/dsa/slave.c:2070:10: note: initialize the variable 'err' to silence this warning
int err;
^
= 0
1 warning generated.
vim +2074 net/dsa/slave.c
2059
2060 static int dsa_slave_netdevice_event(struct notifier_block *nb,
2061 unsigned long event, void *ptr)
2062 {
2063 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
2064
2065 switch (event) {
2066 case NETDEV_PRECHANGEUPPER: {
2067 struct netdev_notifier_changeupper_info *info = ptr;
2068 struct dsa_switch *ds;
2069 struct dsa_port *dp;
2070 int err;
2071
2072 if (is_vlan_dev(dev))
2073 err = dsa_prevent_bridging_8021q_upper(dev, ptr);
> 2074 else if (is_vlan_dev(info->upper_dev))
2075 err = dsa_slave_check_8021q_upper(dev, ptr);
2076
2077 if (err)
2078 return err;
2079
2080 if (!dsa_slave_dev_check(dev))
2081 return NOTIFY_DONE;
2082
2083 dp = dsa_slave_to_port(dev);
2084 ds = dp->ds;
2085
2086 if (ds->ops->port_prechangeupper) {
2087 err = ds->ops->port_prechangeupper(ds, dp->index, info);
2088 if (err)
2089 return notifier_from_errno(err);
2090 }
2091 break;
2092 }
2093 case NETDEV_CHANGEUPPER:
2094 if (dsa_slave_dev_check(dev))
2095 return dsa_slave_changeupper(dev, ptr);
2096
2097 if (netif_is_lag_master(dev))
2098 return dsa_slave_lag_changeupper(dev, ptr);
2099
2100 break;
2101 case NETDEV_CHANGELOWERSTATE: {
2102 struct netdev_notifier_changelowerstate_info *info = ptr;
2103 struct dsa_port *dp;
2104 int err;
2105
2106 if (!dsa_slave_dev_check(dev))
2107 break;
2108
2109 dp = dsa_slave_to_port(dev);
2110
2111 err = dsa_port_lag_change(dp, info->lower_state_info);
2112 return notifier_from_errno(err);
2113 }
2114 case NETDEV_GOING_DOWN: {
2115 struct dsa_port *dp, *cpu_dp;
2116 struct dsa_switch_tree *dst;
2117 LIST_HEAD(close_list);
2118
2119 if (!netdev_uses_dsa(dev))
2120 return NOTIFY_DONE;
2121
2122 cpu_dp = dev->dsa_ptr;
2123 dst = cpu_dp->ds->dst;
2124
2125 list_for_each_entry(dp, &dst->ports, list) {
2126 if (!dsa_is_user_port(dp->ds, dp->index))
2127 continue;
2128
2129 list_add(&dp->slave->close_list, &close_list);
2130 }
2131
2132 dev_close_many(&close_list, true);
2133
2134 return NOTIFY_OK;
2135 }
2136 default:
2137 break;
2138 }
2139
2140 return NOTIFY_DONE;
2141 }
2142
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[mhiramat:kprobes/kretprobe-stackfix 9/10] arch/x86/kernel/unwind_orc.c:547:18: error: 'struct unwind_state' has no member named 'kr_iter'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git kprobes/kretprobe-stackfix
head: 6e2b8966c87adc1be0fb4a386fb24ae438f4cb79
commit: 3f16730e94371a16e7c5490095b089cb198440e6 [9/10] x86/unwind/orc,kprobes: Fixup kretprobe trampoline entry
config: x86_64-randconfig-m001-20210316 (attached as .config)
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/mhiramat/linux.git/commit...
git remote add mhiramat https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git
git fetch --no-tags mhiramat kprobes/kretprobe-stackfix
git checkout 3f16730e94371a16e7c5490095b089cb198440e6
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
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 >>):
arch/x86/kernel/unwind_orc.c: In function 'unwind_next_frame':
>> arch/x86/kernel/unwind_orc.c:547:18: error: 'struct unwind_state' has no member named 'kr_iter'
547 | &state->kr_iter);
| ^~
vim +547 arch/x86/kernel/unwind_orc.c
417
418 bool unwind_next_frame(struct unwind_state *state)
419 {
420 unsigned long ip_p, sp, tmp, orig_ip = state->ip, prev_sp = state->sp;
421 enum stack_type prev_type = state->stack_info.type;
422 struct orc_entry *orc;
423 bool indirect = false;
424
425 if (unwind_done(state))
426 return false;
427
428 /* Don't let modules unload while we're reading their ORC data. */
429 preempt_disable();
430
431 /* End-of-stack check for user tasks: */
432 if (state->regs && user_mode(state->regs))
433 goto the_end;
434
435 /*
436 * Find the orc_entry associated with the text address.
437 *
438 * For a call frame (as opposed to a signal frame), state->ip points to
439 * the instruction after the call. That instruction's stack layout
440 * could be different from the call instruction's layout, for example
441 * if the call was to a noreturn function. So get the ORC data for the
442 * call instruction itself.
443 */
444 orc = orc_find(state->signal ? state->ip : state->ip - 1);
445 if (!orc) {
446 /*
447 * As a fallback, try to assume this code uses a frame pointer.
448 * This is useful for generated code, like BPF, which ORC
449 * doesn't know about. This is just a guess, so the rest of
450 * the unwind is no longer considered reliable.
451 */
452 orc = &orc_fp_entry;
453 state->error = true;
454 }
455
456 /* End-of-stack check for kernel threads: */
457 if (orc->sp_reg == ORC_REG_UNDEFINED) {
458 if (!orc->end)
459 goto err;
460
461 goto the_end;
462 }
463
464 /* Find the previous frame's stack: */
465 switch (orc->sp_reg) {
466 case ORC_REG_SP:
467 sp = state->sp + orc->sp_offset;
468 break;
469
470 case ORC_REG_BP:
471 sp = state->bp + orc->sp_offset;
472 break;
473
474 case ORC_REG_SP_INDIRECT:
475 sp = state->sp;
476 indirect = true;
477 break;
478
479 case ORC_REG_BP_INDIRECT:
480 sp = state->bp + orc->sp_offset;
481 indirect = true;
482 break;
483
484 case ORC_REG_R10:
485 if (!get_reg(state, offsetof(struct pt_regs, r10), &sp)) {
486 orc_warn_current("missing R10 value at %pB\n",
487 (void *)state->ip);
488 goto err;
489 }
490 break;
491
492 case ORC_REG_R13:
493 if (!get_reg(state, offsetof(struct pt_regs, r13), &sp)) {
494 orc_warn_current("missing R13 value at %pB\n",
495 (void *)state->ip);
496 goto err;
497 }
498 break;
499
500 case ORC_REG_DI:
501 if (!get_reg(state, offsetof(struct pt_regs, di), &sp)) {
502 orc_warn_current("missing RDI value at %pB\n",
503 (void *)state->ip);
504 goto err;
505 }
506 break;
507
508 case ORC_REG_DX:
509 if (!get_reg(state, offsetof(struct pt_regs, dx), &sp)) {
510 orc_warn_current("missing DX value at %pB\n",
511 (void *)state->ip);
512 goto err;
513 }
514 break;
515
516 default:
517 orc_warn("unknown SP base reg %d at %pB\n",
518 orc->sp_reg, (void *)state->ip);
519 goto err;
520 }
521
522 if (indirect) {
523 if (!deref_stack_reg(state, sp, &sp))
524 goto err;
525
526 if (orc->sp_reg == ORC_REG_SP_INDIRECT)
527 sp += orc->sp_offset;
528 }
529
530 /* Find IP, SP and possibly regs: */
531 switch (orc->type) {
532 case UNWIND_HINT_TYPE_CALL:
533 ip_p = sp - sizeof(long);
534
535 if (!deref_stack_reg(state, ip_p, &state->ip))
536 goto err;
537
538 state->ip = ftrace_graph_ret_addr(state->task, &state->graph_idx,
539 state->ip, (void *)ip_p);
540 /*
541 * When the unwinder finds the kretprobe_trampoline instead of
542 * the real return address on stack, find the correct return
543 * address from task->kretprobe_instances list.
544 */
545 if (is_kretprobe_trampoline(state->ip))
546 state->ip = kretprobe_find_ret_addr(state->task,
> 547 &state->kr_iter);
548
549 state->sp = sp;
550 state->regs = NULL;
551 state->prev_regs = NULL;
552 state->signal = false;
553 break;
554
555 case UNWIND_HINT_TYPE_REGS:
556 if (!deref_stack_regs(state, sp, &state->ip, &state->sp)) {
557 orc_warn_current("can't access registers at %pB\n",
558 (void *)orig_ip);
559 goto err;
560 }
561
562 state->regs = (struct pt_regs *)sp;
563 state->prev_regs = NULL;
564 state->full_regs = true;
565 state->signal = true;
566 break;
567
568 case UNWIND_HINT_TYPE_REGS_PARTIAL:
569 if (!deref_stack_iret_regs(state, sp, &state->ip, &state->sp)) {
570 orc_warn_current("can't access iret registers at %pB\n",
571 (void *)orig_ip);
572 goto err;
573 }
574
575 if (state->full_regs)
576 state->prev_regs = state->regs;
577 state->regs = (void *)sp - IRET_FRAME_OFFSET;
578 state->full_regs = false;
579 state->signal = true;
580 break;
581
582 default:
583 orc_warn("unknown .orc_unwind entry type %d at %pB\n",
584 orc->type, (void *)orig_ip);
585 goto err;
586 }
587
588 /* Find BP: */
589 switch (orc->bp_reg) {
590 case ORC_REG_UNDEFINED:
591 if (get_reg(state, offsetof(struct pt_regs, bp), &tmp))
592 state->bp = tmp;
593 break;
594
595 case ORC_REG_PREV_SP:
596 if (!deref_stack_reg(state, sp + orc->bp_offset, &state->bp))
597 goto err;
598 break;
599
600 case ORC_REG_BP:
601 if (!deref_stack_reg(state, state->bp + orc->bp_offset, &state->bp))
602 goto err;
603 break;
604
605 default:
606 orc_warn("unknown BP base reg %d for ip %pB\n",
607 orc->bp_reg, (void *)orig_ip);
608 goto err;
609 }
610
611 /* Prevent a recursive loop due to bad ORC data: */
612 if (state->stack_info.type == prev_type &&
613 on_stack(&state->stack_info, (void *)state->sp, sizeof(long)) &&
614 state->sp <= prev_sp) {
615 orc_warn_current("stack going in the wrong direction? at %pB\n",
616 (void *)orig_ip);
617 goto err;
618 }
619
620 preempt_enable();
621 return true;
622
623 err:
624 state->error = true;
625
626 the_end:
627 preempt_enable();
628 state->stack_info.type = STACK_TYPE_UNKNOWN;
629 return false;
630 }
631 EXPORT_SYMBOL_GPL(unwind_next_frame);
632
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[ti:ti-linux-5.4.y 4081/13420] drivers/dma-buf/heaps/carveout-heap.c:249:5: warning: no previous prototype for function 'carveout_dma_heap_export'
by kernel test robot
tree: git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-linux-5.4.y
head: b26f403d01870360392f2fe778304d3a8cba0bef
commit: d5ba15e3647df3f2bece61d36cca4a536939623b [4081/13420] dma-buf: heaps: Add Carveout heap to dmabuf heaps
config: x86_64-randconfig-r036-20210316 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 50c7504a93fdb90c26870db8c8ea7add895c7725)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
git fetch --no-tags ti ti-linux-5.4.y
git checkout d5ba15e3647df3f2bece61d36cca4a536939623b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
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 >>):
>> drivers/dma-buf/heaps/carveout-heap.c:249:5: warning: no previous prototype for function 'carveout_dma_heap_export' [-Wmissing-prototypes]
int carveout_dma_heap_export(phys_addr_t base, size_t size, const char *name)
^
drivers/dma-buf/heaps/carveout-heap.c:249:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int carveout_dma_heap_export(phys_addr_t base, size_t size, const char *name)
^
static
1 warning generated.
vim +/carveout_dma_heap_export +249 drivers/dma-buf/heaps/carveout-heap.c
248
> 249 int carveout_dma_heap_export(phys_addr_t base, size_t size, const char *name)
250 {
251 struct carveout_dma_heap *carveout_dma_heap;
252 struct dma_heap_export_info exp_info;
253 int ret;
254
255 carveout_dma_heap = kzalloc(sizeof(*carveout_dma_heap), GFP_KERNEL);
256 if (!carveout_dma_heap)
257 return -ENOMEM;
258
259 carveout_dma_heap->pool = gen_pool_create(PAGE_SHIFT, NUMA_NO_NODE);
260 if (IS_ERR(carveout_dma_heap->pool)) {
261 pr_err("Carveout Heap: Could not create memory pool\n");
262 ret = PTR_ERR(carveout_dma_heap->pool);
263 goto free_carveout_dma_heap;
264 }
265 ret = gen_pool_add(carveout_dma_heap->pool, base, size, NUMA_NO_NODE);
266 if (ret) {
267 pr_err("Carveout Heap: Could not add memory to pool\n");
268 goto free_pool;
269 }
270
271 exp_info.name = name;
272 exp_info.ops = &carveout_dma_heap_ops;
273 exp_info.priv = carveout_dma_heap;
274 carveout_dma_heap->heap = dma_heap_add(&exp_info);
275 if (IS_ERR(carveout_dma_heap->heap)) {
276 pr_err("Carveout Heap: Could not add DMA-Heap\n");
277 ret = PTR_ERR(carveout_dma_heap->heap);
278 goto free_pool;
279 }
280
281 pr_info("Carveout Heap: Exported %zu MiB at %pa\n", size / SZ_1M, &base);
282
283 return 0;
284
285 free_pool:
286 gen_pool_destroy(carveout_dma_heap->pool);
287 free_carveout_dma_heap:
288 kfree(carveout_dma_heap);
289 return ret;
290 }
291
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH] mm: Move page_mapping_file to pagemap.h
by kernel test robot
Hi "Matthew,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on hnaz-linux-mm/master]
url: https://github.com/0day-ci/linux/commits/Matthew-Wilcox-Oracle/mm-Move-pa...
base: https://github.com/hnaz/linux-mm master
config: mips-randconfig-r032-20210316 (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.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://github.com/0day-ci/linux/commit/5f7b112de945843f38fbf9f602dd54701...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Matthew-Wilcox-Oracle/mm-Move-page_mapping_file-to-pagemap-h/20210316-221138
git checkout 5f7b112de945843f38fbf9f602dd547010e8b8d0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
arch/mips/mm/cache.c: In function '__flush_dcache_page':
>> arch/mips/mm/cache.c:85:34: error: implicit declaration of function 'page_mapping_file'; did you mean 'page_mapping'? [-Werror=implicit-function-declaration]
85 | struct address_space *mapping = page_mapping_file(page);
| ^~~~~~~~~~~~~~~~~
| page_mapping
>> arch/mips/mm/cache.c:85:34: warning: initialization of 'struct address_space *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
arch/mips/mm/cache.c: At top level:
arch/mips/mm/cache.c:129:6: warning: no previous prototype for '__update_cache' [-Wmissing-prototypes]
129 | void __update_cache(unsigned long address, pte_t pte)
| ^~~~~~~~~~~~~~
arch/mips/mm/cache.c:236:12: warning: no previous prototype for '__uncached_access' [-Wmissing-prototypes]
236 | int __weak __uncached_access(struct file *file, unsigned long addr)
| ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +85 arch/mips/mm/cache.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 82
^1da177e4c3f41 Linus Torvalds 2005-04-16 83 void __flush_dcache_page(struct page *page)
^1da177e4c3f41 Linus Torvalds 2005-04-16 84 {
cb9f753a3731f7 Huang Ying 2018-04-05 @85 struct address_space *mapping = page_mapping_file(page);
^1da177e4c3f41 Linus Torvalds 2005-04-16 86 unsigned long addr;
^1da177e4c3f41 Linus Torvalds 2005-04-16 87
^1da177e4c3f41 Linus Torvalds 2005-04-16 88 if (mapping && !mapping_mapped(mapping)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 89 SetPageDcacheDirty(page);
^1da177e4c3f41 Linus Torvalds 2005-04-16 90 return;
^1da177e4c3f41 Linus Torvalds 2005-04-16 91 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 92
^1da177e4c3f41 Linus Torvalds 2005-04-16 93 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 94 * We could delay the flush for the !page_mapping case too. But that
^1da177e4c3f41 Linus Torvalds 2005-04-16 95 * case is for exec env/arg pages and those are %99 certainly going to
^1da177e4c3f41 Linus Torvalds 2005-04-16 96 * get faulted into the tlb (and thus flushed) anyways.
^1da177e4c3f41 Linus Torvalds 2005-04-16 97 */
234859e49a1532 Paul Burton 2016-03-01 98 if (PageHighMem(page))
234859e49a1532 Paul Burton 2016-03-01 99 addr = (unsigned long)kmap_atomic(page);
234859e49a1532 Paul Burton 2016-03-01 100 else
^1da177e4c3f41 Linus Torvalds 2005-04-16 101 addr = (unsigned long)page_address(page);
234859e49a1532 Paul Burton 2016-03-01 102
^1da177e4c3f41 Linus Torvalds 2005-04-16 103 flush_data_cache_page(addr);
234859e49a1532 Paul Burton 2016-03-01 104
234859e49a1532 Paul Burton 2016-03-01 105 if (PageHighMem(page))
abca2500c0c1b2 Ira Weiny 2020-06-04 106 kunmap_atomic((void *)addr);
^1da177e4c3f41 Linus Torvalds 2005-04-16 107 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 108
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[ti:ti-linux-5.4.y 9094/13420] drivers/mtd/spi-nor/spi-nor.c:5721:18: error: implicit declaration of function 'of_read_number'
by kernel test robot
Hi Pratyush,
FYI, the error/warning still remains.
tree: git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-linux-5.4.y
head: b26f403d01870360392f2fe778304d3a8cba0bef
commit: 6f9db649f76819bbe6b9ee1a7758717d0f2e01ee [9094/13420] HACK: mtd: spi-nor: Look for PHY pattern partition
config: arm-randconfig-r026-20210316 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 50c7504a93fdb90c26870db8c8ea7add895c7725)
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
git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
git fetch --no-tags ti ti-linux-5.4.y
git checkout 6f9db649f76819bbe6b9ee1a7758717d0f2e01ee
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
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/mtd/spi-nor/spi-nor.c:5721:18: error: implicit declaration of function 'of_read_number' [-Werror,-Wimplicit-function-declaration]
op.addr.val = of_read_number(reg, a_cells);
^
1 error generated.
vim +/of_read_number +5721 drivers/mtd/spi-nor/spi-nor.c
5556
5557 int spi_nor_scan(struct spi_nor *nor, const char *name,
5558 const struct spi_nor_hwcaps *hwcaps)
5559 {
5560 const struct flash_info *info;
5561 struct device *dev = nor->dev;
5562 struct mtd_info *mtd = &nor->mtd;
5563 struct device_node *np = spi_nor_get_flash_node(nor);
5564 struct device_node *child;
5565 struct spi_nor_flash_parameter *params = &nor->params;
5566 struct spi_mem_op op;
5567 int ret;
5568 int i;
5569
5570 ret = spi_nor_check(nor);
5571 if (ret)
5572 return ret;
5573
5574 /* Reset SPI protocol for all commands. */
5575 nor->reg_proto = SNOR_PROTO_1_1_1;
5576 nor->read_proto = SNOR_PROTO_1_1_1;
5577 nor->write_proto = SNOR_PROTO_1_1_1;
5578
5579 /*
5580 * We need the bounce buffer early to read/write registers when going
5581 * through the spi-mem layer (buffers have to be DMA-able).
5582 * For spi-mem drivers, we'll reallocate a new buffer if
5583 * nor->page_size turns out to be greater than PAGE_SIZE (which
5584 * shouldn't happen before long since NOR pages are usually less
5585 * than 1KB) after spi_nor_scan() returns.
5586 */
5587 nor->bouncebuf_size = PAGE_SIZE;
5588 nor->bouncebuf = devm_kmalloc(dev, nor->bouncebuf_size,
5589 GFP_KERNEL);
5590 if (!nor->bouncebuf)
5591 return -ENOMEM;
5592
5593 info = spi_nor_get_flash_info(nor, name);
5594 if (IS_ERR(info))
5595 return PTR_ERR(info);
5596
5597 nor->info = info;
5598
5599 spi_nor_debugfs_init(nor, info);
5600
5601 mutex_init(&nor->lock);
5602
5603 /*
5604 * Make sure the XSR_RDY flag is set before calling
5605 * spi_nor_wait_till_ready(). Xilinx S3AN share MFR
5606 * with Atmel spi-nor
5607 */
5608 if (info->flags & SPI_NOR_XSR_RDY)
5609 nor->flags |= SNOR_F_READY_XSR_RDY;
5610
5611 if (info->flags & SPI_NOR_HAS_LOCK)
5612 nor->flags |= SNOR_F_HAS_LOCK;
5613
5614 /*
5615 * Atmel, SST, Intel/Numonyx, and others serial NOR tend to power up
5616 * with the software protection bits set.
5617 */
5618 if (JEDEC_MFR(nor->info) == SNOR_MFR_ATMEL ||
5619 JEDEC_MFR(nor->info) == SNOR_MFR_INTEL ||
5620 JEDEC_MFR(nor->info) == SNOR_MFR_SST ||
5621 nor->info->flags & SPI_NOR_HAS_LOCK)
5622 nor->clear_sr_bp = spi_nor_clear_sr_bp;
5623
5624 /* Init flash parameters based on flash_info struct and SFDP */
5625 spi_nor_init_params(nor);
5626
5627 if (!mtd->name)
5628 mtd->name = dev_name(dev);
5629 mtd->priv = nor;
5630 mtd->type = MTD_NORFLASH;
5631 mtd->writesize = 1;
5632 mtd->flags = MTD_CAP_NORFLASH;
5633 mtd->size = params->size;
5634 mtd->_erase = spi_nor_erase;
5635 mtd->_read = spi_nor_read;
5636 mtd->_suspend = spi_nor_suspend;
5637 mtd->_resume = spi_nor_resume;
5638
5639 if (nor->params.locking_ops) {
5640 mtd->_lock = spi_nor_lock;
5641 mtd->_unlock = spi_nor_unlock;
5642 mtd->_is_locked = spi_nor_is_locked;
5643 }
5644
5645 /* sst nor chips use AAI word program */
5646 if (info->flags & SST_WRITE)
5647 mtd->_write = sst_write;
5648 else
5649 mtd->_write = spi_nor_write;
5650
5651 if (info->flags & USE_FSR)
5652 nor->flags |= SNOR_F_USE_FSR;
5653 if (info->flags & SPI_NOR_HAS_TB)
5654 nor->flags |= SNOR_F_HAS_SR_TB;
5655 if (info->flags & NO_CHIP_ERASE)
5656 nor->flags |= SNOR_F_NO_OP_CHIP_ERASE;
5657 if (info->flags & USE_CLSR)
5658 nor->flags |= SNOR_F_USE_CLSR;
5659
5660 if (info->flags & SPI_NOR_NO_ERASE)
5661 mtd->flags |= MTD_NO_ERASE;
5662
5663 mtd->dev.parent = dev;
5664 nor->page_size = params->page_size;
5665 mtd->writebufsize = nor->page_size;
5666
5667 if (of_property_read_bool(np, "broken-flash-reset"))
5668 nor->flags |= SNOR_F_BROKEN_RESET;
5669
5670 /*
5671 * Configure the SPI memory:
5672 * - select op codes for (Fast) Read, Page Program and Sector Erase.
5673 * - set the number of dummy cycles (mode cycles + wait states).
5674 * - set the SPI protocols for register and memory accesses.
5675 */
5676 ret = spi_nor_setup(nor, hwcaps);
5677 if (ret)
5678 return ret;
5679
5680 if (info->flags & SPI_NOR_4B_OPCODES)
5681 nor->flags |= SNOR_F_4B_OPCODES;
5682
5683 ret = spi_nor_set_addr_width(nor);
5684 if (ret)
5685 return ret;
5686
5687 /* Send all the required SPI flash commands to initialize device */
5688 ret = spi_nor_init(nor);
5689 if (ret)
5690 return ret;
5691
5692 /*
5693 * Find out if a PHY pattern partition is present.
5694 *
5695 * TODO: Teach the mtd core to find the partition for us so we don't
5696 * have to repeat the parsing logic here that mtd already has.
5697 */
5698 child = NULL;
5699 do {
5700 int len;
5701 char *label = NULL;
5702
5703 child = of_get_next_child(np, child);
5704 if (child)
5705 label = (char *)of_get_property(child, "label", &len);
5706
5707 if (label && !strcmp(label, "ospi.phypattern")) {
5708 const __be32 *reg;
5709 int a_cells, s_cells;
5710
5711 reg = of_get_property(child, "reg", &len);
5712 if (!reg)
5713 continue;
5714
5715 a_cells = of_n_addr_cells(child);
5716 s_cells = of_n_size_cells(child);
5717 if (len / 4 != a_cells + s_cells)
5718 continue;
5719
5720 op = spi_nor_spimem_read_op(nor);
> 5721 op.addr.val = of_read_number(reg, a_cells);
5722 spi_mem_set_calibration_read_op(nor->spimem, &op);
5723 break;
5724 }
5725 } while (child);
5726
5727 dev_info(dev, "%s (%lld Kbytes)\n", info->name,
5728 (long long)mtd->size >> 10);
5729
5730 dev_dbg(dev,
5731 "mtd .name = %s, .size = 0x%llx (%lldMiB), "
5732 ".erasesize = 0x%.8x (%uKiB) .numeraseregions = %d\n",
5733 mtd->name, (long long)mtd->size, (long long)(mtd->size >> 20),
5734 mtd->erasesize, mtd->erasesize / 1024, mtd->numeraseregions);
5735
5736 if (mtd->numeraseregions)
5737 for (i = 0; i < mtd->numeraseregions; i++)
5738 dev_dbg(dev,
5739 "mtd.eraseregions[%d] = { .offset = 0x%llx, "
5740 ".erasesize = 0x%.8x (%uKiB), "
5741 ".numblocks = %d }\n",
5742 i, (long long)mtd->eraseregions[i].offset,
5743 mtd->eraseregions[i].erasesize,
5744 mtd->eraseregions[i].erasesize / 1024,
5745 mtd->eraseregions[i].numblocks);
5746 return 0;
5747 }
5748 EXPORT_SYMBOL_GPL(spi_nor_scan);
5749
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[mhiramat:kprobes/kretprobe-stackfix 7/10] arch/ia64/include/asm/ptrace.h:76:2: error: implicit declaration of function 'ia64_psr'; did you mean
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git kprobes/kretprobe-stackfix
head: 6e2b8966c87adc1be0fb4a386fb24ae438f4cb79
commit: bf8953ce458279534e3e2bdfdab6eaf2dd224bf9 [7/10] ia64: Add instruction_pointer_set() API
config: ia64-randconfig-s031-20210316 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-277-gc089cd2d-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git/commit...
git remote add mhiramat https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git
git fetch --no-tags mhiramat kprobes/kretprobe-stackfix
git checkout bf8953ce458279534e3e2bdfdab6eaf2dd224bf9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=ia64
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 arch/ia64/include/asm/processor.h:20,
from arch/ia64/include/asm/thread_info.h:12,
from include/linux/thread_info.h:58,
from include/asm-generic/preempt.h:5,
from ./arch/ia64/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/rcupdate.h:27,
from include/linux/rculist.h:11,
from include/linux/sched/signal.h:5,
from arch/ia64/kernel/asm-offsets.c:10:
arch/ia64/include/asm/ptrace.h: In function 'instruction_pointer_set':
>> arch/ia64/include/asm/ptrace.h:76:2: error: implicit declaration of function 'ia64_psr'; did you mean 'ia64_pal'? [-Werror=implicit-function-declaration]
76 | ia64_psr(regs)->ri = (val & 0xf);
| ^~~~~~~~
| ia64_pal
>> arch/ia64/include/asm/ptrace.h:76:16: error: invalid type argument of '->' (have 'int')
76 | ia64_psr(regs)->ri = (val & 0xf);
| ^~
In file included from arch/ia64/include/asm/pgtable.h:154,
from include/linux/pgtable.h:6,
from arch/ia64/include/asm/uaccess.h:40,
from include/linux/uaccess.h:11,
from include/linux/sched/task.h:11,
from include/linux/sched/signal.h:9,
from arch/ia64/kernel/asm-offsets.c:10:
arch/ia64/include/asm/mmu_context.h: In function 'reload_context':
arch/ia64/include/asm/mmu_context.h:127:41: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable]
127 | unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
| ^~~~~~~
arch/ia64/kernel/asm-offsets.c: At top level:
arch/ia64/kernel/asm-offsets.c:23:6: warning: no previous prototype for 'foo' [-Wmissing-prototypes]
23 | void foo(void)
| ^~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:116: arch/ia64/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1235: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:215: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
vim +76 arch/ia64/include/asm/ptrace.h
73
74 static inline void instruction_pointer_set(struct pt_regs *regs, unsigned long val)
75 {
> 76 ia64_psr(regs)->ri = (val & 0xf);
77 regs->cr_iip = (val & ~0xfULL);
78 }
79
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH] mm: Move page_mapping_file to pagemap.h
by kernel test robot
Hi "Matthew,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on hnaz-linux-mm/master]
url: https://github.com/0day-ci/linux/commits/Matthew-Wilcox-Oracle/mm-Move-pa...
base: https://github.com/hnaz/linux-mm master
config: nios2-defconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.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://github.com/0day-ci/linux/commit/5f7b112de945843f38fbf9f602dd54701...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Matthew-Wilcox-Oracle/mm-Move-page_mapping_file-to-pagemap-h/20210316-221138
git checkout 5f7b112de945843f38fbf9f602dd547010e8b8d0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nios2
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
arch/nios2/mm/cacheflush.c:160:6: warning: no previous prototype for '__flush_dcache_page' [-Wmissing-prototypes]
160 | void __flush_dcache_page(struct address_space *mapping, struct page *page)
| ^~~~~~~~~~~~~~~~~~~
arch/nios2/mm/cacheflush.c: In function 'flush_dcache_page':
>> arch/nios2/mm/cacheflush.c:183:12: error: implicit declaration of function 'page_mapping_file'; did you mean 'page_mapping'? [-Werror=implicit-function-declaration]
183 | mapping = page_mapping_file(page);
| ^~~~~~~~~~~~~~~~~
| page_mapping
>> arch/nios2/mm/cacheflush.c:183:10: warning: assignment to 'struct address_space *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
183 | mapping = page_mapping_file(page);
| ^
arch/nios2/mm/cacheflush.c: In function 'update_mmu_cache':
arch/nios2/mm/cacheflush.c:221:10: warning: assignment to 'struct address_space *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
221 | mapping = page_mapping_file(page);
| ^
cc1: some warnings being treated as errors
vim +183 arch/nios2/mm/cacheflush.c
93c91cb228e76b Ley Foon Tan 2014-11-06 159
1a70db49a73535 Ley Foon Tan 2015-04-24 @160 void __flush_dcache_page(struct address_space *mapping, struct page *page)
1a70db49a73535 Ley Foon Tan 2015-04-24 161 {
1a70db49a73535 Ley Foon Tan 2015-04-24 162 /*
1a70db49a73535 Ley Foon Tan 2015-04-24 163 * Writeback any data associated with the kernel mapping of this
1a70db49a73535 Ley Foon Tan 2015-04-24 164 * page. This ensures that data in the physical page is mutually
1a70db49a73535 Ley Foon Tan 2015-04-24 165 * coherent with the kernels mapping.
1a70db49a73535 Ley Foon Tan 2015-04-24 166 */
1a70db49a73535 Ley Foon Tan 2015-04-24 167 unsigned long start = (unsigned long)page_address(page);
1a70db49a73535 Ley Foon Tan 2015-04-24 168
8e3d7c834ba0f7 Ley Foon Tan 2015-11-26 169 __flush_dcache(start, start + PAGE_SIZE);
1a70db49a73535 Ley Foon Tan 2015-04-24 170 }
1a70db49a73535 Ley Foon Tan 2015-04-24 171
93c91cb228e76b Ley Foon Tan 2014-11-06 172 void flush_dcache_page(struct page *page)
93c91cb228e76b Ley Foon Tan 2014-11-06 173 {
93c91cb228e76b Ley Foon Tan 2014-11-06 174 struct address_space *mapping;
93c91cb228e76b Ley Foon Tan 2014-11-06 175
93c91cb228e76b Ley Foon Tan 2014-11-06 176 /*
93c91cb228e76b Ley Foon Tan 2014-11-06 177 * The zero page is never written to, so never has any dirty
93c91cb228e76b Ley Foon Tan 2014-11-06 178 * cache lines, and therefore never needs to be flushed.
93c91cb228e76b Ley Foon Tan 2014-11-06 179 */
93c91cb228e76b Ley Foon Tan 2014-11-06 180 if (page == ZERO_PAGE(0))
93c91cb228e76b Ley Foon Tan 2014-11-06 181 return;
93c91cb228e76b Ley Foon Tan 2014-11-06 182
cb9f753a3731f7 Huang Ying 2018-04-05 @183 mapping = page_mapping_file(page);
93c91cb228e76b Ley Foon Tan 2014-11-06 184
93c91cb228e76b Ley Foon Tan 2014-11-06 185 /* Flush this page if there are aliases. */
93c91cb228e76b Ley Foon Tan 2014-11-06 186 if (mapping && !mapping_mapped(mapping)) {
93c91cb228e76b Ley Foon Tan 2014-11-06 187 clear_bit(PG_dcache_clean, &page->flags);
93c91cb228e76b Ley Foon Tan 2014-11-06 188 } else {
1a70db49a73535 Ley Foon Tan 2015-04-24 189 __flush_dcache_page(mapping, page);
1a70db49a73535 Ley Foon Tan 2015-04-24 190 if (mapping) {
93c91cb228e76b Ley Foon Tan 2014-11-06 191 unsigned long start = (unsigned long)page_address(page);
93c91cb228e76b Ley Foon Tan 2014-11-06 192 flush_aliases(mapping, page);
1a70db49a73535 Ley Foon Tan 2015-04-24 193 flush_icache_range(start, start + PAGE_SIZE);
1a70db49a73535 Ley Foon Tan 2015-04-24 194 }
93c91cb228e76b Ley Foon Tan 2014-11-06 195 set_bit(PG_dcache_clean, &page->flags);
93c91cb228e76b Ley Foon Tan 2014-11-06 196 }
93c91cb228e76b Ley Foon Tan 2014-11-06 197 }
93c91cb228e76b Ley Foon Tan 2014-11-06 198 EXPORT_SYMBOL(flush_dcache_page);
93c91cb228e76b Ley Foon Tan 2014-11-06 199
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months