Received: by mail.netbsd.org (Postfix, from userid 605) id 5101B84E41; Sat, 18 Apr 2020 15:06:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id CA23A84E3F for ; Sat, 18 Apr 2020 15:06:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id gj0GtHtolVVa for ; Sat, 18 Apr 2020 15:06:19 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 3B0F584CD8 for ; Sat, 18 Apr 2020 15:06:19 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 364E9FB27; Sat, 18 Apr 2020 15:06:19 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Sat, 18 Apr 2020 15:06:19 +0000 From: "Manuel Bouyer" Subject: CVS commit: [bouyer-xenpvh] src/sys/arch To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20200418150619.364E9FB27@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: source-changes.NetBSD.org Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Manuel Bouyer" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: bouyer Date: Sat Apr 18 15:06:18 UTC 2020 Modified Files: src/sys/arch/x86/include [bouyer-xenpvh]: cpu.h cpuvar.h src/sys/arch/x86/x86 [bouyer-xenpvh]: cpu.c mainbus.c src/sys/arch/xen/include [bouyer-xenpvh]: hypervisor.h xen.h src/sys/arch/xen/x86 [bouyer-xenpvh]: cpu.c hypervisor_machdep.c xen_ipi.c xen_mainbus.c src/sys/arch/xen/xen [bouyer-xenpvh]: evtchn.c hypervisor.c xen_clock.c Log Message: Add PVHVM multiprocessor support: We need the hypervisor to be set up before cpus attaches. Move hypervisor setup to a new function xen_hvm_init(), called at the beggining of mainbus_attach(). This function searches the cfdata[] array to see if the hypervisor device is enabled (so you can disable PV support with disable hypervisor from userconf). For HVM, ci_cpuid doens't match the virtual CPU index needed by Xen. Introduce ci_vcpuid to cpu_info. Introduce xen_hvm_init_cpu(), to be called for each CPU in in its context, which initialize ci_vcpuid and ci_vcpu, and setup the event callback. Change Xen code to use ci_vcpuid. Do not call lapic_calibrate_timer() for VM_GUEST_XENPVHVM, we will use Xen timers. Don't call lapic_initclocks() from cpu_hatch(); instead set x86_cpu_initclock_func to lapic_initclocks() in lapic_calibrate_timer(), and call *(x86_cpu_initclock_func)() from cpu_hatch(). Also call x86_cpu_initclock_func from cpu_attach() for the boot CPU. As x86_cpu_initclock_func is called for all CPUs, x86_initclock_func can be a NOP for lapic timer. Reorganize Xen code for x86_initclock_func/x86_cpu_initclock_func. Move x86_cpu_idle_xen() to hypervisor_machdep.c To generate a diff of this commit: cvs rdiff -u -r1.117.4.5 -r1.117.4.6 src/sys/arch/x86/include/cpu.h cvs rdiff -u -r1.51 -r1.51.10.1 src/sys/arch/x86/include/cpuvar.h cvs rdiff -u -r1.181.4.2 -r1.181.4.3 src/sys/arch/x86/x86/cpu.c cvs rdiff -u -r1.3.12.2 -r1.3.12.3 src/sys/arch/x86/x86/mainbus.c cvs rdiff -u -r1.49.10.2 -r1.49.10.3 src/sys/arch/xen/include/hypervisor.h cvs rdiff -u -r1.44 -r1.44.8.1 src/sys/arch/xen/include/xen.h cvs rdiff -u -r1.133 -r1.133.4.1 src/sys/arch/xen/x86/cpu.c cvs rdiff -u -r1.36.8.3 -r1.36.8.4 src/sys/arch/xen/x86/hypervisor_machdep.c cvs rdiff -u -r1.35.6.3 -r1.35.6.4 src/sys/arch/xen/x86/xen_ipi.c cvs rdiff -u -r1.6.12.2 -r1.6.12.3 src/sys/arch/xen/x86/xen_mainbus.c cvs rdiff -u -r1.88.2.4 -r1.88.2.5 src/sys/arch/xen/xen/evtchn.c cvs rdiff -u -r1.73.2.5 -r1.73.2.6 src/sys/arch/xen/xen/hypervisor.c cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/xen/xen/xen_clock.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.