qemu-s390x
[Top][All Lists]
Advanced

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

Re: [qemu-s390x] [RFC 19/19] s390/facilities: enable AP facilities neede


From: Harald Freudenberger
Subject: Re: [qemu-s390x] [RFC 19/19] s390/facilities: enable AP facilities needed by guest
Date: Fri, 3 Nov 2017 09:14:17 +0100

I talked with the firmware guys about this.
The answer is that the AP 3 instructions (NQAP, DQAP, PQAP) are always available.
Tony is right with the facility bits.
facility bit 15 tells if the T bit is supported with the PQAP(TAPQ) subcommand,
facility bit 12 tells if the PQAP(QCI) subcommand is available.

As far as I could discover the AP instructions where optional on some older machines.
This may be the reason why zVM throws an exception if there is no AP device assigned.
However, for all machines still in service the AP instructions are available at al time.

Mit freundlichen Grüßen / Kind regards

Harald Freudenberger


IBM Systems &Technology Group, zLinux Development
----------------------------------------------------------------------------------
IBM Deutschland
Schoenaicher Str. 220
71032 Boeblingen
Phone: +49-7031-16-5152
E-Mail: address@hidden
----------------------------------------------------------------------------------
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
------------------------------------------------------------------------------------


Inactive hide details for Tony Krowiak ---02.11.2017 16:36:38---On 11/02/2017 08:08 AM, Christian Borntraeger wrote: >Tony Krowiak ---02.11.2017 16:36:38---On 11/02/2017 08:08 AM, Christian Borntraeger wrote: >

From: Tony Krowiak <address@hidden>
To: address@hidden, address@hidden, Harald Freudenberger/Germany/address@hidden
Cc: address@hidden, address@hidden, address@hidden, address@hidden, address@hidden, address@hidden, address@hidden, address@hidden, address@hidden, address@hidden, address@hidden, address@hidden, address@hidden, address@hidden, address@hidden, address@hidden
Date: 02.11.2017 16:36
Subject: Re: [RFC 19/19] s390/facilities: enable AP facilities needed by guest





On 11/02/2017 08:08 AM, Christian Borntraeger wrote:


      On 10/16/2017 11:25 AM, Martin Schwidefsky wrote:
          On Fri, 13 Oct 2017 13:39:04 -0400
          Tony Krowiak
          <address@hidden> wrote:

              Sets up the following facilities bits to enable the specified AP
              facilities for the guest VM:
                 * STFLE.12: Enables the AP Query Configuration Information
                             facility. The AP bus running in the guest uses
                             the information returned from this instruction
                             to configure AP adapters and domains for the
                             guest machine.
                 * STFLE.15: Indicates the AP facilities test is available.
                             The AP bus running in the guest uses the
                             information.

              Signed-off-by: Tony Krowiak
              <address@hidden>
              ---
              arch/s390/tools/gen_facilities.c |    2 ++
              1 files changed, 2 insertions(+), 0 deletions(-)

              diff --git a/arch/s390/tools/gen_facilities.c b/arch/s390/tools/gen_facilities.c
              index 70dd8f1..eeaa7db 100644
              --- a/arch/s390/tools/gen_facilities.c
              +++ b/arch/s390/tools/gen_facilities.c
              @@ -74,8 +74,10 @@ struct facility_def {
              8,  /* enhanced-DAT 1 */
              9,  /* sense-running-status */
              10, /* conditional sske */
              + 12, /* AP query configuration */
              13, /* ipte-range */
              14, /* nonquiescing key-setting */
              + 15, /* AP special-command facility */
              73, /* transactional execution */
              75, /* access-exception-fetch/store indication */
              76, /* msa extension 3 */

          With this all KVM guests will always have the AP instructions available, no?
          In principles I like this approach, but it differs from the way z/VM does things,
          there the guest will get an exception if it tries to execute an AP instruction
          if there are no AP devices assigned to the guest. I wonder if there is a reason
          why z/VM does it the way it does.

      A good question. For LPAR it seems that you have AP instructions even if you have
      no crypto cards.

I don't believe these facilities control whether or not AP instructions will be available

to the guest. Bit 12 controls whether the PQAP(QCI) - query AP configuration information - instruction

is available. This is necessary because if the PQAP(QCI) instruction is not available to the guest,

then the AP bus scan code running on the guest will not create any AP devices regardless of whether

AP devices are assigned to the guest or not. Facility bit 15 indicates whether the APFT facility is

installed. If the APFT facility is not installed, then it looks like the probe function for CEX4 and

CEX5 cards will fail because the information provided by the facility will not be returned from the

PQAP(TAPQ) function. 

The way the AP bus determines whether or not AP instructions are installed is by executing an AP

instruction. If the instruction throws an exception, then it is assumed the AP instructions are not

available. This is done in the AP module init which returns -ENODEV if the AP instructions are not

installed. Since the AP bus is not initialized, no AP instructions will ever get executed. I surmise

this is the difference between z/VM and linux.

Harald, can you verify my statements above? 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]