# US 2004/0064618 A1 · Method and apparatus for controlling the execution of a broadcast instruction on a guest processor of a guest multiprocessing configuration

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2004/0064618 A1
- Document ID: US20040064618A1
- Status: Published application
- Kind: A1
- Application number: 10/262,311
- Filed: 2002-09-30
- Published: 2004-04-01
- Earliest claimed: 2002-09-30
- Assignees: International Business Machines Corporation
- Inventors: Mark S. Farrell; Charles W. Gainey; Jeffrey P. Kubala; Damian L. Osisek
- Web page: https://patentgrep.com/patent/US20040064618A1

## CPC

- G06F 9/52: Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F 9/30047: {Prefetch instructions; cache control instructions}
- G06F 9/30087: {Synchronisation or serialisation instructions}
- G06F 9/45533: {Hypervisors; Virtual machine monitors}
- G06F 12/1072: Decentralised address translation, e.g. in distributed shared memory systems
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method and apparatus for managing the execution on guest processors of a broadcast instruction requiring a corresponding operation on other processors of a guest machine. Each of a plurality of processors on an information handling system is operable either as a host processor under the control of a host program executing on a host machine or as a guest processor under the control of a guest program executing on a guest machine. The guest machine is defined by the host program executing on the host machine and contains a plurality of such guest processors forming a guest multiprocessing configuration. A lock is defined for the guest machine containing an indication of whether it is being held by a host lock holder from the host program and a count of the number of processors holding the lock as guest lock holders. Upon decoding a broadcast instruction executing on a processor operating as a guest processor, the lock is tested to determine whether it is being held by a host lock holder. If the lock is being held by a host lock holder, an instruction interception is recognized and execution of the instruction is terminated. If the lock is not being held by a host lock holder, the lock is updated to indicate that it is being held by the guest processor as a shared lock holder, the instruction is executed, and then the lock is updated a second time to indicate that it is no longer being held by the guest processor as a shared lock holder.

## Claims

### Claim 1

In an information handling system containing a plurality of processors, each of which is operable either as a host processor under the control of a host program executing on a host machine or as a guest processor under the control of a guest program executing on a guest machine, the guest machine being defined by the host program executing on the host machine and containing a plurality of such guest processors, a method for managing the execution on one of the guest processors of a broadcast instruction requiring a corresponding operation on other processors of the guest machine, the method comprising the steps of:
defining for the guest machine a lock containing an indication of whether it is being held by a host lock holder from the host program and a count of the number of processors holding the lock as guest lock holders;
upon decoding a broadcast instruction executing on a processor operating as a guest processor, testing the lock to determine whether it is being held by a host lock holder;
if the lock is being held by a host lock holder, terminating execution of the instruction; and
if the lock is not being held by a host lock holder, updating the lock to indicate that it is being held by the guest processor as a shared lock holder and executing the instruction.

### Claim 2 (depends on 1)

The method of claim 1 in which the lock contains an indicator that is set to a first value to indicate that it is not being held by either a host lock holder or a guest lock holder and is set to a second value to indicate that it is being held by at least one host lock holder or at least one guest lock holder, the step of updating the lock to indicate that it is being held by the processor as a guest lock holder comprising the step of setting the indicator to the second value.

### Claim 3 (depends on 1)

The method of claim 1 in which the lock contains a host count that is set to zero to indicate that it is not being held by a host lock holder and is set to a nonzero value to indicate that it is being held by at least one host lock holder, the step of testing the lock to determine whether it is being held by a host lock holder comprising the step of testing the host count to determine whether it is zero.

### Claim 4 (depends on 1)

The method of claim 1 in which the lock contains a guest count indicating the number of processors holding the lock as guest lock holders, the step of updating the lock to indicate that it is being held by the processor as a guest lock holder comprising the step of incrementing the guest count.

### Claim 5 (depends on 1)

The method of claim 1, comprising the step of updating the lock a second time after the instruction is executed to indicate that it is no longer being held by the guest processor as a shared lock holder.

### Claim 6 (depends on 5)

The method of claim 5 in which the lock contains a guest count indicating the number of processors holding the lock as guest lock holders, the step of updating the lock a second time to indicate that it is being held by the processor as a guest lock holder comprising the step of decrementing the guest count.

### Claim 7

In an information handling system containing a plurality of processors, each of which is operable either as a host processor under the control of a host program executing on a host machine or as a guest processor under the control of a guest program executing on a guest machine, the guest machine being defined by the host program executing on the host machine and containing a plurality of such guest processors, apparatus for managing the execution on one of the guest processors of a broadcast instruction requiring a corresponding operation on other processors of the guest machine, comprising:
means for defining for the guest machine a lock containing an indication of whether it is being held by a host lock holder from the host program and a count of the number of processors holding the lock as guest lock holders;
means for testing the lock to determine whether it is being held by a host lock holder upon decoding a broadcast instruction executing on a processor operating as a guest processor;
means for terminating execution of the instruction if the lock is being held by a host lock holder; and
means for updating the lock to indicate that it is being held by the guest processor as a shared lock holder and executing the instruction if the lock is not being held by a host lock holder.

### Claim 8 (depends on 7)

The apparatus of claim 7 in which the lock contains an indicator that is set to a first value to indicate that it is not being held by either a host lock holder or a guest lock holder and is set to a second value to indicate that it is being held by at least one host lock holder or at least one guest lock holder, the means for of updating the lock to indicate that it is being held by the processor as a guest lock holder comprising means for setting the indicator to the second value.

### Claim 9 (depends on 7)

The apparatus of claim 7 in which the lock contains a host count that is set to zero to indicate that it is not being held by a host lock holder and is set to a nonzero value to indicate that it is being held by at least one host lock holder, the means for testing the lock to determine whether it is being held by a host lock holder comprising means for testing the host count to determine whether it is zero.

### Claim 10 (depends on 7)

The apparatus of claim 7 in which the lock contains a guest count indicating the number of processors holding the lock as guest lock holders, the step of updating the lock to indicate that it is being held by the processor as a guest lock holder comprising the step of incrementing the guest count.

### Claim 11 (depends on 7)

The apparatus of claim 7, comprising means for updating the lock a second time after the instruction is executed to indicate that it is no longer being held by the guest processor as a shared lock holder.

### Claim 12 (depends on 11)

The apparatus of claim 11 in which the lock contains a guest count indicating the number of processors holding the lock as guest lock holders, the means for updating the lock a second time to indicate that it is being held by the processor as a guest lock holder comprising means for decrementing the guest count.

### Claim 13

A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform method steps for managing the execution on a guest processor of a broadcast instruction requiring a corresponding operation on other processors of a guest machine in an information handling system containing a plurality of processors, each of which is operable either as a host processor under the control of a host program executing on a host machine or as a guest processor under the control of a guest program executing on a guest machine, the guest machine being defined by the host program executing on the host machine and containing a plurality of such guest processors, the method steps comprising:
defining for the guest machine a lock containing an indication of whether it is being held by a host lock holder from the host program and a count of the number of processors holding the lock as guest lock holders;
upon decoding a broadcast instruction executing on a processor operating as a guest processor, testing the lock to determine whether it is being held by a host lock holder;
if the lock is being held by a host lock holder, terminating execution of the instruction; and
if the lock is not being held by a host lock holder, updating the lock to indicate that it is being held by the guest processor as a shared lock holder and executing the instruction.

### Claim 14 (depends on 13)

The program storage device of claim 13 in which the lock contains an indicator that is set to a first value to indicate that it is not being held by either a host lock holder or a guest lock holder and is set to a second value to indicate that it is being held by at least one host lock holder or at least one guest lock holder, the step of updating the lock to indicate that it is being held by the processor as a guest lock holder comprising the step of setting the indicator to the second value.

### Claim 15 (depends on 13)

The program storage device of claim 13 in which the lock contains a host count that is set to zero to indicate that it is not being held by a host lock holder and is set to a nonzero value to indicate that it is being held by at least one host lock holder, the step of testing the lock to determine whether it is being held by a host lock holder comprising the step of testing the host count to determine whether it is zero.

### Claim 16 (depends on 13)

The program storage device of claim 13 in which the lock contains a guest count indicating the number of processors holding the lock as guest lock holders, the step of updating the lock to indicate that it is being held by the processor as a guest lock holder comprising the step of incrementing the guest count.

### Claim 17 (depends on 13)

The program storage device of claim 13, the method steps comprising the step of updating the lock a second time after the instruction is executed to indicate that it is no longer being held by the guest processor as a shared lock holder.

### Claim 18 (depends on 17)

The program storage device of claim 17 in which the lock contains a guest count indicating the number of processors holding the lock as guest lock holders, the step of updating the lock a second time to indicate that it is being held by the processor as a guest lock holder comprising the step of decrementing the guest count.

### Claim 19

In an information handling system, a method for managing a lock comprising the steps of:
defining a lock containing a first count of the number of requesters from a first group holding the lock on a shared basis and a second count of the number of requesters from a second group holding the lock on a basis that is shared among requesters of the second group but exclusive relative to requesters of the first group;
upon receiving a request for said lock from one of said groups, testing the lock to determine whether it is being held by any requesters from the other group;
if the lock is being held by any requesters from the other group, denying the request; and
if the lock is not being held by any requesters from the other group, granting the request and updating the lock to indicate that it is being held by the requester as a shared lock holder.

### Claim 20 (depends on 19)

The method of claim 19 in which the lock contains an indicator that is set to a first value to indicate that it is not being held by a lock holder from either of said groups and is set to a second value to indicate that it is being held by at least one lock holder from one of said groups, the step of updating the lock to indicate that it is being held by the requester as a shared lock holder comprising the step of setting the indicator to the second value if it is not already set to the second value.

### Claim 21 (depends on 19)

The method of claim 19 in which the step of testing the lock to determine whether it is being held by any requesters from the other group comprises the step of testing the count associated with the other group to determine whether it is zero.

### Claim 22 (depends on 19)

The method of claim 19 in which the step of updating the lock to indicate that it is being held by the requester as a shared lock holder comprises the step of incrementing the count associated with said one of said groups.

### Claim 23

In an information handling system, apparatus for managing a lock, comprising:
means for defining a lock containing a first count of the number of requesters from a first group holding the lock on a shared basis and a second count of the number of requesters from a second group holding the lock on a basis that is shared among requesters of the second group but exclusive relative to requesters of the first group;
means responsive to receiving a request for said lock from one of said groups for testing the lock to determine whether it is being held by any requesters from the other group;
means for denying the request if the lock is being held by any requesters from the other group; and
means for granting the request and updating the lock to indicate that it is being held by the requester as a shared lock holder if the lock is not being held by any requesters from the other group.

### Claim 24

A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform method steps for managing a lock, the method steps comprising:
defining a lock containing a first count of the number of requesters from a first group holding the lock on a shared basis and a second count of the number of requesters from a second group holding the lock on a basis that is shared among requesters of the second group but exclusive relative to requesters of the first group;
upon receiving a request for said lock from one of said groups, testing the lock to determine whether it is being held by any requesters from the other group;
if the lock is being held by any requesters from the other group, denying the request; and
if the lock is not being held by any requesters from the other group, granting the request and updating the lock to indicate that it is being held by the requester as a shared lock holder.
