forked from Minki/linux
84621c9b18
- FIFO event channels. Key advantages: support for over 100,000 events (2^17), 16 different event priorities, improved fairness in event latency through the use of FIFOs. - Xen PVH support. "It’s a fully PV kernel mode, running with paravirtualized disk and network, paravirtualized interrupts and timers, no emulated devices of any kind (and thus no qemu), no BIOS or legacy boot — but instead of requiring PV MMU, it uses the HVM hardware extensions to virtualize the pagetables, as well as system calls and other privileged operations." (from "The Paravirtualization Spectrum, Part 2: From poles to a spectrum") Bug-fixes: - Fixes in balloon driver (refactor and make it work under ARM) - Allow xenfb to be used in HVM guests. - Allow xen_platform_pci=0 to work properly. - Refactors in event channels. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJS4BmLAAoJEFjIrFwIi8fJ4SAH/iNGESowgMhfW64vRA8pBWq+ NRJpUjYjjwmbxpwoNl6NPwn15cIXFyc3sMtvvrDD3taRDyko2RFuT+NTjpO05xPh d/cRpRXpXERHoiFgPf/WTp7ONBDhvPtHG0+BzJKwgqEIOUYXdbhD+gEjaVlFJScS CAY68OLmk7XYMSZBNzPfKNbSCyhVgZF7wpaimK9lxZBKsFRCDIq6jIyrAsC8epIL 6V/V4l2S6lk/uUeGB6ULphYeINjI2kkpbSfCd1vyenLfWpVscc2o8uWEYFcZMAxy V4HpsoseuqrfdDqgPfud3VgogdISvbkCvDfW85rzfDP4MWxei2mVHFtJ/gSBV+g= =ToNG -----END PGP SIGNATURE----- Merge tag 'stable/for-linus-3.14-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull Xen updates from Konrad Rzeszutek Wilk: "Two major features that Xen community is excited about: The first is event channel scalability by David Vrabel - we switch over from an two-level per-cpu bitmap of events (IRQs) - to an FIFO queue with priorities. This lets us be able to handle more events, have lower latency, and better scalability. Good stuff. The other is PVH by Mukesh Rathor. In short, PV is a mode where the kernel lets the hypervisor program page-tables, segments, etc. With EPT/NPT capabilities in current processors, the overhead of doing this in an HVM (Hardware Virtual Machine) container is much lower than the hypervisor doing it for us. In short we let a PV guest run without doing page-table, segment, syscall, etc updates through the hypervisor - instead it is all done within the guest container. It is a "hybrid" PV - hence the 'PVH' name - a PV guest within an HVM container. The major benefits are less code to deal with - for example we only use one function from the the pv_mmu_ops (which has 39 function calls); faster performance for syscall (no context switches into the hypervisor); less traps on various operations; etc. It is still being baked - the ABI is not yet set in stone. But it is pretty awesome and we are excited about it. Lastly, there are some changes to ARM code - you should get a simple conflict which has been resolved in #linux-next. In short, this pull has awesome features. Features: - FIFO event channels. Key advantages: support for over 100,000 events (2^17), 16 different event priorities, improved fairness in event latency through the use of FIFOs. - Xen PVH support. "It’s a fully PV kernel mode, running with paravirtualized disk and network, paravirtualized interrupts and timers, no emulated devices of any kind (and thus no qemu), no BIOS or legacy boot — but instead of requiring PV MMU, it uses the HVM hardware extensions to virtualize the pagetables, as well as system calls and other privileged operations." (from "The Paravirtualization Spectrum, Part 2: From poles to a spectrum") Bug-fixes: - Fixes in balloon driver (refactor and make it work under ARM) - Allow xenfb to be used in HVM guests. - Allow xen_platform_pci=0 to work properly. - Refactors in event channels" * tag 'stable/for-linus-3.14-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: (52 commits) xen/pvh: Set X86_CR0_WP and others in CR0 (v2) MAINTAINERS: add git repository for Xen xen/pvh: Use 'depend' instead of 'select'. xen: delete new instances of __cpuinit usage xen/fb: allow xenfb initialization for hvm guests xen/evtchn_fifo: fix error return code in evtchn_fifo_setup() xen-platform: fix error return code in platform_pci_init() xen/pvh: remove duplicated include from enlighten.c xen/pvh: Fix compile issues with xen_pvh_domain() xen: Use dev_is_pci() to check whether it is pci device xen/grant-table: Force to use v1 of grants. xen/pvh: Support ParaVirtualized Hardware extensions (v3). xen/pvh: Piggyback on PVHVM XenBus. xen/pvh: Piggyback on PVHVM for grant driver (v4) xen/grant: Implement an grant frame array struct (v3). xen/grant-table: Refactor gnttab_init xen/grants: Remove gnttab_max_grant_frames dependency on gnttab_init. xen/pvh: Piggyback on PVHVM for event channels (v2) xen/pvh: Update E820 to work with PVH (v2) xen/pvh: Secondary VCPU bringup (non-bootup CPUs) ...
124 lines
3.0 KiB
C
124 lines
3.0 KiB
C
#ifndef _ASM_ARM_XEN_PAGE_H
|
|
#define _ASM_ARM_XEN_PAGE_H
|
|
|
|
#include <asm/page.h>
|
|
#include <asm/pgtable.h>
|
|
|
|
#include <linux/pfn.h>
|
|
#include <linux/types.h>
|
|
#include <linux/dma-mapping.h>
|
|
|
|
#include <xen/xen.h>
|
|
#include <xen/interface/grant_table.h>
|
|
|
|
#define phys_to_machine_mapping_valid(pfn) (1)
|
|
#define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT))
|
|
|
|
#define pte_mfn pte_pfn
|
|
#define mfn_pte pfn_pte
|
|
|
|
/* Xen machine address */
|
|
typedef struct xmaddr {
|
|
phys_addr_t maddr;
|
|
} xmaddr_t;
|
|
|
|
/* Xen pseudo-physical address */
|
|
typedef struct xpaddr {
|
|
phys_addr_t paddr;
|
|
} xpaddr_t;
|
|
|
|
#define XMADDR(x) ((xmaddr_t) { .maddr = (x) })
|
|
#define XPADDR(x) ((xpaddr_t) { .paddr = (x) })
|
|
|
|
#define INVALID_P2M_ENTRY (~0UL)
|
|
|
|
unsigned long __pfn_to_mfn(unsigned long pfn);
|
|
unsigned long __mfn_to_pfn(unsigned long mfn);
|
|
extern struct rb_root phys_to_mach;
|
|
|
|
static inline unsigned long pfn_to_mfn(unsigned long pfn)
|
|
{
|
|
unsigned long mfn;
|
|
|
|
if (phys_to_mach.rb_node != NULL) {
|
|
mfn = __pfn_to_mfn(pfn);
|
|
if (mfn != INVALID_P2M_ENTRY)
|
|
return mfn;
|
|
}
|
|
|
|
return pfn;
|
|
}
|
|
|
|
static inline unsigned long mfn_to_pfn(unsigned long mfn)
|
|
{
|
|
unsigned long pfn;
|
|
|
|
if (phys_to_mach.rb_node != NULL) {
|
|
pfn = __mfn_to_pfn(mfn);
|
|
if (pfn != INVALID_P2M_ENTRY)
|
|
return pfn;
|
|
}
|
|
|
|
return mfn;
|
|
}
|
|
|
|
#define mfn_to_local_pfn(mfn) mfn_to_pfn(mfn)
|
|
|
|
static inline xmaddr_t phys_to_machine(xpaddr_t phys)
|
|
{
|
|
unsigned offset = phys.paddr & ~PAGE_MASK;
|
|
return XMADDR(PFN_PHYS(pfn_to_mfn(PFN_DOWN(phys.paddr))) | offset);
|
|
}
|
|
|
|
static inline xpaddr_t machine_to_phys(xmaddr_t machine)
|
|
{
|
|
unsigned offset = machine.maddr & ~PAGE_MASK;
|
|
return XPADDR(PFN_PHYS(mfn_to_pfn(PFN_DOWN(machine.maddr))) | offset);
|
|
}
|
|
/* VIRT <-> MACHINE conversion */
|
|
#define virt_to_machine(v) (phys_to_machine(XPADDR(__pa(v))))
|
|
#define virt_to_pfn(v) (PFN_DOWN(__pa(v)))
|
|
#define virt_to_mfn(v) (pfn_to_mfn(virt_to_pfn(v)))
|
|
#define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT))
|
|
|
|
static inline xmaddr_t arbitrary_virt_to_machine(void *vaddr)
|
|
{
|
|
/* TODO: assuming it is mapped in the kernel 1:1 */
|
|
return virt_to_machine(vaddr);
|
|
}
|
|
|
|
/* TODO: this shouldn't be here but it is because the frontend drivers
|
|
* are using it (its rolled in headers) even though we won't hit the code path.
|
|
* So for right now just punt with this.
|
|
*/
|
|
static inline pte_t *lookup_address(unsigned long address, unsigned int *level)
|
|
{
|
|
BUG();
|
|
return NULL;
|
|
}
|
|
|
|
static inline int m2p_add_override(unsigned long mfn, struct page *page,
|
|
struct gnttab_map_grant_ref *kmap_op)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int m2p_remove_override(struct page *page, bool clear_pte)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn);
|
|
bool __set_phys_to_machine_multi(unsigned long pfn, unsigned long mfn,
|
|
unsigned long nr_pages);
|
|
|
|
static inline bool set_phys_to_machine(unsigned long pfn, unsigned long mfn)
|
|
{
|
|
return __set_phys_to_machine(pfn, mfn);
|
|
}
|
|
|
|
#define xen_remap(cookie, size) ioremap_cache((cookie), (size))
|
|
#define xen_unmap(cookie) iounmap((cookie))
|
|
|
|
#endif /* _ASM_ARM_XEN_PAGE_H */
|