From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Marcelo Tosatti <mtosatti@redhat.com>,
Gleb Natapov <gleb@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
"H. Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
Nadav Amit <namit@cs.technion.ac.il>
Subject: linux-next: manual merge of the kvm tree with the tip tree
Date: Tue, 26 May 2015 14:45:27 +1000 [thread overview]
Message-ID: <20150526144527.07dfc438@canb.auug.org.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 2675 bytes --]
Hi all,
Today's linux-next merge of the kvm tree got conflicts in
arch/x86/include/asm/kvm_host.h and arch/x86/kvm/x86.c between commit
0ee6a5172573 ("x86/fpu, kvm: Simplify fx_init()") (and a few others)
from the tip tree and commit d28bc9dd25ce ("KVM: x86: INIT and reset
sequences are different") from the kvm tree.
I fixed it up (since the former commit made fx_init() static, I just
removed the declaration and see below) and can carry the fix as
necessary (no action is required).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc arch/x86/kvm/x86.c
index 989cfc01e2a5,457b908244f2..000000000000
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@@ -7002,11 -7088,19 +7089,13 @@@ int kvm_arch_vcpu_ioctl_set_fpu(struct
return 0;
}
- static void fx_init(struct kvm_vcpu *vcpu)
-int fx_init(struct kvm_vcpu *vcpu, bool init_event)
++static void fx_init(struct kvm_vcpu *vcpu, bool init_event)
{
- fpstate_init(&vcpu->arch.guest_fpu.state);
- int err;
-
- err = fpu_alloc(&vcpu->arch.guest_fpu);
- if (err)
- return err;
-
+ if (!init_event)
- fpu_finit(&vcpu->arch.guest_fpu);
++ fpstate_init(&vcpu->arch.guest_fpu.state);
+
if (cpu_has_xsaves)
- vcpu->arch.guest_fpu.state->xsave.xsave_hdr.xcomp_bv =
+ vcpu->arch.guest_fpu.state.xsave.header.xcomp_bv =
host_xcr0 | XSTATE_COMPACTION_ENABLED;
/*
@@@ -7038,16 -7140,25 +7127,25 @@@ void kvm_put_guest_fpu(struct kvm_vcpu
{
kvm_put_guest_xcr0(vcpu);
- if (!vcpu->guest_fpu_loaded)
+ if (!vcpu->guest_fpu_loaded) {
+ vcpu->fpu_counter = 0;
return;
+ }
vcpu->guest_fpu_loaded = 0;
- fpu_save_init(&vcpu->arch.guest_fpu);
+ copy_fpregs_to_fpstate(&vcpu->arch.guest_fpu);
__kernel_fpu_end();
++vcpu->stat.fpu_reload;
- if (!vcpu->arch.eager_fpu)
- kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu);
-
+ /*
+ * If using eager FPU mode, or if the guest is a frequent user
+ * of the FPU, just leave the FPU active for next time.
+ * Every 255 times fpu_counter rolls over to 0; a guest that uses
+ * the FPU in bursts will revert to loading it on demand.
+ */
+ if (!use_eager_fpu()) {
+ if (++vcpu->fpu_counter < 5)
+ kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu);
+ }
trace_kvm_fpu(0);
}
@@@ -7346,7 -7450,9 +7445,7 @@@ int kvm_arch_vcpu_init(struct kvm_vcpu
goto fail_free_mce_banks;
}
- fx_init(vcpu);
- r = fx_init(vcpu, false);
- if (r)
- goto fail_free_wbinvd_dirty_mask;
++ fx_init(vcpu, false);
vcpu->arch.ia32_tsc_adjust_msr = 0x0;
vcpu->arch.pv_time_enabled = false;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next reply other threads:[~2015-05-26 4:45 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-26 4:45 Stephen Rothwell [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-01-18 0:32 linux-next: manual merge of the kvm tree with the tip tree Stephen Rothwell
2022-12-01 0:18 Stephen Rothwell
2022-12-01 0:14 Stephen Rothwell
2022-12-15 23:26 ` Stephen Rothwell
2022-01-10 2:16 Stephen Rothwell
2022-01-10 2:28 ` Like Xu
2021-12-13 17:46 broonie
2021-12-13 18:14 ` Paolo Bonzini
2021-12-13 18:23 ` Mark Brown
2021-10-25 5:11 Stephen Rothwell
2021-10-21 2:39 Stephen Rothwell
2021-10-21 15:32 ` Borislav Petkov
2021-04-22 4:30 Stephen Rothwell
2021-04-22 4:45 ` Nadav Amit
2021-04-22 4:58 ` Stephen Rothwell
2021-04-22 6:29 ` Paolo Bonzini
2020-07-29 6:47 Stephen Rothwell
2020-07-17 5:25 Stephen Rothwell
2020-06-02 4:53 Stephen Rothwell
2020-06-04 3:09 ` Stephen Rothwell
2020-01-16 2:48 Stephen Rothwell
2018-12-19 4:12 Stephen Rothwell
2018-12-17 5:22 Stephen Rothwell
2018-10-19 3:25 Stephen Rothwell
2018-08-08 3:54 Stephen Rothwell
2018-08-15 4:27 ` Stephen Rothwell
2018-08-06 5:12 Stephen Rothwell
2018-08-06 6:27 ` Tianyu Lan
2018-02-02 0:51 Stephen Rothwell
2018-01-15 2:39 Stephen Rothwell
2017-08-28 4:52 Stephen Rothwell
2017-09-04 6:09 ` Stephen Rothwell
2017-08-25 4:39 Stephen Rothwell
2017-08-25 6:39 ` Paolo Bonzini
2017-08-25 13:57 ` Tom Lendacky
2017-08-25 16:53 ` Brijesh Singh
2017-08-25 20:05 ` Paolo Bonzini
2017-08-25 20:41 ` Brijesh Singh
2017-08-25 20:42 ` Paolo Bonzini
2017-08-26 7:24 ` Ingo Molnar
2016-11-28 3:56 Stephen Rothwell
2016-11-17 3:50 Stephen Rothwell
2016-11-17 7:07 ` Thomas Gleixner
2016-11-17 21:31 ` Stephen Rothwell
2016-05-12 2:54 Stephen Rothwell
2015-06-19 4:59 Michael Ellerman
2012-11-30 4:26 Stephen Rothwell
2012-05-16 7:14 Stephen Rothwell
2012-05-16 7:53 ` Gleb Natapov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150526144527.07dfc438@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=gleb@kernel.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mtosatti@redhat.com \
--cc=namit@cs.technion.ac.il \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).