hypercalls.c (b8fa3e3833c14151a47ebebbc5427dcfe94bb407) hypercalls.c (47053904e18282af4525a02e3e0f519f014fc7f9)
1// SPDX-License-Identifier: GPL-2.0
2// Copyright (C) 2019 Arm Ltd.
3
4#include <linux/arm-smccc.h>
5#include <linux/kvm_host.h>
6
7#include <asm/kvm_emulate.h>
8

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

39 /*
40 * The guest selects one of the two reference counters
41 * (virtual or physical) with the first argument of the SMCCC
42 * call. In case the identifier is not supported, error out.
43 */
44 feature = smccc_get_arg1(vcpu);
45 switch (feature) {
46 case KVM_PTP_VIRT_COUNTER:
1// SPDX-License-Identifier: GPL-2.0
2// Copyright (C) 2019 Arm Ltd.
3
4#include <linux/arm-smccc.h>
5#include <linux/kvm_host.h>
6
7#include <asm/kvm_emulate.h>
8

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

39 /*
40 * The guest selects one of the two reference counters
41 * (virtual or physical) with the first argument of the SMCCC
42 * call. In case the identifier is not supported, error out.
43 */
44 feature = smccc_get_arg1(vcpu);
45 switch (feature) {
46 case KVM_PTP_VIRT_COUNTER:
47 cycles = systime_snapshot.cycles - vcpu_read_sys_reg(vcpu, CNTVOFF_EL2);
47 cycles = systime_snapshot.cycles - vcpu->kvm->arch.timer_data.voffset;
48 break;
49 case KVM_PTP_PHYS_COUNTER:
50 cycles = systime_snapshot.cycles;
51 break;
52 default:
53 return;
54 }
55

--- 426 unchanged lines hidden ---
48 break;
49 case KVM_PTP_PHYS_COUNTER:
50 cycles = systime_snapshot.cycles;
51 break;
52 default:
53 return;
54 }
55

--- 426 unchanged lines hidden ---