Skip to contentSkip to conversation

KVM: s390: introduce defines for control registers

PATCH David Hildenbrand 1 participant 1 message Apr 30, 2018 1 message not in the archive s390

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 41 lines · Janosch Frank
Quoted 40 lines · David Hildenbrand
Quoted 10 lines · David Hildenbrand

In KVM code we use masks to test/set control registers.

Let's define the ones we use in arch/s390/include/asm/ctl_reg.h and replace all occurrences in KVM code.

As we will be needing the define for Clock-comparator sign control soon, let's also add it.

Just realized that I was sending out an older version of the patch, (partially updated due to new SIGN bit) the following two hunks are missing

arch/s390/kvm/interrupt.c +2 -2
index 5a30fc275a4c..daa09f89ca2d 100644
@@ -172,7 +172,7 @@ static int ckc_irq_pending(struct kvm_vcpu *vcpu)
        const u64 now = kvm_s390_get_tod_clock_fast(vcpu->kvm);
        const u64 ckc = vcpu->arch.sie_block->ckc;
 
-       if (vcpu->arch.sie_block->gcr[0] & 0x0020000000000000ul) {
+       if (vcpu->arch.sie_block->gcr[0] & CR0_CLOCK_COMPARATOR_SIGN) {
                if ((s64)ckc >= (s64)now)
                        return 0;
        } else if (ckc >= now) {
@@ -1062,7 +1062,7 @@ static u64 __calculate_sltime(struct kvm_vcpu *vcpu)
        u64 cputm, sltime = 0;
 
        if (ckc_interrupts_enabled(vcpu)) {
-               if (vcpu->arch.sie_block->gcr[0] & 0x0020000000000000ul) {
+               if (vcpu->arch.sie_block->gcr[0] & CR0_CLOCK_COMPARATOR_SIGN) {
                        if ((s64)now < (s64)ckc)
                                sltime = tod_to_ns((s64)ckc - (s64)now);
                } else if (now < ckc) {
Quoted 6 lines
Quoted 3 lines

Christian/Janosch, please tell me if you can fix this up by applying or if I should resend.

Please send a v2 of this patch as a reply, no need for a full resend. Thanks for the work, have a nice first of May.

Yes, will send as reference to v1. Thanks - to you, too!

Quoted 4 lines

If possible try to get the linux.vnet.ibm.com addresses out of your address books. We dropped the vnet bit recently.

Oh, haven't noticed that. Thanks for the heads up. maybe in another 10 years you'll be back to a pure "@ibm.com", one step at a time :P

Signature · 3 lines
Thanks,

David / dhildenb