Home | History | Annotate | Download | only in include
History log of /src/sys/arch/xen/include/xen.h
RevisionDateAuthorComments
 1.48  24-Mar-2023  bouyer Allow a PVH dom0 to use VGA as console: make xen_pvh_consinit() return 1 if
it handles the console and 0 otherwise (especially when console=tty0 or
console=pc is present on the command line).
In consinit() fallback to native console selection if xen_pvh_consinit()
returns 0.
 1.47  02-May-2020  bouyer branches: 1.47.20;
Introduce Xen PVH support in GENERIC.
This is compiled in with
options XENPVHVM
x86 changes:
- add Xen section and xen pvh entry points to locore.S. Set vm_guest
to VM_GUEST_XENPVH in this entry point.
Most of the boot procedure (especially page table setup and switch to
paged mode) is shared with native.
- change some x86_delay() to delay_func(), which points to x86_delay() for
native/HVM, and xen_delay() for PVH

Xen changes:
- remove Xen bits from init_x86_64_ksyms() and init386_ksyms()
and move to xen_init_ksyms(), used for both PV and PVH
- set ISA no-legacy-devices property for PVH
- factor out code from Xen's cpu_bootconf() to xen_bootconf()
in xen_machdep.c
- set up a specific pvh_consinit() which starts with printk()
(which uses a simple hypercall that is available early) and switch to
xencons when we can use pmap_kenter_pa().
 1.46  25-Apr-2020  bouyer Merge the bouyer-xenpvh branch, bringing in Xen PV drivers support under HVM
guests in GENERIC.
Xen support can be disabled at runtime with
boot -c
disable hypervisor
 1.45  09-Apr-2020  jdolecek update to __XEN_INTERFACE_VERSION__ 0x0003020a aka Xen 3.2.10

this brings grant memory v2 support:
- status separated from flags - revoking access needs just memory barrier,
no need for expensive cmpxchg16 any more
- sub-page hypervisor copy-only grants, to be used by xennet(4)
- 64-bit frame, i.e. support for DomU RAM >16TB

the grant table is now always allocated on boot to maximum size, it's now
never grown in runtime; switch back to regular kmem_alloc()/kmem_free()

code now requires v2 support, no compatibility for grant version 1 retained -
Xen v2 support predates all currently supported Xen versions

also interface for baloon changed slightly, code updated
 1.44  09-May-2019  bouyer branches: 1.44.8;
sti/cli are not allowed on Xen, we have to clear/set a bit in the
shared page. Revert x86_disable_intr/x86_enable_intr to plain function
calls on XENPV.
While there, clean up unused functions and macros, and change cli()/sti()
macros to x86_disable_intr/x86_enable_intr.
Makes Xen domU boot again
(http://www-soc.lip6.fr/~bouyer/NetBSD-tests/xen/HEAD/)
 1.43  04-Feb-2019  cherry Bump up XEN source API compatibility to 0x00030208 from 0x00030201,

but maintain backwards source API compilation compatibility.

ie; sources with config(5)
options __XEN_INTERFACE_VERSION__=0x00030201 # Xen 3.1 interface

should compile and run without problems.

Not that API version 0x00030201 is the lowest version we support now.
 1.42  02-Feb-2019  cherry Switch NetBSD/xen to use XEN api tag RELEASE-4.11.1

The headers for this api are in sys/external/mit/xen-include-public/dist/
 1.41  10-Oct-2018  cherry In xen_atomic_test_and_clear_bit()

Use the appropriate sized variable for inline assembler.
 1.40  07-Oct-2018  mlelstv Support bootspec.
 1.39  26-Jul-2018  maxv Merge the content of xen_debug.c into xen_machdep.c, there is only one
function.
 1.38  26-Jul-2018  maxv Remove dead code. This looks like a leftover from when our Xen port was
being developed (2004), and it seems to have been copied from the Xen
kernel examples. It can't have any use, so get rid of it. Also remove
vprintk, unused.
 1.37  07-Jul-2016  msaitoh branches: 1.37.10; 1.37.16; 1.37.18;
KNF. Remove extra spaces. No functional change.
 1.36  29-May-2016  bouyer Switch to elf notes for amd64 instead of the old key=value list to describe the
guest requirements and support.
Add infrastructure to query the hypervisor about features support.
For verbose boot, print the features suppoted by the hypervisor for this
guest.
 1.35  20-Sep-2011  jym branches: 1.35.12; 1.35.30;
Merge jym-xensuspend branch in -current. ok bouyer@.

Goal: save/restore support in NetBSD domUs, for i386, i386 PAE and amd64.

Executive summary:
- split all Xen drivers (xenbus(4), grant tables, xbd(4), xennet(4))
in two parts: suspend and resume, and hook them to pmf(9).
- modify pmap so that Xen hypervisor does not cry out loud in case
it finds "unexpected" recursive memory mappings
- provide a sysctl(7), machdep.xen.suspend, to command suspend from
userland via powerd(8). Note: a suspend can only be handled correctly
when dom0 requested it, so provide a mechanism that will prevent
kernel to blindly validate user's commands

The code is still in experimental state, use at your own risk: restore
can corrupt backend communications rings; this can completely thrash
dom0 as it will loop at a high interrupt level trying to honor
all domU requests.

XXX PAE suspend does not work in amd64 currently, due to (yet again!)
page validation issues with hypervisor. Will fix.

XXX secondary CPUs are not suspended, I will write the handlers
in sync with cherry's Xen MP work.

Tested under i386 and amd64, bear in mind ring corruption though.

No build break expected, GENERICs and XEN* kernels should be fine.
./build.sh distribution still running. In any case: sorry if it does
break for you, contact me directly for reports.
 1.34  17-Jul-2011  joerg Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.33  17-Apr-2011  mrg apply some _KERNEL_OPT.
 1.32  29-Jul-2009  cegger branches: 1.32.4; 1.32.6;
remove Xen2 support.
ok bouyer@
 1.31  13-Feb-2009  bouyer Work in progress on PCI front-end/back-end support
front-end:
- add a xpci* at xenbus? which provides pci busses from the dom0
xpci provides support routines for PCI config space operations and
enumeration in xpci_xenbus.c
- hypervisor.c: do dom0-style PCI attach only ifdef DOM0OPS
- pci_intr_machdep.c: check line value only if DOM0OPS

back-end:
- add a pciback* at pci? device which takes precedences over all
other PCI devices (match return 500) and matches all devices passed
to pciback.hide option on boot command line.
It exports the PCI device informations to files in /kern/xen/pci/
- hypervisor.c: create /kern/xen earlier so pciback can create its
entries while PCI devices are probed
- xen_machdep.c: add handling for pciback.hide=

frontend is know working on Xen 3.1.x dom0 with ahc(4) and pciide(4)
devices. uhci(4) fail when trying to allocate a large contigous DMA
buffer.

backend is work in progress; support in xentools is not there yet.
 1.30  21-Oct-2008  cegger branches: 1.30.2; 1.30.4; 1.30.8; 1.30.12;
introduce two macros: xendomain_is_dom0() and xendomain_is_privileged(). Use them.
 1.29  21-Apr-2008  cegger branches: 1.29.2; 1.29.8;
Access Xen's vcpu info structure per-CPU.
Tested on i386 and amd64 (both dom0 and domU) by me.
Xen2 tested (both dom0 and domU) by bouyer.
OK bouyer
 1.28  19-Feb-2008  bouyer branches: 1.28.6; 1.28.8;
The event bitmasks provided by the hypervisor are unsigned long (so 64bits
on amd64). Make sure to use the right type to store and manipulate them.
This fixes amd64, where basically any event channel > 31 was not working
(and you get there after starting/stopping a domU a few times). Things
would occasionally unwedge though the spllower() callbacks.
 1.27  19-Feb-2008  bouyer Fix xenevt to not call softint_schedule() above IPL_HIGH:
Register a ipl callback for IPL_HIGH.
if the current ipl level is too high, just record the event in a bitmap,
and record IPL_HIGH as pending. The callback will process the pending events.
 1.26  11-Jan-2008  bouyer Merge the bouyer-xeni386 branch to head, at tag bouyer-xeni386-merge1 (the
branch is still active and will see i386PAE support developement).
Sumary of changes:
- switch xeni386 to the x86/x86/pmap.c, and the xen/x86/x86_xpmap.c
pmap bootstrap.
- merge back most of xen/i386/ to i386/i386
- change the build to reduce diffs between i386 and amd64 in file locations
- remove include files that were identical to the i386/amd64 counterparts,
the build will find them via the xen-ma/machine link.
 1.25  22-Nov-2007  bouyer branches: 1.25.6;
Pull up the bouyer-xenamd64 branch to HEAD. This brings in amd64 support
to NetBSD/Xen, both Dom0 and DomU.
 1.24  17-Oct-2007  garbled branches: 1.24.2;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.23  26-Sep-2007  ad branches: 1.23.2;
x86 changes for pcc and LKMs.

- Replace most inline assembly with proper functions. As a side effect
this reduces the size of amd64 GENERIC by about 120kB, and i386 by a
smaller amount. Nearly all of the inlines did something slow, or something
that does not need to be fast.
- Make curcpu() and curlwp functions proper, unless __GNUC__ && _KERNEL.
In that case make them inlines. Makes curlwp LKM and preemption safe.
- Make bus_space and bus_dma more LKM friendly.
- Share a few more files between the ports.
- Other minor changes.
 1.22  23-Sep-2007  bouyer branches: 1.22.2;
Ajust for Xen 3.1.0 public headers. From Christoph Egger in private mail.
 1.21  06-Mar-2006  bouyer branches: 1.21.22; 1.21.30; 1.21.40; 1.21.42;
Add xen_atomic_cmpxchg16(), which exports the cmpxchgw instruction to C.
 1.20  16-Feb-2006  perry branches: 1.20.2;
Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
 1.19  15-Jan-2006  bouyer branches: 1.19.2; 1.19.4;
Snapshot of work in progress on NetBSD port to Xen3:
- kernel (both dom0 and domU) boot, console is functionnal and it can starts
software from a ramdisk
- there is no driver front-end expect console for domU yet.
- dom0 can probe devices and ex(4) work when Xen3 is booted without acpi
and apic support. But the on-board IDE doens't get interrupts.
The PCI code still needs work (it's hardcoded to mode 1). Some of this
code should be shared with ../x86
The physical insterrupt code needs to get MPBIOS and ACPI support, and
do interrupt routing to properly interract with Xen.
To enable Xen-3.0 support, add
options XEN3
to your kernel config file (this will disable Xen2 support)
Changes affecting Xen-2.0 support (no functionnal changes intended):
- get more constants from genassym for assembly code
- remove some unneeded registers move from start()
- map the shared info page from start(), and remove the pte = 0xffffffff hack
- vector.S: in hypervisor_callback() make sure %esi points to
HYPERVISOR_shared_info before accessing the info page. Remplace some
hand-written assembly with the equivalent macro defined in frameasm.h
- more debug code, dissabled by default.

while here added my copyright on some files I worked on in 2005.
 1.18  24-Dec-2005  perry branches: 1.18.2;
__asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
 1.17  24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.16  11-Dec-2005  christos merge ktrace-lwp.
 1.15  15-Jun-2005  bouyer branches: 1.15.2;
Add support for x86 boot flags:
-s boot single user
-a ask root device
XXX -d is ifdef'd out for now, it cause early panic (no console message).
 1.14  31-May-2005  yamt always provide prototype of printk for now. because:
- currently its implementation is always compiled in.
- there're users which don't honor XENDEBUG.
 1.13  31-May-2005  yamt x86_variable_test_bit: don't remove const qualifier unnecessarily.
 1.12  11-Apr-2005  yamt fix a bug which corrupts runqueue.
when dealing with events, which are handed to xenevt pseudo device,
don't call wakeup(9)/selnotify(9) at too high IPL. PR/29792.
 1.11  26-Mar-2005  bouyer Don't assume we're on a uniprocessor system (the hypervisor may be running SMP)
and add "lock;" barrier to avoid instruction reordering in event handlings.
This fix the last issue with event loss I was getting on SMP systems.
 1.10  09-Mar-2005  bouyer branches: 1.10.2;
Merge the bouyer-xen2 branch. This add supports for the Xen 2.0 virtual
machine kernel (both privileged and non-privileged domains), and remove support
for the old xen 1.2.
 1.9  10-Dec-2004  christos branches: 1.9.2; 1.9.4; 1.9.6;
don't use va_list here; use _BSD_VA_LIST_ because we could be included
before va_list is defined. This is common practice for kernel header
files (syslog.h)
 1.8  14-Jun-2004  cl branches: 1.8.2;
cleanup low-level bit mangling code
 1.7  07-May-2004  cl Add support for domain0 operations:
- access to all physical memory
- access to hypervisor traps from userland
- setup/config Xen's network routing/firewall rules
 1.6  07-May-2004  cl cleanup debugging code
 1.5  26-Apr-2004  cl Move struct xen_netinfo into include/xen.h so that xen12load compiles again.
 1.4  24-Apr-2004  cl Make kernel command line parsing support additional keywords without
having to change existing code which calls the parser.
 1.3  24-Apr-2004  cl Consistently use xencons for eveything reffering to Xen's virtual console.

rename arch/xen/xen/console.c -> arch/xen/xen/xencons.c
 1.2  17-Apr-2004  cl - fix event dispatching for event 0
- use struct trapframe instead of struct pt_regs
 1.1  11-Mar-2004  cl branches: 1.1.2;
Add port to the Xen virtual machine monitor.
(see http://www.cl.cam.ac.uk/Research/SRG/netos/xen/)
 1.1.2.2  17-Jun-2004  tron Pull up revision 1.8 (requested by cl in ticket #498):
cleanup low-level bit mangling code
 1.1.2.1  22-May-2004  he Pull up revisions 1.2-1.7 (requested by cl in ticket #337):
Upgrade xen support:
- add block device driver
- network device driver bug fixes
- support for vga/keyboard/mouse
- support for domain0 operations
- fix /dev/mem and i386_iopl, reboot, event dispatch
- fix clock support, cpu speed report, lazy fpu switching
- add xen12load loader
- sys/arch/xen parts of build.sh release support
[cl, ticket #337]
 1.8.2.7  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.2.6  01-Apr-2005  skrll Sync with HEAD.
 1.8.2.5  18-Dec-2004  skrll Sync with HEAD.
 1.8.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.8.2.2  03-Aug-2004  skrll Sync with HEAD
 1.8.2.1  14-Jun-2004  skrll file xen.h was added on branch ktrace-lwp on 2004-08-03 10:43:11 +0000
 1.9.6.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.9.4.1  29-Apr-2005  kent sync with -current
 1.9.2.6  16-Feb-2005  bouyer Glue xen_shm and the block and network backends to the system.
 1.9.2.5  12-Feb-2005  bouyer Remove prototypes for xenvfr_init and xenmachmem_init
 1.9.2.4  31-Jan-2005  bouyer First pieces of domain control operations:
- use an up to date xenio.h
- update privcmd.c for newer ioctls (incomplete, some just return an error for
now)
- add a /dev/xenevt pseudo-device, which provide to userland an interface to
xen events
Now xend starts, and basic xm commands (such as list) work.
 1.9.2.3  18-Jan-2005  bouyer The wbinvd instruction can't be used with xen, it case a kernel trap.
Implement wbinvd() with MMUEXT_FLUSH_CACHE.
Make shared_info_t volatile.
 1.9.2.2  17-Dec-2004  bouyer Merge change from rev 1.9
 1.9.2.1  13-Dec-2004  bouyer Commit files from netbsd-2.0-xen-sparse/sys/arch/xen in the Xen-2.0
distribution. These are the files modified from the 2.0 tree to get
NetBSD/xen working with Xen 2.
 1.10.2.6  07-Apr-2006  tron Apply patch (requested by bouyer in ticket #1245):
Pull up Xen3 domU support. This adds support for the Xen-3 memory bootstrap,
xenstore, and block and network device frontend. Xen-3 support is turned
on by 'options XEN3', which disable Xen-2 support.
Changes affecting non-xen3 specific code:
- xbd and xennet at hypervisor now attaches with xbd_hypervisor and
xennet_hypervisor
- x86_atomic_* renamed to xen_atomic_*
- use genassim.cf to pull in more constant from include files for assembly
- Map the shared info page from locore.S instead of the 0xffffffff hack
in xen_machdep.c
- remove some unused code
- some __asm__ __volatile__ -> __asm volatile and __inline__ -> inline
- more debug code
 1.10.2.5  28-Jun-2005  tron Pull up revision 1.15 (requested by bouyer in ticket #481):
Add support for x86 boot flags:
-s boot single user
-a ask root device
XXX -d is ifdef'd out for now, it cause early panic (no console message).
 1.10.2.4  18-Jun-2005  tron Pull up revision 1.14 (requested by yamt in ticket #462):
always provide prototype of printk for now. because:
- currently its implementation is always compiled in.
- there're users which don't honor XENDEBUG.
 1.10.2.3  18-Jun-2005  tron Pull up revision 1.13 (requested by yamt in ticket #461):
x86_variable_test_bit: don't remove const qualifier unnecessarily.
 1.10.2.2  13-Apr-2005  tron Pull up revision 1.12 (requested by yamt in ticket #146):
fix a bug which corrupts runqueue.
when dealing with events, which are handed to xenevt pseudo device,
don't call wakeup(9)/selnotify(9) at too high IPL. PR/29792.
 1.10.2.1  30-Mar-2005  tron Pull up revision 1.11 (requested by bouyer in ticket #71):
Don't assume we're on a uniprocessor system (the hypervisor may be running SMP)
and add "lock;" barrier to avoid instruction reordering in event handlings.
This fix the last issue with event loss I was getting on SMP systems.
 1.15.2.5  27-Feb-2008  yamt sync with head.
 1.15.2.4  21-Jan-2008  yamt sync with head
 1.15.2.3  07-Dec-2007  yamt sync with head
 1.15.2.2  27-Oct-2007  yamt sync with head.
 1.15.2.1  21-Jun-2006  yamt sync with head.
 1.18.2.2  18-Feb-2006  yamt sync with head.
 1.18.2.1  01-Feb-2006  yamt sync with head.
 1.19.4.1  22-Apr-2006  simonb Sync with head.
 1.19.2.1  09-Sep-2006  rpaulo sync with head
 1.20.2.1  13-Mar-2006  yamt sync with head.
 1.21.42.3  23-Mar-2008  matt sync with HEAD
 1.21.42.2  09-Jan-2008  matt sync with HEAD
 1.21.42.1  06-Nov-2007  matt sync with HEAD
 1.21.40.2  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.21.40.1  02-Oct-2007  joerg Sync with HEAD.
 1.21.30.1  03-Oct-2007  garbled Sync with HEAD
 1.21.22.2  03-Dec-2007  ad Sync with HEAD.
 1.21.22.1  09-Oct-2007  ad Sync with head.
 1.22.2.1  06-Oct-2007  yamt sync with head.
 1.23.2.1  17-Oct-2007  bouyer Prepare for xenamd64:
- kill xen/i386/identcpu.c, use i386/i386/identcpu.c instead (with a few
#ifndef XEN)
- move some files that can be shared between i386 and amd64 from
xen/i386 to xen/x86 (or to xen/xen for non-cpu-specific code)
- split assembly out of xen/include/hypervisor.h to xen/include/hypercalls.h
- use <xen/...> instead of <machine/...> for cpu-independant include files.

more work needed here, i386-specific files should got out of arch/xen to
arch/xeni386, and more code shared with arch/i386.
 1.24.2.2  18-Feb-2008  mjf Sync with HEAD.
 1.24.2.1  08-Dec-2007  mjf Sync with HEAD.
 1.25.6.1  08-Jan-2008  bouyer Make XEN kernels build again.
 1.28.8.1  18-May-2008  yamt sync with head.
 1.28.6.2  17-Jan-2009  mjf Sync with HEAD.
 1.28.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.29.8.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.29.2.2  19-Aug-2009  yamt sync with head.
 1.29.2.1  04-May-2009  yamt sync with head.
 1.30.12.1  21-Apr-2010  matt sync to netbsd-5
 1.30.8.8  27-Aug-2011  jym Rename the functions for suspend to reflect that Xen does not hijack
the ACPI "sleepstate" sysctl(7) node anymore.

Add a boolean value to mark that the save/suspend operation has been
notified by dom0, so as to avoid possible errors where admin would like
to schedule the domain for sleep without dom0 being prepared for that. Fail
with EAGAIN in this case.

Sprinkle some KNF.
 1.30.8.7  27-Aug-2011  jym (HEAD fix) _BSD_VA_LIST_ => va_list
 1.30.8.6  27-Aug-2011  jym Further sync with HEAD.
 1.30.8.5  02-May-2011  jym Sync with head.
 1.30.8.4  01-Nov-2009  jym - Upgrade suspend/resume code to comply with Xen2 removal.
- Add support for PAE domUs suspend/resume.
- Fix an issue regarding initialization of the xbd ring I/O that could end
badly during resume, with invalid block operations submitted to dom0 backend.

NetBSD supports PAE under x86_32 by considering the L2 page as being
4 pages long instead of 1.

Xen validates the page types during resume. Sadly, the hypervisor handles
alternative recursive mappings (== PG/PD entries pointing to pages other
than self) inadequately, which could lead to incorrect page pinning.

As a result, the important change with this patch is to clear these alternative
mappings during suspend, and reset them back to their former self upon
resume. For PAE, approx. all 4 PDIR_SLOT_PTEs could be considered as
alternative recursive mappings.

See comments in pmap.c for further details.

Now, let the testing and bug hunting begin.
 1.30.8.3  01-Nov-2009  jym Sync with HEAD.
 1.30.8.2  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.30.8.1  09-Feb-2009  jym Initial code for xen save/restore/migrate facilities.

- split the attach code of frontends in two half: one that is only needed
during autoconf(9) attach/detach phases, and one used at each save/restore
of device state (between suspend and resume).

Applies to hypervisor, xencons, xenbus, xbd, and xennet.

- add a rwlock(9) ("ptom_lock") to protect the different parts in the kernel
that manipulate MFNs (which could change between a suspend and a resume,
without the kernel noticing it). Parts that require MFNs acquire a reader lock,
while suspend code will acquire a writer lock to ensure that no-other parts
in kernel still use MFNs.

- integrate the suspend code with sysmon.

- various things in pmap(9), and clock.

TODO:
- factorize code a bit more inside frontends drivers.
- remove all alternative recursive (APDP_PDE) mappings found in PD/PT during
suspend, as Xen does not support them.
- abstract the ptom_lock locking, it is only required when kernel preemption
is enabled, or on MP systems.

Current code works mostly. You may experience difficulties in some corner
cases (dom0 warnings about xennet interface errors, and Xen tools failing to
validate NetBSD's alternative pmaps).
 1.30.4.1  03-Oct-2009  snj Pull up following revision(s) (requested by bouyer in ticket #1054):
sys/arch/xen/conf/files.xen: revision 1.93
sys/arch/xen/include/pci_machdep.h: revision 1.11
sys/arch/xen/include/xen.h: revision 1.31
sys/arch/xen/xen/hypervisor.c: revision 1.44
sys/arch/xen/xen/pci_intr_machdep.c: revision 1.8
sys/arch/xen/xen/pciback.c: revision 1.1
sys/arch/xen/xen/xen_machdep.c: revision 1.5
sys/arch/xen/xen/xpci_xenbus.c: revision 1.1
Work in progress on PCI front-end/back-end support
front-end:
- add a xpci* at xenbus? which provides pci busses from the dom0
xpci provides support routines for PCI config space operations and
enumeration in xpci_xenbus.c
- hypervisor.c: do dom0-style PCI attach only ifdef DOM0OPS
- pci_intr_machdep.c: check line value only if DOM0OPS
back-end:
- add a pciback* at pci? device which takes precedences over all
other PCI devices (match return 500) and matches all devices passed
to pciback.hide option on boot command line.
It exports the PCI device informations to files in /kern/xen/pci/
- hypervisor.c: create /kern/xen earlier so pciback can create its
entries while PCI devices are probed
- xen_machdep.c: add handling for pciback.hide=
frontend is know working on Xen 3.1.x dom0 with ahc(4) and pciide(4)
devices. uhci(4) fail when trying to allocate a large contigous DMA
buffer.
backend is work in progress; support in xentools is not there yet.
 1.30.2.1  03-Mar-2009  skrll Sync with HEAD.
 1.32.6.1  06-Jun-2011  jruoho Sync with HEAD.
 1.32.4.1  21-Apr-2011  rmind sync with head
 1.35.30.1  09-Jul-2016  skrll Sync with HEAD
 1.35.12.1  03-Dec-2017  jdolecek update from HEAD
 1.37.18.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.37.18.1  10-Jun-2019  christos Sync with HEAD
 1.37.16.2  20-Oct-2018  pgoyette Sync with head
 1.37.16.1  28-Jul-2018  pgoyette Sync with HEAD
 1.37.10.2  31-Jul-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1862):

sys/arch/xen/x86/xen_intr.c: revision 1.31 (patch)
sys/arch/xen/include/xen.h (apply patch)

xen_intr.c: Use kpreempt_disable/enable around access to curcpu().

curcpu() is not otherwise guaranteed to be stable at these points.

While here, nix nonsensical membars. This need only be synchronized
with interrupts on the same CPU.

Proposed on port-xen:
https://mail-index.netbsd.org/port-xen/2022/07/13/msg010250.html
 1.37.10.1  13-Oct-2018  martin Pull up following revision(s) (requested by mlelstv in ticket #1057):

sys/arch/xen/x86/autoconf.c: revision 1.20
sys/arch/xen/include/xen.h: revision 1.40

Support bootspec.
 1.44.8.2  20-Apr-2020  bouyer Sync with HEAD
 1.44.8.1  18-Apr-2020  bouyer 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
 1.47.20.1  30-Mar-2023  martin Pull up following revision(s) (requested by bouyer in ticket #131):

sys/arch/x86/x86/consinit.c: revision 1.36
sys/arch/xen/x86/pvh_consinit.c: revision 1.3
sys/arch/xen/include/xen.h: revision 1.48

Allow a PVH dom0 to use VGA as console: make xen_pvh_consinit() return 1 if
it handles the console and 0 otherwise (especially when console=tty0 or
console=pc is present on the command line).

In consinit() fallback to native console selection if xen_pvh_consinit()
returns 0.

RSS XML Feed