Re: [PATCH v1 8/9] selftests: kvm: s390: Add uc_skey VM test case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 9 Jul 2024 19:06:58 +0200
Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx> wrote:

> On Tue,  9 Jul 2024 14:57:03 +0200
> Christoph Schlameuss <schlameuss@xxxxxxxxxxxxx> wrote:
> 
> > Add a test case manipulating s390 storage keys from within the ucontrol
> > VM.
> > 
> > Signed-off-by: Christoph Schlameuss <schlameuss@xxxxxxxxxxxxx>
> > ---
> >  .../selftests/kvm/s390x/ucontrol_test.c       | 83 +++++++++++++++++++
> >  1 file changed, 83 insertions(+)
> > 

[...]

> > +	/* set register content for test_skey_pgm to access not mapped memory*/  
> 
> missing space before */
> 

Fixing...

> > +	sync_regs->gprs[1] = skeyvalue;
> > +	sync_regs->gprs[5] = self->base_gpa;
> > +	sync_regs->gprs[6] = test_vaddr;
> > +	run->kvm_dirty_regs |= KVM_SYNC_GPRS;
> > +
> > +	run->kvm_dirty_regs |= KVM_SYNC_CRS;
> > +	TH_LOG("set CR0 to 0x%llx", sync_regs->crs[0]);
> > +
> > +	self->sie_block->ictl |= ICTL_OPEREXC | ICTL_PINT;
> > +	self->sie_block->cpuflags &= ~CPUSTAT_KSS;
> > +	run->psw_mask = 0x0400000180000000ULL;  /* DAT enabled + 64 bit mode */
> > +	run->psw_addr = self->code_gpa;
> > +	ASSERT_EQ(0, uc_run_once(self));
> > +	ASSERT_EQ(true, uc_handle_exit(self));
> > +	ASSERT_EQ(0, sync_regs->gprs[0]);
> > +	ASSERT_EQ(13, run->exit_reason);  
> 
> can you use macros here instead of magic values?
> 
> > +	ASSERT_EQ(40, sie_block->icptcode);  
> 
> same here
> 

Yes, I should have done that from the beginning.

[...]






[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux