[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PULL 05/15] s390x/kvm: pass values instead of pointers to
From: |
Cornelia Huck |
Subject: |
[qemu-s390x] [PULL 05/15] s390x/kvm: pass values instead of pointers to kvm_s390_set_clock_*() |
Date: |
Mon, 2 Jul 2018 13:17:27 +0200 |
From: David Hildenbrand <address@hidden>
We are going to factor out the TOD into a separate device and use const
pointers for device class functions where possible. We are passing right
now ordinary pointers that should never be touched when setting the TOD.
Let's just pass the values directly.
Note that s390_set_clock() will be removed in a follow-on patch and
therefore its calling convention is not changed.
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
target/s390x/cpu.c | 4 ++--
target/s390x/kvm-stub.c | 4 ++--
target/s390x/kvm.c | 12 ++++++------
target/s390x/kvm_s390x.h | 4 ++--
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index c268065887..68512e3e54 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -413,9 +413,9 @@ int s390_set_clock(uint8_t *tod_high, uint64_t *tod_low)
int r = 0;
if (kvm_enabled()) {
- r = kvm_s390_set_clock_ext(tod_high, tod_low);
+ r = kvm_s390_set_clock_ext(*tod_high, *tod_low);
if (r == -ENXIO) {
- return kvm_s390_set_clock(tod_high, tod_low);
+ return kvm_s390_set_clock(*tod_high, *tod_low);
}
}
/* Fixme TCG */
diff --git a/target/s390x/kvm-stub.c b/target/s390x/kvm-stub.c
index 29b10542cc..bf7795e47a 100644
--- a/target/s390x/kvm-stub.c
+++ b/target/s390x/kvm-stub.c
@@ -60,12 +60,12 @@ int kvm_s390_get_clock_ext(uint8_t *tod_high, uint64_t
*tod_low)
return -ENOSYS;
}
-int kvm_s390_set_clock(uint8_t *tod_high, uint64_t *tod_low)
+int kvm_s390_set_clock(uint8_t tod_high, uint64_t tod_low)
{
return -ENOSYS;
}
-int kvm_s390_set_clock_ext(uint8_t *tod_high, uint64_t *tod_low)
+int kvm_s390_set_clock_ext(uint8_t tod_high, uint64_t tod_low)
{
return -ENOSYS;
}
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index ac370da281..8bcd832123 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -666,13 +666,13 @@ int kvm_s390_get_clock_ext(uint8_t *tod_high, uint64_t
*tod_low)
return r;
}
-int kvm_s390_set_clock(uint8_t *tod_high, uint64_t *tod_low)
+int kvm_s390_set_clock(uint8_t tod_high, uint64_t tod_low)
{
int r;
struct kvm_device_attr attr = {
.group = KVM_S390_VM_TOD,
.attr = KVM_S390_VM_TOD_LOW,
- .addr = (uint64_t)tod_low,
+ .addr = (uint64_t)&tod_low,
};
r = kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attr);
@@ -681,15 +681,15 @@ int kvm_s390_set_clock(uint8_t *tod_high, uint64_t
*tod_low)
}
attr.attr = KVM_S390_VM_TOD_HIGH;
- attr.addr = (uint64_t)tod_high;
+ attr.addr = (uint64_t)&tod_high;
return kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attr);
}
-int kvm_s390_set_clock_ext(uint8_t *tod_high, uint64_t *tod_low)
+int kvm_s390_set_clock_ext(uint8_t tod_high, uint64_t tod_low)
{
struct kvm_s390_vm_tod_clock gtod = {
- .epoch_idx = *tod_high,
- .tod = *tod_low,
+ .epoch_idx = tod_high,
+ .tod = tod_low,
};
struct kvm_device_attr attr = {
.group = KVM_S390_VM_TOD,
diff --git a/target/s390x/kvm_s390x.h b/target/s390x/kvm_s390x.h
index c383bf4ee9..36eb34bf99 100644
--- a/target/s390x/kvm_s390x.h
+++ b/target/s390x/kvm_s390x.h
@@ -25,8 +25,8 @@ int kvm_s390_get_ri(void);
int kvm_s390_get_gs(void);
int kvm_s390_get_clock(uint8_t *tod_high, uint64_t *tod_clock);
int kvm_s390_get_clock_ext(uint8_t *tod_high, uint64_t *tod_clock);
-int kvm_s390_set_clock(uint8_t *tod_high, uint64_t *tod_clock);
-int kvm_s390_set_clock_ext(uint8_t *tod_high, uint64_t *tod_clock);
+int kvm_s390_set_clock(uint8_t tod_high, uint64_t tod_clock);
+int kvm_s390_set_clock_ext(uint8_t tod_high, uint64_t tod_clock);
void kvm_s390_enable_css_support(S390CPU *cpu);
int kvm_s390_assign_subch_ioeventfd(EventNotifier *notifier, uint32_t sch,
int vq, bool assign);
--
2.14.4
- [qemu-s390x] [PULL 00/15] s390x patches for 3.0, Cornelia Huck, 2018/07/02
- [qemu-s390x] [PULL 01/15] s390/ipl: fix ipl with -no-reboot, Cornelia Huck, 2018/07/02
- [qemu-s390x] [PULL 02/15] loader: Check access size when calling rom_ptr() to avoid crashes, Cornelia Huck, 2018/07/02
- [qemu-s390x] [PULL 03/15] s390x/cpumodel: default enable bpb and ppa15 for z196 and later, Cornelia Huck, 2018/07/02
- [qemu-s390x] [PULL 04/15] s390x/tcg: avoid overflows in time2tod/tod2time, Cornelia Huck, 2018/07/02
- [qemu-s390x] [PULL 05/15] s390x/kvm: pass values instead of pointers to kvm_s390_set_clock_*(),
Cornelia Huck <=
- [qemu-s390x] [PULL 07/15] s390x/tcg: drop tod_basetime, Cornelia Huck, 2018/07/02
- [qemu-s390x] [PULL 09/15] s390x/tcg: SET CLOCK COMPARATOR can clear CKC interrupts, Cornelia Huck, 2018/07/02
- [qemu-s390x] [PULL 08/15] s390x/tcg: properly implement the TOD, Cornelia Huck, 2018/07/02
- [qemu-s390x] [PULL 06/15] s390x/tod: factor out TOD into separate device, Cornelia Huck, 2018/07/02
- [qemu-s390x] [PULL 11/15] s390x/tcg: rearm the CKC timer during migration, Cornelia Huck, 2018/07/02
- [qemu-s390x] [PULL 13/15] s390x/kvm: legacy_s390_alloc() only supports one allocation, Cornelia Huck, 2018/07/02
- [qemu-s390x] [PULL 10/15] s390x/tcg: implement SET CLOCK, Cornelia Huck, 2018/07/02
- [qemu-s390x] [PULL 12/15] s390x/tcg: fix CPU hotplug with single-threaded TCG, Cornelia Huck, 2018/07/02
- [qemu-s390x] [PULL 14/15] s390x/kvm: indicate alignment in legacy_s390_alloc(), Cornelia Huck, 2018/07/02
- [qemu-s390x] [PULL 15/15] s390x/tcg: fix locking problem with tcg_s390_tod_updated, Cornelia Huck, 2018/07/02