From mboxrd@z Thu Jan 1 00:00:00 1970 From: panand@redhat.com (Pratyush Anand) Date: Wed, 4 Jan 2017 17:53:26 +0530 Subject: arm64: virt_to_page() does not return right page for a kernel image address In-Reply-To: <20170104120602.GG8329@leverpostej> References: <20170104111119.GD8329@leverpostej> <20170104120602.GG8329@leverpostej> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wednesday 04 January 2017 05:36 PM, Mark Rutland wrote: > So it seems we need to fix the crypto test. > > Looking at crypto/testmgr.c, I can't spot the kmap_atomic() or the > page_address()/virt_to_page(). I guess that's hidden behind helpers, > which might also be used elsewhere? > > Could you elaborate on where exactly the problem is in the crypto test? We have in test_acomp() -> crypto_acomp_decompress() -> tfm->decompress() -> scomp_acomp_decompress() -> scomp_acomp_comp_decomp() -> scatterwalk_map_and_copy() -> scatterwalk_copychunks() 41 if (out != 2) { 42 vaddr = scatterwalk_map(walk); 43 memcpy_dir(buf, vaddr, len_this_page, out); 44 scatterwalk_unmap(vaddr); 45 } scatterwalk_map() gets vaddr from kmap_atomic(). test_acomp() initializes sg: sg_init_one(&src, ctemplate[i].input, ilen); ctemplate is a kernel address (like lzo_comp_tv_template), which was assigned to walk->sg latter and passed to kmap_atomic(). ~Pratyush