/* Note: xp_remote_memcpy_sn2() should never be called while holding a spinlock.  */
static enum xp_retval xp_remote_memcpy_sn2(unsigned long dst_pa, const unsigned long src_pa, size_t len)
/* Note: xp_remote_memcpy_sn2() should never be called while holding a spinlock.  */
static enum xp_retval xp_remote_memcpy_sn2(unsigned long dst_pa, const unsigned long src_pa, size_t len)
{
	bte_result_t ret;
	ret = bte_copy(src_pa, dst_pa, len, (BTE_NOTIFY | BTE_WACQUIRE), NULL);
	if (ret == BTE_SUCCESS)
		return xpSuccess;
	if (is_shub2()) {
		dev_err(xp, "bte_copy() on shub2 failed, error=0x%x dst_pa="
			"0x%016lx src_pa=0x%016lx len=%ld\\n", ret, dst_pa,
			src_pa, len);
	} else {
		dev_err(xp, "bte_copy() failed, error=%d dst_pa=0x%016lx "
			"src_pa=0x%016lx len=%ld\\n", ret, dst_pa, src_pa, len);
	}
	return xpBteCopyError;
}