Re: [PATCH v7 19/19] KVM: ARM64: Add a new kvm ARM PMU device

2015-12-17 Thread Marc Zyngier
On Thu, 17 Dec 2015 15:22:50 +0800 Shannon Zhao wrote: > > > On 2015/12/17 4:33, Christoffer Dall wrote: > > On Wed, Dec 16, 2015 at 04:06:49PM +0800, Shannon Zhao wrote: > >> Hi, > >> > >> On 2015/12/16 15:31, Shannon Zhao wrote: > > But in this case, you're

Re: [PATCH v7 19/19] KVM: ARM64: Add a new kvm ARM PMU device

2015-12-17 Thread Shannon Zhao
On 2015/12/17 16:33, Marc Zyngier wrote: > On Thu, 17 Dec 2015 15:22:50 +0800 > Shannon Zhao wrote: > >> > >> > >> > On 2015/12/17 4:33, Christoffer Dall wrote: >>> > > On Wed, Dec 16, 2015 at 04:06:49PM +0800, Shannon Zhao wrote: > >> Hi, > >> > >>

Re: [PATCH RESEND] kvm:x86:Fix error handling in the function kvm_write_wall_clock

2015-12-17 Thread Paolo Bonzini
On 17/12/2015 03:30, Nicholas Krause wrote: > This fixes error handling in the function kvm_write_wall_clock > by checking if any of the calls to kvm_write_guest have failed > inside this paricutlar function and if so print to the console > with pr_err that we are unable to write the data to the

Re: [PATCH v7 19/19] KVM: ARM64: Add a new kvm ARM PMU device

2015-12-17 Thread Shannon Zhao
On 2015/12/17 17:38, Marc Zyngier wrote: > On 17/12/15 08:41, Shannon Zhao wrote: >> > >> > >> > On 2015/12/17 16:33, Marc Zyngier wrote: >>> >> On Thu, 17 Dec 2015 15:22:50 +0800 >>> >> Shannon Zhao wrote: >>> >> > > > On 2015/12/17 4:33,

Re: [RFC PATCH 3/3] vfio-pci: Allow to mmap MSI-X table if EEH is supported

2015-12-17 Thread yongji xie
On 2015/12/17 4:14, Alex Williamson wrote: On Fri, 2015-12-11 at 16:53 +0800, Yongji Xie wrote: Current vfio-pci implementation disallows to mmap MSI-X table in case that user get to touch this directly. However, EEH mechanism could ensure that a given pci device can only shoot the MSIs

Re: [PATCH v7 19/19] KVM: ARM64: Add a new kvm ARM PMU device

2015-12-17 Thread Marc Zyngier
On 17/12/15 10:10, Shannon Zhao wrote: > > > On 2015/12/17 17:38, Marc Zyngier wrote: >> On 17/12/15 08:41, Shannon Zhao wrote: On 2015/12/17 16:33, Marc Zyngier wrote: >> On Thu, 17 Dec 2015 15:22:50 +0800 >> Shannon Zhao wrote: >>

Re: [PATCH v7 19/19] KVM: ARM64: Add a new kvm ARM PMU device

2015-12-17 Thread Marc Zyngier
On 17/12/15 08:41, Shannon Zhao wrote: > > > On 2015/12/17 16:33, Marc Zyngier wrote: >> On Thu, 17 Dec 2015 15:22:50 +0800 >> Shannon Zhao wrote: >> On 2015/12/17 4:33, Christoffer Dall wrote: >> On Wed, Dec 16, 2015 at 04:06:49PM +0800, Shannon

Re: [RFC PATCH 2/3] vfio-pci: Allow to mmap sub-page MMIO BARs if all MMIO BARs are page aligned

2015-12-17 Thread yongji xie
On 2015/12/17 4:04, Alex Williamson wrote: On Fri, 2015-12-11 at 16:53 +0800, Yongji Xie wrote: Current vfio-pci implementation disallows to mmap sub-page(size < PAGE_SIZE) MMIO BARs because these BARs' mmio page may be shared with other BARs. But we should allow to mmap these sub-page MMIO

Re: [PATCH 00/16] MIPS: KVM: Misc trivial cleanups

2015-12-17 Thread Paolo Bonzini
On 17/12/2015 00:49, James Hogan wrote: > This patchset contains a bunch of miscellaneous cleanups (which are > mostly trivial) for MIPS KVM & MIPS headers, such as: > - Style/whitespace fixes > - General cleanup and removal of dead code. > - Moving/refactoring of general MIPS definitions out of

Re: [patch] VFIO: platform: reset: fix a warning message condition

2015-12-17 Thread Eric Auger
Hi Dan, thanks for pointing this out. Reviewed-by: Eric Auger I add Thomas in CC since the bug also exists in the native driver I think (drivers/net/ethernet/amd/xgbe/drivers/net/ethernet/amd/xgbe /xgbe-dev.c, xgbe_exit function). Best Regards Eric On 12/17/2015 01:27

Re: [PATCH v2 0/3] KVM-UNIT-TESTS: Hyper-V SynIC timers test

2015-12-17 Thread Paolo Bonzini
On 16/12/2015 19:51, Denis V. Lunev wrote: > On 12/08/2015 07:36 PM, Andrey Smetanin wrote: >> The test checks Hyper-V SynIC timers functionality. >> The test runs on every vCPU and performs start/stop >> of periodic/one-shot timers (with period=1ms) and checks >> validity of received expiration

Re: [patch] VFIO: platform: reset: fix a warning message condition

2015-12-17 Thread Dan Carpenter
On Thu, Dec 17, 2015 at 01:45:52PM +0100, Eric Auger wrote: > I add Thomas in CC since the bug also exists in the native driver I > think (drivers/net/ethernet/amd/xgbe/drivers/net/ethernet/amd/xgbe > /xgbe-dev.c, xgbe_exit function). > Thanks, but I sent a patch for that one already. (These

Re: kvmclock doesn't work, help?

2015-12-17 Thread Marcelo Tosatti
On Wed, Dec 16, 2015 at 10:17:16AM -0800, Andy Lutomirski wrote: > On Wed, Dec 16, 2015 at 9:48 AM, Andy Lutomirski wrote: > > On Tue, Dec 15, 2015 at 12:42 AM, Paolo Bonzini wrote: > >> > >> > >> On 14/12/2015 23:31, Andy Lutomirski wrote: > >>> >

Re: kvmclock doesn't work, help?

2015-12-17 Thread Andy Lutomirski
On Wed, Dec 16, 2015 at 1:57 PM, Marcelo Tosatti wrote: > On Wed, Dec 16, 2015 at 10:17:16AM -0800, Andy Lutomirski wrote: >> On Wed, Dec 16, 2015 at 9:48 AM, Andy Lutomirski wrote: >> > On Tue, Dec 15, 2015 at 12:42 AM, Paolo Bonzini

Re: [PATCH v7 07/19] KVM: ARM64: PMU: Add perf event map and introduce perf event creating function

2015-12-17 Thread Marc Zyngier
On 17/12/15 15:22, Mark Rutland wrote: > On Tue, Dec 15, 2015 at 04:49:27PM +0800, Shannon Zhao wrote: >> From: Shannon Zhao >> >> When we use tools like perf on host, perf passes the event type and the >> id of this event type category to kernel, then kernel will map

Re: kvmclock doesn't work, help?

2015-12-17 Thread Marcelo Tosatti
GOn Mon, Dec 14, 2015 at 02:31:10PM -0800, Andy Lutomirski wrote: > On Mon, Dec 14, 2015 at 2:00 PM, Marcelo Tosatti wrote: > > On Mon, Dec 14, 2015 at 02:44:15PM +0100, Paolo Bonzini wrote: > >> > >> > >> On 11/12/2015 22:57, Andy Lutomirski wrote: > >> > I'm still not

Re: [PATCH] arm64: KVM: debug: Remove spurious inline attributes

2015-12-17 Thread Marc Zyngier
On 17/12/15 16:28, Alex Bennée wrote: > > Marc Zyngier writes: > >> The debug trapping code is pretty heavy on the "inline" attribute, >> but most functions are actually referenced in the sysreg tables, >> making the inlining imposible. >> >> Removing the useless inline

Re: [Question] Switching VCPU CPL from the hypervisor ?

2015-12-17 Thread Yacine HEBBAL
Paolo Bonzini redhat.com> writes: > On 15/12/2015 18:02, Hebbal Yacine wrote: > > What I want to do is: when a controlled process is in user mode, i > > change its cpl to 0, force it to execute a code that is injected in the > > VM, set back its cpl to 3 and let it run like if nothing happened >

Re: [PATCH] arm64: KVM: debug: Remove spurious inline attributes

2015-12-17 Thread Alex Bennée
Marc Zyngier writes: > The debug trapping code is pretty heavy on the "inline" attribute, > but most functions are actually referenced in the sysreg tables, > making the inlining imposible. > > Removing the useless inline qualifier seems the right thing to do, > having

Re: [PATCH v7 07/19] KVM: ARM64: PMU: Add perf event map and introduce perf event creating function

2015-12-17 Thread Mark Rutland
On Tue, Dec 15, 2015 at 04:49:27PM +0800, Shannon Zhao wrote: > From: Shannon Zhao > > When we use tools like perf on host, perf passes the event type and the > id of this event type category to kernel, then kernel will map them to > hardware event number and write this

Re: [PATCH kvm-unit-tests v2 01/12] run_tests: move run() to scripts/

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:32PM +0100, Radim Krčmář wrote: > We'll be using it from scripts/mkstandalone later. > > Signed-off-by: Radim Krčmář > --- > v2: new > > run_tests.sh | 53 + > scripts/run.bash | 51

[PULL 17/45] target-i386/kvm: Hyper-V SynIC timers MSR's support

2015-12-17 Thread Paolo Bonzini
From: Andrey Smetanin Hyper-V SynIC timers are host timers that are configurable by guest through corresponding MSR's (HV_X64_MSR_STIMER*). Guest setup and use fired by host events(SynIC interrupt and appropriate timer expiration message) as guest clock events. The

[PULL 16/45] hw/misc: Hyper-V test device 'hyperv-testdev'

2015-12-17 Thread Paolo Bonzini
From: Andrey Smetanin 'hyperv-testdev' will be used by kvm-unit-tests to setup Hyper-V SynIC SINT's routing and to inject Hyper-V SynIC SINT's. Hyper-V test device is ISA type device that creates 0x3000 IO memory region and catches write access into it. Every write

[PULL 13/45] target-i386/kvm: Hyper-V SynIC MSR's support

2015-12-17 Thread Paolo Bonzini
From: Andrey Smetanin This patch does Hyper-V Synthetic interrupt controller(Hyper-V SynIC) MSR's support and migration. Hyper-V SynIC is enabled by cpu's 'hv-synic' option. This patch does not allow cpu creation if 'hv-synic' option specified but kernel doesn't support

[PULL 15/45] target-i386/hyperv: Hyper-V SynIC SINT routing and vcpu exit

2015-12-17 Thread Paolo Bonzini
From: Andrey Smetanin Hyper-V SynIC(synthetic interrupt controller) helpers for Hyper-V SynIC irq routing setup, irq injection, irq ack notifications event/message pages changes tracking for future use. Signed-off-by: Andrey Smetanin

[PULL 14/45] kvm: Hyper-V SynIC irq routing support

2015-12-17 Thread Paolo Bonzini
From: Andrey Smetanin Signed-off-by: Andrey Smetanin Reviewed-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Richard Henderson CC: Eduardo

[PATCH kvm-unit-tests v2 00/12] Improve the output of test runners

2015-12-17 Thread Radim Krčmář
v1: http://www.spinics.net/lists/kvm/msg125202.html Drew brought up the existence of scripts/mkstandalone.sh, which significantly expanded v2 (and my set of curses) ... I didn't want to do the same twice, so first part of this series, [1-4/12], reuses run() from run_tests.sh and does some

[PATCH kvm-unit-tests v2 01/12] run_tests: move run() to scripts/

2015-12-17 Thread Radim Krčmář
We'll be using it from scripts/mkstandalone later. Signed-off-by: Radim Krčmář --- v2: new run_tests.sh | 53 + scripts/run.bash | 51 +++ 2 files changed, 52

[PATCH kvm-unit-tests v2 12/12] run_tests: suppress stderr

2015-12-17 Thread Radim Krčmář
log it instead to keep the output clear. Signed-off-by: Radim Krčmář --- v2: new (v1 did this by catching all output in a variable) run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_tests.sh b/run_tests.sh index 62c106a0b693..4c8c20a16eac

[PATCH kvm-unit-tests v2 06/12] x86/*: report skipped tests

2015-12-17 Thread Radim Krčmář
No care to consistency or exhaustivity was given. (svm-disabled test should be redone and it's weird that x86/hyperv_synic is about the only one that does report_skip when unsupported.) Signed-off-by: Radim Krčmář --- v2: remove double newline in enable_tsc_deadline_timer

[PATCH kvm-unit-tests v2 03/12] scripts/mkstandalone: use common run function

2015-12-17 Thread Radim Krčmář
The biggest change is dependency on bash. An alternative would be to rewrite `run` in POSIX shell, but I think it's ok to presume that KVM unit tests will run on a system where installing bash isn't a problem. (We already depend on QEMU ...) Apart from that, there are changes in output and exit

[PATCH kvm-unit-tests v2 10/12] run_tests: print summary

2015-12-17 Thread Radim Krčmář
Might be interesting and hopefully won't break too many scripts. Signed-off-by: Radim Krčmář --- v2: - don't print "0 unexpected failures" in run_tests' summary. [Drew] (This could have been done in lib/report, but I'm not sure why we want to always print it in the

[PATCH kvm-unit-tests v2 04/12] scripts/mkstandalone: improve exit paths

2015-12-17 Thread Radim Krčmář
trap can be called on EXIT, which covers most exits. Signed-off-by: Radim Krčmář --- v2: new scripts/mkstandalone.sh | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh index

[PATCH kvm-unit-tests v2 09/12] x86/hyperv_synic: check for support before testing

2015-12-17 Thread Radim Krčmář
It's not easy to distinguish successful unit-test from failed QEMU, so we check for presence of the needed feature before hand. Signed-off-by: Radim Krčmář --- v2: remove "> /dev/null" as check doesn't print the output anymore x86/unittests.cfg | 1 + 1 file changed, 1

[PATCH kvm-unit-tests v2 07/12] x86/pmu: expect failure with nmi_watchdog

2015-12-17 Thread Radim Krčmář
Host's nmi_watchdog takes one slot, making the "all counters" unit-test fail. We know exactly what happens, mark it as expected failure. PMU test is now executed regardless of host_nmi_watchdog. Signed-off-by: Radim Krčmář --- v2: - host_nmi_watchdog made static

[PATCH kvm-unit-tests v2 02/12] run_tests: prepare for changes in scripts/mkstandalone

2015-12-17 Thread Radim Krčmář
mkstandalone has a different mechanism for running tests as well as a different handling of output and return codes. - create two shell function to capture test execution and logging - return the return value of unit-test - cope with empty $verbose in `run` Signed-off-by: Radim Krčmář

[PATCH kvm-unit-tests v2 05/12] lib/report: allow test skipping

2015-12-17 Thread Radim Krčmář
We can now explicitly mark a unit-test as skipped. If all unit-tests were skipped, the whole test is reported as skipped as well. This also includes the case where no tests were run, but still ended with report_summary(). When the whole test is skipped, ./run_tests.sh prints yellow "SKIP"

[PATCH kvm-unit-tests v2 08/12] scripts/run: generalize check

2015-12-17 Thread Radim Krčmář
config attribute "check" is currently unused. Provide a simple implementation instead of removing it. Signed-off-by: Radim Krčmář --- v2: - update scripts/mkstandalone.sh [Drew] - don't print too much [Drew] - log the output of check command - use $testname

[PATCH kvm-unit-tests v2 11/12] wrappers: consolidate skip output

2015-12-17 Thread Radim Krčmář
Ugly helpers will get us yellow "SKIP" to stdout and 77 on exit. Signed-off-by: Radim Krčmář --- v2: new scripts/mkstandalone.sh | 6 +++--- scripts/run.bash| 25 - 2 files changed, 19 insertions(+), 12 deletions(-) diff --git

Re: [PATCH kvm-unit-tests v2 02/12] run_tests: prepare for changes in scripts/mkstandalone

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:33PM +0100, Radim Krčmář wrote: > mkstandalone has a different mechanism for running tests as well as a > different handling of output and return codes. > - create two shell function to capture test execution and logging > - return the return value of unit-test > -

Re: [PATCH kvm-unit-tests v2 10/12] run_tests: print summary

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:41PM +0100, Radim Krčmář wrote: > Might be interesting and hopefully won't break too many scripts. > > Signed-off-by: Radim Krčmář > --- > v2: > - don't print "0 unexpected failures" in run_tests' summary. [Drew] >(This could have been done

Re: [PATCH kvm-unit-tests v2 09/12] x86/hyperv_synic: check for support before testing

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:40PM +0100, Radim Krčmář wrote: > It's not easy to distinguish successful unit-test from failed QEMU, so > we check for presence of the needed feature before hand. > > Signed-off-by: Radim Krčmář > --- > v2: remove "> /dev/null" as check doesn't

Re: [PATCH kvm-unit-tests v2 10/12] run_tests: print summary

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:41PM +0100, Radim Krčmář wrote: > Might be interesting and hopefully won't break too many scripts. > > Signed-off-by: Radim Krčmář > --- > v2: > - don't print "0 unexpected failures" in run_tests' summary. [Drew] >(This could have been done

Re: [PATCH kvm-unit-tests v2 05/12] lib/report: allow test skipping

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:36PM +0100, Radim Krčmář wrote: > We can now explicitly mark a unit-test as skipped. > If all unit-tests were skipped, the whole test is reported as skipped as > well. This also includes the case where no tests were run, but still > ended with report_summary(). > >

Re: [PATCH kvm-unit-tests v2 05/12] lib/report: allow test skipping

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 01:30:23PM -0600, Andrew Jones wrote: > On Thu, Dec 17, 2015 at 06:53:36PM +0100, Radim Krčmář wrote: > > We can now explicitly mark a unit-test as skipped. > > If all unit-tests were skipped, the whole test is reported as skipped as > > well. This also includes the case

[kvm-unit-tests PATCH 3/3] add timeout support

2015-12-17 Thread Andrew Jones
Signed-off-by: Andrew Jones --- arm/run | 8 ++-- arm/unittests.cfg | 1 + run_tests.sh| 5 - scripts/functions.bash | 8 ++-- scripts/mkstandalone.sh | 9 +++-- x86/run | 8 ++-- x86/unittests.cfg |

[kvm-unit-tests PATCH 1/3] run_tests.sh: reduce return code ambiguity

2015-12-17 Thread Andrew Jones
qemu/unittest exit codes are convoluted, causing codes 0 and 1 to be ambiguous. Here are the possible meanings .-. || 0 | 1 |

[kvm-unit-tests PATCH 2/3] cleanup unittests.cfg headers

2015-12-17 Thread Andrew Jones
Signed-off-by: Andrew Jones --- arm/unittests.cfg | 26 +- x86/unittests.cfg | 21 ++--- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/arm/unittests.cfg b/arm/unittests.cfg index 5e26da1a8c1bc..926bbb153728b 100644

[kvm-unit-tests PATCH 0/3] run_tests.sh changes

2015-12-17 Thread Andrew Jones
Improve exit code handling and add unittest timeout support. Andrew Jones (3): run_tests.sh: reduce return code ambiguity cleanup unittests.cfg headers add timeout support arm/run | 8 ++-- arm/unittests.cfg | 27 ++- run_tests.sh

Re: [PATCH kvm-unit-tests v2 12/12] run_tests: suppress stderr

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:43PM +0100, Radim Krčmář wrote: > log it instead to keep the output clear. > > Signed-off-by: Radim Krčmář > --- > v2: new (v1 did this by catching all output in a variable) > > run_tests.sh | 2 +- > 1 file changed, 1 insertion(+), 1

Re: [PATCH kvm-unit-tests v2 03/12] scripts/mkstandalone: use common run function

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:34PM +0100, Radim Krčmář wrote: > The biggest change is dependency on bash. An alternative would be to > rewrite `run` in POSIX shell, but I think it's ok to presume that KVM > unit tests will run on a system where installing bash isn't a problem. Hmm... as hard as

Re: [PATCH kvm-unit-tests v2 11/12] wrappers: consolidate skip output

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:42PM +0100, Radim Krčmář wrote: > Ugly helpers will get us yellow "SKIP" to stdout and 77 on exit. > > Signed-off-by: Radim Krčmář > --- > v2: new > > scripts/mkstandalone.sh | 6 +++--- > scripts/run.bash| 25

[PATCH v3 3/9] powerpc/xics: Add icp_native_cause_ipi_rm

2015-12-17 Thread Suresh Warrier
Function to cause an IPI by directly updating the MFFR register in the XICS. The function is meant for real-mode callers since they cannot use the smp_ops->cause_ipi function which uses an ioremapped address. Normal usage is for the the KVM real mode code to set the IPI message using

[PATCH v3 8/9] KVM: PPC: Book3S HV: Send IPI to host core to wake VCPU

2015-12-17 Thread Suresh Warrier
This patch adds support to real-mode KVM to search for a core running in the host partition and send it an IPI message with VCPU to be woken. This avoids having to switch to the host partition to complete an H_IPI hypercall when the VCPU which is the target of the the H_IPI is not loaded (is not

[PATCH v3 5/9] KVM: PPC: Book3S HV: Manage core host state

2015-12-17 Thread Suresh Warrier
Update the core host state in kvmppc_host_rm_ops whenever the primary thread of the core enters the guest or returns back. Signed-off-by: Suresh Warrier --- arch/powerpc/kvm/book3s_hv.c | 44 1 file changed, 44

[PATCH v3 4/9] KVM: PPC: Book3S HV: Host-side RM data structures

2015-12-17 Thread Suresh Warrier
This patch defines the data structures to support the setting up of host side operations while running in real mode in the guest, and also the functions to allocate and free it. The operations are for now limited to virtual XICS operations. Currently, we have only defined one operation in the

[PATCH v3 2/9] powerpc/smp: Add smp_muxed_ipi_set_message

2015-12-17 Thread Suresh Warrier
smp_muxed_ipi_message_pass() invokes smp_ops->cause_ipi, which uses an ioremapped address to access registers on the XICS interrupt controller to cause the IPI. Because of this real mode callers cannot call smp_muxed_ipi_message_pass() for IPI messaging. This patch creates a separate function

Re: [RFC PATCH 3/3] vfio-pci: Allow to mmap MSI-X table if EEH is supported

2015-12-17 Thread Alex Williamson
On Thu, 2015-12-17 at 18:37 +0800, yongji xie wrote: > > On 2015/12/17 4:14, Alex Williamson wrote: > > On Fri, 2015-12-11 at 16:53 +0800, Yongji Xie wrote: > > > Current vfio-pci implementation disallows to mmap MSI-X table in > > > case that user get to touch this directly. > > > > > >

[PATCH v3 1/9] powerpc/smp: Support more IPI messages

2015-12-17 Thread Suresh Warrier
This patch increases the number of demuxed messages for a controller with a single ipi to 8 for 64-bit systems This is required because we want to use the IPI mechanism to send messages from a CPU running in KVM real mode in a guest to a CPU in the host to take some action. Currently, we only

Re: [RFC PATCH 3/3] vfio-pci: Allow to mmap MSI-X table if EEH is supported

2015-12-17 Thread Alex Williamson
On Thu, 2015-12-17 at 10:08 +, David Laight wrote: > > The MSI-X table is paravirtualized on vfio in general and interrupt > > remapping theoretically protects against errant interrupts, so why > > is > > this PPC64 specific? We have the same safeguards on x86 if we want > > to > > decide

[PATCH v3 6/9] KVM: PPC: Book3S HV: kvmppc_host_rm_ops - handle offlining CPUs

2015-12-17 Thread Suresh Warrier
The kvmppc_host_rm_ops structure keeps track of which cores are are in the host by maintaining a bitmask of active/runnable online CPUs that have not entered the guest. This patch adds support to manage the bitmask when a CPU is offlined or onlined in the host. Signed-off-by: Suresh Warrier

[PATCH v3 9/9] KVM: PPC: Book3S HV: Add tunable to control H_IPI redirection

2015-12-17 Thread Suresh Warrier
Redirecting the wakeup of a VCPU from the H_IPI hypercall to a core running in the host is usually a good idea, most workloads seemed to benefit. However, in one heavily interrupt-driven SMT1 workload, some regression was observed. This patch adds a kvm_hv module parameter called h_ipi_redirect to

[PATCH v3 7/9] KVM: PPC: Book3S HV: Host side kick VCPU when poked by real-mode KVM

2015-12-17 Thread Suresh Warrier
This patch adds the support for the kick VCPU operation for kvmppc_host_rm_ops. The kvmppc_xics_ipi_action() function provides the function to be invoked for a host side operation when poked by the real mode KVM. This is initiated by KVM by sending an IPI to any free host core. KVM real mode must

[PATCH v3 0/9] KVM: PPC: Book3S HV: Optimize wakeup VCPU from H_IPI

2015-12-17 Thread Suresh Warrier
When the VCPU target of an H_IPI hypercall is not running in the guest, we need to do a kick VCPU (wake the VCPU thread) to make it runnable. The real-mode version of the H_IPI hypercall cannot do this because it involves waking a sleeping thread. Thus the hcall returns H_TOO_HARD which forces a

Re: [RFC PATCH 2/3] vfio-pci: Allow to mmap sub-page MMIO BARs if all MMIO BARs are page aligned

2015-12-17 Thread Alex Williamson
On Thu, 2015-12-17 at 18:26 +0800, yongji xie wrote: > > On 2015/12/17 4:04, Alex Williamson wrote: > > On Fri, 2015-12-11 at 16:53 +0800, Yongji Xie wrote: > > > Current vfio-pci implementation disallows to mmap > > > sub-page(size < PAGE_SIZE) MMIO BARs because these BARs' mmio > > > page > > >

Re: [PATCH v2 0/3] KVM-UNIT-TESTS: Hyper-V SynIC timers test

2015-12-17 Thread Denis V. Lunev
On 12/17/2015 05:55 PM, Paolo Bonzini wrote: On 16/12/2015 19:51, Denis V. Lunev wrote: On 12/08/2015 07:36 PM, Andrey Smetanin wrote: The test checks Hyper-V SynIC timers functionality. The test runs on every vCPU and performs start/stop of periodic/one-shot timers (with period=1ms) and

linux-next: manual merge of the akpm-current tree with the kvm tree

2015-12-17 Thread Stephen Rothwell
Hi Andrew, Today's linux-next merge of the akpm-current tree got a conflict in: arch/x86/kvm/mmu.c between commits: 7ee0e5b29d27 ("KVM: x86: MMU: Remove unused parameter of __direct_map()") 029499b47738 ("KVM: x86: MMU: Make mmu_set_spte() return emulate value") from the kvm tree and

Re: [RFC PATCH 3/3] vfio-pci: Allow to mmap MSI-X table if EEH is supported

2015-12-17 Thread Benjamin Herrenschmidt
On Thu, 2015-12-17 at 14:41 -0700, Alex Williamson wrote: > > So I think it is safe to mmap/passthrough MSI-X table on PPC64 > > platform. > > And I'm not sure whether other architectures can ensure these two  > > points.  > > There is another consideration, which is the API exposed to the user.

[patch] VFIO: platform: reset: fix a warning message condition

2015-12-17 Thread Dan Carpenter
This loop ends with count set to -1 and not zero so the warning message isn't printed when it should be. I've fixed this by change the postop to a preop. Fixes: 0990822c9866 ('VFIO: platform: reset: AMD xgbe reset module') Signed-off-by: Dan Carpenter diff --git

RE: [RFC PATCH 3/3] vfio-pci: Allow to mmap MSI-X table if EEH is supported

2015-12-17 Thread David Laight
> The MSI-X table is paravirtualized on vfio in general and interrupt > remapping theoretically protects against errant interrupts, so why is > this PPC64 specific? We have the same safeguards on x86 if we want to > decide they're sufficient. Offhand, the only way I can think that a > device can

Re: [PATCH 00/16] MIPS: KVM: Misc trivial cleanups

2015-12-17 Thread James Hogan
Hi Paolo. On Thu, Dec 17, 2015 at 11:39:14AM +0100, Paolo Bonzini wrote: > > > On 17/12/2015 00:49, James Hogan wrote: > > This patchset contains a bunch of miscellaneous cleanups (which are > > mostly trivial) for MIPS KVM & MIPS headers, such as: > > - Style/whitespace fixes > > - General

Re: [PATCH kvm-unit-tests v2 04/12] scripts/mkstandalone: improve exit paths

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:35PM +0100, Radim Krčmář wrote: > trap can be called on EXIT, which covers most exits. Not with dash :-) If we decide to depend on bash, then Reviewed-by: Andrew Jones > > Signed-off-by: Radim Krčmář > --- > v2: new > >

Re: [PATCH kvm-unit-tests v2 00/12] Improve the output of test runners

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:31PM +0100, Radim Krčmář wrote: > v1: http://www.spinics.net/lists/kvm/msg125202.html > > Drew brought up the existence of scripts/mkstandalone.sh, which > significantly expanded v2 (and my set of curses) ... > I didn't want to do the same twice, so first part of

Re: [PATCH] arm64: KVM: debug: Remove spurious inline attributes

2015-12-17 Thread Alex Bennée
Marc Zyngier writes: > On 17/12/15 16:28, Alex Bennée wrote: >> >> Marc Zyngier writes: >> >>> The debug trapping code is pretty heavy on the "inline" attribute, >>> but most functions are actually referenced in the sysreg tables, >>> making the

Re: [RFC PATCH 0/3] VFIO: capability chains

2015-12-17 Thread Alexey Kardashevskiy
On 11/24/2015 07:43 AM, Alex Williamson wrote: Please see the commit log and comments in patch 1 for a general explanation of the problems that this series tries to address. The general problem is that we have several cases where we want to expose variable sized information to the user, whether

Re: [RFC PATCH 0/3] VFIO: capability chains

2015-12-17 Thread Alex Williamson
On Fri, 2015-12-18 at 13:05 +1100, Alexey Kardashevskiy wrote: > On 11/24/2015 07:43 AM, Alex Williamson wrote: > > Please see the commit log and comments in patch 1 for a general > > explanation of the problems that this series tries to address.  The > > general problem is that we have several

Re: kvmclock doesn't work, help?

2015-12-17 Thread Marcelo Tosatti
On Thu, Dec 17, 2015 at 08:33:17AM -0800, Andy Lutomirski wrote: > On Wed, Dec 16, 2015 at 1:57 PM, Marcelo Tosatti wrote: > > On Wed, Dec 16, 2015 at 10:17:16AM -0800, Andy Lutomirski wrote: > >> On Wed, Dec 16, 2015 at 9:48 AM, Andy Lutomirski > >>

Re: kvmclock doesn't work, help?

2015-12-17 Thread Andy Lutomirski
On Thu, Dec 17, 2015 at 11:08 AM, Marcelo Tosatti wrote: > On Thu, Dec 17, 2015 at 08:33:17AM -0800, Andy Lutomirski wrote: >> On Wed, Dec 16, 2015 at 1:57 PM, Marcelo Tosatti wrote: >> > On Wed, Dec 16, 2015 at 10:17:16AM -0800, Andy Lutomirski wrote:

[PATCH kernel] vfio: Add explicit alignments in vfio_iommu_spapr_tce_create

2015-12-17 Thread Alexey Kardashevskiy
The vfio_iommu_spapr_tce_create struct has 4x32bit and 2x64bit fields which should have resulted in sizeof(fio_iommu_spapr_tce_create) equal to 32 bytes. However due to the gcc's default alignment, the actual size of this struct is 40 bytes. This fills gaps with __resv1/2 fields. This should not

Re: [RFC PATCH 0/3] VFIO: capability chains

2015-12-17 Thread Alexey Kardashevskiy
On 12/18/2015 01:38 PM, Alex Williamson wrote: On Fri, 2015-12-18 at 13:05 +1100, Alexey Kardashevskiy wrote: On 11/24/2015 07:43 AM, Alex Williamson wrote: Please see the commit log and comments in patch 1 for a general explanation of the problems that this series tries to address. The