* [PATCH v2 3/6] tile: Move tile to use generic on_each_cpu_mask
From: Gilad Ben-Yossef @ 2011-10-23 15:48 UTC (permalink / raw)
To: lkml
Cc: Gilad Ben-Yossef, Peter Zijlstra, Frederic Weisbecker,
Russell King, linux-mm, Christoph Lameter, Pekka Enberg,
Matt Mackall, Sasha Levin
In-Reply-To: <1319384922-29632-1-git-send-email-gilad@benyossef.com>
The API is the same as the tile private one, so just remove
the private version of the functions
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
CC: Peter Zijlstra <a.p.zijlstra@chello.nl>
CC: Frederic Weisbecker <fweisbec@gmail.com>
CC: Russell King <linux@arm.linux.org.uk>
CC: linux-mm@kvack.org
CC: Christoph Lameter <cl@linux-foundation.org>
CC: Pekka Enberg <penberg@kernel.org>
CC: Matt Mackall <mpm@selenic.com>
CC: Sasha Levin <levinsasha928@gmail.com>
---
arch/tile/include/asm/smp.h | 7 -------
arch/tile/kernel/smp.c | 19 -------------------
2 files changed, 0 insertions(+), 26 deletions(-)
diff --git a/arch/tile/include/asm/smp.h b/arch/tile/include/asm/smp.h
index 532124a..1aa759a 100644
--- a/arch/tile/include/asm/smp.h
+++ b/arch/tile/include/asm/smp.h
@@ -43,10 +43,6 @@ void evaluate_message(int tag);
/* Boot a secondary cpu */
void online_secondary(void);
-/* Call a function on a specified set of CPUs (may include this one). */
-extern void on_each_cpu_mask(const struct cpumask *mask,
- void (*func)(void *), void *info, bool wait);
-
/* Topology of the supervisor tile grid, and coordinates of boot processor */
extern HV_Topology smp_topology;
@@ -91,9 +87,6 @@ void print_disabled_cpus(void);
#else /* !CONFIG_SMP */
-#define on_each_cpu_mask(mask, func, info, wait) \
- do { if (cpumask_test_cpu(0, (mask))) func(info); } while (0)
-
#define smp_master_cpu 0
#define smp_height 1
#define smp_width 1
diff --git a/arch/tile/kernel/smp.c b/arch/tile/kernel/smp.c
index c52224d..a44e103 100644
--- a/arch/tile/kernel/smp.c
+++ b/arch/tile/kernel/smp.c
@@ -87,25 +87,6 @@ void send_IPI_allbutself(int tag)
send_IPI_many(&mask, tag);
}
-
-/*
- * Provide smp_call_function_mask, but also run function locally
- * if specified in the mask.
- */
-void on_each_cpu_mask(const struct cpumask *mask, void (*func)(void *),
- void *info, bool wait)
-{
- int cpu = get_cpu();
- smp_call_function_many(mask, func, info, wait);
- if (cpumask_test_cpu(cpu, mask)) {
- local_irq_disable();
- func(info);
- local_irq_enable();
- }
- put_cpu();
-}
-
-
/*
* Functions related to starting/stopping cpus.
*/
--
1.7.0.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related
* [PATCH v2 2/6] arm: Move arm over to generic on_each_cpu_mask
From: Gilad Ben-Yossef @ 2011-10-23 15:48 UTC (permalink / raw)
To: lkml
Cc: Gilad Ben-Yossef, Peter Zijlstra, Frederic Weisbecker,
Russell King, linux-mm, Christoph Lameter, Pekka Enberg,
Matt Mackall, Sasha Levin
In-Reply-To: <1319384922-29632-1-git-send-email-gilad@benyossef.com>
Note the generic version has the mask as first parameter
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
CC: Peter Zijlstra <a.p.zijlstra@chello.nl>
CC: Frederic Weisbecker <fweisbec@gmail.com>
CC: Russell King <linux@arm.linux.org.uk>
CC: linux-mm@kvack.org
CC: Christoph Lameter <cl@linux-foundation.org>
CC: Pekka Enberg <penberg@kernel.org>
CC: Matt Mackall <mpm@selenic.com>
CC: Sasha Levin <levinsasha928@gmail.com>
---
arch/arm/kernel/smp_tlb.c | 20 +++++---------------
1 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/arch/arm/kernel/smp_tlb.c b/arch/arm/kernel/smp_tlb.c
index 7dcb352..02c5d2c 100644
--- a/arch/arm/kernel/smp_tlb.c
+++ b/arch/arm/kernel/smp_tlb.c
@@ -13,18 +13,6 @@
#include <asm/smp_plat.h>
#include <asm/tlbflush.h>
-static void on_each_cpu_mask(void (*func)(void *), void *info, int wait,
- const struct cpumask *mask)
-{
- preempt_disable();
-
- smp_call_function_many(mask, func, info, wait);
- if (cpumask_test_cpu(smp_processor_id(), mask))
- func(info);
-
- preempt_enable();
-}
-
/**********************************************************************/
/*
@@ -87,7 +75,7 @@ void flush_tlb_all(void)
void flush_tlb_mm(struct mm_struct *mm)
{
if (tlb_ops_need_broadcast())
- on_each_cpu_mask(ipi_flush_tlb_mm, mm, 1, mm_cpumask(mm));
+ on_each_cpu_mask(mm_cpumask(mm), ipi_flush_tlb_mm, mm, 1);
else
local_flush_tlb_mm(mm);
}
@@ -98,7 +86,8 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
struct tlb_args ta;
ta.ta_vma = vma;
ta.ta_start = uaddr;
- on_each_cpu_mask(ipi_flush_tlb_page, &ta, 1, mm_cpumask(vma->vm_mm));
+ on_each_cpu_mask(mm_cpumask(vma->vm_mm), ipi_flush_tlb_page,
+ &ta, 1);
} else
local_flush_tlb_page(vma, uaddr);
}
@@ -121,7 +110,8 @@ void flush_tlb_range(struct vm_area_struct *vma,
ta.ta_vma = vma;
ta.ta_start = start;
ta.ta_end = end;
- on_each_cpu_mask(ipi_flush_tlb_range, &ta, 1, mm_cpumask(vma->vm_mm));
+ on_each_cpu_mask(mm_cpumask(vma->vm_mm), ipi_flush_tlb_range,
+ &ta, 1);
} else
local_flush_tlb_range(vma, start, end);
}
--
1.7.0.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related
* [PATCH v2 1/6] smp: Introduce a generic on_each_cpu_mask function
From: Gilad Ben-Yossef @ 2011-10-23 15:48 UTC (permalink / raw)
To: lkml
Cc: Gilad Ben-Yossef, Peter Zijlstra, Frederic Weisbecker,
Russell King, linux-mm, Christoph Lameter, Pekka Enberg,
Matt Mackall, Sasha Levin
In-Reply-To: <1319384922-29632-1-git-send-email-gilad@benyossef.com>
on_each_cpu_mask calls a function on processors specified my cpumask,
which may include the local processor.
All the limitation specified in smp_call_function_many apply.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
CC: Peter Zijlstra <a.p.zijlstra@chello.nl>
CC: Frederic Weisbecker <fweisbec@gmail.com>
CC: Russell King <linux@arm.linux.org.uk>
CC: linux-mm@kvack.org
CC: Christoph Lameter <cl@linux-foundation.org>
CC: Pekka Enberg <penberg@kernel.org>
CC: Matt Mackall <mpm@selenic.com>
CC: Sasha Levin <levinsasha928@gmail.com>
---
include/linux/smp.h | 16 ++++++++++++++++
kernel/smp.c | 20 ++++++++++++++++++++
2 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 8cc38d3..60628d7 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -102,6 +102,13 @@ static inline void call_function_init(void) { }
int on_each_cpu(smp_call_func_t func, void *info, int wait);
/*
+ * Call a function on processors specified by mask, which might include
+ * the local one.
+ */
+void on_each_cpu_mask(const struct cpumask *mask, void (*func)(void *),
+ void *info, bool wait);
+
+/*
* Mark the boot cpu "online" so that it can call console drivers in
* printk() and can access its per-cpu storage.
*/
@@ -132,6 +139,15 @@ static inline int up_smp_call_function(smp_call_func_t func, void *info)
local_irq_enable(); \
0; \
})
+#define on_each_cpu_mask(mask, func, info, wait) \
+ do { \
+ if (cpumask_test_cpu(0, (mask))) { \
+ local_irq_disable(); \
+ (func)(info); \
+ local_irq_enable(); \
+ } \
+ } while (0)
+
static inline void smp_send_reschedule(int cpu) { }
#define num_booting_cpus() 1
#define smp_prepare_boot_cpu() do {} while (0)
diff --git a/kernel/smp.c b/kernel/smp.c
index fb67dfa..df37c08 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -701,3 +701,23 @@ int on_each_cpu(void (*func) (void *info), void *info, int wait)
return ret;
}
EXPORT_SYMBOL(on_each_cpu);
+
+/*
+ * Call a function on processors specified by cpumask, which may include
+ * the local processor. All the limitation specified in smp_call_function_many
+ * apply.
+ */
+void on_each_cpu_mask(const struct cpumask *mask, void (*func)(void *),
+ void *info, bool wait)
+{
+ int cpu = get_cpu();
+
+ smp_call_function_many(mask, func, info, wait);
+ if (cpumask_test_cpu(cpu, mask)) {
+ local_irq_disable();
+ func(info);
+ local_irq_enable();
+ }
+ put_cpu();
+}
+EXPORT_SYMBOL(on_each_cpu_mask);
--
1.7.0.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related
* [PATCH v2 0/6] Reduce cross CPU IPI interference
From: Gilad Ben-Yossef @ 2011-10-23 15:48 UTC (permalink / raw)
To: lkml
Cc: Gilad Ben-Yossef, Peter Zijlstra, Frederic Weisbecker,
Russell King, linux-mm, Christoph Lameter, Pekka Enberg,
Matt Mackall, Sasha Levin
We have lots of infrastructure in place to partition a multi-core system such
that we have a group of CPUs that are dedicated to specific task: cgroups,
scheduler and interrupt affinity and cpuisol boot parameter. Still, kernel
code will some time interrupt all CPUs in the system via IPIs for various
needs. These IPIs are useful and cannot be avoided altogether, but in certain
cases it is possible to interrupt only specific CPUs that have useful work to
do and not the entire system.
This patch set, inspired by discussions with Peter Zijlstra and Frederic
Weisbecker when testing the nohz task patch set, is a first stab at trying to
explore doing this by locating the places where such global IPI calls are
being made and turning a global IPI into an IPI for a specific group of CPUs.
The purpose of the patch set is to get feedback if this is the right way to
go for dealing with this issue and indeed, if the issue is even worth dealing
with at all.
The patch creates an on_each_cpu_mask infrastructure API (derived from
existing arch specific versions in Tile and Arm) and uses it to turn two global
IPI invocation to per CPU group invocations.
This second version incorporates changes due to reviewers feedback and
additional testing. The major changes from the previous version of the patch
are:
- Better description for some of the patches with examples of what I am
trying to solve.
- Better coding style for on_each_cpu based on review comments by Peter
Zijlstra and Sasha Levin.
- Fixed pcp_count handling to take into account which cpu the accounting
is done for. Sadly, AFAIK this negates using this_cpu_add/sub as
suggested by Peter Z.
- Removed kmalloc from the flush_all() path as per review comment by
Pekka Enberg.
- Moved cpumask allocations for CONFIG_CPUMASK_OFFSTACK=y to a point previous
to first use during boot as testing revealed we no longer boot under
CONFIG_CPUMASK_OFFSTACK=y with original code.
The patch was compiled for arm and boot tested on x86 in UP, SMP, with and without
CONFIG_CPUMASK_OFFSTACK and was further tested by running hackbench on x86 in
SMP mode in a 4 CPUs VM for several hours with no obvious regressions.
I also artificially exercised SLUB flush_all via the debug interface and observed
the difference in IPI count across processors with and without the patch - from
an IPI on all processors but one without the patch to a subset (and often no IPI
at all) with the patch.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
CC: Peter Zijlstra <a.p.zijlstra@chello.nl>
CC: Frederic Weisbecker <fweisbec@gmail.com>
CC: Russell King <linux@arm.linux.org.uk>
CC: linux-mm@kvack.org
CC: Christoph Lameter <cl@linux-foundation.org>
CC: Pekka Enberg <penberg@kernel.org>
CC: Matt Mackall <mpm@selenic.com>
CC: Sasha Levin <levinsasha928@gmail.com>
Gilad Ben-Yossef (6):
smp: Introduce a generic on_each_cpu_mask function
arm: Move arm over to generic on_each_cpu_mask
tile: Move tile to use generic on_each_cpu_mask
mm: Only IPI CPUs to drain local pages if they exist
slub: Only IPI CPUs that have per cpu obj to flush
slub: only preallocate cpus_with_slabs if offstack
arch/arm/kernel/smp_tlb.c | 20 +++----------
arch/tile/include/asm/smp.h | 7 -----
arch/tile/kernel/smp.c | 19 -------------
include/linux/slub_def.h | 9 ++++++
include/linux/smp.h | 16 +++++++++++
kernel/smp.c | 20 +++++++++++++
mm/page_alloc.c | 64 +++++++++++++++++++++++++++++++++++++------
mm/slub.c | 61 +++++++++++++++++++++++++++++++++++++++-
8 files changed, 164 insertions(+), 52 deletions(-)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [Qemu-devel] [PATCH 1/1] Introduce a new bus "ICC" to connect APIC
From: Jan Kiszka @ 2011-10-23 15:45 UTC (permalink / raw)
To: Blue Swirl; +Cc: aliguori, pingfank, qemu-devel
In-Reply-To: <CAAu8pHsuK3ExYKe0Fu9uHiMkj0L_+0gxOBFvWXOAm1k+MYe4qg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 960 bytes --]
On 2011-10-23 14:40, Blue Swirl wrote:
> I'm not sure that a full bus is needed for now, even if it could match
> real HW better, since the memory API already provides the separation
> needed. Perhaps this would be needed later to make IRQs per-CPU also,
> or to put IOAPIC also to the bus?
The ICC interconnects LAPICs and IOAPICs. So it should next take over
the management of the local_apics array from apic.c and the ioapics
array from ioapic.c. It could implement generic message delivery
services. Every bus participant would then have a reception handler that
first checks the type and additional fields of a generic ICC message
and, on match, forwards it to the corresponding device model functions.
That would allow for something nicer than global apic_deliver_irq or
ioapic_eoi_broadcast.
That's clearly beyond the scope of this series but a good reason to
model the ICC as accurately as qdev allows right from the start.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply
* RE: [PATCH 1/1] Staging: hv: mousevsc: Move the mouse driver out of staging
From: KY Srinivasan @ 2011-10-23 15:45 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: gregkh@suse.de, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org, virtualization@lists.osdl.org,
linux-input@vger.kernel.org, Haiyang Zhang, Jiri Kosina
In-Reply-To: <20111023072427.GA13268@core.coreip.homeip.net>
> -----Original Message-----
> From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
> Sent: Sunday, October 23, 2011 3:24 AM
> To: KY Srinivasan
> Cc: gregkh@suse.de; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; virtualization@lists.osdl.org; linux-
> input@vger.kernel.org; Haiyang Zhang; Jiri Kosina
> Subject: Re: [PATCH 1/1] Staging: hv: mousevsc: Move the mouse driver out of
> staging
>
> Hi K. Y.,
>
> On Fri, Oct 14, 2011 at 11:08:27PM -0700, K. Y. Srinivasan wrote:
> > In preparation for moving the mouse driver out of staging, seek community
> > review of the mouse driver code.
> >
>
> Because it is a HID driver it should go through Jiri Kosina's tree
> (CCed). Still, a few comments below.
>
> > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> > ---
> > drivers/hid/Kconfig | 6 +
> > drivers/hid/Makefile | 1 +
> > drivers/hid/hv_mouse.c | 599
> +++++++++++++++++++++++++++++++++++++++++
> > drivers/staging/hv/Kconfig | 6 -
> > drivers/staging/hv/Makefile | 1 -
> > drivers/staging/hv/hv_mouse.c | 599 -----------------------------------------
> > 6 files changed, 606 insertions(+), 606 deletions(-)
> > create mode 100644 drivers/hid/hv_mouse.c
> > delete mode 100644 drivers/staging/hv/hv_mouse.c
> >
> > diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> > index 1130a89..f8b98b8 100644
> > --- a/drivers/hid/Kconfig
> > +++ b/drivers/hid/Kconfig
> > @@ -613,6 +613,12 @@ config HID_ZYDACRON
> > ---help---
> > Support for Zydacron remote control.
> >
> > +config HYPERV_MOUSE
> > + tristate "Microsoft Hyper-V mouse driver"
> > + depends on HYPERV
> > + help
> > + Select this option to enable the Hyper-V mouse driver.
> > +
> > endmenu
> >
> > endif # HID_SUPPORT
> > diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
> > index 0a0a38e..436ac2e 100644
> > --- a/drivers/hid/Makefile
> > +++ b/drivers/hid/Makefile
> > @@ -76,6 +76,7 @@ obj-$(CONFIG_HID_ZYDACRON) += hid-zydacron.o
> > obj-$(CONFIG_HID_WACOM) += hid-wacom.o
> > obj-$(CONFIG_HID_WALTOP) += hid-waltop.o
> > obj-$(CONFIG_HID_WIIMOTE) += hid-wiimote.o
> > +obj-$(CONFIG_HYPERV_MOUSE) += hv_mouse.o
> >
> > obj-$(CONFIG_USB_HID) += usbhid/
> > obj-$(CONFIG_USB_MOUSE) += usbhid/
> > diff --git a/drivers/hid/hv_mouse.c b/drivers/hid/hv_mouse.c
> > new file mode 100644
> > index 0000000..ccd39c7
> > --- /dev/null
> > +++ b/drivers/hid/hv_mouse.c
> > @@ -0,0 +1,599 @@
> > +/*
> > + * Copyright (c) 2009, Citrix Systems, Inc.
> > + * Copyright (c) 2010, Microsoft Corporation.
> > + * Copyright (c) 2011, Novell Inc.
> > + *
> > + * This program is free software; you can redistribute it and/or modify it
> > + * under the terms and conditions of the GNU General Public License,
> > + * version 2, as published by the Free Software Foundation.
> > + *
> > + * This program is distributed in the hope it will be useful, but WITHOUT
> > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
> or
> > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
> for
> > + * more details.
> > + */
> > +#include <linux/init.h>
> > +#include <linux/module.h>
> > +#include <linux/delay.h>
> > +#include <linux/device.h>
> > +#include <linux/workqueue.h>
>
> Is this really needed?
>
> > +#include <linux/sched.h>
>
> You probably want completion.h instead.
I will fix this.
>
> > +#include <linux/wait.h>
> > +#include <linux/input.h>
> > +#include <linux/hid.h>
> > +#include <linux/hiddev.h>
> > +#include <linux/hyperv.h>
> > +
> > +
> > +struct hv_input_dev_info {
> > + unsigned int size;
> > + unsigned short vendor;
> > + unsigned short product;
> > + unsigned short version;
> > + unsigned short reserved[11];
> > +};
> > +
> > +/* The maximum size of a synthetic input message. */
> > +#define SYNTHHID_MAX_INPUT_REPORT_SIZE 16
> > +
> > +/*
> > + * Current version
> > + *
> > + * History:
> > + * Beta, RC < 2008/1/22 1,0
> > + * RC > 2008/1/22 2,0
> > + */
> > +#define SYNTHHID_INPUT_VERSION_MAJOR 2
> > +#define SYNTHHID_INPUT_VERSION_MINOR 0
> > +#define SYNTHHID_INPUT_VERSION
> (SYNTHHID_INPUT_VERSION_MINOR | \
> > + (SYNTHHID_INPUT_VERSION_MAJOR <<
> 16))
> > +
> > +
> > +#pragma pack(push, 1)
> > +/*
> > + * Message types in the synthetic input protocol
> > + */
> > +enum synthhid_msg_type {
> > + SYNTH_HID_PROTOCOL_REQUEST,
> > + SYNTH_HID_PROTOCOL_RESPONSE,
> > + SYNTH_HID_INITIAL_DEVICE_INFO,
> > + SYNTH_HID_INITIAL_DEVICE_INFO_ACK,
> > + SYNTH_HID_INPUT_REPORT,
> > + SYNTH_HID_MAX
> > +};
> > +
> > +/*
> > + * Basic message structures.
> > + */
> > +struct synthhid_msg_hdr {
> > + enum synthhid_msg_type type;
> > + u32 size;
> > +};
> > +
> > +struct synthhid_msg {
> > + struct synthhid_msg_hdr header;
> > + char data[1]; /* Enclosed message */
> > +};
> > +
> > +union synthhid_version {
> > + struct {
> > + u16 minor_version;
> > + u16 major_version;
> > + };
> > + u32 version;
> > +};
> > +
> > +/*
> > + * Protocol messages
> > + */
> > +struct synthhid_protocol_request {
> > + struct synthhid_msg_hdr header;
> > + union synthhid_version version_requested;
> > +};
> > +
> > +struct synthhid_protocol_response {
> > + struct synthhid_msg_hdr header;
> > + union synthhid_version version_requested;
> > + unsigned char approved;
> > +};
> > +
> > +struct synthhid_device_info {
> > + struct synthhid_msg_hdr header;
> > + struct hv_input_dev_info hid_dev_info;
> > + struct hid_descriptor hid_descriptor;
> > +};
> > +
> > +struct synthhid_device_info_ack {
> > + struct synthhid_msg_hdr header;
> > + unsigned char reserved;
> > +};
> > +
> > +struct synthhid_input_report {
> > + struct synthhid_msg_hdr header;
> > + char buffer[1];
> > +};
> > +
> > +#pragma pack(pop)
> > +
> > +#define INPUTVSC_SEND_RING_BUFFER_SIZE (10*PAGE_SIZE)
> > +#define INPUTVSC_RECV_RING_BUFFER_SIZE (10*PAGE_SIZE)
> > +
> > +#define NBITS(x) (((x)/BITS_PER_LONG)+1)
> > +
> > +enum pipe_prot_msg_type {
> > + PIPE_MESSAGE_INVALID,
> > + PIPE_MESSAGE_DATA,
> > + PIPE_MESSAGE_MAXIMUM
> > +};
> > +
> > +
> > +struct pipe_prt_msg {
> > + enum pipe_prot_msg_type type;
> > + u32 size;
> > + char data[1];
> > +};
> > +
> > +struct mousevsc_prt_msg {
> > + enum pipe_prot_msg_type type;
> > + u32 size;
> > + union {
> > + struct synthhid_protocol_request request;
> > + struct synthhid_protocol_response response;
> > + struct synthhid_device_info_ack ack;
> > + };
> > +};
> > +
> > +/*
> > + * Represents an mousevsc device
> > + */
> > +struct mousevsc_dev {
> > + struct hv_device *device;
> > + unsigned char init_complete;
> > + struct mousevsc_prt_msg protocol_req;
> > + struct mousevsc_prt_msg protocol_resp;
> > + /* Synchronize the request/response if needed */
> > + struct completion wait_event;
> > + int dev_info_status;
> > +
> > + struct hid_descriptor *hid_desc;
> > + unsigned char *report_desc;
> > + u32 report_desc_size;
> > + struct hv_input_dev_info hid_dev_info;
> > + int connected;
>
> bool?
>
> > + struct hid_device *hid_device;
> > +};
> > +
> > +
> > +static struct mousevsc_dev *alloc_input_device(struct hv_device *device)
> > +{
> > + struct mousevsc_dev *input_dev;
> > +
> > + input_dev = kzalloc(sizeof(struct mousevsc_dev), GFP_KERNEL);
> > +
>
> This blank line is extra.
>
> > + if (!input_dev)
> > + return NULL;
> > +
> > + input_dev->device = device;
> > + hv_set_drvdata(device, input_dev);
> > + init_completion(&input_dev->wait_event);
> > +
> > + return input_dev;
> > +}
> > +
> > +static void free_input_device(struct mousevsc_dev *device)
> > +{
> > + kfree(device->hid_desc);
> > + kfree(device->report_desc);
> > + hv_set_drvdata(device->device, NULL);
> > + kfree(device);
> > +}
> > +
> > +
> > +static void mousevsc_on_receive_device_info(struct mousevsc_dev
> *input_device,
> > + struct synthhid_device_info *device_info)
> > +{
> > + int ret = 0;
> > + struct hid_descriptor *desc;
> > + struct mousevsc_prt_msg ack;
> > +
> > + /* Assume success for now */
> > + input_device->dev_info_status = 0;
> > +
> > + memcpy(&input_device->hid_dev_info, &device_info->hid_dev_info,
> > + sizeof(struct hv_input_dev_info));
> > +
> > + desc = &device_info->hid_descriptor;
> > + WARN_ON(desc->bLength == 0);
> > +
> > + input_device->hid_desc = kzalloc(desc->bLength, GFP_ATOMIC);
> > +
> > + if (!input_device->hid_desc)
> > + goto cleanup;
> > +
> > + memcpy(input_device->hid_desc, desc, desc->bLength);
> > +
> > + input_device->report_desc_size = desc->desc[0].wDescriptorLength;
> > + if (input_device->report_desc_size == 0)
> > + goto cleanup;
> > + input_device->report_desc = kzalloc(input_device->report_desc_size,
> > + GFP_ATOMIC);
> > +
> > + if (!input_device->report_desc)
> > + goto cleanup;
> > +
> > + memcpy(input_device->report_desc,
> > + ((unsigned char *)desc) + desc->bLength,
> > + desc->desc[0].wDescriptorLength);
> > +
> > + /* Send the ack */
> > + memset(&ack, 0, sizeof(struct mousevsc_prt_msg));
> > +
> > + ack.type = PIPE_MESSAGE_DATA;
> > + ack.size = sizeof(struct synthhid_device_info_ack);
> > +
> > + ack.ack.header.type = SYNTH_HID_INITIAL_DEVICE_INFO_ACK;
> > + ack.ack.header.size = 1;
> > + ack.ack.reserved = 0;
>
> That looks like a constant structure...
Will clean this up.
>
> > +
> > + ret = vmbus_sendpacket(input_device->device->channel,
> > + &ack,
> > + sizeof(struct pipe_prt_msg) - sizeof(unsigned char) +
> > + sizeof(struct synthhid_device_info_ack),
> > + (unsigned long)&ack,
> > + VM_PKT_DATA_INBAND,
> > +
> VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
> > + if (ret != 0)
> > + goto cleanup;
> > +
> > + complete(&input_device->wait_event);
> > +
> > + return;
> > +
> > +cleanup:
> > + kfree(input_device->hid_desc);
> > + input_device->hid_desc = NULL;
> > +
> > + kfree(input_device->report_desc);
> > + input_device->report_desc = NULL;
> > +
> > + input_device->dev_info_status = -1;
> > + complete(&input_device->wait_event);
> > +}
> > +
> > +static void mousevsc_on_receive(struct hv_device *device,
> > + struct vmpacket_descriptor *packet)
> > +{
> > + struct pipe_prt_msg *pipe_msg;
> > + struct synthhid_msg *hid_msg;
> > + struct mousevsc_dev *input_dev = hv_get_drvdata(device);
> > + struct synthhid_input_report *input_report;
> > +
> > + pipe_msg = (struct pipe_prt_msg *)((unsigned long)packet +
> > + (packet->offset8 << 3));
> > +
> > + if (pipe_msg->type != PIPE_MESSAGE_DATA)
> > + return;
> > +
> > + hid_msg = (struct synthhid_msg *)&pipe_msg->data[0];
> > +
> > + switch (hid_msg->header.type) {
> > + case SYNTH_HID_PROTOCOL_RESPONSE:
> > + memcpy(&input_dev->protocol_resp, pipe_msg,
> > + pipe_msg->size + sizeof(struct pipe_prt_msg) -
> > + sizeof(unsigned char));
> > + complete(&input_dev->wait_event);
> > + break;
> > +
> > + case SYNTH_HID_INITIAL_DEVICE_INFO:
> > + WARN_ON(pipe_msg->size < sizeof(struct hv_input_dev_info));
> > +
> > + /*
> > + * Parse out the device info into device attr,
> > + * hid desc and report desc
> > + */
> > + mousevsc_on_receive_device_info(input_dev,
> > + (struct synthhid_device_info *)&pipe_msg->data[0]);
> > + break;
> > + case SYNTH_HID_INPUT_REPORT:
> > + input_report =
> > + (struct synthhid_input_report *)&pipe_msg->data[0];
> > + if (!input_dev->init_complete)
> > + break;
> > + hid_input_report(input_dev->hid_device,
> > + HID_INPUT_REPORT, input_report->buffer,
> > + input_report->header.size, 1);
> > + break;
> > + default:
> > + pr_err("unsupported hid msg type - type %d len %d",
> > + hid_msg->header.type, hid_msg->header.size);
> > + break;
> > + }
> > +
> > +}
> > +
> > +static void mousevsc_on_channel_callback(void *context)
> > +{
> > + const int packetSize = 0x100;
> > + int ret = 0;
> > + struct hv_device *device = (struct hv_device *)context;
>
> No need to cast.
>
> > +
> > + u32 bytes_recvd;
> > + u64 req_id;
> > + unsigned char packet[0x100];
>
> Hmm, 100 bytes on stack... and are we in interrupt context by any
> chance?
>
> > + struct vmpacket_descriptor *desc;
> > + unsigned char *buffer = packet;
> > + int bufferlen = packetSize;
> > +
> > +
> > + do {
> > + ret = vmbus_recvpacket_raw(device->channel, buffer,
> > + bufferlen, &bytes_recvd, &req_id);
> > +
> > + if (ret == 0) {
> > + if (bytes_recvd > 0) {
> > + desc = (struct vmpacket_descriptor *)buffer;
> > +
> > + switch (desc->type) {
> > + case VM_PKT_COMP:
> > + break;
> > +
> > + case VM_PKT_DATA_INBAND:
> > + mousevsc_on_receive(
> > + device, desc);
> > + break;
> > +
> > + default:
> > + pr_err("unhandled packet type %d, tid
> %llx len %d\n",
> > + desc->type,
> > + req_id,
> > + bytes_recvd);
> > + break;
> > + }
> > +
> > + /* reset */
> > + if (bufferlen > packetSize) {
> > + kfree(buffer);
> > +
> > + buffer = packet;
> > + bufferlen = packetSize;
> > + }
> > + } else {
> > + if (bufferlen > packetSize) {
> > + kfree(buffer);
> > +
> > + buffer = packet;
> > + bufferlen = packetSize;
> > + }
> > + break;
> > + }
> > + } else if (ret == -ENOBUFS) {
> > + /* Handle large packet */
> > + bufferlen = bytes_recvd;
> > + buffer = kzalloc(bytes_recvd, GFP_ATOMIC);
> > +
>
> What happens if we receive even larger amount of data after allocating
> the buffer?
I will cleanup this function.
>
> > + if (buffer == NULL) {
> > + buffer = packet;
> > + bufferlen = packetSize;
> > + break;
> > + }
> > + }
> > + } while (1);
>
> So we can be looping indefinitely here as long as other side keeps
> sending data?
The current protocol requires that the consumer handle all available data on the
channel before exiting the handler; this is used to optimize signaling on the ring
buffer between the producer and the consumer.
>
> > +
> > + return;
>
> No naked returns please.
>
> > +}
> > +
> > +static int mousevsc_connect_to_vsp(struct hv_device *device)
> > +{
> > + int ret = 0;
> > + int t;
> > + struct mousevsc_dev *input_dev = hv_get_drvdata(device);
> > + struct mousevsc_prt_msg *request;
> > + struct mousevsc_prt_msg *response;
> > +
> > +
> > + request = &input_dev->protocol_req;
> > +
> > + memset(request, 0, sizeof(struct mousevsc_prt_msg));
> > +
> > + request->type = PIPE_MESSAGE_DATA;
> > + request->size = sizeof(struct synthhid_protocol_request);
> > +
> > + request->request.header.type = SYNTH_HID_PROTOCOL_REQUEST;
> > + request->request.header.size = sizeof(unsigned int);
> > + request->request.version_requested.version =
> SYNTHHID_INPUT_VERSION;
> > +
> > +
> > + ret = vmbus_sendpacket(device->channel, request,
> > + sizeof(struct pipe_prt_msg) -
> > + sizeof(unsigned char) +
> > + sizeof(struct synthhid_protocol_request),
> > + (unsigned long)request,
> > + VM_PKT_DATA_INBAND,
> > +
> VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
> > + if (ret != 0)
> > + goto cleanup;
> > +
> > + t = wait_for_completion_timeout(&input_dev->wait_event, 5*HZ);
> > + if (t == 0) {
> > + ret = -ETIMEDOUT;
> > + goto cleanup;
> > + }
> > +
> > + response = &input_dev->protocol_resp;
> > +
> > + if (!response->response.approved) {
> > + pr_err("synthhid protocol request failed (version %d)",
> > + SYNTHHID_INPUT_VERSION);
> > + ret = -ENODEV;
> > + goto cleanup;
> > + }
> > +
> > + t = wait_for_completion_timeout(&input_dev->wait_event, 5*HZ);
>
> We just completed the wait for this completion, why are we waiting on
> the same completion again?
In response to our initial query, we expect the host to respond back with two
distinct pieces of information; we wait for both these responses.
>
> > + if (t == 0) {
> > + ret = -ETIMEDOUT;
> > + goto cleanup;
> > + }
> > +
> > + /*
> > + * We should have gotten the device attr, hid desc and report
> > + * desc at this point
> > + */
> > + if (input_dev->dev_info_status)
> > + ret = -ENOMEM;
>
> -ENOMEM seems wrong.
>
There are many failures here and not being able to allocate memory is the
primary one; and so I chose to capture that.
> > +
> > +cleanup:
> > +
> > + return ret;
> > +}
> > +
> > +static int mousevsc_hid_open(struct hid_device *hid)
> > +{
> > + return 0;
> > +}
> > +
> > +static void mousevsc_hid_close(struct hid_device *hid)
> > +{
> > +}
> > +
> > +static struct hid_ll_driver mousevsc_ll_driver = {
> > + .open = mousevsc_hid_open,
> > + .close = mousevsc_hid_close,
> > +};
> > +
> > +static struct hid_driver mousevsc_hid_driver;
> > +
> > +static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len)
> > +{
>
> This is called from mousevsc_on_device_add() which is part of device
> probe. Why it is split into separate function with bizzare arguments is
> beyond me.
I will clean this up.
>
> > + struct hid_device *hid_dev;
> > + struct mousevsc_dev *input_device = hv_get_drvdata(dev);
> > +
> > + hid_dev = hid_allocate_device();
> > + if (IS_ERR(hid_dev))
> > + return;
>
> This is not very helpful.
I will clean this up.
>
> > +
> > + hid_dev->ll_driver = &mousevsc_ll_driver;
> > + hid_dev->driver = &mousevsc_hid_driver;
> > +
> > + if (hid_parse_report(hid_dev, packet, len))
> > + return;
>
> Neither is this.
>
> > +
> > + hid_dev->bus = BUS_VIRTUAL;
> > + hid_dev->vendor = input_device->hid_dev_info.vendor;
> > + hid_dev->product = input_device->hid_dev_info.product;
> > + hid_dev->version = input_device->hid_dev_info.version;
> > +
> > + sprintf(hid_dev->name, "%s", "Microsoft Vmbus HID-compliant Mouse");
> > +
> > + if (!hidinput_connect(hid_dev, 0)) {
> > + hid_dev->claimed |= HID_CLAIMED_INPUT;
>
> Why do you force hidinput claim? Let the normal rules do it.
>
> > +
> > + input_device->connected = 1;
>
> input_device->connected = true;
>
> > +
> > + }
> > +
> > + input_device->hid_device = hid_dev;
>
> This assignment is probably too late.
I will address this.
>
> > +}
> > +
> > +static int mousevsc_on_device_add(struct hv_device *device)
>
> The only caller of this is mousevsc_probe() so why do you have it
I will address this.
>
> > +{
> > + int ret = 0;
> > + struct mousevsc_dev *input_dev;
> > +
> > + input_dev = alloc_input_device(device);
> > +
> > + if (!input_dev)
> > + return -ENOMEM;
> > +
> > + input_dev->init_complete = false;
> > +
> > + ret = vmbus_open(device->channel,
> > + INPUTVSC_SEND_RING_BUFFER_SIZE,
> > + INPUTVSC_RECV_RING_BUFFER_SIZE,
> > + NULL,
> > + 0,
> > + mousevsc_on_channel_callback,
> > + device
> > + );
> > +
> > + if (ret != 0) {
> > + free_input_device(input_dev);
> > + return ret;
> > + }
> > +
> > +
> > + ret = mousevsc_connect_to_vsp(device);
> > +
> > + if (ret != 0) {
> > + vmbus_close(device->channel);
> > + free_input_device(input_dev);
> > + return ret;
> > + }
> > +
> > +
> > + /* workaround SA-167 */
> > + if (input_dev->report_desc[14] == 0x25)
> > + input_dev->report_desc[14] = 0x29;
> > +
> > + reportdesc_callback(device, input_dev->report_desc,
> > + input_dev->report_desc_size);
> > +
> > + input_dev->init_complete = true;
> > +
> > + return ret;
> > +}
> > +
> > +static int mousevsc_probe(struct hv_device *dev,
> > + const struct hv_vmbus_device_id *dev_id)
> > +{
> > +
> > + return mousevsc_on_device_add(dev);
> > +
> > +}
> > +
> > +static int mousevsc_remove(struct hv_device *dev)
> > +{
> > + struct mousevsc_dev *input_dev = hv_get_drvdata(dev);
> > +
> > + vmbus_close(dev->channel);
> > +
> > + if (input_dev->connected) {
> > + hidinput_disconnect(input_dev->hid_device);
> > + input_dev->connected = 0;
> > + hid_destroy_device(input_dev->hid_device);
>
> hid_destroy_device() should disconnect registered handlers for you; you
> do not need to do that manually.
>
> > + }
> > +
> > + free_input_device(input_dev);
>
> Calling it input device is terribly confusing to me. I'd also freed it
> inline (and used gotos to unwind errors in probe()).
>
I will clean this up.
Regards,
K. Y
^ permalink raw reply
* LVM2/test/lib aux.sh
From: zkabelac @ 2011-10-23 15:43 UTC (permalink / raw)
To: lvm-devel
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2011-10-23 15:43:10
Modified files:
test/lib : aux.sh
Log message:
Used device name instead of device path
Udev is tricky here - since with udev the node does not exists until
it resume happens. So we need to resume devices via its name.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/lib/aux.sh.diff?cvsroot=lvm2&r1=1.32&r2=1.33
--- LVM2/test/lib/aux.sh 2011/10/23 15:40:15 1.32
+++ LVM2/test/lib/aux.sh 2011/10/23 15:43:10 1.33
@@ -333,7 +333,8 @@
for dev in "$@"; do
local name=`echo "$dev" | sed -e 's,.*/,,'`
dmsetup create -u TEST-$name $name $name.table || dmsetup load $name $name.table
- dmsetup resume $dev
+ # using device name (since device path does not exists yes with udev)
+ dmsetup resume $name
done
finish_udev_transaction
}
^ permalink raw reply
* [Qemu-devel] [PATCH 2/2] [PATCH RFC v2 2/2] hyper-v: initialize Hyper-V CPUID leaves.
From: Vadim Rozenfeld @ 2011-10-23 15:39 UTC (permalink / raw)
To: kvm
Cc: Kevin Wolf, Jan Kiszka, qemu-devel, Vadim Rozenfeld,
Paolo Bonzini, Avi Kivity
In-Reply-To: <1319384389-1389-1-git-send-email-vrozenfe@redhat.com>
---
target-i386/kvm.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 71 insertions(+), 2 deletions(-)
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 82fec8c..c061e3b 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -29,6 +29,7 @@
#include "hw/pc.h"
#include "hw/apic.h"
#include "ioport.h"
+#include "hyperv.h"
//#define DEBUG_KVM
@@ -380,11 +381,16 @@ int kvm_arch_init_vcpu(CPUState *env)
cpuid_i = 0;
/* Paravirtualization CPUIDs */
- memcpy(signature, "KVMKVMKVM\0\0\0", 12);
c = &cpuid_data.entries[cpuid_i++];
memset(c, 0, sizeof(*c));
c->function = KVM_CPUID_SIGNATURE;
- c->eax = 0;
+ if (!hyperv_enabled()) {
+ memcpy(signature, "KVMKVMKVM\0\0\0", 12);
+ c->eax = 0;
+ } else {
+ memcpy(signature, "Microsoft Hv", 12);
+ c->eax = HYPERV_CPUID_MIN;
+ }
c->ebx = signature[0];
c->ecx = signature[1];
c->edx = signature[2];
@@ -395,6 +401,54 @@ int kvm_arch_init_vcpu(CPUState *env)
c->eax = env->cpuid_kvm_features &
kvm_arch_get_supported_cpuid(s, KVM_CPUID_FEATURES, 0, R_EAX);
+ if (hyperv_enabled()) {
+ memcpy(signature, "Hv#1\0\0\0\0\0\0\0\0", 12);
+ c->eax = signature[0];
+
+ c = &cpuid_data.entries[cpuid_i++];
+ memset(c, 0, sizeof(*c));
+ c->function = HYPERV_CPUID_VERSION;
+ c->eax = 0x00001bbc;
+ c->ebx = 0x00060001;
+
+ c = &cpuid_data.entries[cpuid_i++];
+ memset(c, 0, sizeof(*c));
+ c->function = HYPERV_CPUID_FEATURES;
+ if (hyperv_relaxed_timing_enabled()) {
+ c->eax |= HV_X64_MSR_HYPERCALL_AVAILABLE;
+ }
+ if (hyperv_vapic_recommended()) {
+ c->eax |= HV_X64_MSR_HYPERCALL_AVAILABLE;
+ c->eax |= HV_X64_MSR_APIC_ACCESS_AVAILABLE;
+ }
+
+ c = &cpuid_data.entries[cpuid_i++];
+ memset(c, 0, sizeof(*c));
+ c->function = HYPERV_CPUID_ENLIGHTMENT_INFO;
+ if (hyperv_relaxed_timing_enabled()) {
+ c->eax |= HV_X64_RELAXED_TIMING_RECOMMENDED;
+ }
+ if (hyperv_vapic_recommended()) {
+ c->eax |= HV_X64_APIC_ACCESS_RECOMMENDED;
+ }
+ c->ebx = hyperv_get_spinlock_retries();
+
+ c = &cpuid_data.entries[cpuid_i++];
+ memset(c, 0, sizeof(*c));
+ c->function = HYPERV_CPUID_IMPLEMENT_LIMITS;
+ c->eax = 0x40;
+ c->ebx = 0x40;
+
+ c = &cpuid_data.entries[cpuid_i++];
+ memset(c, 0, sizeof(*c));
+ c->function = KVM_CPUID_SIGNATURE_NEXT;
+ memcpy(signature, "KVMKVMKVM\0\0\0", 12);
+ c->eax = 0;
+ c->ebx = signature[0];
+ c->ecx = signature[1];
+ c->edx = signature[2];
+ }
+
has_msr_async_pf_en = c->eax & (1 << KVM_FEATURE_ASYNC_PF);
cpu_x86_cpuid(env, 0, 0, &limit, &unused, &unused, &unused);
@@ -953,6 +1007,13 @@ static int kvm_put_msrs(CPUState *env, int level)
kvm_msr_entry_set(&msrs[n++], MSR_KVM_ASYNC_PF_EN,
env->async_pf_en_msr);
}
+ if (hyperv_hypercall_available()) {
+ kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_GUEST_OS_ID, 0);
+ kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_HYPERCALL, 0);
+ }
+ if (hyperv_vapic_recommended()) {
+ kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_APIC_ASSIST_PAGE, 0);
+ }
}
if (env->mcg_cap) {
int i;
@@ -1190,6 +1251,14 @@ static int kvm_get_msrs(CPUState *env)
msrs[n++].index = MSR_KVM_ASYNC_PF_EN;
}
+ if (hyperv_hypercall_available()) {
+ msrs[n++].index = HV_X64_MSR_GUEST_OS_ID;
+ msrs[n++].index = HV_X64_MSR_HYPERCALL;
+ }
+ if (hyperv_vapic_recommended()) {
+ msrs[n++].index = HV_X64_MSR_APIC_ASSIST_PAGE;
+ }
+
if (env->mcg_cap) {
msrs[n++].index = MSR_MCG_STATUS;
msrs[n++].index = MSR_MCG_CTL;
--
1.7.4.4
^ permalink raw reply related
* LVM2/test/lib aux.sh
From: zkabelac @ 2011-10-23 15:40 UTC (permalink / raw)
To: lvm-devel
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2011-10-23 15:40:15
Modified files:
test/lib : aux.sh
Log message:
Do not make link in the real /dev
Skip trying to make link when real /dev dir is used for test.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/lib/aux.sh.diff?cvsroot=lvm2&r1=1.31&r2=1.32
--- LVM2/test/lib/aux.sh 2011/09/24 21:15:13 1.31
+++ LVM2/test/lib/aux.sh 2011/10/23 15:40:15 1.32
@@ -265,7 +265,7 @@
echo "$SCSI_DEBUG_DEV" > SCSI_DEBUG_DEV
echo "$SCSI_DEBUG_DEV" > LOOP
# Setting $LOOP provides means for prepare_devs() override
- ln -snf $DEBUG_DEV $SCSI_DEBUG_DEV
+ test "$LVM_TEST_DEVDIR" != "/dev" && ln -snf $DEBUG_DEV $SCSI_DEBUG_DEV
return 0
}
^ permalink raw reply
* [Qemu-devel] [PATCH 1/2] [PATCH RFC v2 1/2] hyper-v: introduce Hyper-V support infrastructure.
From: Vadim Rozenfeld @ 2011-10-23 15:39 UTC (permalink / raw)
To: kvm
Cc: Kevin Wolf, Jan Kiszka, qemu-devel, Vadim Rozenfeld,
Paolo Bonzini, Avi Kivity
In-Reply-To: <1319384389-1389-1-git-send-email-vrozenfe@redhat.com>
---
Makefile.target | 2 +
target-i386/cpuid.c | 14 ++++++++++
target-i386/hyperv.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++
target-i386/hyperv.h | 37 ++++++++++++++++++++++++++++
4 files changed, 118 insertions(+), 0 deletions(-)
create mode 100644 target-i386/hyperv.c
create mode 100644 target-i386/hyperv.h
diff --git a/Makefile.target b/Makefile.target
index 325f26e..446fabc 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -202,6 +202,8 @@ obj-$(CONFIG_NO_KVM) += kvm-stub.o
obj-y += memory.o
LIBS+=-lz
+obj-i386-y +=hyperv.o
+
QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
QEMU_CFLAGS += $(VNC_SASL_CFLAGS)
QEMU_CFLAGS += $(VNC_JPEG_CFLAGS)
diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c
index 1e8bcff..261c168 100644
--- a/target-i386/cpuid.c
+++ b/target-i386/cpuid.c
@@ -27,6 +27,8 @@
#include "qemu-option.h"
#include "qemu-config.h"
+#include "hyperv.h"
+
/* feature flags taken from "Intel Processor Identification and the CPUID
* Instruction" and AMD's "CPUID Specification". In cases of disagreement
* between feature naming conventions, aliases may be added.
@@ -716,6 +718,14 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *cpu_model)
goto error;
}
x86_cpu_def->tsc_khz = tsc_freq / 1000;
+ } else if (!strcmp(featurestr, "hv_spinlocks")) {
+ char *err;
+ numvalue = strtoul(val, &err, 0);
+ if (!*val || *err) {
+ fprintf(stderr, "bad numerical value %s\n", val);
+ goto error;
+ }
+ hyperv_set_spinlock_retries(numvalue);
} else {
fprintf(stderr, "unrecognized feature %s\n", featurestr);
goto error;
@@ -724,6 +734,10 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *cpu_model)
check_cpuid = 1;
} else if (!strcmp(featurestr, "enforce")) {
check_cpuid = enforce_cpuid = 1;
+ } else if (!strcmp(featurestr, "hv_relaxed")) {
+ hyperv_enable_relaxed_timing(true);
+ } else if (!strcmp(featurestr, "hv_vapic")) {
+ hyperv_enable_vapic_recommended(true);
} else {
fprintf(stderr, "feature string `%s' not in format (+feature|-feature|feature=xyz)\n", featurestr);
goto error;
diff --git a/target-i386/hyperv.c b/target-i386/hyperv.c
new file mode 100644
index 0000000..b2e57ad
--- /dev/null
+++ b/target-i386/hyperv.c
@@ -0,0 +1,65 @@
+/*
+ * QEMU Hyper-V support
+ *
+ * Copyright Red Hat, Inc. 2011
+ *
+ * Author: Vadim Rozenfeld <vrozenfe@redhat.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#include "hyperv.h"
+
+static bool hyperv_vapic;
+static bool hyperv_relaxed_timing;
+static int hyperv_spinlock_attempts = HYPERV_SPINLOCK_NEVER_RETRY;
+
+void hyperv_enable_vapic_recommended(bool val)
+{
+ hyperv_vapic = val;
+}
+
+void hyperv_enable_relaxed_timing(bool val)
+{
+ hyperv_relaxed_timing = val;
+}
+
+void hyperv_set_spinlock_retries(int val)
+{
+ hyperv_spinlock_attempts = val;
+ if (hyperv_spinlock_attempts < 0xFFF) {
+ hyperv_spinlock_attempts = 0xFFF;
+ }
+}
+
+bool hyperv_enabled(void)
+{
+ return hyperv_hypercall_available() || hyperv_relaxed_timing_enabled();
+}
+
+bool hyperv_hypercall_available(void)
+{
+ if (hyperv_vapic ||
+ (hyperv_spinlock_attempts != HYPERV_SPINLOCK_NEVER_RETRY)) {
+ return true;
+ }
+ return false;
+}
+
+bool hyperv_vapic_recommended(void)
+{
+ return hyperv_vapic;
+}
+
+bool hyperv_relaxed_timing_enabled(void)
+{
+ return hyperv_relaxed_timing;
+}
+
+int hyperv_get_spinlock_retries(void)
+{
+ return hyperv_spinlock_attempts;
+}
+
diff --git a/target-i386/hyperv.h b/target-i386/hyperv.h
new file mode 100644
index 0000000..0d742f8
--- /dev/null
+++ b/target-i386/hyperv.h
@@ -0,0 +1,37 @@
+/*
+ * QEMU Hyper-V support
+ *
+ * Copyright Red Hat, Inc. 2011
+ *
+ * Author: Vadim Rozenfeld <vrozenfe@redhat.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#ifndef QEMU_HW_HYPERV_H
+#define QEMU_HW_HYPERV_H 1
+
+#include "qemu-common.h"
+#include <asm/hyperv.h>
+
+#ifndef HYPERV_SPINLOCK_NEVER_RETRY
+#define HYPERV_SPINLOCK_NEVER_RETRY 0xFFFFFFFF
+#endif
+
+#ifndef KVM_CPUID_SIGNATURE_NEXT
+#define KVM_CPUID_SIGNATURE_NEXT 0x40000100
+#endif
+
+void hyperv_enable_vapic_recommended(bool val);
+void hyperv_enable_relaxed_timing(bool val);
+void hyperv_set_spinlock_retries(int val);
+
+bool hyperv_enabled(void);
+bool hyperv_hypercall_available(void);
+bool hyperv_vapic_recommended(void);
+bool hyperv_relaxed_timing_enabled(void);
+int hyperv_get_spinlock_retries(void);
+
+#endif /* QEMU_HW_HYPERV_H */
--
1.7.4.4
^ permalink raw reply related
* [PATCH 2/2] [PATCH RFC v2 2/2] hyper-v: initialize Hyper-V CPUID leaves.
From: Vadim Rozenfeld @ 2011-10-23 15:39 UTC (permalink / raw)
To: kvm
Cc: Avi Kivity, qemu-devel, Jan Kiszka, Paolo Bonzini, Kevin Wolf,
Vadim Rozenfeld
In-Reply-To: <1319384389-1389-1-git-send-email-vrozenfe@redhat.com>
---
target-i386/kvm.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 71 insertions(+), 2 deletions(-)
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 82fec8c..c061e3b 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -29,6 +29,7 @@
#include "hw/pc.h"
#include "hw/apic.h"
#include "ioport.h"
+#include "hyperv.h"
//#define DEBUG_KVM
@@ -380,11 +381,16 @@ int kvm_arch_init_vcpu(CPUState *env)
cpuid_i = 0;
/* Paravirtualization CPUIDs */
- memcpy(signature, "KVMKVMKVM\0\0\0", 12);
c = &cpuid_data.entries[cpuid_i++];
memset(c, 0, sizeof(*c));
c->function = KVM_CPUID_SIGNATURE;
- c->eax = 0;
+ if (!hyperv_enabled()) {
+ memcpy(signature, "KVMKVMKVM\0\0\0", 12);
+ c->eax = 0;
+ } else {
+ memcpy(signature, "Microsoft Hv", 12);
+ c->eax = HYPERV_CPUID_MIN;
+ }
c->ebx = signature[0];
c->ecx = signature[1];
c->edx = signature[2];
@@ -395,6 +401,54 @@ int kvm_arch_init_vcpu(CPUState *env)
c->eax = env->cpuid_kvm_features &
kvm_arch_get_supported_cpuid(s, KVM_CPUID_FEATURES, 0, R_EAX);
+ if (hyperv_enabled()) {
+ memcpy(signature, "Hv#1\0\0\0\0\0\0\0\0", 12);
+ c->eax = signature[0];
+
+ c = &cpuid_data.entries[cpuid_i++];
+ memset(c, 0, sizeof(*c));
+ c->function = HYPERV_CPUID_VERSION;
+ c->eax = 0x00001bbc;
+ c->ebx = 0x00060001;
+
+ c = &cpuid_data.entries[cpuid_i++];
+ memset(c, 0, sizeof(*c));
+ c->function = HYPERV_CPUID_FEATURES;
+ if (hyperv_relaxed_timing_enabled()) {
+ c->eax |= HV_X64_MSR_HYPERCALL_AVAILABLE;
+ }
+ if (hyperv_vapic_recommended()) {
+ c->eax |= HV_X64_MSR_HYPERCALL_AVAILABLE;
+ c->eax |= HV_X64_MSR_APIC_ACCESS_AVAILABLE;
+ }
+
+ c = &cpuid_data.entries[cpuid_i++];
+ memset(c, 0, sizeof(*c));
+ c->function = HYPERV_CPUID_ENLIGHTMENT_INFO;
+ if (hyperv_relaxed_timing_enabled()) {
+ c->eax |= HV_X64_RELAXED_TIMING_RECOMMENDED;
+ }
+ if (hyperv_vapic_recommended()) {
+ c->eax |= HV_X64_APIC_ACCESS_RECOMMENDED;
+ }
+ c->ebx = hyperv_get_spinlock_retries();
+
+ c = &cpuid_data.entries[cpuid_i++];
+ memset(c, 0, sizeof(*c));
+ c->function = HYPERV_CPUID_IMPLEMENT_LIMITS;
+ c->eax = 0x40;
+ c->ebx = 0x40;
+
+ c = &cpuid_data.entries[cpuid_i++];
+ memset(c, 0, sizeof(*c));
+ c->function = KVM_CPUID_SIGNATURE_NEXT;
+ memcpy(signature, "KVMKVMKVM\0\0\0", 12);
+ c->eax = 0;
+ c->ebx = signature[0];
+ c->ecx = signature[1];
+ c->edx = signature[2];
+ }
+
has_msr_async_pf_en = c->eax & (1 << KVM_FEATURE_ASYNC_PF);
cpu_x86_cpuid(env, 0, 0, &limit, &unused, &unused, &unused);
@@ -953,6 +1007,13 @@ static int kvm_put_msrs(CPUState *env, int level)
kvm_msr_entry_set(&msrs[n++], MSR_KVM_ASYNC_PF_EN,
env->async_pf_en_msr);
}
+ if (hyperv_hypercall_available()) {
+ kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_GUEST_OS_ID, 0);
+ kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_HYPERCALL, 0);
+ }
+ if (hyperv_vapic_recommended()) {
+ kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_APIC_ASSIST_PAGE, 0);
+ }
}
if (env->mcg_cap) {
int i;
@@ -1190,6 +1251,14 @@ static int kvm_get_msrs(CPUState *env)
msrs[n++].index = MSR_KVM_ASYNC_PF_EN;
}
+ if (hyperv_hypercall_available()) {
+ msrs[n++].index = HV_X64_MSR_GUEST_OS_ID;
+ msrs[n++].index = HV_X64_MSR_HYPERCALL;
+ }
+ if (hyperv_vapic_recommended()) {
+ msrs[n++].index = HV_X64_MSR_APIC_ASSIST_PAGE;
+ }
+
if (env->mcg_cap) {
msrs[n++].index = MSR_MCG_STATUS;
msrs[n++].index = MSR_MCG_CTL;
--
1.7.4.4
^ permalink raw reply related
* [PATCH 1/2] [PATCH RFC v2 1/2] hyper-v: introduce Hyper-V support infrastructure.
From: Vadim Rozenfeld @ 2011-10-23 15:39 UTC (permalink / raw)
To: kvm
Cc: Avi Kivity, qemu-devel, Jan Kiszka, Paolo Bonzini, Kevin Wolf,
Vadim Rozenfeld
In-Reply-To: <1319384389-1389-1-git-send-email-vrozenfe@redhat.com>
---
Makefile.target | 2 +
target-i386/cpuid.c | 14 ++++++++++
target-i386/hyperv.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++
target-i386/hyperv.h | 37 ++++++++++++++++++++++++++++
4 files changed, 118 insertions(+), 0 deletions(-)
create mode 100644 target-i386/hyperv.c
create mode 100644 target-i386/hyperv.h
diff --git a/Makefile.target b/Makefile.target
index 325f26e..446fabc 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -202,6 +202,8 @@ obj-$(CONFIG_NO_KVM) += kvm-stub.o
obj-y += memory.o
LIBS+=-lz
+obj-i386-y +=hyperv.o
+
QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
QEMU_CFLAGS += $(VNC_SASL_CFLAGS)
QEMU_CFLAGS += $(VNC_JPEG_CFLAGS)
diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c
index 1e8bcff..261c168 100644
--- a/target-i386/cpuid.c
+++ b/target-i386/cpuid.c
@@ -27,6 +27,8 @@
#include "qemu-option.h"
#include "qemu-config.h"
+#include "hyperv.h"
+
/* feature flags taken from "Intel Processor Identification and the CPUID
* Instruction" and AMD's "CPUID Specification". In cases of disagreement
* between feature naming conventions, aliases may be added.
@@ -716,6 +718,14 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *cpu_model)
goto error;
}
x86_cpu_def->tsc_khz = tsc_freq / 1000;
+ } else if (!strcmp(featurestr, "hv_spinlocks")) {
+ char *err;
+ numvalue = strtoul(val, &err, 0);
+ if (!*val || *err) {
+ fprintf(stderr, "bad numerical value %s\n", val);
+ goto error;
+ }
+ hyperv_set_spinlock_retries(numvalue);
} else {
fprintf(stderr, "unrecognized feature %s\n", featurestr);
goto error;
@@ -724,6 +734,10 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *cpu_model)
check_cpuid = 1;
} else if (!strcmp(featurestr, "enforce")) {
check_cpuid = enforce_cpuid = 1;
+ } else if (!strcmp(featurestr, "hv_relaxed")) {
+ hyperv_enable_relaxed_timing(true);
+ } else if (!strcmp(featurestr, "hv_vapic")) {
+ hyperv_enable_vapic_recommended(true);
} else {
fprintf(stderr, "feature string `%s' not in format (+feature|-feature|feature=xyz)\n", featurestr);
goto error;
diff --git a/target-i386/hyperv.c b/target-i386/hyperv.c
new file mode 100644
index 0000000..b2e57ad
--- /dev/null
+++ b/target-i386/hyperv.c
@@ -0,0 +1,65 @@
+/*
+ * QEMU Hyper-V support
+ *
+ * Copyright Red Hat, Inc. 2011
+ *
+ * Author: Vadim Rozenfeld <vrozenfe@redhat.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#include "hyperv.h"
+
+static bool hyperv_vapic;
+static bool hyperv_relaxed_timing;
+static int hyperv_spinlock_attempts = HYPERV_SPINLOCK_NEVER_RETRY;
+
+void hyperv_enable_vapic_recommended(bool val)
+{
+ hyperv_vapic = val;
+}
+
+void hyperv_enable_relaxed_timing(bool val)
+{
+ hyperv_relaxed_timing = val;
+}
+
+void hyperv_set_spinlock_retries(int val)
+{
+ hyperv_spinlock_attempts = val;
+ if (hyperv_spinlock_attempts < 0xFFF) {
+ hyperv_spinlock_attempts = 0xFFF;
+ }
+}
+
+bool hyperv_enabled(void)
+{
+ return hyperv_hypercall_available() || hyperv_relaxed_timing_enabled();
+}
+
+bool hyperv_hypercall_available(void)
+{
+ if (hyperv_vapic ||
+ (hyperv_spinlock_attempts != HYPERV_SPINLOCK_NEVER_RETRY)) {
+ return true;
+ }
+ return false;
+}
+
+bool hyperv_vapic_recommended(void)
+{
+ return hyperv_vapic;
+}
+
+bool hyperv_relaxed_timing_enabled(void)
+{
+ return hyperv_relaxed_timing;
+}
+
+int hyperv_get_spinlock_retries(void)
+{
+ return hyperv_spinlock_attempts;
+}
+
diff --git a/target-i386/hyperv.h b/target-i386/hyperv.h
new file mode 100644
index 0000000..0d742f8
--- /dev/null
+++ b/target-i386/hyperv.h
@@ -0,0 +1,37 @@
+/*
+ * QEMU Hyper-V support
+ *
+ * Copyright Red Hat, Inc. 2011
+ *
+ * Author: Vadim Rozenfeld <vrozenfe@redhat.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#ifndef QEMU_HW_HYPERV_H
+#define QEMU_HW_HYPERV_H 1
+
+#include "qemu-common.h"
+#include <asm/hyperv.h>
+
+#ifndef HYPERV_SPINLOCK_NEVER_RETRY
+#define HYPERV_SPINLOCK_NEVER_RETRY 0xFFFFFFFF
+#endif
+
+#ifndef KVM_CPUID_SIGNATURE_NEXT
+#define KVM_CPUID_SIGNATURE_NEXT 0x40000100
+#endif
+
+void hyperv_enable_vapic_recommended(bool val);
+void hyperv_enable_relaxed_timing(bool val);
+void hyperv_set_spinlock_retries(int val);
+
+bool hyperv_enabled(void);
+bool hyperv_hypercall_available(void);
+bool hyperv_vapic_recommended(void);
+bool hyperv_relaxed_timing_enabled(void);
+int hyperv_get_spinlock_retries(void);
+
+#endif /* QEMU_HW_HYPERV_H */
--
1.7.4.4
^ permalink raw reply related
* [Qemu-devel] [PATCH RFC v2 0/2] Initial support for Microsoft Hyper-V.
From: Vadim Rozenfeld @ 2011-10-23 15:39 UTC (permalink / raw)
To: kvm
Cc: Kevin Wolf, Jan Kiszka, qemu-devel, Vadim Rozenfeld,
Paolo Bonzini, Avi Kivity
With the following series of patches we are starting to implement
some basic Microsoft Hyper-V Enlightenment functionality. This series
is mostly about adding support for relaxed timing, spinlock,
and virtual apic.
For more Hyper-V related information please see:
"Hypervisor Functional Specification v2.0: For Windows Server 2008 R2" at
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=18673
Changelog:
v2->v1
- remove KVM_CAP_IRQCHIP ifdef,
- remove CONFIG_HYPERV config option,
- move KVM leaves to new location (0x40000100),
- cosmetic changes.
v0->v1
- move hyper-v parameters under cpu category,
- move hyper-v stuff to target-i386 directory,
- make CONFIG_HYPERV enabled by default for
i386-softmmu and x86_64-softmmu configurations,
- rearrange the patches from v0,
- set HV_X64_MSR_HYPERCALL, HV_X64_MSR_GUEST_OS_ID,
and HV_X64_MSR_APIC_ASSIST_PAGE to 0 on system reset.
Vadim Rozenfeld (2):
hyper-v: introduce Hyper-V support infrastructure.
hyper-v: initialize Hyper-V CPUID leaves.
Makefile.target | 2 +
target-i386/cpuid.c | 14 +++++++++
target-i386/hyperv.c | 65 ++++++++++++++++++++++++++++++++++++++++++++
target-i386/hyperv.h | 37 +++++++++++++++++++++++++
target-i386/kvm.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++-
5 files changed, 189 insertions(+), 2 deletions(-)
create mode 100644 target-i386/hyperv.c
create mode 100644 target-i386/hyperv.h
--
1.7.4.4
^ permalink raw reply
* [PATCH RFC v2 0/2] Initial support for Microsoft Hyper-V.
From: Vadim Rozenfeld @ 2011-10-23 15:39 UTC (permalink / raw)
To: kvm
Cc: Kevin Wolf, Jan Kiszka, qemu-devel, Vadim Rozenfeld,
Paolo Bonzini, Avi Kivity
With the following series of patches we are starting to implement
some basic Microsoft Hyper-V Enlightenment functionality. This series
is mostly about adding support for relaxed timing, spinlock,
and virtual apic.
For more Hyper-V related information please see:
"Hypervisor Functional Specification v2.0: For Windows Server 2008 R2" at
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=18673
Changelog:
v2->v1
- remove KVM_CAP_IRQCHIP ifdef,
- remove CONFIG_HYPERV config option,
- move KVM leaves to new location (0x40000100),
- cosmetic changes.
v0->v1
- move hyper-v parameters under cpu category,
- move hyper-v stuff to target-i386 directory,
- make CONFIG_HYPERV enabled by default for
i386-softmmu and x86_64-softmmu configurations,
- rearrange the patches from v0,
- set HV_X64_MSR_HYPERCALL, HV_X64_MSR_GUEST_OS_ID,
and HV_X64_MSR_APIC_ASSIST_PAGE to 0 on system reset.
Vadim Rozenfeld (2):
hyper-v: introduce Hyper-V support infrastructure.
hyper-v: initialize Hyper-V CPUID leaves.
Makefile.target | 2 +
target-i386/cpuid.c | 14 +++++++++
target-i386/hyperv.c | 65 ++++++++++++++++++++++++++++++++++++++++++++
target-i386/hyperv.h | 37 +++++++++++++++++++++++++
target-i386/kvm.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++-
5 files changed, 189 insertions(+), 2 deletions(-)
create mode 100644 target-i386/hyperv.c
create mode 100644 target-i386/hyperv.h
--
1.7.4.4
^ permalink raw reply
* LVM2/test t-mdata-strings.sh
From: zkabelac @ 2011-10-23 15:39 UTC (permalink / raw)
To: lvm-devel
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2011-10-23 15:39:08
Modified files:
test : t-mdata-strings.sh
Log message:
Expect failure with real /dev dir
As udev is for now incapable to create such devices
turn this test error into warning.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-mdata-strings.sh.diff?cvsroot=lvm2&r1=1.6&r2=1.7
--- LVM2/test/t-mdata-strings.sh 2011/01/05 00:16:20 1.6
+++ LVM2/test/t-mdata-strings.sh 2011/10/23 15:39:08 1.7
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2008 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2008-2011 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
@@ -13,8 +13,9 @@
. lib/test
-aux prepare_devs 1
+aux prepare_devs 2
+# for udev impossible to create
pv_ugly="__\"!@#\$%^&*,()|@||'\\\"__pv1"
# 'set up temp files, loopback devices'
@@ -23,9 +24,11 @@
dev1=$(dirname "$dev1")/$PREFIX$pv_ugly
# 'pvcreate, vgcreate on filename with backslashed chars'
-pvcreate "$dev1"
-vgcreate $vg "$dev1"
-
+created=$dev1
+# when used with real udev without fallback, it will fail here
+pvcreate "$dev1" || created=$dev2
+pvs | should grep $dev1
+vgcreate $vg "$created"
# 'no parse errors and VG really exists'
vgs 2>err
not grep "Parse error" err;
^ permalink raw reply
* LVM2 ./WHATS_NEW_DM libdm/mm/pool-fast.c
From: zkabelac @ 2011-10-23 15:38 UTC (permalink / raw)
To: lvm-devel
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2011-10-23 15:38:03
Modified files:
. : WHATS_NEW_DM
libdm/mm : pool-fast.c
Log message:
Fix usage of DEBUG_ENFORCE_POOL_LOCKING with DEBUG_MEM
Since DEBUG_MEM is storing own extra structure within returned memory chunk,
glibc free must be used directly for posix_memaling() allocated block.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.517&r2=1.518
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/mm/pool-fast.c.diff?cvsroot=lvm2&r1=1.16&r2=1.17
--- LVM2/WHATS_NEW_DM 2011/10/20 14:43:33 1.517
+++ LVM2/WHATS_NEW_DM 2011/10/23 15:38:02 1.518
@@ -1,5 +1,6 @@
Version 1.02.68 -
==================================
+ Fix compile-time pool memory locking with DEBUG_MEM.
Fix valgrind error reports in free of pool chunks with DEBUG_MEM.
Align size of structure chunk for fast pool allocator to 8 bytes.
Simplify some pointer operations in dm_free_aux() debug code.
--- LVM2/libdm/mm/pool-fast.c 2011/10/20 14:43:33 1.16
+++ LVM2/libdm/mm/pool-fast.c 2011/10/23 15:38:03 1.17
@@ -306,7 +306,12 @@
VALGRIND_MAKE_MEM_UNDEFINED(c + 1, c->end - (char *) (c + 1));
# endif
#endif
+#ifdef DEBUG_ENFORCE_POOL_LOCKING
+ /* since DEBUG_MEM is using own memory list */
+ free(c); /* for posix_memalign() */
+#else
dm_free(c);
+#endif
}
^ permalink raw reply
* Re: Kernel BUG unable to handle kernel NULL pointer dereference
From: Mitch Harder @ 2011-10-23 15:37 UTC (permalink / raw)
To: Leonidas Spyropoulos; +Cc: linux-btrfs
In-Reply-To: <CAAeznTqh1W0W743WxTO+iUfajgsMw-A6abwr1fAZ6hWOJOnw2Q@mail.gmail.com>
On Sat, Oct 22, 2011 at 3:23 PM, Leonidas Spyropoulos
<artafinde@gmail.com> wrote:
> Hello, I got a kernel bug error, my guess from BTRFS.
>
> Here is the report,
> Oct 22 20:44:43 localhost kernel: [25554.947970] BUG: unable to handle
> kernel NULL pointer dereference at 0000000000000030
> Oct 22 20:44:43 localhost kernel: [25554.948002] IP:
> [<ffffffffa01ab027>] btrfs_print_leaf+0x37/0x880 [btrfs]
A patch was submitted by Sergei Trofimovich to address the issue with
handling a NULL pointer in btrfs_print_leaf.
http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg12021.html
Unfortunately, this usually only crops up when btrfs runs into
corruptions that it can't handle. So you very likely still have
problems even if the btrfs_print_leaf issue isn't addressed.
^ permalink raw reply
* Re: [PATCH 05/10] RDMA/cxgb4: Add DB Overflow Avoidance.
From: Steve Wise @ 2011-10-23 15:33 UTC (permalink / raw)
To: Vipul Pandya
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
roland-BHEL68pLQRGGvPXPguhicg, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
divy-ut6Up61K2wZBDgjK7y7TUQ, dm-ut6Up61K2wZBDgjK7y7TUQ,
kumaras-ut6Up61K2wZBDgjK7y7TUQ
In-Reply-To: <1319044264-779-6-git-send-email-vipul-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
On 10/19/2011 12:10 PM, Vipul Pandya wrote:
> - get FULL/EMPTY/DROP events from LLD
>
> - on FULL event, disable normal user mode DB rings.
>
> - add modify_qp semantics to allow user processes to call into
> the kernel to ring doobells without overflowing.
>
> Add DB Full/Empty/Drop stats.
>
> Mark queues when created indicating the doorbell state.
>
> If we're in the middle of db overflow avoidance, then newly created
> queues should start out in this mode.
>
Hey Vipul,
I just realized, we need to bump the ABI for iw_cxgb4 with this series
so the user mode library can know if the driver supports the kernel mode
db ringing. So bump C4IW_UVERBS_ABI_VERSION to 3.
Steve.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [Qemu-devel] [PATCH v3] add add-cow file format
From: shu ming @ 2011-10-23 15:28 UTC (permalink / raw)
To: Dong Xu Wang; +Cc: kwolf, wdongxu, qemu-devel, stefanha
In-Reply-To: <1318436596-6952-1-git-send-email-wdongxu@linux.vnet.ibm.com>
On 2011-10-13 0:23, Dong Xu Wang wrote:
> Add add-cow file format
>
> Signed-off-by: Dong Xu Wang<wdongxu@linux.vnet.ibm.com>
> ---
> Makefile.objs | 1 +
> block.c | 2 +-
> block.h | 1 +
> block/add-cow.c | 412 ++++++++++++++++++++++++++++++++++++++++++++++++
> block_int.h | 1 +
> docs/specs/add-cow.txt | 45 ++++++
> 6 files changed, 461 insertions(+), 1 deletions(-)
> create mode 100644 block/add-cow.c
> create mode 100644 docs/specs/add-cow.txt
>
> diff --git a/Makefile.objs b/Makefile.objs
> index c849e51..624c04c 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -31,6 +31,7 @@ block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
>
> block-nested-y += raw.o cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o
> block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o qcow2-cache.o
> +block-nested-y += add-cow.o
> block-nested-y += qed.o qed-gencb.o qed-l2-cache.o qed-table.o qed-cluster.o
> block-nested-y += qed-check.o
> block-nested-y += parallels.o nbd.o blkdebug.o sheepdog.o blkverify.o
> diff --git a/block.c b/block.c
> index e865fab..c25241d 100644
> --- a/block.c
> +++ b/block.c
> @@ -106,7 +106,7 @@ int is_windows_drive(const char *filename)
> #endif
>
> /* check if the path starts with "<protocol>:" */
> -static int path_has_protocol(const char *path)
> +int path_has_protocol(const char *path)
> {
> #ifdef _WIN32
> if (is_windows_drive(path) ||
> diff --git a/block.h b/block.h
> index 16bfa0a..8b09f12 100644
> --- a/block.h
> +++ b/block.h
> @@ -256,6 +256,7 @@ char *bdrv_snapshot_dump(char *buf, int buf_size, QEMUSnapshotInfo *sn);
>
> char *get_human_readable_size(char *buf, int buf_size, int64_t size);
> int path_is_absolute(const char *path);
> +int path_has_protocol(const char *path);
> void path_combine(char *dest, int dest_size,
> const char *base_path,
> const char *filename);
> diff --git a/block/add-cow.c b/block/add-cow.c
> new file mode 100644
> index 0000000..d2538a2
> --- /dev/null
> +++ b/block/add-cow.c
> @@ -0,0 +1,412 @@
> +#include "qemu-common.h"
> +#include "block_int.h"
> +#include "module.h"
> +
> +#define ADD_COW_MAGIC (((uint64_t)'A'<< 56) | ((uint64_t)'D'<< 48) | \
> + ((uint64_t)'D'<< 40) | ((uint64_t)'_'<< 32) | \
> + ((uint64_t)'C'<< 24) | ((uint64_t)'O'<< 16) | \
> + ((uint64_t)'W'<< 8) | 0xFF)
> +#define ADD_COW_VERSION 1
> +
> +typedef struct AddCowHeader {
> + uint64_t magic;
> + uint32_t version;
> + char backing_file[1024];
> + char image_file[1024];
1024 is a magic number for me. Can we have a meaningful macro?
> + uint64_t size;
> +} QEMU_PACKED AddCowHeader;
> +
> +typedef struct BDRVAddCowState {
> + char image_file[1024];
> + BlockDriverState *image_hd;
> + uint8_t *bitmap;
> + uint64_t bitmap_size;
> +} BDRVAddCowState;
> +
> +static int add_cow_probe(const uint8_t *buf, int buf_size, const char *filename)
> +{
> + const AddCowHeader *header = (const void *)buf;
> +
> + if (be64_to_cpu(header->magic) == ADD_COW_MAGIC&&
> + be32_to_cpu(header->version) == ADD_COW_VERSION) {
> + return 100;
> + } else {
> + return 0;
> + }
> +}
> +
> +static int add_cow_open(BlockDriverState *bs, int flags)
> +{
> + AddCowHeader header;
> + int64_t size;
> + char image_filename[1024];
> + int image_flags;
> + BlockDriver *image_drv = NULL;
> + int ret;
> + BDRVAddCowState *state = (BDRVAddCowState *)(bs->opaque);
> +
> + ret = bdrv_pread(bs->file, 0,&header, sizeof(header));
> + if (ret != sizeof(header)) {
> + goto fail;
> + }
> +
> + if (be64_to_cpu(header.magic) != ADD_COW_MAGIC ||
> + be32_to_cpu(header.version) != ADD_COW_VERSION) {
> + ret = -1;
> + goto fail;
> + }
> +
> + size = be64_to_cpu(header.size);
> + bs->total_sectors = size / BDRV_SECTOR_SIZE;
> +
> + QEMU_BUILD_BUG_ON(sizeof(state->image_file) != sizeof(header.image_file));
> + pstrcpy(bs->backing_file, sizeof(bs->backing_file),
> + header.backing_file);
> + pstrcpy(state->image_file, sizeof(state->image_file),
> + header.image_file);
> +
> + state->bitmap_size = ((bs->total_sectors + 7)>> 3);
> + state->bitmap = g_malloc0(state->bitmap_size);
> +
> + ret = bdrv_pread(bs->file, sizeof(header), state->bitmap,
> + state->bitmap_size);
> + if (ret != state->bitmap_size) {
> + goto fail;
> + }
> + /* If there is a image_file, must be together with backing_file */
> + if (state->image_file[0] != '\0') {
> + state->image_hd = bdrv_new("");
> + /* Relative to image or working dir, need discussion */
> + if (path_has_protocol(state->image_file)) {
> + pstrcpy(image_filename, sizeof(image_filename),
> + state->image_file);
> + } else {
> + path_combine(image_filename, sizeof(image_filename),
> + bs->filename, state->image_file);
> + }
> +
> + image_drv = bdrv_find_format("raw");
> + image_flags =
> + (flags& (~(BDRV_O_SNAPSHOT | BDRV_O_NO_BACKING))) | BDRV_O_RDWR;
> + state->image_hd->keep_read_only = 0;
> +
> + ret = bdrv_open(state->image_hd, image_filename, image_flags,
> + image_drv);
> + if (ret< 0) {
> + goto fail;
> + }
> + } else {
> + ret = -ENOENT;
> + goto fail;
> + }
> + return 0;
> + fail:
> + if (state->bitmap) {
> + g_free(state->bitmap);
> + state->bitmap = NULL;
> + }
> + return ret;
> +}
> +
> +static inline void add_cow_set_bit(BlockDriverState *bs, int64_t bitnum)
> +{
> + uint64_t offset = bitnum / 8;
> + BDRVAddCowState *state = (BDRVAddCowState *)(bs->opaque);
> + state->bitmap[offset] |= (1<< (bitnum % 8));
> +}
> +
> +static inline int is_bit_set(BlockDriverState *bs, int64_t bitnum)
> +{
> + BDRVAddCowState *state = (BDRVAddCowState *)(bs->opaque);
> + uint64_t offset = bitnum / 8;
> + return !!(state->bitmap[offset]& (1<< (bitnum % 8)));
> +}
> +
> +static int add_cow_is_allocated(BlockDriverState *bs, int64_t sector_num,
> + int nb_sectors, int *num_same)
> +{
> + int changed;
> + uint64_t bitmap_size = ((BDRVAddCowState *)(bs->opaque))->bitmap_size;
> +
> + /* Beyond the end of bitmap, return error or read from backing_file? */
> + if (((sector_num + nb_sectors + 7) / 8)> bitmap_size) {
> + return 0;
> + }
> +
> + if (nb_sectors == 0) {
> + *num_same = nb_sectors;
> + return 0;
> + }
> +
> + changed = is_bit_set(bs, sector_num);
> + if (changed< 0) {
> + return 0;
> + }
> +
> + for (*num_same = 1; *num_same< nb_sectors; (*num_same)++) {
> + if (is_bit_set(bs, sector_num + *num_same) != changed) {
> + break;
> + }
> + }
> +
> + return changed;
> +}
> +
> +static int add_cow_update_bitmap(BlockDriverState *bs, int64_t sector_num,
> + int nb_sectors)
> +{
> + int i, ret = 0;
> + BDRVAddCowState *state = (BDRVAddCowState *)(bs->opaque);
> + uint64_t start_pos = sector_num / 8;
> + uint64_t end_pos = (sector_num + nb_sectors - 1) / 8;
> +
> + if (start_pos> state->bitmap_size) {
> + return -1;
> + }
> +
> + for (i = 0; i< nb_sectors; i++) {
> + add_cow_set_bit(bs, sector_num + i);
> + }
> + ret = bdrv_pwrite_sync(bs->file,
> + sizeof(AddCowHeader) + start_pos,
> + state->bitmap + start_pos,
> + MIN(((end_pos - start_pos)& (~512)) + 512, state->bitmap_size - start_pos));
> + return ret;
> +}
> +
> +static void add_cow_close(BlockDriverState *bs)
> +{
> + BDRVAddCowState *state = (BDRVAddCowState *)(bs->opaque);
> + if (state->bitmap) {
> + g_free(state->bitmap);
> + state->bitmap = NULL;
> + }
> +}
> +
> +static int add_cow_create(const char *filename, QEMUOptionParameter *options)
> +{
> + AddCowHeader header;
> + int64_t image_sectors = 0;
> + const char *backing_filename = NULL;
> + const char *image_filename = NULL;
> + int ret;
> + BlockDriverState *bs, *image_bs = NULL;
> +
> + while (options&& options->name) {
> + if (!strcmp(options->name, BLOCK_OPT_SIZE)) {
> + image_sectors = options->value.n / BDRV_SECTOR_SIZE;
> + } else if (!strcmp(options->name, BLOCK_OPT_BACKING_FILE)) {
> + backing_filename = options->value.s;
> + } else if (!strcmp(options->name, BLOCK_OPT_IMAGE_FILE)) {
> + image_filename = options->value.s;
> + }
> + options++;
> + }
> +
> + if (!backing_filename || !image_filename) {
> + return -EINVAL;
> + }
> + /* Make sure image file exists */
> + ret = bdrv_file_open(&image_bs, image_filename, BDRV_O_RDWR
> + | BDRV_O_CACHE_WB);
> + if (ret< 0) {
> + return ret;
> + }
> + bdrv_close(image_bs);
> + ret = bdrv_create_file(filename, NULL);
> + if (ret< 0) {
> + return ret;
> + }
> +
> + ret = bdrv_file_open(&bs, filename, BDRV_O_RDWR);
> + if (ret< 0) {
> + return ret;
> + }
> +
> + memset(&header, 0, sizeof(header));
> + header.magic = cpu_to_be64(ADD_COW_MAGIC);
> + header.version = cpu_to_be32(ADD_COW_VERSION);
> + pstrcpy(header.backing_file, sizeof(header.backing_file), backing_filename);
> + pstrcpy(header.image_file, sizeof(header.image_file), image_filename);
> + header.size = cpu_to_be64(image_sectors * BDRV_SECTOR_SIZE);
> +
> + ret = bdrv_pwrite(bs, 0,&header, sizeof(header));
> + if (ret< 0) {
> + bdrv_close(bs);
> + return ret;
> + }
> + bdrv_close(bs);
> +
> + BlockDriver *drv = bdrv_find_format("add-cow");
> + assert(drv != NULL);
> + ret = bdrv_open(bs, filename, BDRV_O_RDWR | BDRV_O_NO_FLUSH, drv);
> + if (ret< 0) {
> + return ret;
> + }
> +
> + ret = bdrv_truncate(bs, image_sectors * BDRV_SECTOR_SIZE);
> +fail:
"fail" label is not used in this function.
> + bdrv_close(bs);
> + return ret;
> +}
> +
> +static int add_cow_co_readv(BlockDriverState *bs, int64_t sector_num,
> + int remaining_sectors, QEMUIOVector *qiov)
> +{
> + BDRVAddCowState *s = bs->opaque;
> + int cur_nr_sectors;
> + uint64_t bytes_done = 0;
> + QEMUIOVector hd_qiov;
> + int n, ret = 0;
> +
> + qemu_iovec_init(&hd_qiov, qiov->niov);
> + while (remaining_sectors != 0) {
> + cur_nr_sectors = remaining_sectors;
> + if (add_cow_is_allocated(bs, sector_num, cur_nr_sectors,&n)) {
> + cur_nr_sectors = n;
> + qemu_iovec_reset(&hd_qiov);
> + qemu_iovec_copy(&hd_qiov, qiov, bytes_done,
> + cur_nr_sectors * BDRV_SECTOR_SIZE);
> + ret = bdrv_co_readv(s->image_hd, sector_num, n,&hd_qiov);
> + if (ret< 0) {
> + goto fail;
> + }
> + } else {
> + cur_nr_sectors = n;
> + if (bs->backing_hd) {
> + qemu_iovec_reset(&hd_qiov);
> + qemu_iovec_copy(&hd_qiov, qiov, bytes_done,
> + cur_nr_sectors * BDRV_SECTOR_SIZE);
> + ret = bdrv_co_readv(bs->backing_hd, sector_num,
> + n,&hd_qiov);
> + if (ret< 0) {
> + goto fail;
> + }
> + } else {
> + qemu_iovec_reset(&hd_qiov);
> + qemu_iovec_memset(&hd_qiov, 0,
> + BDRV_SECTOR_SIZE * cur_nr_sectors);
> + }
> + }
> + remaining_sectors -= cur_nr_sectors;
> + sector_num += cur_nr_sectors;
> + bytes_done += cur_nr_sectors * BDRV_SECTOR_SIZE;
> + }
> +fail:
> + qemu_iovec_destroy(&hd_qiov);
> + return ret;
> +}
> +
> +static int add_cow_co_writev(BlockDriverState *bs, int64_t sector_num,
> + int remaining_sectors, QEMUIOVector *qiov)
> +{
> + BDRVAddCowState *s = bs->opaque;
> + int ret = 0;
> + QEMUIOVector hd_qiov;
> + qemu_iovec_init(&hd_qiov, qiov->niov);
> +
It looks like that the memory where "bs" is pointing to should be
protected by a lock. Because "bs"
was passed to several BlockDriver entries like ".bdrv_co_writev',
'bdrv_co_readv'&etc which can be executed
in parallel to access the memory where "bs" is pointing to.
> + qemu_iovec_reset(&hd_qiov);
> + qemu_iovec_copy(&hd_qiov, qiov, 0, remaining_sectors * BDRV_SECTOR_SIZE);
> + ret = bdrv_co_writev(s->image_hd,
> + sector_num,
> + remaining_sectors,&hd_qiov);
> + if (ret< 0) {
> + goto fail;
> + }
> +
> + ret = add_cow_update_bitmap(bs, sector_num, remaining_sectors);
> + if (ret< 0) {
> + goto fail;
> + }
> +fail:
> + qemu_iovec_destroy(&hd_qiov);
> + return ret;
> +}
> +
> +static int bdrv_add_cow_truncate(BlockDriverState *bs, int64_t offset)
> +{
> + int ret = 0;
> + int64_t image_sectors = offset/BDRV_SECTOR_SIZE;
> + int64_t be_offset = cpu_to_be64(offset);
> + BDRVAddCowState *state = bs->opaque;
> + ret = bdrv_truncate(bs->file, ((image_sectors + 7)>> 3)
> + + sizeof(AddCowHeader));
> + if (ret< 0) {
> + return ret;
> + }
> +
> + ret = bdrv_pwrite_sync(bs->file, offsetof(AddCowHeader, size),
> +&be_offset, sizeof(uint64_t));
> + if (ret< 0) {
> + return ret;
> + }
> +
> + ret = bdrv_truncate(state->image_hd, offset);
> + return ret;
> +}
> +
> +static QEMUOptionParameter add_cow_create_options[] = {
> + {
> + .name = BLOCK_OPT_SIZE,
> + .type = OPT_SIZE,
> + .help = "Virtual disk size"
> + },
> + {
> + .name = BLOCK_OPT_BACKING_FILE,
> + .type = OPT_STRING,
> + .help = "File name of a base image"
> + },
> + {
> + .name = BLOCK_OPT_IMAGE_FILE,
> + .type = OPT_STRING,
> + .help = "File name of a image file"
> + },
> + { NULL }
> +};
> +
> +static int add_cow_flush(BlockDriverState *bs)
> +{
> + BDRVAddCowState *state = bs->opaque;
> + int ret = bdrv_flush(state->image_hd);
> + if (ret< 0) {
> + return ret;
> + }
> + return bdrv_flush(bs->file);
> +}
> +
> +static BlockDriverAIOCB *add_cow_aio_flush(BlockDriverState *bs,
> + BlockDriverCompletionFunc *cb, void *opaque)
> +{
> + BDRVAddCowState *state = bs->opaque;
> + int ret = bdrv_flush(state->image_hd);
> + if (ret< 0) {
> + return NULL;
> + }
> +
> + return bdrv_aio_flush(bs->file, cb, opaque);
> +}
> +
> +static BlockDriver bdrv_add_cow = {
> + .format_name = "add-cow",
> + .instance_size = sizeof(BDRVAddCowState),
> + .bdrv_probe = add_cow_probe,
> + .bdrv_open = add_cow_open,
> + .bdrv_close = add_cow_close,
> + .bdrv_create = add_cow_create,
> + .bdrv_is_allocated = add_cow_is_allocated,
> +
> + .bdrv_co_readv = add_cow_co_readv,
> + .bdrv_co_writev = add_cow_co_writev,
> + .bdrv_truncate = bdrv_add_cow_truncate,
> +
> + .create_options = add_cow_create_options,
> + .bdrv_flush = add_cow_flush,
> + .bdrv_aio_flush = add_cow_aio_flush,
> +};
> +
> +static void bdrv_add_cow_init(void)
> +{
> + bdrv_register(&bdrv_add_cow);
> +}
> +
> +block_init(bdrv_add_cow_init);
> diff --git a/block_int.h b/block_int.h
> index 8c3b863..2b26fdc 100644
> --- a/block_int.h
> +++ b/block_int.h
> @@ -42,6 +42,7 @@
> #define BLOCK_OPT_TABLE_SIZE "table_size"
> #define BLOCK_OPT_PREALLOC "preallocation"
> #define BLOCK_OPT_SUBFMT "subformat"
> +#define BLOCK_OPT_IMAGE_FILE "image_file"
>
> typedef struct AIOPool {
> void (*cancel)(BlockDriverAIOCB *acb);
> diff --git a/docs/specs/add-cow.txt b/docs/specs/add-cow.txt
> new file mode 100644
> index 0000000..0443c6c
> --- /dev/null
> +++ b/docs/specs/add-cow.txt
> @@ -0,0 +1,45 @@
> +== General ==
> +
> +Raw file format does not support backing_file and copy on write feature. Then
> +you can use add-cow file realize these features.
> +
> +When using add-cow, procedures may like this:
> +(ubuntu.img is a disk image which has been installed OS.)
> + 1) Create a raw image with the same size of ubuntu.img
> + qemu-img create -f raw test.raw 8G
> + 2) Create a add-cow image which will store dirty bitmap
> + qemu-img create -f add-cow test.add-cow -o backing_file=ubuntu.img,image_file=test.raw
> + 3) Run qemu with add-cow image
> + qemu -drive if=virtio,file=test.add-cow
> +
> +=Specification=
> +
> +The file format looks like this:
> +
> + +----------+----------+----------+-----+
> + | Header | Data | Data | ... |
> + +----------+----------+----------+-----+
> +
> + All numbers in add-cow are stored in Big Endian byte order.
> +
> +
> +== Header ==
> +
> +The Header is included in the first bytes:
> +
> + Byte 0 - 7: magic
> + add-cow magic string ("ADD_COW\xff")
> +
> + 8 - 11: version
> + Version number (only valid value is 1 now)
> +
> + 12 - 1035: backing_file
> + backing_file file name related to add-cow file. While
> + using backing_file, must together with image_file.
> +
> + 1036 - 2059: image_file
> + image_file is a raw file, While using image_file, must
> + together with image_file.
> +
> + 2060 - 2067: size
> + Virtual disk size of image_file in bytes.
^ permalink raw reply
* [PATCH] [TRIVIAL] powerpc: 4xx: remove commented out Kconfig entries
From: Paul Bolle @ 2011-10-23 15:25 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-kernel
These Kconfig entries have been commented out ever since commit f6557331
("[...] Re-organize Kconfig code for 4xx in arch/powerpc"). There's no
indication why they're commented out. It looks like they're just "old,
unused [...] config options" that were not removed, as other entries
were in that commit, but only commented out. They might as well be
removed now.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
"git grep" tested only.
arch/powerpc/platforms/40x/Kconfig | 38 ------------------------------------
arch/powerpc/platforms/44x/Kconfig | 16 ---------------
2 files changed, 0 insertions(+), 54 deletions(-)
diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig
index d733d7c..e568e85 100644
--- a/arch/powerpc/platforms/40x/Kconfig
+++ b/arch/powerpc/platforms/40x/Kconfig
@@ -1,19 +1,3 @@
-#config BUBINGA
-# bool "Bubinga"
-# depends on 40x
-# default n
-# select 405EP
-# help
-# This option enables support for the IBM 405EP evaluation board.
-
-#config CPCI405
-# bool "CPCI405"
-# depends on 40x
-# default n
-# select 405GP
-# help
-# This option enables support for the CPCI405 board.
-
config ACADIA
bool "Acadia"
depends on 40x
@@ -73,14 +57,6 @@ config MAKALU
help
This option enables support for the AMCC PPC405EX board.
-#config SYCAMORE
-# bool "Sycamore"
-# depends on 40x
-# default n
-# select 405GPR
-# help
-# This option enables support for the IBM PPC405GPr evaluation board.
-
config WALNUT
bool "Walnut"
depends on 40x
@@ -185,17 +161,3 @@ config IBM405_ERR77
# All 40x-based cores, up until the 405GPR and 405EP have this errata.
config IBM405_ERR51
bool
-
-#config BIOS_FIXUP
-# bool
-# depends on BUBINGA || EP405 || SYCAMORE || WALNUT
-# default y
-
-#config PPC4xx_DMA
-# bool "PPC4xx DMA controller support"
-# depends on 4xx
-
-#config PPC4xx_EDMA
-# bool
-# depends on !STB03xxx && PPC4xx_DMA
-# default y
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index e958b6f..595e28a 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -197,22 +197,6 @@ config ICON
help
This option enables support for the AMCC PPC440SPe evaluation board.
-#config LUAN
-# bool "Luan"
-# depends on 44x
-# default n
-# select 440SP
-# help
-# This option enables support for the IBM PPC440SP evaluation board.
-
-#config OCOTEA
-# bool "Ocotea"
-# depends on 44x
-# default n
-# select 440GX
-# help
-# This option enables support for the IBM PPC440GX evaluation board.
-
config XILINX_VIRTEX440_GENERIC_BOARD
bool "Generic Xilinx Virtex 5 FXT board support"
depends on 44x
--
1.7.4.4
^ permalink raw reply related
* [PATCH] [TRIVIAL] snd-aoa: remove commented out Kconfig entry
From: Paul Bolle @ 2011-10-23 15:24 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-kernel
config SND_AOA_TOPAZ has been commented out since it was added five
years ago with commit f3d9478b ("[...] add snd-aoa"). There's no
indication why it's commented out. It might as well be removed.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
"git grep" tested only.
sound/aoa/codecs/Kconfig | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/sound/aoa/codecs/Kconfig b/sound/aoa/codecs/Kconfig
index 808eb11..0c68e32 100644
--- a/sound/aoa/codecs/Kconfig
+++ b/sound/aoa/codecs/Kconfig
@@ -7,14 +7,6 @@ config SND_AOA_ONYX
codec chip found in the latest Apple machines
(most of those with digital audio output).
-#config SND_AOA_TOPAZ
-# tristate "support Topaz chips"
-# ---help---
-# This option enables support for the Topaz (CS84xx)
-# codec chips found in the latest Apple machines,
-# these chips do the digital input and output on
-# some PowerMacs.
-
config SND_AOA_TAS
tristate "support TAS chips"
select I2C
--
1.7.4.4
^ permalink raw reply related
* [PATCH] [TRIVIAL] remove commented out Kconfig entries
From: Paul Bolle @ 2011-10-23 15:23 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-kernel
These Kconfig entries have been commented out since (at least)
v2.6.12-rc2 (the first commit of the git repository). There's no
indication why they're commented out. They might as well be removed.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
"git grep" tested only.
arch/frv/Kconfig | 10 ----------
arch/mips/Kconfig | 4 ----
arch/mips/sgi-ip27/Kconfig | 6 ------
drivers/parisc/Kconfig | 7 -------
4 files changed, 0 insertions(+), 27 deletions(-)
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index bad27a6..c5e69ab 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -341,16 +341,6 @@ source "drivers/pci/Kconfig"
source "drivers/pcmcia/Kconfig"
-#config MATH_EMULATION
-# bool "Math emulation support (EXPERIMENTAL)"
-# depends on EXPERIMENTAL
-# help
-# At some point in the future, this will cause floating-point math
-# instructions to be emulated by the kernel on machines that lack a
-# floating-point math coprocessor. Thrill-seekers and chronically
-# sleep-deprived psychotic hacker types can say Y now, everyone else
-# should probably wait a while.
-
menu "Power management options"
config ARCH_SUSPEND_POSSIBLE
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index b122adc..c616420 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2386,10 +2386,6 @@ config TC
Linux driver support status is documented at:
<http://www.linux-mips.org/wiki/DECstation>
-#config ACCESSBUS
-# bool "Access.Bus support"
-# depends on TC
-
config MMU
bool
default y
diff --git a/arch/mips/sgi-ip27/Kconfig b/arch/mips/sgi-ip27/Kconfig
index bc5e976..4b2ea28 100644
--- a/arch/mips/sgi-ip27/Kconfig
+++ b/arch/mips/sgi-ip27/Kconfig
@@ -1,9 +1,3 @@
-#config SGI_SN0_XXL
-# bool "IP27 XXL"
-# depends on SGI_IP27
-# This options adds support for userspace processes up to 16TB size.
-# Normally the limit is just .5TB.
-
choice
prompt "Node addressing mode"
depends on SGI_IP27
diff --git a/drivers/parisc/Kconfig b/drivers/parisc/Kconfig
index 553a990..6202649 100644
--- a/drivers/parisc/Kconfig
+++ b/drivers/parisc/Kconfig
@@ -108,13 +108,6 @@ config IOMMU_HELPER
depends on IOMMU_SBA || IOMMU_CCIO
default y
-#config PCI_EPIC
-# bool "EPIC/SAGA PCI support"
-# depends on PCI
-# default y
-# help
-# Say Y here for V-class PCI, DMA/IOMMU, IRQ subsystem support.
-
source "drivers/pcmcia/Kconfig"
source "drivers/pci/hotplug/Kconfig"
--
1.7.4.4
^ permalink raw reply related
* Re: YeeLoong / hotkey driver
From: Wu Zhangjin @ 2011-10-23 15:25 UTC (permalink / raw)
To: Paul Roge; +Cc: Ralf Baechle, Andreas Barth, linux-mips, debian-mips
In-Reply-To: <20111017180015.1e5fc4fe@dragon.agroecology>
On Tue, Oct 18, 2011 at 7:00 AM, Paul Roge <proge@riseup.net> wrote:
>> The old patch is out-of-date, perhaps we can start a new trip to
>> upstream the latest version maintained at
>> http://dev.lemote.com/code/linux-loongson-community.
>>
>> The latest one threaded the irq interrupt handler and fixed some bugs.
>>
>> Hope somebody else can work on it for I'm a little busy currently ;-)
>
> Since I am new to configuring kernels, I doubt that I can help very much on this.
>
> The 3.0.4-libre-lemote kernel from http://linux-libre.fsfla.org/pub/linux-libre/lemote/gnewsense has everything except hotkey support for wireless. The CONFIG_RTL8187 and CONFIG_RTL8187B options are disabled in the config file. Typing "echo 1 > /sys/class/rfkill/rfkill0/state" does nothing, even when the kernel is reconfigured with those drivers enabled.
>
> The 2.36.8-loongson-2f kernel from http://bjlx.org.cn/loongson2f/squeeze has functional hotkey and wireless networking capability. However, the date resets to 1968 when restarted, thus messing up certificates, and scrolling with the keybad is disabled.
>
> I would really appreciate suggestions for adding wireless/hotkey capability to the 3.0.4-libre-lemote kernel, or fixing the date problem and adding the keybad scrolling capability on 2.36.8-loongson-2f! Should I add the patch, modify options, or both?
I guess something may have been broken from 2.6.39 or 3.0, because I
have no enough time to continue the maintaining, sorry, hope you can
try 2.6.37 or 2.6.38 from http://bjlx.org.cn/loongson2f/squeeze
instead.
Sorry for my late response.
Regards,
Wu Zhangjin
>
> Thanks!
> Paul
>
^ permalink raw reply
* Re: [PATCH 00/36] Staging: cx25821: Clean up patch series
From: Leonid V. Fedorenchik @ 2011-10-23 15:24 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: Greg KH, Namhyung Kim, Palash Bandyopadhyay, Joe Perches,
Ilia Mirkin, Youquan Song, devel, linux-kernel
In-Reply-To: <4EA3A7ED.8090404@redhat.com>
On Sun, 23 Oct 2011 07:36:45 +0200
Mauro Carvalho Chehab <mchehab@redhat.com> wrote:
> Em 22-10-2011 10:19, Greg KH escreveu:
> > On Sat, Oct 22, 2011 at 01:43:20PM +0800, Leonid V. Fedorenchik wrote:
> >> This patch series fixes some style issues in drivers/staging/cx25821
> >> Mostly I was hoping to improve readability and fix some issues found by
> >> checkpatch.pl script.
> >
> > These are for Mauro to take through his tree.
>
> Yes. I'll put them on my queue.
Thank you. Should I send my future patches for this driver directly to you?
>
> Thanks,
> Mauro
Leonid V. Fedorenchik
^ permalink raw reply
* [PATCH 2/2] crypto: lrw: fix nblocks not being updated in walk loop
From: Jussi Kivilinna @ 2011-10-23 15:23 UTC (permalink / raw)
To: linux-crypto; +Cc: Herbert Xu, David S. Miller
In-Reply-To: <20111023152302.31041.36522.stgit@localhost6.localdomain6>
In lrw_crypt() function, nblocks should be updated after blkcipher_walk_done
call.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
---
crypto/lrw.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/crypto/lrw.c b/crypto/lrw.c
index 66c4d22..ba42acc 100644
--- a/crypto/lrw.c
+++ b/crypto/lrw.c
@@ -284,6 +284,7 @@ first:
if (!nbytes)
break;
+ nblocks = min(nbytes / bsize, max_blks);
src = (be128 *)walk.src.virt.addr;
dst = (be128 *)walk.dst.virt.addr;
}
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.