kvm-s390.c (8fa1696ea78162ca3112a26879d9379483443c85) kvm-s390.c (1bab1c02aff73eb5c3001e97f48e64ab6a80988a)
1/*
2 * hosting zSeries kernel virtual machines
3 *
4 * Copyright IBM Corp. 2008, 2009
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License (version 2 only)
8 * as published by the Free Software Foundation.

--- 1560 unchanged lines hidden (view full) ---

1569 }
1570 /* decrement only if we actually flipped the bit to 0 */
1571 if (!peek && test_and_clear_bit(cur, s->pgste_bitmap))
1572 atomic64_dec(&s->dirty_pages);
1573 r = get_pgste(kvm->mm, hva, &pgstev);
1574 if (r < 0)
1575 pgstev = 0;
1576 /* save the value */
1/*
2 * hosting zSeries kernel virtual machines
3 *
4 * Copyright IBM Corp. 2008, 2009
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License (version 2 only)
8 * as published by the Free Software Foundation.

--- 1560 unchanged lines hidden (view full) ---

1569 }
1570 /* decrement only if we actually flipped the bit to 0 */
1571 if (!peek && test_and_clear_bit(cur, s->pgste_bitmap))
1572 atomic64_dec(&s->dirty_pages);
1573 r = get_pgste(kvm->mm, hva, &pgstev);
1574 if (r < 0)
1575 pgstev = 0;
1576 /* save the value */
1577 res[i++] = (pgstev >> 24) & 0x3;
1577 res[i++] = (pgstev >> 24) & 0x43;
1578 /*
1579 * if the next bit is too far away, stop.
1580 * if we reached the previous "next", find the next one
1581 */
1582 if (!peek) {
1583 if (next > cur + KVM_S390_MAX_BIT_DISTANCE)
1584 break;
1585 if (cur == next)

--- 61 unchanged lines hidden (view full) ---

1647 hva = gfn_to_hva(kvm, args->start_gfn + i);
1648 if (kvm_is_error_hva(hva)) {
1649 r = -EFAULT;
1650 break;
1651 }
1652
1653 pgstev = bits[i];
1654 pgstev = pgstev << 24;
1578 /*
1579 * if the next bit is too far away, stop.
1580 * if we reached the previous "next", find the next one
1581 */
1582 if (!peek) {
1583 if (next > cur + KVM_S390_MAX_BIT_DISTANCE)
1584 break;
1585 if (cur == next)

--- 61 unchanged lines hidden (view full) ---

1647 hva = gfn_to_hva(kvm, args->start_gfn + i);
1648 if (kvm_is_error_hva(hva)) {
1649 r = -EFAULT;
1650 break;
1651 }
1652
1653 pgstev = bits[i];
1654 pgstev = pgstev << 24;
1655 mask &= _PGSTE_GPS_USAGE_MASK;
1655 mask &= _PGSTE_GPS_USAGE_MASK | _PGSTE_GPS_NODAT;
1656 set_pgste_bits(kvm->mm, hva, mask, pgstev);
1657 }
1658 srcu_read_unlock(&kvm->srcu, srcu_idx);
1659 up_read(&kvm->mm->mmap_sem);
1660
1661 if (!kvm->mm->context.use_cmma) {
1662 down_write(&kvm->mm->mmap_sem);
1663 kvm->mm->context.use_cmma = 1;

--- 260 unchanged lines hidden (view full) ---

1924
1925 /* Populate the facility list initially. */
1926 kvm->arch.model.fac_list = kvm->arch.sie_page2->fac_list;
1927 memcpy(kvm->arch.model.fac_list, kvm->arch.model.fac_mask,
1928 S390_ARCH_FAC_LIST_SIZE_BYTE);
1929
1930 set_kvm_facility(kvm->arch.model.fac_mask, 74);
1931 set_kvm_facility(kvm->arch.model.fac_list, 74);
1656 set_pgste_bits(kvm->mm, hva, mask, pgstev);
1657 }
1658 srcu_read_unlock(&kvm->srcu, srcu_idx);
1659 up_read(&kvm->mm->mmap_sem);
1660
1661 if (!kvm->mm->context.use_cmma) {
1662 down_write(&kvm->mm->mmap_sem);
1663 kvm->mm->context.use_cmma = 1;

--- 260 unchanged lines hidden (view full) ---

1924
1925 /* Populate the facility list initially. */
1926 kvm->arch.model.fac_list = kvm->arch.sie_page2->fac_list;
1927 memcpy(kvm->arch.model.fac_list, kvm->arch.model.fac_mask,
1928 S390_ARCH_FAC_LIST_SIZE_BYTE);
1929
1930 set_kvm_facility(kvm->arch.model.fac_mask, 74);
1931 set_kvm_facility(kvm->arch.model.fac_list, 74);
1932 if (MACHINE_HAS_TLB_GUEST) {
1933 set_kvm_facility(kvm->arch.model.fac_mask, 147);
1934 set_kvm_facility(kvm->arch.model.fac_list, 147);
1935 }
1932
1933 kvm->arch.model.cpuid = kvm_s390_get_initial_cpuid();
1934 kvm->arch.model.ibc = sclp.ibc & 0x0fff;
1935
1936 kvm_s390_crypto_init(kvm);
1937
1938 mutex_init(&kvm->arch.float_int.ais_lock);
1939 kvm->arch.float_int.simm = 0;

--- 2000 unchanged lines hidden ---
1936
1937 kvm->arch.model.cpuid = kvm_s390_get_initial_cpuid();
1938 kvm->arch.model.ibc = sclp.ibc & 0x0fff;
1939
1940 kvm_s390_crypto_init(kvm);
1941
1942 mutex_init(&kvm->arch.float_int.ais_lock);
1943 kvm->arch.float_int.simm = 0;

--- 2000 unchanged lines hidden ---