From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH for-4.9 v3 3/3] xen/livepatch: Don't crash on encountering STN_UNDEF relocations Date: Fri, 23 Jun 2017 10:46:03 -0400 Message-ID: <20170623144603.GJ16947@char.us.oracle.com> References: <1498155329-4752-1-git-send-email-andrew.cooper3@citrix.com> <1498155329-4752-4-git-send-email-andrew.cooper3@citrix.com> <12865bf5-d94b-51ad-42d2-1b0f0102010a@arm.com> <827484de-2053-611d-470d-2d1783967d04@citrix.com> <20170623143544.GI16947@char.us.oracle.com> <7c970989-4b32-cd20-2650-7e0ee745f0f5@arm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="GvXjxJ+pjyke8COw" Return-path: Content-Disposition: inline In-Reply-To: <7c970989-4b32-cd20-2650-7e0ee745f0f5@arm.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Julien Grall Cc: Andrew Cooper , Ross Lagerwall , Stefano Stabellini , Jan Beulich , Xen-devel List-Id: xen-devel@lists.xenproject.org --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jun 23, 2017 at 03:36:51PM +0100, Julien Grall wrote: > > > On 23/06/17 15:35, Konrad Rzeszutek Wilk wrote: > > On Fri, Jun 23, 2017 at 02:45:22PM +0100, Andrew Cooper wrote: > > > On 23/06/17 14:43, Julien Grall wrote: > > > > Hi, > > > > > > > > On 23/06/17 14:33, Andrew Cooper wrote: > > > > > On 23/06/17 14:32, Julien Grall wrote: > > > > > > Hi Andrew, > > > > > > > > > > > > I am a bit confused, the title says "PATCH for-4.9 v3 3/3". I haven't > > > > > > been CCed on the first two patches. Does it mean you are only looking > > > > > > at this patch to be in 4.9? > > > > > > > > > > Sorry - I messed up the CC lists. The correctness of this patch does > > > > > depend on the previous two, so all 3 are looking for inclusion. > > > > > > > > Given that we don't have livepatch testing in osstest how much test > > > > have we done on those 3 patches? > > > > > > There is testing in OSSTest. > > > > Hurray hurray hurray! > > > > > > I've manually run each of the scenarios, including with my livepatch > > > which has a STN_UNDEF relocation. > > > > > > I don't know what testing Konrad has done. > > > > I run a version of the same tests that are in OSSTest (basically an earlier > > version of the Perl code) and I have done it on x86 and on ARM32. > > > > And I also run the standalone OSSTest (on x86) > > > > And then I also do a livepatch using the livepatch-build-tools on x86 to > > patch some silly function. > > > > So from a testing perspective these patches have been tested very exhaustively. > > Well it has not been tested on ARM64 :). I am about to do that. /me facepalm. I really need to get myself a working ARM64 box that is not expensive. Also attached is the poor-man livepatch_test.perl script that mirrors what OSSTest does. [Do adjust the path, it is /usr/lib/debug, but it should be /usr/lib/debug/livepatch with Xen 4.9] --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="livepatch_test.perl" #!/usr/bin/perl use Data::Dumper; my @livepatch_files = ("xen_hello_world.livepatch", "xen_replace_world.livepatch", "xen_bye_world.livepatch", "xen_nop.livepatch"); my @livepatch_tests = ( {cmd => "xen-livepatch list", rc => 0}, {cmd => "xl info | grep xen_extra | grep -q \"Hello World\"", rc => 256}, {cmd => "xen-livepatch revert xen_hello_world", rc => 256}, {cmd => "xen-livepatch load xen_hello_world.livepatch", rc => 0}, {cmd => "xen-livepatch load xen_hello_world.livepatch", rc => 256}, {cmd => "xen-livepatch list | grep -q xen_hello_world", rc => 0}, {cmd => "xl info | grep xen_extra | grep -q \"Hello World\"", rc => 0}, {cmd => "xen-livepatch revert xen_hello_world", rc => 0}, {cmd => "xl info | grep xen_extra | grep -q \"Hello World\"", rc => 256}, {cmd => "xen-livepatch unload xen_hello_world", rc => 0}, {cmd => "xen-livepatch unload xen_hello_world", rc => 256}, {cmd => "xl info | grep xen_extra | grep -q \"Hello World\"", rc => 256}, {cmd => "xen-livepatch load xen_hello_world.livepatch", rc => 0}, {cmd => "xen-livepatch load xen_bye_world.livepatch", rc => 0}, {cmd => "xl info | grep xen_extra | grep -q \"Bye World\"", rc => 0}, {cmd => "xen-livepatch upload xen_replace xen_replace_world.livepatch", rc => 0}, {cmd => "xen-livepatch replace xen_replace", rc => 0}, {cmd => "xen-livepatch apply xen_hello_world", rc => 256}, {cmd => "xen-livepatch apply xen_bye_world", rc => 256}, {cmd => "xl info | grep xen_extra | grep -q \"Hello Again Wor\"", rc => 0}, {cmd => "xen-livepatch apply xen_replace", rc => 0}, {cmd => "xen-livepatch revert xen_replace", rc => 0}, {cmd => "xen-livepatch unload xen_replace", rc => 0}, {cmd => "xen-livepatch unload xen_hello_world", rc => 0}, {cmd => "xen-livepatch unload xen_bye_world", rc => 0}, {cmd => "xen-livepatch list | grep -q xen", rc => 256}, # If running this under Xen 4.4, or 5.5 it will fail. #{cmd => "[ `xl info| grep \"xen_m\" | grep or | sed s/.*:// | uniq | wc -l` == 2 ]", rc => 0}, {cmd => "xen-livepatch load xen_nop.livepatch", rc => 0}, {cmd => "xen-livepatch revert xen_nop", rc => 0}, {cmd => "xen-livepatch apply xen_nop", rc => 0}, {cmd => "[ `xl info| grep \"xen_m\" | grep or | sed s/.*:// | uniq | wc -l` == 1 ]", rc => 0}, {cmd => "xen-livepatch unload xen_nop", rc => 256}, {cmd => "xen-livepatch revert xen_nop", rc => 0}, {cmd => "xen-livepatch unload xen_nop", rc => 0}, ); chdir("/usr/lib/debug") or die "cannot change: $!\n"; foreach my $file (@livepatch_files) { if ( ! -f $file ) { die "$file is missing!\n"; } } print "Have $#livepatch_tests test-cases\n"; my $rc=0; for my $i ( 0 .. $#livepatch_tests ) { my $expected_rc = $livepatch_tests[$i]{rc}; my $cmd = $livepatch_tests[$i]{cmd}; print "Executing: '$cmd:' .."; my $rc=system($cmd); if ( $rc != $expected_rc ) { print "FAILED (got $rc, expected: $expected_rc)\n"; exit $rc } print ".. OK!\n"; } exit $rc --GvXjxJ+pjyke8COw Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --GvXjxJ+pjyke8COw--