public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jesse Taube <jesse@rivosinc.com>, linux-riscv@lists.infradead.org
Cc: oe-kbuild-all@lists.linux.dev,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Conor Dooley" <conor.dooley@microchip.com>,
	"Evan Green" <evan@rivosinc.com>,
	"Charlie Jenkins" <charlie@rivosinc.com>,
	"Andrew Jones" <ajones@ventanamicro.com>,
	"Jesse Taube" <jesse@rivosinc.com>,
	"Xiao Wang" <xiao.w.wang@intel.com>,
	"Clément Léger" <cleger@rivosinc.com>,
	"Andy Chiu" <andy.chiu@sifive.com>,
	"Greentime Hu" <greentime.hu@sifive.com>,
	"Heiko Stuebner" <heiko@sntech.de>, "Guo Ren" <guoren@kernel.org>,
	"Björn Töpel" <bjorn@rivosinc.com>,
	"Costa Shulyupin" <costa.shul@redhat.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Linux Memory Management List" <linux-mm@kvack.org>,
	"Baoquan He" <bhe@redhat.com>,
	"Sami Tolvanen" <samitolvanen@google.com>,
	"Zong Li" <zong.li@sifive.com>,
	"Ben Dooks" <ben.dooks@codethink.co.uk>,
	"Erick Archer" <erick.archer@gmx.com>,
	"Vincent Chen" <vincent.chen@sifive.com>,
	"Joel Granados" <j.granados@samsung.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] RISC-V: Detect unaligned vector accesses supported.
Date: Fri, 7 Jun 2024 05:58:56 +0800	[thread overview]
Message-ID: <202406070508.6UJUx2rO-lkp@intel.com> (raw)
In-Reply-To: <20240606183215.416829-2-jesse@rivosinc.com>

Hi Jesse,

kernel test robot noticed the following build errors:

[auto build test ERROR on v6.9]
[cannot apply to akpm-mm/mm-everything linus/master v6.10-rc2 v6.10-rc1 next-20240606]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Jesse-Taube/RISC-V-Detect-unaligned-vector-accesses-supported/20240607-023434
base:   v6.9
patch link:    https://lore.kernel.org/r/20240606183215.416829-2-jesse%40rivosinc.com
patch subject: [PATCH 2/3] RISC-V: Detect unaligned vector accesses supported.
config: riscv-allnoconfig (https://download.01.org/0day-ci/archive/20240607/202406070508.6UJUx2rO-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240607/202406070508.6UJUx2rO-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406070508.6UJUx2rO-lkp@intel.com/

All errors (new ones prefixed by >>):

   arch/riscv/kernel/traps_misaligned.c: In function 'handle_misaligned_load':
>> arch/riscv/kernel/traps_misaligned.c:427:13: error: implicit declaration of function 'insn_is_vector' [-Werror=implicit-function-declaration]
     427 |         if (insn_is_vector(insn) &&
         |             ^~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/insn_is_vector +427 arch/riscv/kernel/traps_misaligned.c

   406	
   407	int handle_misaligned_load(struct pt_regs *regs)
   408	{
   409		union reg_data val;
   410		unsigned long epc = regs->epc;
   411		unsigned long insn;
   412		unsigned long addr = regs->badaddr;
   413		int i, fp = 0, shift = 0, len = 0;
   414	
   415		perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, regs, addr);
   416	
   417		if (!unaligned_enabled)
   418			return -1;
   419	
   420		if (user_mode(regs) && (current->thread.align_ctl & PR_UNALIGN_SIGBUS))
   421			return -1;
   422	
   423		if (get_insn(regs, epc, &insn))
   424			return -1;
   425	
   426	#ifdef CONFIG_RISCV_PROBE_UNALIGNED_ACCESS
 > 427		if (insn_is_vector(insn) &&
   428		    *this_cpu_ptr(&vector_misaligned_access) == RISCV_HWPROBE_VEC_MISALIGNED_SUPPORTED) {
   429			*this_cpu_ptr(&vector_misaligned_access) = RISCV_HWPROBE_VEC_MISALIGNED_UNSUPPORTED;
   430			regs->epc = epc + INSN_LEN(insn);
   431			return 0;
   432		}
   433	
   434		*this_cpu_ptr(&misaligned_access_speed) = RISCV_HWPROBE_MISALIGNED_EMULATED;
   435	#endif
   436	
   437		regs->epc = 0;
   438	
   439		if ((insn & INSN_MASK_LW) == INSN_MATCH_LW) {
   440			len = 4;
   441			shift = 8 * (sizeof(unsigned long) - len);
   442	#if defined(CONFIG_64BIT)
   443		} else if ((insn & INSN_MASK_LD) == INSN_MATCH_LD) {
   444			len = 8;
   445			shift = 8 * (sizeof(unsigned long) - len);
   446		} else if ((insn & INSN_MASK_LWU) == INSN_MATCH_LWU) {
   447			len = 4;
   448	#endif
   449		} else if ((insn & INSN_MASK_FLD) == INSN_MATCH_FLD) {
   450			fp = 1;
   451			len = 8;
   452		} else if ((insn & INSN_MASK_FLW) == INSN_MATCH_FLW) {
   453			fp = 1;
   454			len = 4;
   455		} else if ((insn & INSN_MASK_LH) == INSN_MATCH_LH) {
   456			len = 2;
   457			shift = 8 * (sizeof(unsigned long) - len);
   458		} else if ((insn & INSN_MASK_LHU) == INSN_MATCH_LHU) {
   459			len = 2;
   460	#if defined(CONFIG_64BIT)
   461		} else if ((insn & INSN_MASK_C_LD) == INSN_MATCH_C_LD) {
   462			len = 8;
   463			shift = 8 * (sizeof(unsigned long) - len);
   464			insn = RVC_RS2S(insn) << SH_RD;
   465		} else if ((insn & INSN_MASK_C_LDSP) == INSN_MATCH_C_LDSP &&
   466			   ((insn >> SH_RD) & 0x1f)) {
   467			len = 8;
   468			shift = 8 * (sizeof(unsigned long) - len);
   469	#endif
   470		} else if ((insn & INSN_MASK_C_LW) == INSN_MATCH_C_LW) {
   471			len = 4;
   472			shift = 8 * (sizeof(unsigned long) - len);
   473			insn = RVC_RS2S(insn) << SH_RD;
   474		} else if ((insn & INSN_MASK_C_LWSP) == INSN_MATCH_C_LWSP &&
   475			   ((insn >> SH_RD) & 0x1f)) {
   476			len = 4;
   477			shift = 8 * (sizeof(unsigned long) - len);
   478		} else if ((insn & INSN_MASK_C_FLD) == INSN_MATCH_C_FLD) {
   479			fp = 1;
   480			len = 8;
   481			insn = RVC_RS2S(insn) << SH_RD;
   482		} else if ((insn & INSN_MASK_C_FLDSP) == INSN_MATCH_C_FLDSP) {
   483			fp = 1;
   484			len = 8;
   485	#if defined(CONFIG_32BIT)
   486		} else if ((insn & INSN_MASK_C_FLW) == INSN_MATCH_C_FLW) {
   487			fp = 1;
   488			len = 4;
   489			insn = RVC_RS2S(insn) << SH_RD;
   490		} else if ((insn & INSN_MASK_C_FLWSP) == INSN_MATCH_C_FLWSP) {
   491			fp = 1;
   492			len = 4;
   493	#endif
   494		} else {
   495			regs->epc = epc;
   496			return -1;
   497		}
   498	
   499		if (!IS_ENABLED(CONFIG_FPU) && fp)
   500			return -EOPNOTSUPP;
   501	
   502		val.data_u64 = 0;
   503		for (i = 0; i < len; i++) {
   504			if (load_u8(regs, (void *)(addr + i), &val.data_bytes[i]))
   505				return -1;
   506		}
   507	
   508		if (!fp)
   509			SET_RD(insn, regs, val.data_ulong << shift >> shift);
   510		else if (len == 8)
   511			set_f64_rd(insn, regs, val.data_u64);
   512		else
   513			set_f32_rd(insn, regs, val.data_ulong);
   514	
   515		regs->epc = epc + INSN_LEN(insn);
   516	
   517		return 0;
   518	}
   519	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply	other threads:[~2024-06-06 21:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06 18:32 [PATCH 1/3] RISC-V: Add Zicclsm to cpufeature and hwprobe Jesse Taube
2024-06-06 18:32 ` [PATCH 2/3] RISC-V: Detect unaligned vector accesses supported Jesse Taube
2024-06-06 21:29   ` Charlie Jenkins
2024-06-06 23:13     ` Charlie Jenkins
2024-06-07 19:53       ` Jesse Taube
2024-06-07 20:11         ` Jesse Taube
2024-06-07 21:06         ` Charlie Jenkins
2024-06-07 21:21           ` Conor Dooley
2024-06-07 21:32             ` Charlie Jenkins
2024-06-10  8:23     ` Clément Léger
2024-06-10 20:17       ` Jesse Taube
2024-06-06 21:58   ` kernel test robot [this message]
2024-06-06 18:32 ` [PATCH 3/3] RISC-V: Report vector unaligned accesse speed hwprobe Jesse Taube
2024-06-06 23:11   ` kernel test robot
2024-06-06 23:13   ` Charlie Jenkins
2024-06-06 18:43 ` [PATCH 1/3] RISC-V: Add Zicclsm to cpufeature and hwprobe Conor Dooley
2024-06-06 22:10   ` Charlie Jenkins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202406070508.6UJUx2rO-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ajones@ventanamicro.com \
    --cc=akpm@linux-foundation.org \
    --cc=andy.chiu@sifive.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=ben.dooks@codethink.co.uk \
    --cc=bhe@redhat.com \
    --cc=bjorn@rivosinc.com \
    --cc=charlie@rivosinc.com \
    --cc=cleger@rivosinc.com \
    --cc=conor.dooley@microchip.com \
    --cc=costa.shul@redhat.com \
    --cc=erick.archer@gmx.com \
    --cc=evan@rivosinc.com \
    --cc=greentime.hu@sifive.com \
    --cc=guoren@kernel.org \
    --cc=heiko@sntech.de \
    --cc=j.granados@samsung.com \
    --cc=jesse@rivosinc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=samitolvanen@google.com \
    --cc=vincent.chen@sifive.com \
    --cc=xiao.w.wang@intel.com \
    --cc=zong.li@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox