Re: [RFC/PATCH 3/3] x86/signal/64: Add explicit controls for sigcontext SS handling

2015-08-14 Thread Cyrill Gorcunov
On Fri, Aug 14, 2015 at 01:57:42PM -0700, Andy Lutomirski wrote: > > Don't bother testing yet. I'm waffling between trying something like > this and adding SA_SAVE_SS. I have partially written patches for the > latter. ok, ping me if anything -- To unsubscribe from this list: send the line "uns

Re: [RFC/PATCH 3/3] x86/signal/64: Add explicit controls for sigcontext SS handling

2015-08-14 Thread Cyrill Gorcunov
ould detect UC_RESTORE_SS and use it to avoid needing a > trampoline. > > Cc: Stas Sergeev > Cc: Linus Torvalds > Cc: Cyrill Gorcunov > Cc: Pavel Emelyanov > Signed-off-by: Andy Lutomirski Looks reasonable to me. Andy, Linus, what the final conclusion -- are we about to intr

Re: [patch 2/2] tools: lkvm - Filter out cpu vendor string

2013-06-06 Thread Cyrill Gorcunov
On Thu, Jun 06, 2013 at 03:03:03PM +0300, Pekka Enberg wrote: > > /* Set X86_FEATURE_HYPERVISOR */ > > if (entry->index == 0) > > Ping! Is there someone out there who has a AMD box they could test this on? I don't have it, sorry :-( -- To unsubscrib

[patch 2/2] tools: lkvm - Filter out cpu vendor string

2013-05-28 Thread Cyrill Gorcunov
own string and kernel will use generic cpu init. Reported-by: Ingo Molnar CC: Pekka Enberg CC: Sasha Levin CC: Asias He Signed-off-by: Cyrill Gorcunov --- tools/kvm/x86/cpuid.c |8 1 file changed, 8 insertions(+) Index: linux-2.6.git/tools/kvm/x86/cpuid.c

[patch 1/2] tools: lkvm - Dont generate deps and verion file on clean target

2013-05-28 Thread Cyrill Gorcunov
This is redundant since we're to remove them right after being generated. CC: Ingo Molnar CC: Pekka Enberg CC: Sasha Levin CC: Asias He Signed-off-by: Cyrill Gorcunov --- tools/kvm/Makefile | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) Index: linux-2.6.git/tool

[patch 0/2] A few fixes for make and cpuid

2013-05-28 Thread Cyrill Gorcunov
Hi guys, here are a couple of fixes for "make clean" and cpuid filtering. Please give them a shot. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: kvm tools: why SDL window does not exit on "poweroff"?

2013-04-12 Thread Cyrill Gorcunov
On Fri, Apr 12, 2013 at 12:17:58PM +0300, Pekka Enberg wrote: > On Fri, Apr 12, 2013 at 10:42 AM, Lin Ming wrote: > > I run "poweroff" or "halt" in SDL window, but the window does not exit > > although guest is already halted. But qemu can exit properly. > > > > Is it because "hlt" instruction is

Re: [BUG] lkvm crash on crashkernel boot

2012-10-26 Thread Cyrill Gorcunov
On Fri, Oct 26, 2012 at 06:31:00PM +0300, Pekka Enberg wrote: > On Thu, 25 Oct 2012, Sasha Levin wrote: > > I think we're seeing that because we don't handle VIRTIO_MSI_NO_VECTOR > > properly. > > > > We need to deal with the ability to remove GSI & friends as well. I've > > added it to my workqu

Re: [PATCH 2/2] kvm tools: Bring SMP back

2012-09-12 Thread Cyrill Gorcunov
On Wed, Sep 12, 2012 at 11:03:36PM +0800, Asias He wrote: > We have this currently: > >kvm__init() > kvm__arch_setup_firmware() > mptable__init() > using kvm->nrcpus > >kvm_cpu__init() > kvm->nrcpus = kvm->cfg.nrcpus > > kvm->nrcpus is used in mptable__in

Re: [PATCH 5/7] kvm tools: enable LTO

2012-08-30 Thread Cyrill Gorcunov
On Thu, Aug 30, 2012 at 10:33:21AM +0200, Sasha Levin wrote: > >>> > >>> Ingo, any objections to this? > >> > >> No objections if you can live with a 2x-4x increase in build > >> time - at worst it might cause funnies with the BIOS linker > >> script and such. > > > > Maybe we could enable it vi

Re: [PATCH 5/7] kvm tools: enable LTO

2012-08-30 Thread Cyrill Gorcunov
On Thu, Aug 30, 2012 at 10:16:54AM +0200, Ingo Molnar wrote: > > * Pekka Enberg wrote: > > > On Thu, Aug 30, 2012 at 10:36 AM, Sasha Levin > > wrote: > > > Build with -flto set, which should enable link-time-optimizations. > > > > > > I'm not sure if it provides a significant performance incre

Re: [PATCH 1/7] kvm tools: add HOME env var to hostfs

2012-08-30 Thread Cyrill Gorcunov
On Thu, Aug 30, 2012 at 09:36:37AM +0200, Sasha Levin wrote: > + char *new_env[] = { "TERM=linux", "DISPLAY=192.168.33.1:0", > + "HOME=/virt/home", NULL }; > + > + mkdir("/virt/home", 0755); Please add check for mkdir error code. Frankly, this is a bad habbit to

Re: perf uncore & lkvm woes

2012-08-16 Thread Cyrill Gorcunov
On Thu, Aug 16, 2012 at 11:45:52AM +0300, Avi Kivity wrote: > >> On Thu, Aug 16, 2012 at 10:38 AM, Yan, Zheng > >> wrote: > >> > The Intel uncore doc does not specify how to check if uncore exist. > >> > How about disabling uncore on virtualized CPU? > >> > >> (CC'ing Avi.) > > > > Why not simpl

Re: perf uncore & lkvm woes

2012-08-16 Thread Cyrill Gorcunov
On Thu, Aug 16, 2012 at 10:41:53AM +0300, Pekka Enberg wrote: > On 08/16/2012 03:19 PM, Peter Zijlstra wrote: > >> On Thu, 2012-08-16 at 10:01 +0300, Pekka Enberg wrote: > >>> Has anyone seen this? It's kvmtool/next with 3.6.0-rc1. Looks like we > >>> are doing uncore_init() on virtualized CPU whic

Re: perf uncore & lkvm woes

2012-08-16 Thread Cyrill Gorcunov
On Thu, Aug 16, 2012 at 11:07:43AM +0400, Cyrill Gorcunov wrote: > On Thu, Aug 16, 2012 at 10:01:58AM +0300, Pekka Enberg wrote: > > Hello, > > [0.248962] Pid: 0, comm: swapper/0 Not tainted 3.6.0-rc1+ #24 > > [penberg@tux ~]$ cat perf-kvmtool-issue > > Hello, &g

Re: perf uncore & lkvm woes

2012-08-16 Thread Cyrill Gorcunov
On Thu, Aug 16, 2012 at 10:01:58AM +0300, Pekka Enberg wrote: > Hello, > [0.248962] Pid: 0, comm: swapper/0 Not tainted 3.6.0-rc1+ #24 > [penberg@tux ~]$ cat perf-kvmtool-issue > Hello, > > Has anyone seen this? It's kvmtool/next with 3.6.0-rc1. Looks like we > are doing uncore_init() on virtu

Re: [PATCH 1/2] kvm tools: set the HYPERVISOR flag in cpuid

2012-06-20 Thread Cyrill Gorcunov
On Wed, Jun 20, 2012 at 10:23:06AM +0300, Pekka Enberg wrote: > On Fri, 15 Jun 2012, Cyrill Gorcunov wrote: > > > On Fri, Jun 15, 2012 at 01:34:16PM +0200, Sasha Levin wrote: > > > We need to set the HYPERVISOR flag to let the kernel know we're running > > > un

Re: [PATCH 1/2] kvm tools: set the HYPERVISOR flag in cpuid

2012-06-15 Thread Cyrill Gorcunov
On Fri, Jun 15, 2012 at 01:34:16PM +0200, Sasha Levin wrote: > We need to set the HYPERVISOR flag to let the kernel know we're running > under a hypervisor. > > This makes the kernel enable all sorts of para-virtualization options > such as kvm-clock. > > Signed-off-by: Sasha Levin OK, looks go

kvm tool: Use safe string hanlding functions

2012-06-06 Thread Cyrill Gorcunov
From: Cyrill Gorcunov Use str[n|l] functions to make sure destination is not overflowed. Seems socket path generation should be moved into a separate helper, but it's for another patch. Signed-off-by: Cyrill Gorcunov --- tools/kvm/include/kvm/strbuf.h |1 + tools/kvm/

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-04 Thread Cyrill Gorcunov
On Tue, Jun 05, 2012 at 08:47:17AM +0800, Asias He wrote: > > I must admit I don't understand this code ;) The data get read into > > stack variable forever? > > The data we read itself is not interesting at all. virtio_blk_thread() > sleeps on the eventfd bdev->io_efd until notify_vq() writes som

Re: [PATCH] kvm tools: Process virito blk requests in separate thread

2012-06-04 Thread Cyrill Gorcunov
On Mon, Jun 04, 2012 at 11:40:53PM +0800, Asias He wrote: > > +static void *virtio_blk_thread(void *dev) > +{ > + struct blk_dev *bdev = dev; > + u64 data; > + > + while (1) { > + read(bdev->io_efd, &data, sizeof(u64)); > + virtio_blk_do_io(bdev->kvm, &bdev->vq

[PATCH] kvm tool: Add own barrier() definition

2012-05-08 Thread Cyrill Gorcunov
Otherwise I'm getting the following compile problem on my Fedora machine. The helper is rather taken from linux kernel. | [cyrill@moon kvm]$ make tags | x86/include/kvm/barrier.h:11:25: fatal error: asm/barrier.h: No such file or directory compilation terminated. Signed-off-by: C

Re: [PATCH v2] kvm tools: Make raw block device work

2012-04-12 Thread Cyrill Gorcunov
On Thu, Apr 12, 2012 at 09:39:59PM +0800, 'Asias He wrote: > +static bool is_mounted(struct stat *st) > +{ > + struct stat st_buf; > + struct mntent *mnt; > + FILE *f; > + > + f = setmntent("/proc/mounts", "r"); > + if (!f) > + return false; > + > + while ((mnt =

Re: native kvm tool hrtimer problem

2012-03-08 Thread Cyrill Gorcunov
On Thu, Mar 08, 2012 at 04:31:17PM +0100, Daniele Carollo wrote: > > > I don't really use the tap interface so lets CC Asias. Which guest > > > kernel are you using, btw? > > > > > > > Yup, Asias was using it, if my memory doesn't betray me. Also both -- host > > and guest kernel versions might be

Re: native kvm tool hrtimer problem

2012-03-08 Thread Cyrill Gorcunov
On Thu, Mar 08, 2012 at 05:11:16PM +0200, Pekka Enberg wrote: > On Thu, Mar 8, 2012 at 4:32 PM, Daniele Carollo > wrote: > > for an university study, I'm doing some network test between two vm > > using native linux kvm tool and connected via tap/virtio/vhost. > > When I run my script (several co

Re: [PATCH] kvm tools: Make 'vm sandbox' more user-friendly

2012-03-07 Thread Cyrill Gorcunov
om --dangerous > > Cc: Asias He > Cc: Cyrill Gorcunov > Cc: Ingo Molnar > Cc: Sasha Levin > Signed-off-by: Pekka Enberg > --- > tools/kvm/builtin-run.c | 29 ++--- > 1 files changed, 26 insertions(+), 3 deletions(-) > > diff --git a/

Re: [RFC/PATCH 1/2] kvm tools, seabios: Add "--bios" option to "vm run"

2012-02-24 Thread Cyrill Gorcunov
On Fri, Feb 24, 2012 at 05:05:29PM +0200, Pekka Enberg wrote: > This patch adds a "--bios" command line option to "vm run". You can use this > to > try to boot with SeaBIOS, for example: > > ./vm run --bios=/usr/share/seabios/bios.bin \ >--disk $HOME/images/debian_lenny_amd64_standard.q

Re: The way of mapping BIOS into the guest's address space

2012-02-15 Thread Cyrill Gorcunov
On Tue, Feb 14, 2012 at 11:07:08PM -0500, Kevin O'Connor wrote: ... > > hardware. Maybe we could poke someone from KVM camp for a hint? > > SeaBIOS has two ways to be deployed - first is to copy the image to > the top of the first 1MB (eg, 0xe-0xf) and jump to > 0xf000:0xfff0 in 16bit mode

Re: The way of mapping BIOS into the guest's address space

2012-02-14 Thread Cyrill Gorcunov
On Tue, Feb 14, 2012 at 05:35:47PM +0200, Pekka Enberg wrote: > On Tue, Feb 14, 2012 at 09:20:18PM +0800, Yang Bai wrote: > >> And will seabios replace the present bios implement or co-exsit? > > On Tue, Feb 14, 2012 at 3:32 PM, Cyrill Gorcunov wrote: > > Ideally

Re: The way of mapping BIOS into the guest's address space

2012-02-14 Thread Cyrill Gorcunov
On Tue, Feb 14, 2012 at 09:20:18PM +0800, Yang Bai wrote: > And will seabios replace the present bios implement or co-exsit? Ideally we should get rid of our minibios completely and only have seabios here instead. Cyrill -- To unsubscribe from this list: send the line "unsubscribe kvm" in

Re: The way of mapping BIOS into the guest's address space

2012-02-14 Thread Cyrill Gorcunov
On Tue, Feb 14, 2012 at 01:10:59PM +0200, Pekka Enberg wrote: > On Tue, Feb 14, 2012 at 1:03 PM, Yang Bai wrote: > > Since on X86, bios is always at the end of the address space, so I > > have some thought about how to implement the seabios support for kvm > > tool. > > > > 1. using kvm__register_

Re: Q: Does linux kvm native tool support loading BIOS as the default loader now?

2012-02-13 Thread Cyrill Gorcunov
On Mon, Feb 13, 2012 at 08:14:22PM +0800, Yang Bai wrote: > Hi all, > > As I know, native tool does not support loading BIOS so it does not > support Windows. Is this supporting now? > If not, I may try to implement it. > Nope yet. There was a plan to implement seabios support, but nothing is do

Re: [PATCH] kvm tool: rewrite kvm__init

2012-02-09 Thread Cyrill Gorcunov
On Thu, Feb 09, 2012 at 03:01:26PM +0200, Pekka Enberg wrote: > On Thu, Feb 9, 2012 at 7:40 AM, Yang Bai wrote: > > Since the different issues have been handled in the > > internal of kvm__init, it can only return NULL if error > > happened. > > > > Signed-off-by: Yang Bai > > Sorry, I don't und

Re: [PATCH 1/2] kvm tool: Report error and don't segfault if kvm__init() fails

2012-02-06 Thread Cyrill Gorcunov
On Mon, Feb 06, 2012 at 12:22:04PM +0200, Pekka Enberg wrote: > Hi Michael, > > On Mon, 6 Feb 2012, Michael Ellerman wrote: > >Signed-off-by: Michael Ellerman > >--- > >tools/kvm/builtin-run.c |5 + > >1 files changed, 5 insertions(+), 0 deletions(-) > > > >diff --git a/tools/kvm/builtin-r

Re: [PATCH] kvm tool: Don't close not yet opened files and SIGSEV fix

2012-02-05 Thread Cyrill Gorcunov
On Sat, Feb 04, 2012 at 10:02:19PM +0400, Cyrill Gorcunov wrote: > > Strictly speaking, kvm__init need more serious rewrite together with > kvm__arch_init/kvm_ipc__start/kvm_ipc__register_handler ret. vals tests, > i'll do this a bit late. > Sorry for delay, was busy. Anyway

Re: [PATCH] kvm tool: Don't close not yet opened files and SIGSEV fix

2012-02-04 Thread Cyrill Gorcunov
On Sat, Feb 04, 2012 at 07:54:38PM +0200, Pekka Enberg wrote: > On Sat, 4 Feb 2012, Cyrill Gorcunov wrote: > >Index: linux-2.6.git/tools/kvm/kvm.c > >=== > >--- linux-2.6.git.orig/tools/kvm/kvm.c > >+++ li

Re: [PATCH] kvm tool: Don't close not yet opened files and SIGSEV fix

2012-02-04 Thread Cyrill Gorcunov
On Sat, Feb 04, 2012 at 07:38:41PM +0200, Pekka Enberg wrote: > On Sat, 4 Feb 2012, Cyrill Gorcunov wrote: > >In case if there error happened in kvm__init and we have > >no files opened -- we should not try to close them. > > > >Also once kvm failed to init the

[PATCH] kvm tool: Don't close not yet opened files and SIGSEV fix

2012-02-04 Thread Cyrill Gorcunov
' not found. Please make sure your kernel has CONFIG_KVM enabled and that the KVM modules are loaded. | Segmentation fault (core dumped) | [cyrill@moon kvm]$ Signed-off-by: Cyrill Gorcunov --- tools/kvm/builtin-run.c |4 tools/kvm/kvm.c | 11 --- 2 files c

Re: [PATCH] kvm tool: Make kvm structure to carry name copy

2012-02-04 Thread Cyrill Gorcunov
On Sat, Feb 04, 2012 at 02:57:23PM +0200, Pekka Enberg wrote: > On Sat, 4 Feb 2012, Cyrill Gorcunov wrote: > >Index: linux-2.6.git/tools/kvm/kvm.c > >=== > >--- linux-2.6.git.orig/tools/kvm/kvm.c > >+++ li

Re: [PATCH] kvm tool: Make kvm structure to carry name copy

2012-02-04 Thread Cyrill Gorcunov
On Sat, Feb 04, 2012 at 04:20:05PM +0400, Cyrill Gorcunov wrote: > On Sat, Feb 04, 2012 at 02:15:36PM +0200, Pekka Enberg wrote: > > On Fri, 3 Feb 2012, Cyrill Gorcunov wrote: > > >If guest name is used (which is default case) the kvm might end > > >up carrying t

Re: [PATCH] kvm tool: Make kvm structure to carry name copy

2012-02-04 Thread Cyrill Gorcunov
On Sat, Feb 04, 2012 at 02:15:36PM +0200, Pekka Enberg wrote: > On Fri, 3 Feb 2012, Cyrill Gorcunov wrote: > >If guest name is used (which is default case) the kvm might end > >up carrying the pointer to name which is allocated on stack. > > > >kvm_cmd_run_init

[PATCH] kvm tool: Make kvm structure to carry name copy

2012-02-03 Thread Cyrill Gorcunov
64 symbols should be more than enough. Signed-off-by: Cyrill Gorcunov --- I hope I didn't miss anything? tools/kvm/kvm.c |2 +- tools/kvm/powerpc/include/kvm/kvm-arch.h |2 +- tools/kvm/x86/include/kvm/kvm-arch.h |2 +- 3 files changed, 3 insertio

Re: [PATCH] kvm tools: Fix test for mmap failure

2012-02-03 Thread Cyrill Gorcunov
On Fri, Feb 03, 2012 at 11:15:41PM +0400, Cyrill Gorcunov wrote: > On error mmap returns MAP_FAILED so we > need a proper test here. > Pekka, pick this one instead -- a caller is expecting null/not-null only. Cyrill --- kvm tools: Fix test for mmap failure On error mma

[PATCH] kvm tools: Fix test for mmap failure

2012-02-03 Thread Cyrill Gorcunov
On error mmap returns MAP_FAILED so we need a proper test here. Signed-off-by: Cyrill Gorcunov --- tools/kvm/hw/pci-shmem.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Index: linux-2.6.git/tools/kvm/hw/pci-shmem.c

Re: [PATCH] kvm tools: Fix segfault when failing to initialize KVM

2012-01-31 Thread Cyrill Gorcunov
On Wed, Feb 01, 2012 at 09:26:00AM +0200, Pekka Enberg wrote: > On Wed, 1 Feb 2012, Cyrill Gorcunov wrote: > >I suspect we need something like > >--- > >tools/kvm/builtin-run.c |5 + > >tools/kvm/kvm.c |2 +- > >2 files changed, 6 insertions(+),

Re: [PATCH] kvm tools: Fix segfault when failing to initialize KVM

2012-01-31 Thread Cyrill Gorcunov
On Wed, Feb 01, 2012 at 09:05:34AM +0200, Pekka Enberg wrote: > On Tue, 31 Jan 2012, Sasha Levin wrote: > >Might happen when hardware virtualization is not supported. > > > >Reported-by: Ingo Molnar > >Signed-off-by: Sasha Levin > >--- > >tools/kvm/builtin-run.c |4 > >1 files changed, 4

[PATCH] kvm tools: Remove tags/TAGS on "make clean"

2012-01-15 Thread Cyrill Gorcunov
Signed-off-by: Cyrill Gorcunov --- tools/kvm/Makefile |2 ++ 1 file changed, 2 insertions(+) Index: linux-2.6.git/tools/kvm/Makefile === --- linux-2.6.git.orig/tools/kvm/Makefile +++ linux-2.6.git/tools/kvm/Makefile @@ -327,6

[PATCH] kvm tool: Introduce own BUG_ON handler

2011-12-20 Thread Cyrill Gorcunov
Raise SIGABRT in case if run-time crtitical problem found. Proposed-by: Ingo Molnar Signed-off-by: Cyrill Gorcunov --- Ingo, you meant something like below? tools/kvm/include/kvm/util.h | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) Index: linux-2.6.git/tools/kvm

Re: [PATCH] kvm tools: Use assert() helper to check a variable value

2011-12-19 Thread Cyrill Gorcunov
On Mon, Dec 19, 2011 at 11:50:31AM +0100, Ingo Molnar wrote: ... > > The tool-specific BUG() implementation can be added as a delta > on top of that. It's in fact better to keep those two steps > separate. > OK, will do on top. Cyrill -- To unsubscribe from this list: send the line "u

Re: [PATCH] kvm tools: Use assert() helper to check a variable value

2011-12-19 Thread Cyrill Gorcunov
On Mon, Dec 19, 2011 at 11:40:09AM +0100, Ingo Molnar wrote: > > GDB will catch that signal. > Yeah, good point! Pekka, drop this patch please, I'll make new one at evening. Cyrill -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vg

Re: [PATCH] kvm tools: Use assert() helper to check a variable value

2011-12-19 Thread Cyrill Gorcunov
UG_ON() like tools/perf does. > > On Mon, Dec 19, 2011 at 9:57 AM, Cyrill Gorcunov wrote: > > We dont have it yet. So I'll introduce this helper later, > > but note that we will have to cover _all_ assert() calls then, > > so it's better to make in a separate patc

Re: [PATCH] kvm tools: Use assert() helper to check a variable value

2011-12-18 Thread Cyrill Gorcunov
On Mon, Dec 19, 2011 at 09:13:28AM +0200, Pekka Enberg wrote: > > > >-BUILD_BUG_ON(i > E820_X_MAX); > >+assert(i <= E820_X_MAX); > > We should use BUG_ON() like tools/perf does. > We dont have it yet. So I'll introduce this helper later, but note that we will have to cover _all_ assert()

[PATCH] kvm tools: Use assert() helper to check a variable value

2011-12-18 Thread Cyrill Gorcunov
BUILD_BUG_ON is unable to catch errors on expression which can't be evaluated at compile time. Signed-off-by: Cyrill Gorcunov --- tools/kvm/x86/bios.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Index: linux-2.6.git/tools/kvm/x86/b

[RFC] kvm tools: Make kvm__arch_setup_firmware to return error code

2011-12-18 Thread Cyrill Gorcunov
If some of subsequent calls fails we better to return error code instead of dying with a message. This is a first step in getting rid of number of die() calls we have in code. Signed-off-by: Cyrill Gorcunov --- tools/kvm/builtin-run.c |5 - tools/kvm/include/kvm/kvm.h

[PATCH] kvm tools: sdl -- Fix array size for keymap

2011-12-18 Thread Cyrill Gorcunov
Index is u8 value so array size should be 256. Signed-off-by: Cyrill Gorcunov --- tools/kvm/ui/sdl.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6.git/tools/kvm/ui/sdl.c === --- linux-2.6.git.orig/tools

[PATCH] kvm tools: Rename pr_error to pr_err to follow kernel convention

2011-12-18 Thread Cyrill Gorcunov
The kernel already has pr_err helper lets do the same. Signed-off-by: Cyrill Gorcunov --- tools/kvm/builtin-stat.c |2 +- tools/kvm/disk/core.c |2 +- tools/kvm/include/kvm/util.h |2 +- tools/kvm/kvm.c|2 +- tools/kvm/util/parse-options.c | 16

[PATCH] kvm tools: Define __compiletime_error helper

2011-12-18 Thread Cyrill Gorcunov
‘__xchg_wrong_size’ [-Werror=missing-prototypes] | ../../arch/x86/include/asm/cmpxchg.h: In function ‘__xchg_wrong_size’: | ../../arch/x86/include/asm/cmpxchg.h:12:2: error: expected declaration specifiers before ‘__compiletime_error’ Signed-off-by: Cyrill Gorcunov --- Not sure if it'

Re: [PATCH] kvm tools: Trivial cleanup

2011-12-16 Thread Cyrill Gorcunov
On Fri, Dec 16, 2011 at 10:40:06AM +0200, Sasha Levin wrote: > Signed-off-by: Sasha Levin > --- Thanks, Sasha! Cyrill -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/maj

Re: [PATCH] kvm tools: Add 'kvm nmi' command

2011-12-07 Thread Cyrill Gorcunov
On Wed, Dec 07, 2011 at 12:41:50PM +0200, Gleb Natapov wrote: > > > > Yup, but while we support linux kernels only it should be fine. Still > > of course on long term we need a check. > > > Tomorrow someone will send a patch to change how Linux behaves and > slightly older kvmtool will not be abl

Re: [PATCH] kvm tools: Add 'kvm nmi' command

2011-12-07 Thread Cyrill Gorcunov
On Wed, Dec 07, 2011 at 12:33:05PM +0200, Gleb Natapov wrote: > On Wed, Dec 07, 2011 at 02:31:11PM +0400, Cyrill Gorcunov wrote: > > On Wed, Dec 07, 2011 at 12:21:52PM +0200, Gleb Natapov wrote: > > > On Tue, Dec 06, 2011 at 10:42:55PM +0200, Sasha Levin wrote: > > > &g

Re: [PATCH] kvm tools: Add 'kvm nmi' command

2011-12-07 Thread Cyrill Gorcunov
On Wed, Dec 07, 2011 at 12:21:52PM +0200, Gleb Natapov wrote: > On Tue, Dec 06, 2011 at 10:42:55PM +0200, Sasha Levin wrote: > > +static void handle_nmi(int fd, u32 type, u32 len, u8 *msg) > > +{ > > + u32 vcpu = *(u32 *)msg; > > + > > + ioctl(kvm_cpus[vcpu]->vcpu_fd, KVM_NMI); > > You need to

Re: [PATCH 16/28] kvm tools: Allow load_flat_binary() to load an initrd alongside

2011-12-06 Thread Cyrill Gorcunov
On Wed, Dec 07, 2011 at 11:42:27AM +1100, Matt Evans wrote: > Hi Cyrill, > > On 06/12/11 23:04, Cyrill Gorcunov wrote: > > On Tue, Dec 06, 2011 at 12:29:48PM +0200, Pekka Enberg wrote: > > ... > >> > >> Otherwise looks OK to me. Cyrill? > >> >

Re: [PATCH 23/28] kvm tools: Endian-sanitise pci.h and PCI device setup

2011-12-06 Thread Cyrill Gorcunov
On Tue, Dec 06, 2011 at 03:29:00PM +0200, Pekka Enberg wrote: > > > >Hehe, this is because it should be rtaher defined as > > > >union pci_config_address { > >struct { > > #if __BYTE_ORDER == __LITTLE_ENDIAN > > unsignedzeros : 2; > > unsignedregister_number : 6; > > #

Re: [PATCH 23/28] kvm tools: Endian-sanitise pci.h and PCI device setup

2011-12-06 Thread Cyrill Gorcunov
On Tue, Dec 06, 2011 at 01:58:24PM +0200, Pekka Enberg wrote: > On Tue, 2011-12-06 at 15:47 +0400, Cyrill Gorcunov wrote: > > On Tue, Dec 06, 2011 at 01:41:56PM +0200, Pekka Enberg wrote: > > > On Tue, Dec 6, 2011 at 12:28 PM, Cyrill Gorcunov > > > wrote: > >

Re: [PATCH 16/28] kvm tools: Allow load_flat_binary() to load an initrd alongside

2011-12-06 Thread Cyrill Gorcunov
On Tue, Dec 06, 2011 at 12:29:48PM +0200, Pekka Enberg wrote: ... > > Otherwise looks OK to me. Cyrill? > It might be not seen from patch (or my local kvm repo is not yet updated well) but I somehow miss who will be reading initrd in case of loading flat image? If noone, then what's the point to

Re: [PATCH 23/28] kvm tools: Endian-sanitise pci.h and PCI device setup

2011-12-06 Thread Cyrill Gorcunov
On Tue, Dec 06, 2011 at 01:41:56PM +0200, Pekka Enberg wrote: > On Tue, Dec 6, 2011 at 12:28 PM, Cyrill Gorcunov wrote: > > On Tue, Dec 06, 2011 at 12:25:29PM +0200, Pekka Enberg wrote: > >> On Tue, Dec 6, 2011 at 5:42 AM, Matt Evans wrote: > >> > vesa, pci-shmem

Re: [PATCH 23/28] kvm tools: Endian-sanitise pci.h and PCI device setup

2011-12-06 Thread Cyrill Gorcunov
On Tue, Dec 06, 2011 at 12:25:29PM +0200, Pekka Enberg wrote: > On Tue, Dec 6, 2011 at 5:42 AM, Matt Evans wrote: > > vesa, pci-shmem and virtio-pci devices need to set up config space with > > little-endian conversions (as config space is LE).  The pci_config_address > > bitfield also needs to be

Re: [PATCH] kvm tools: Split custom rootfs init into two stages

2011-12-05 Thread Cyrill Gorcunov
On Mon, Dec 05, 2011 at 11:22:11AM +0200, Sasha Levin wrote: > > +static int kvm_custom_stage2(void) > +{ > + char tmp[PATH_MAX], dst[PATH_MAX], *src; > + const char *rootfs; > + int r; > + > + src = realpath("guest/init_stage2", NULL); > + if (src == NULL) > + ret

Re: [PATCH] kvm tools: Support virtio indirect buffers

2011-11-29 Thread Cyrill Gorcunov
On Tue, Nov 29, 2011 at 03:01:59PM +0200, Pekka Enberg wrote: > >> > >>Hi Sasha, where the rmb() then? Or maybe you wanted plain barrier() here? > > > >On the kernel side. > >Theres a mb there which happens there during the kick. > > I guess we need to improve the comment in next_desc()? > Kerne

Re: [PATCH] kvm tools: Support virtio indirect buffers

2011-11-28 Thread Cyrill Gorcunov
On Mon, Nov 28, 2011 at 07:54:27PM +0200, Sasha Levin wrote: > > +/* > + * Each buffer in the virtqueues is actually a chain of descriptors. This > + * function returns the next descriptor in the chain, or vq->vring.num if > we're > + * at the end. > + */ > +static unsigned next_desc(struct vri

Re: kvm tools: clock sources for hrtimer

2011-11-09 Thread Cyrill Gorcunov
kvm: Drop "notsc" no longer needed kernel option "notsc" option has been used to avoid APIC calibration problem at early days when we didn't support APIC at all. Now with KVM APIC emulation used there is no longer need for this option. Drop it. Reported-by: Richard Weinberger

Re: kvm tools: clock sources for hrtimer

2011-11-09 Thread Cyrill Gorcunov
On Wed, Nov 09, 2011 at 08:00:06PM +0400, Cyrill Gorcunov wrote: ... > > > > You'll need CONFIG_KVM_CLOCK. > > > > I'm not actually sure how close our implementation is to having tsc > > working so far, Cyrill knows more about that than me. > >

Re: kvm tools: clock sources for hrtimer

2011-11-09 Thread Cyrill Gorcunov
On Wed, Nov 09, 2011 at 05:49:53PM +0200, Sasha Levin wrote: > On Wed, 2011-11-09 at 17:42 +0200, Richard Weinberger wrote: > > On Wed, 09 Nov 2011 16:49:51 +0200, Sasha Levin > > wrote: > > > We'll do kvm_clock as well if you compile it in the kernel. > > > > CONFIG_HIGH_RES_TIMERS is on both ho

Re: [PATCH 4/5] kvm tools: Teach 'run' to handle guestfs

2011-09-06 Thread Cyrill Gorcunov
On Tue, Sep 06, 2011 at 02:23:54AM +0300, Sasha Levin wrote: > This patch allows to run previously created guestfs by simply specifying it > with the '-d' parameter. > > This allows running guestfs which were created before using: > > kvm setup -n [name] > > Signed-off-by: Sasha Levin > -

Re: [PATCH 1/4] kvm tools: Use GSI routing

2011-07-28 Thread Cyrill Gorcunov
On Thu, Jul 28, 2011 at 12:01:52PM +0300, Sasha Levin wrote: > Map GSIs manually when starting the guest. > This will allow us mapping new GSIs for MSIX in the future. > > Signed-off-by: Sasha Levin > --- Other than a few nits the series looks good to me, thanks Sasha! -- To unsubscribe from thi

Re: [PATCH 3/4] kvm tools: Add a void ptr to be passed to mmio callback

2011-07-28 Thread Cyrill Gorcunov
On Thu, Jul 28, 2011 at 12:01:54PM +0300, Sasha Levin wrote: ... > > struct mmio_mapping { > struct rb_int_node node; > - void(*kvm_mmio_callback_fn)(u64 addr, u8 *data, u32 > len, u8 is_write); > + void(*kvm_mmio_callback_fn)(u64 addr,

Re: [PATCH 2/4] kvm tools: Fix PCI probing

2011-07-28 Thread Cyrill Gorcunov
On Thu, Jul 28, 2011 at 12:31:51PM +0300, Pekka Enberg wrote: > On Thu, Jul 28, 2011 at 12:01 PM, Sasha Levin wrote: > > PCI BAR probing is done in four steps: > > > >  1. Read address (and flags). > >  2. Mask BAR. > >  3. Read BAR again - Now the expected result is the size of the BAR. > >  4. M

Re: [patch 2/5] kvm tools: Introduce vidmode parmeter

2011-06-07 Thread Cyrill Gorcunov
On Wed, Jun 08, 2011 at 12:10:30AM +0400, Cyrill Gorcunov wrote: > On Tue, Jun 07, 2011 at 10:53:28PM +0300, Pekka Enberg wrote: > > On Tue, 7 Jun 2011, Cyrill Gorcunov wrote: > > >Usually this might be set by loader but since > > >we're the loader lets allow t

Re: [patch 2/5] kvm tools: Introduce vidmode parmeter

2011-06-07 Thread Cyrill Gorcunov
On Tue, Jun 07, 2011 at 10:53:28PM +0300, Pekka Enberg wrote: > On Tue, 7 Jun 2011, Cyrill Gorcunov wrote: > >Usually this might be set by loader but since > >we're the loader lets allow to specify vesa > >mode as well. > > > >Signed-off-by: Cyrill Gorcunov

Re: [patch 2/5] kvm tools: Introduce vidmode parmeter

2011-06-07 Thread Cyrill Gorcunov
On Tue, Jun 07, 2011 at 10:53:28PM +0300, Pekka Enberg wrote: > On Tue, 7 Jun 2011, Cyrill Gorcunov wrote: > >Usually this might be set by loader but since > >we're the loader lets allow to specify vesa > >mode as well. > > > >Signed-off-by: Cyrill Gorcunov

[patch 3/5] kvm tools: Delete dangling cursor from int10

2011-06-07 Thread Cyrill Gorcunov
Noone use it anymore. Also cleanup comment on int10 as well, int10_handler routine do all the hard work. Signed-off-by: Cyrill Gorcunov --- tools/kvm/bios/bios-rom.S | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) Index: linux-2.6.git/tools/kvm/bios/bios-rom.S

[patch 2/5] kvm tools: Introduce vidmode parmeter

2011-06-07 Thread Cyrill Gorcunov
Usually this might be set by loader but since we're the loader lets allow to specify vesa mode as well. Signed-off-by: Cyrill Gorcunov --- tools/kvm/kvm-run.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) Index: linux-2.6.git/tools/kvm/kvm-

[patch 1/5] kvm tools: Options parser to handle hex numbers

2011-06-07 Thread Cyrill Gorcunov
Some kernel parameters are convenient if passed in hex form so our options parser should handle even such form of input. Signed-off-by: Cyrill Gorcunov --- tools/kvm/util/parse-options.c | 102 - 1 file changed, 82 insertions(+), 20 deletions(-) Index

[patch 5/5] kvm tools: Reform bios make fules

2011-06-07 Thread Cyrill Gorcunov
Put bios code into bios.s and adjust makefile rules accordingly. It's more natural than bios-rom.S (which is now simply a container over real bios code). Also improve bios deps in Makefile. Signed-off-by: Cyrill Gorcunov --- tools/kvm/Makefile| 29 +++- tools/kvm

[patch 4/5] kvm tools: Get rid of spaces in ld script

2011-06-07 Thread Cyrill Gorcunov
Signed-off-by: Cyrill Gorcunov --- tools/kvm/bios/rom.ld.S |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux-2.6.git/tools/kvm/bios/rom.ld.S === --- linux-2.6.git.orig/tools/kvm/bios/rom.ld.S +++ linux-2.6

[patch 0/5] kvm tools: A few fixes

2011-06-07 Thread Cyrill Gorcunov
Nothing serious, please review. Thanks. Cyrill -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 2/2] kvm tools, vesa: Fix 'ah' access in int10_vesa()

2011-06-06 Thread Cyrill Gorcunov
On Mon, Jun 06, 2011 at 12:09:25PM +0300, Pekka Enberg wrote: ... > > Type conversion will do the work but having explicit masking is > > a way better I believe, at least it makes this code snippet notable. > > True but the patch description is bogus as it really doesn't _fix_ anything. > >

Re: [PATCH 2/2] kvm tools, vesa: Fix 'ah' access in int10_vesa()

2011-06-06 Thread Cyrill Gorcunov
On Mon, Jun 06, 2011 at 11:28:56AM +0300, Avi Kivity wrote: > On 06/03/2011 10:37 PM, Pekka Enberg wrote: > >This patch fixes access to 'ah' in int10_vesa() by masking the high bits. > > > >@@ -131,7 +131,7 @@ static void int10_vesa(struct int10_args *args) > > { > > u8 al; > > > >-al = ar

Re: [PATCH 1/2] kvm tools, vesa: Cleanup code in bios/int10.c

2011-06-03 Thread Cyrill Gorcunov
On Fri, Jun 03, 2011 at 10:37:03PM +0300, Pekka Enberg wrote: > This patch cleans up the code in bios/int10.c without changing functionality. > > Cc: Ingo Molnar > Cc: Cyrill Gorcunov > Cc: John Floren > Cc: Sasha Levin > Signed-off-by: Pekka Enberg > --- > to

Re: [PATCH 2/2] kvm tools, vesa: Fix 'ah' access in int10_vesa()

2011-06-03 Thread Cyrill Gorcunov
On Fri, Jun 03, 2011 at 10:37:04PM +0300, Pekka Enberg wrote: > This patch fixes access to 'ah' in int10_vesa() by masking the high bits. > > Cc: Ingo Molnar > Cc: Cyrill Gorcunov > Cc: John Floren > Cc: Sasha Levin > Signed-off-by: Pekka Enberg > --- .

Re: [PATCH 5/5 V2] kvm tools: Initialize and use VESA and VNC

2011-05-24 Thread Cyrill Gorcunov
On 05/24/2011 12:37 PM, Paolo Bonzini wrote: > On 05/23/2011 01:38 PM, Ingo Molnar wrote: >> Later on even this could be removed: using section >> tricks we can put init functions into a section > > This is not kernel space, the C library provides a way to do that with > __attribute__((constructo

[PATCH] kvm tools: Drop unused vars from int10.c code

2011-05-23 Thread Cyrill Gorcunov
ed-but-set-variable] bios/int10.c: In function ‘int10_vesa’: bios/int10.c:96:9: error: variable ‘ah’ set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors so get rid of them. Signed-off-by: Cyrill Gorcunov CC: Sasha Levin --- tools/kvm/bios/int10.c |8 +

Re: [tip:tools/kvm] kvm tools: Add conditional compilation of symbol resolving

2011-05-22 Thread Cyrill Gorcunov
On 05/22/2011 03:00 PM, Ingo Molnar wrote: > > * Ingo Molnar wrote: > >> >> * tip-bot for Cyrill Gorcunov wrote: >> >>> diff --git a/tools/perf/feature-tests.mak >>> b/tools/kvm/config/feature-tests.mak >>> similarity index 83% >>&g

Re: [tip:tools/kvm] kvm tools: Add conditional compilation of symbol resolving

2011-05-22 Thread Cyrill Gorcunov
On 05/22/2011 02:58 PM, Ingo Molnar wrote: > > * tip-bot for Cyrill Gorcunov wrote: > >> diff --git a/tools/perf/feature-tests.mak >> b/tools/kvm/config/feature-tests.mak >> similarity index 83% >> copy from tools/perf/feature-tests.mak >> copy to tool

Re: [PATCH 2/2] kvm tools: Modify ioport to use interval rbtree

2011-05-21 Thread Cyrill Gorcunov
On 05/21/2011 04:08 PM, Cyrill Gorcunov wrote: > On 05/21/2011 02:55 PM, Sasha Levin wrote: > ... >>>> void ioport__register(u16 port, struct ioport_operations *ops, int count) >>>> { >>>> - int i; >>>> + struct ioport

[PATCH] kvm tools, 9p: Test for tuncation result

2011-05-21 Thread Cyrill Gorcunov
p.o] Error 1 so add a basic check for ftruncate result, this eliminate warning and we might need to use 'res' status later in caller code. Signed-off-by: Cyrill Gorcunov CC: Sasha Levin --- Pekka, are you fine with 'kvm-tools,9p' prefix? tools/kvm/virtio/9p.c |5 +++--

Re: [PATCH 2/2] kvm tools: Modify ioport to use interval rbtree

2011-05-21 Thread Cyrill Gorcunov
On 05/21/2011 02:55 PM, Sasha Levin wrote: ... >>> void ioport__register(u16 port, struct ioport_operations *ops, int count) >>> { >>> - int i; >>> + struct ioport_entry *entry; >>> >>> - for (i = 0; i < count; i++) >>> - ioport_ops[port + i]= ops; >>> + entry = ioport_sea

Re: [PATCH 2/2] kvm tools: Modify ioport to use interval rbtree

2011-05-21 Thread Cyrill Gorcunov
On 05/21/2011 12:51 PM, Sasha Levin wrote: > Currently the ioport implementation is based on a USHRT_MAX length > array of ptrs to ioport_operations. > > Instead, use an interval rbtree to map the ioports to > ioport_operations. > > Signed-off-by: Sasha Levin > --- ... > -static struct ioport_op

Re: [PATCH] kvm tools: Cleanup e820 code

2011-05-20 Thread Cyrill Gorcunov
struct e820map to calculate offsets used by bios code. > > Signed-off-by: Sasha Levin > --- Thanks Sasha! Reviewed-by: Cyrill Gorcunov -- Cyrill -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.ke

Re: [PATCH] kvm tools: Default guest cpu count to host cpu count

2011-05-19 Thread Cyrill Gorcunov
On 05/19/2011 11:08 PM, Cyrill Gorcunov wrote: ... >> >> What prevents nr_online_cpus from being greater than KVM_NR_CPUS? Since >> that latter is a #define, might want to change 'else if' to if there. >> >> David >> > > Good catch! We shou

  1   2   >