Read/Write to DASD

Once block I/O initialization for a virtual DASD has completed, you can use the read/write function of DIAGNOSE code X'250' to perform I/O to that virtual device.

The function code for a read/write request is X'01', and the BIOPL is defined by one of the following formats determined by bit 0 of byte X'02'.

If bit 0 of byteX'02' is zero:

See surrounding text for a description of the diagram.

If bit 0 of byte X'02' is one:

See surrounding text for a description of the diagram.
Device Number
is a halfword field containing the virtual device number of the DASD to which the read/write operation is targeted.
Flag A
Bit 0 of byte X'02' indicates the format of the parameter list, and the block I/O entries, see Format of a Block I/O Entry.

Bits 1-7 of byte X'02' must contain binary zeros.

Key
Bits 0-3 of byte X'18' contain the subchannel key for fetching of output data and for storing of input data associated with this read/write request. This key is matched with a storage key during these storage references.

Bits 4-7 of this field must contain binary zeros.

Flags
Bits 0-5 of byte X'19' must contain binary zeros.

Bit 6 of byte X'19' indicates whether this is a synchronous or an asynchronous request. If the bit is zero, then the read/write operation is to be performed synchronously. The condition code and return code returned by this function will indicate the results of the operation.

If the bit is one, then the I/O may be performed asynchronously. Status of the I/O request will be presented by a block I/O external interruption. However, if the asynchronous request can be serviced entirely from minidisk cache, and bit 7 of byte X'19' is zero to indicate that minidisk cache should be interrogated, then a condition code and return code are returned by this function and no block I/O external interruption is generated.

Table 1. Summary of the Effects of Byte X'19' Bits 6 and 7 on Read/Write Processing
Bit 6 Bit 7 Effect
0 0 The request will be performed synchronously; minidisk cache may be interrogated. The condition code and return code will indicate the results of the operation.
0 1 The request will be performed synchronously; minidisk cache will not be interrogated. The condition code and return code will indicate the results of the operation. This option is ignored for write requests.
1 0 The request may be performed asynchronously; minidisk cache may be interrogated. The condition code and return code must be examined to determine if the requested was performed asynchronously; if is was, the results of the I/O request will be presented via a block I/O external interruption; otherwise, the condition code and return code will indicate the results of the operation.
1 1 The request will be performed asynchronously; minidisk cache will not be interrogated. The results of the I/O operation will be presented by a block I/O external interruption. This option is ignored for write requests.
Bit 7 of byte X'19' indicates whether minidisk cache should be bypassed for the read request. If the bit is zero, then the request will be satisfied from minidisk cache if possible. If the bit is one, then minidisk cache will not be interrogated. I/O will be performed even if the request could be satisfied from cache.

Use the minidisk cache bypass option when reading data that is not referenced frequently. This prevents infrequently-used data from filling the cache and flushing out frequently referenced data.

Note: This option is ignored for write requests.
Block Count
is a fullword field containing an unsigned binary number specifying the count of entries in the block I/O entry list. The minimum number of entries is 1, and the maximum is 256.
ALET of the block I/O entry list

If your virtual machine is an XC virtual machine executing in host-access-register mode, then this fullword field contains the access-list-entry token (ALET) designating the address space containing the block I/O entry list. If the virtual CPU of your XC virtual machine is executing in host-primary-space mode or your virtual machine is not an XC virtual machine, then this field is ignored, and the block I/O entry list is contained in the host-primary address space.

The system performs host access-register translation for the ALETs contained within the BIOPL during the execution of DIAGNOSE code X'250'. When asynchronous I/O has been requested, the resulting ASITs are used to reference the data buffers during the ensuing asynchronous process.

31 bit address of block I/O entry list
If bit 0 of byte X'02' is zero, then bytes X'24' - X'27' is a fullword field containing the guest real address of a contiguous list of block I/O entries. Each entry in the list identifies a read or write request for the virtual device. The data within an individual entry is described in Format of a Block I/O Entry.

The address of the block I/O entry list must be an address on a doubleword boundary.

If bit 0 of byte X'02' is one, bytes X'24' - X'27' must contain zeros.

32 bit Interruption Parameter
If bit 0 of byte X'02' is zero, then this fullword field contains user data to be stored at guest real storage locations 128-131 in the host-primary address space upon presentation of the block I/O external interruption at the completion of an asynchronous read/write request.
64 bit Interruption Parameter
If bit 0 of byte X'02' is one, then this doubleword field contains user data to be stored at guest real storage locations 4536-4543 in the host-primary address space upon presentation of the block I/O external interruption at the completion of an asynchronous read/write request.
64 bit address of block I/O entry list
If bit 0 of byte X'02' is one, then bytes X'30' - X'37' are a doubleword field containing the guest real address of a contiguous list of block I/O entries. Each entry in the list identifies a read or write request for the virtual device. The data within an individual entry is described in Format of a Block I/O Entry.

The address of the block I/O entry list must be an address on a doubleword boundary.

If bit 0 of byte X'02' is zero, bytes X'30' - X'37' must contain zeros.

Reserved
The rest of the fields in this block are reserved for IBM® use and must contain binary zeros.