From: tip-bot for Juergen Gross <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, pbonzini@redhat.com,
torvalds@linux-foundation.org, hpa@zytor.com, jgross@suse.com,
mingo@kernel.org, peterz@infradead.org,
linux-kernel@vger.kernel.org
Subject: [tip:x86/platform] x86/virt, x86/platform: Add ->guest_late_init() callback to hypervisor_x86 structure
Date: Fri, 10 Nov 2017 01:43:08 -0800 [thread overview]
Message-ID: <tip-f3614646005a1b59f836ff54351c9bd2224b6005@git.kernel.org> (raw)
In-Reply-To: <20171109132739.23465-5-jgross@suse.com>
Commit-ID: f3614646005a1b59f836ff54351c9bd2224b6005
Gitweb: https://git.kernel.org/tip/f3614646005a1b59f836ff54351c9bd2224b6005
Author: Juergen Gross <jgross@suse.com>
AuthorDate: Thu, 9 Nov 2017 14:27:38 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 10 Nov 2017 10:03:13 +0100
x86/virt, x86/platform: Add ->guest_late_init() callback to hypervisor_x86 structure
Add a new guest_late_init callback to the hypervisor_x86 structure. It
will replace the current kvm_guest_init() call which is changed to
make use of the new callback.
Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: kvm@vger.kernel.org
Cc: rkrcmar@redhat.com
Link: http://lkml.kernel.org/r/20171109132739.23465-5-jgross@suse.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/include/asm/kvm_para.h | 2 --
arch/x86/include/asm/x86_init.h | 2 ++
arch/x86/kernel/kvm.c | 3 ++-
arch/x86/kernel/setup.c | 2 +-
arch/x86/kernel/x86_init.c | 1 +
5 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h
index c373e44..7b407dd 100644
--- a/arch/x86/include/asm/kvm_para.h
+++ b/arch/x86/include/asm/kvm_para.h
@@ -88,7 +88,6 @@ static inline long kvm_hypercall4(unsigned int nr, unsigned long p1,
#ifdef CONFIG_KVM_GUEST
bool kvm_para_available(void);
unsigned int kvm_arch_para_features(void);
-void __init kvm_guest_init(void);
void kvm_async_pf_task_wait(u32 token, int interrupt_kernel);
void kvm_async_pf_task_wake(u32 token);
u32 kvm_read_and_reset_pf_reason(void);
@@ -103,7 +102,6 @@ static inline void kvm_spinlock_init(void)
#endif /* CONFIG_PARAVIRT_SPINLOCKS */
#else /* CONFIG_KVM_GUEST */
-#define kvm_guest_init() do {} while (0)
#define kvm_async_pf_task_wait(T, I) do {} while(0)
#define kvm_async_pf_task_wake(T) do {} while(0)
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index 260e9a8..5dd011a 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -117,11 +117,13 @@ struct x86_init_pci {
/**
* struct x86_hyper_init - x86 hypervisor init functions
* @init_platform: platform setup
+ * @guest_late_init: guest late init
* @x2apic_available: X2APIC detection
* @init_mem_mapping: setup early mappings during init_mem_mapping()
*/
struct x86_hyper_init {
void (*init_platform)(void);
+ void (*guest_late_init)(void);
bool (*x2apic_available)(void);
void (*init_mem_mapping)(void);
};
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index a94de09..4b1f6f5 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -465,7 +465,7 @@ static void __init kvm_apf_trap_init(void)
update_intr_gate(X86_TRAP_PF, async_page_fault);
}
-void __init kvm_guest_init(void)
+static void __init kvm_guest_init(void)
{
int i;
@@ -548,6 +548,7 @@ const __initconst struct hypervisor_x86 x86_hyper_kvm = {
.name = "KVM",
.detect = kvm_detect,
.type = X86_HYPER_KVM,
+ .init.guest_late_init = kvm_guest_init,
.init.x2apic_available = kvm_para_available,
};
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 0957dd7..372da52 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1294,7 +1294,7 @@ void __init setup_arch(char **cmdline_p)
io_apic_init_mappings();
- kvm_guest_init();
+ x86_init.hyper.guest_late_init();
e820__reserve_resources();
e820__register_nosave_regions(max_low_pfn);
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 5b2d10c..c8fa4cd 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -86,6 +86,7 @@ struct x86_init_ops x86_init __initdata = {
.hyper = {
.init_platform = x86_init_noop,
+ .guest_late_init = x86_init_noop,
.x2apic_available = bool_x86_init_noop,
.init_mem_mapping = x86_init_noop,
},
next prev parent reply other threads:[~2017-11-10 9:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 13:27 [PATCH v2 0/5] x86/xen: support booting PVH guest via standard boot path Juergen Gross
2017-11-09 13:27 ` [PATCH v2 1/5] x86: merge x86_hyper into x86_platform and x86_init Juergen Gross
2017-11-10 9:41 ` [tip:x86/platform] x86/virt, x86/platform: Merge 'struct x86_hyper' into 'struct x86_platform' and 'struct x86_init' tip-bot for Juergen Gross
2017-11-09 13:27 ` [PATCH v2 2/5] x86: add enum for hypervisors to replace x86_hyper Juergen Gross
2017-11-09 17:57 ` Xavier Deguillard
2017-11-10 9:42 ` [tip:x86/platform] x86/virt: Add " tip-bot for Juergen Gross
2017-11-10 18:26 ` [PATCH v2 2/5] x86: add " Dmitry Torokhov
2017-11-10 20:39 ` KY Srinivasan
2017-11-09 13:27 ` [PATCH v2 3/5] x86/acpi: add test for ACPI_FADT_NO_VGA Juergen Gross
2017-11-10 9:42 ` [tip:x86/platform] x86/virt, x86/acpi: Add " tip-bot for Juergen Gross
2017-11-09 13:27 ` [PATCH v2 4/5] x86: add guest_late_init hook to hypervisor_x86 structure Juergen Gross
2017-11-10 9:43 ` tip-bot for Juergen Gross [this message]
2017-11-09 13:27 ` [PATCH v2 5/5] x86/xen: use guest_late_init to detect Xen PVH guest Juergen Gross
2017-11-10 9:43 ` [tip:x86/platform] x86/virt/xen: Use " tip-bot for Juergen Gross
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=tip-f3614646005a1b59f836ff54351c9bd2224b6005@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/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).