Skip to content

Commit 53861af

Browse files
committed
Merge tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull virtio updates from Rusty Russell: "OK, this has the big virtio 1.0 implementation, as specified by OASIS. On top of tht is the major rework of lguest, to use PCI and virtio 1.0, to double-check the implementation. Then comes the inevitable fixes and cleanups from that work" * tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (80 commits) virtio: don't set VIRTIO_CONFIG_S_DRIVER_OK twice. virtio_net: unconditionally define struct virtio_net_hdr_v1. tools/lguest: don't use legacy definitions for net device in example launcher. virtio: Don't expose legacy net features when VIRTIO_NET_NO_LEGACY defined. tools/lguest: use common error macros in the example launcher. tools/lguest: give virtqueues names for better error messages tools/lguest: more documentation and checking of virtio 1.0 compliance. lguest: don't look in console features to find emerg_wr. tools/lguest: don't start devices until DRIVER_OK status set. tools/lguest: handle indirect partway through chain. tools/lguest: insert driver references from the 1.0 spec (4.1 Virtio Over PCI) tools/lguest: insert device references from the 1.0 spec (4.1 Virtio Over PCI) tools/lguest: rename virtio_pci_cfg_cap field to match spec. tools/lguest: fix features_accepted logic in example launcher. tools/lguest: handle device reset correctly in example launcher. virtual: Documentation: simplify and generalize paravirt_ops.txt lguest: remove NOTIFY call and eventfd facility. lguest: remove NOTIFY facility from demonstration launcher. lguest: use the PCI console device's emerg_wr for early boot messages. lguest: always put console in PCI slot #1. ...
2 parents 5c27700 + 5b40a7d commit 53861af

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3367
-1605
lines changed

Documentation/ia64/paravirt_ops.txt

-137
This file was deleted.

Documentation/virtual/00-INDEX

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ Virtualization support in the Linux kernel.
22

33
00-INDEX
44
- this file.
5+
6+
paravirt_ops.txt
7+
- Describes the Linux kernel pv_ops to support different hypervisors
58
kvm/
69
- Kernel Virtual Machine. See also http://linux-kvm.org
710
uml/
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Paravirt_ops
2+
============
3+
4+
Linux provides support for different hypervisor virtualization technologies.
5+
Historically different binary kernels would be required in order to support
6+
different hypervisors, this restriction was removed with pv_ops.
7+
Linux pv_ops is a virtualization API which enables support for different
8+
hypervisors. It allows each hypervisor to override critical operations and
9+
allows a single kernel binary to run on all supported execution environments
10+
including native machine -- without any hypervisors.
11+
12+
pv_ops provides a set of function pointers which represent operations
13+
corresponding to low level critical instructions and high level
14+
functionalities in various areas. pv-ops allows for optimizations at run
15+
time by enabling binary patching of the low-ops critical operations
16+
at boot time.
17+
18+
pv_ops operations are classified into three categories:
19+
20+
- simple indirect call
21+
These operations correspond to high level functionality where it is
22+
known that the overhead of indirect call isn't very important.
23+
24+
- indirect call which allows optimization with binary patch
25+
Usually these operations correspond to low level critical instructions. They
26+
are called frequently and are performance critical. The overhead is
27+
very important.
28+
29+
- a set of macros for hand written assembly code
30+
Hand written assembly codes (.S files) also need paravirtualization
31+
because they include sensitive instructions or some of code paths in
32+
them are very performance critical.

MAINTAINERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -7302,7 +7302,7 @@ M: Alok Kataria <[email protected]>
73027302
M: Rusty Russell <[email protected]>
73037303
73047304
S: Supported
7305-
F: Documentation/ia64/paravirt_ops.txt
7305+
F: Documentation/virtual/paravirt_ops.txt
73067306
F: arch/*/kernel/paravirt*
73077307
F: arch/*/include/asm/paravirt.h
73087308

arch/mn10300/unit-asb2305/pci-iomap.c

-35
This file was deleted.

arch/s390/include/asm/pci_io.h

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
struct zpci_iomap_entry {
1717
u32 fh;
1818
u8 bar;
19+
u16 count;
1920
};
2021

2122
extern struct zpci_iomap_entry *zpci_iomap_start;

arch/s390/pci/pci.c

+27-7
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,10 @@ void __iowrite64_copy(void __iomem *to, const void *from, size_t count)
259259
}
260260

261261
/* Create a virtual mapping cookie for a PCI BAR */
262-
void __iomem *pci_iomap(struct pci_dev *pdev, int bar, unsigned long max)
262+
void __iomem *pci_iomap_range(struct pci_dev *pdev,
263+
int bar,
264+
unsigned long offset,
265+
unsigned long max)
263266
{
264267
struct zpci_dev *zdev = get_zdev(pdev);
265268
u64 addr;
@@ -270,23 +273,40 @@ void __iomem *pci_iomap(struct pci_dev *pdev, int bar, unsigned long max)
270273

271274
idx = zdev->bars[bar].map_idx;
272275
spin_lock(&zpci_iomap_lock);
273-
zpci_iomap_start[idx].fh = zdev->fh;
274-
zpci_iomap_start[idx].bar = bar;
276+
if (zpci_iomap_start[idx].count++) {
277+
BUG_ON(zpci_iomap_start[idx].fh != zdev->fh ||
278+
zpci_iomap_start[idx].bar != bar);
279+
} else {
280+
zpci_iomap_start[idx].fh = zdev->fh;
281+
zpci_iomap_start[idx].bar = bar;
282+
}
283+
/* Detect overrun */
284+
BUG_ON(!zpci_iomap_start[idx].count);
275285
spin_unlock(&zpci_iomap_lock);
276286

277287
addr = ZPCI_IOMAP_ADDR_BASE | ((u64) idx << 48);
278-
return (void __iomem *) addr;
288+
return (void __iomem *) addr + offset;
279289
}
280-
EXPORT_SYMBOL_GPL(pci_iomap);
290+
EXPORT_SYMBOL_GPL(pci_iomap_range);
291+
292+
void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
293+
{
294+
return pci_iomap_range(dev, bar, 0, maxlen);
295+
}
296+
EXPORT_SYMBOL(pci_iomap);
281297

282298
void pci_iounmap(struct pci_dev *pdev, void __iomem *addr)
283299
{
284300
unsigned int idx;
285301

286302
idx = (((__force u64) addr) & ~ZPCI_IOMAP_ADDR_BASE) >> 48;
287303
spin_lock(&zpci_iomap_lock);
288-
zpci_iomap_start[idx].fh = 0;
289-
zpci_iomap_start[idx].bar = 0;
304+
/* Detect underrun */
305+
BUG_ON(!zpci_iomap_start[idx].count);
306+
if (!--zpci_iomap_start[idx].count) {
307+
zpci_iomap_start[idx].fh = 0;
308+
zpci_iomap_start[idx].bar = 0;
309+
}
290310
spin_unlock(&zpci_iomap_lock);
291311
}
292312
EXPORT_SYMBOL_GPL(pci_iounmap);

arch/x86/include/asm/lguest_hcall.h

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#define LHCALL_SET_PTE 14
1717
#define LHCALL_SET_PGD 15
1818
#define LHCALL_LOAD_TLS 16
19-
#define LHCALL_NOTIFY 17
2019
#define LHCALL_LOAD_GDT_ENTRY 18
2120
#define LHCALL_SEND_INTERRUPTS 19
2221

0 commit comments

Comments
 (0)