diff mbox series

[v4,2/4] kvm: x86: set wall_clock in kvm_write_wall_clock()

Message ID 20200818152429.1923996-3-oupton@google.com (mailing list archive)
State New, archived
Headers show
Series Restrict PV features to only enabled guests | expand

Commit Message

Oliver Upton Aug. 18, 2020, 3:24 p.m. UTC
Small change to avoid meaningless duplication in the subsequent patch.
No functional change intended.

Reviewed-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Peter Shier <pshier@google.com>
Signed-off-by: Oliver Upton <oupton@google.com>
Change-Id: I77ab9cdad239790766b7a49d5cbae5e57a3005ea
---
 arch/x86/kvm/x86.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Wanpeng Li Aug. 19, 2020, 12:19 a.m. UTC | #1
On Tue, 18 Aug 2020 at 23:24, Oliver Upton <oupton@google.com> wrote:
>
> Small change to avoid meaningless duplication in the subsequent patch.
> No functional change intended.
>
> Reviewed-by: Jim Mattson <jmattson@google.com>
> Reviewed-by: Peter Shier <pshier@google.com>
> Signed-off-by: Oliver Upton <oupton@google.com>

Reviewed-by: Wanpeng Li <wanpengli@tencent.com>

> Change-Id: I77ab9cdad239790766b7a49d5cbae5e57a3005ea
> ---
>  arch/x86/kvm/x86.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index b7ba8eb0c91b..e16c71fe1b48 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -1791,6 +1791,8 @@ static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock)
>         struct pvclock_wall_clock wc;
>         u64 wall_nsec;
>
> +       kvm->arch.wall_clock = wall_clock;
> +
>         if (!wall_clock)
>                 return;
>
> @@ -2998,7 +3000,6 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
>                 break;
>         case MSR_KVM_WALL_CLOCK_NEW:
>         case MSR_KVM_WALL_CLOCK:
> -               vcpu->kvm->arch.wall_clock = data;
>                 kvm_write_wall_clock(vcpu->kvm, data);
>                 break;
>         case MSR_KVM_SYSTEM_TIME_NEW:
> --
> 2.28.0.220.ged08abb693-goog
>
diff mbox series

Patch

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index b7ba8eb0c91b..e16c71fe1b48 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1791,6 +1791,8 @@  static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock)
 	struct pvclock_wall_clock wc;
 	u64 wall_nsec;
 
+	kvm->arch.wall_clock = wall_clock;
+
 	if (!wall_clock)
 		return;
 
@@ -2998,7 +3000,6 @@  int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
 		break;
 	case MSR_KVM_WALL_CLOCK_NEW:
 	case MSR_KVM_WALL_CLOCK:
-		vcpu->kvm->arch.wall_clock = data;
 		kvm_write_wall_clock(vcpu->kvm, data);
 		break;
 	case MSR_KVM_SYSTEM_TIME_NEW: