Re: [kvm-unit-tests PATCH v3 1/3] s390x: Test TEID values in storage key test

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

 



On Tue, 2022-05-24 at 17:09 +0200, Claudio Imbrenda wrote:
> On Mon, 23 May 2022 15:24:04 +0200
> Janis Schoetterl-Glausch <scgl@xxxxxxxxxxxxx> wrote:
> 
> > On a protection exception, test that the Translation-Exception
> > Identification (TEID) values are correct given the circumstances of the
> > particular test.
> > The meaning of the TEID values is dependent on the installed
> > suppression-on-protection facility.
> > 
> > Signed-off-by: Janis Schoetterl-Glausch <scgl@xxxxxxxxxxxxx>
> > ---
> >  s390x/skey.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++-----
> >  1 file changed, 69 insertions(+), 6 deletions(-)
> > 
> > diff --git a/s390x/skey.c b/s390x/skey.c
> > index 42bf598c..5e234cde 100644
> > --- a/s390x/skey.c
> > +++ b/s390x/skey.c
> > @@ -8,6 +8,7 @@

[...]

> > +		break;
> > +	case SOP_ENHANCED_2:
> > +		switch (teid_esop2_prot_code(teid)) {
> > +		case PROT_KEY:
> > +			access_code = teid.acc_exc_f_s;
> 
> is the f/s feature guaranteed to be present when we have esop2?

That's how I understand it. For esop1 the PoP explicitly states that
the facility is a prerequisite, for esop2 it doesn't.
> 
> can the f/s feature be present with esop1 or basic sop?

esop1: yes, basic: no.
The way I read it, in the case of esop1 the bits are only meaningful
for DAT and access list exceptions, i.e. when the TEID is not
unpredictable.
> 
> > +
> > +			switch (access_code) {
> > +			case 0:
> > +				report_pass("valid access code");
> > +				break;
> > +			case 1:
> > +			case 2:
> > +				report((access & access_code) && (prot & access_code),
> > +				       "valid access code");
> > +				break;
> > +			case 3:
> > +				/*
> > +				 * This is incorrect in that reserved values
> > +				 * should be ignored, but kvm should not return
> > +				 * a reserved value and having a test for that
> > +				 * is more valuable.
> > +				 */
> > +				report_fail("valid access code");
> > +				break;
> > +			}
> > +			/* fallthrough */
> > +		case PROT_KEY_LAP:
> > +			report_pass("valid protection code");
> > +			break;
> > +		default:
> > +			report_fail("valid protection code");
> > +		}
> > +		break;
> > +	}
> > +	report_prefix_pop();
> > +}
> > +

[...]



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux