[Qemu-devel] [PATCH 1/1] spapr: Correct reference count on spapr-cpu-core

2018-08-30 Thread Sam Bobroff
the reference count. This causes a problem if one of these cores is hot unplugged: no delete event is generated for it because it's reference count doesn't reach zero when it is detached from it's parent. Correct this by adding a call to object_unref() in spapr_init_cpus(). Signed-off-by: Sam Bobroff

[Qemu-devel] [PATCH 1/1] target/ppc: correct htab shift for hash on radix

2017-11-05 Thread Sam Bobroff
led before spapr_h_cas_compose_response() (where htab_shift is added to the device tree). Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> [1] See http://www.spinics.net/lists/kvm-ppc/msg13057.html --- I tested this patch using a kernel based on Paul's kvm-ppc-next branch from his pow

Re: [Qemu-devel] [Qemu-ppc] [PATCH 1/1] ppc: spapr: Move VCPU ID calculation into sPAPR

2017-09-04 Thread Sam Bobroff
On Mon, Sep 04, 2017 at 12:18:57PM +0200, Greg Kurz wrote: > On Thu, 31 Aug 2017 16:38:46 +1000 > Sam Bobroff <sam.bobr...@au1.ibm.com> wrote: > > > Move the calculation of a CPU's VCPU ID out of the generic PPC code > > (ppc_cpu_realizefn()) a

[Qemu-devel] [PATCH 1/1] ppc: spapr: Move VCPU ID calculation into sPAPR

2017-08-31 Thread Sam Bobroff
that doesn't require any interaction with sPAPR. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- This is follow up work arising from my work to clean up the way CPU VCPU IDs are handled on PowerPC. It had looked like it would be difficult to move the actual VCPU ID calculation out of g

[Qemu-devel] [PATCH v4 0/1] Exploit settable KVM_CAP_PPC_SMT

2017-08-17 Thread Sam Bobroff
dded because I'm adding hints to the error. * show_vsmt_possible() now appends an error hint. Sam Bobroff (1): PPC: KVM: Support machine option to set VSMT mode hw/ppc/spapr.c | 75 + include/hw/ppc/spapr.h | 1 +

[Qemu-devel] [PATCH v4 1/1] PPC: KVM: Support machine option to set VSMT mode

2017-08-17 Thread Sam Bobroff
d slightly because it has changed (in KVM) from a global capability to a VM-specific one. This won't cause a problem on older KVMs because VM capabilities fall back to global ones. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- == Version 3 -> version 4: == * Use "

Re: [Qemu-devel] [PATCH v3 1/1] PPC: KVM: Support machine option to set VSMT mode

2017-08-17 Thread Sam Bobroff
On Fri, Aug 18, 2017 at 12:35:36PM +1000, David Gibson wrote: > On Tue, Aug 15, 2017 at 02:42:21PM +1000, Sam Bobroff wrote: > > KVM now allows writing to KVM_CAP_PPC_SMT which has previously been > > read only. Doing so causes KVM to act, for that VM, as if the host's > > S

Re: [Qemu-devel] [PATCH v3 0/5] target-ppc/spapr: Add FWNMI support in QEMU for PowerKVM guests

2017-08-16 Thread Sam Bobroff
On Wed, Aug 16, 2017 at 02:41:59PM +0530, Aravinda Prasad wrote: > This series of patches adds support for FWNMI in PowerKVM guests. > > Memory error such as bit flips that cannot be corrected > by hardware is passed on to the kernel for handling > by raising machine check exception (an NMI).

[Qemu-devel] [PATCH v3 0/1] Exploit settable KVM_CAP_PPC_SMT

2017-08-14 Thread Sam Bobroff
d to keep SPAPR dependencies out of KVM code. Sam Bobroff (1): PPC: KVM: Support machine option to set VSMT mode hw/ppc/spapr.c | 96 + include/hw/ppc/spapr.h | 1 + target/ppc/kvm.c| 20 +- target/ppc/kvm_ppc.h

[Qemu-devel] [PATCH v3 1/1] PPC: KVM: Support machine option to set VSMT mode

2017-08-14 Thread Sam Bobroff
d slightly because it has changed (in KVM) from a global capability to a VM-specific one. This won't cause a problem on older KVMs because VM capabilities fall back to global ones. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- Changes in v3: * Suggested by Greg Kur

[Qemu-devel] [PATCH v3 1/1] ppc: spapr: Make VCPU ID handling private to SPAPR

2017-08-08 Thread Sam Bobroff
The concept of a VCPU ID that differs from the CPU's index (cpu->cpu_index) exists only within SPAPR machines so, move the functions ppc_get_vcpu_id() and ppc_get_cpu_by_vcpu_id() into spapr.c and rename them appropriately. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- Chan

[Qemu-devel] [PATCH v3 0/1] Cleanup cpu_dt_id

2017-08-08 Thread Sam Bobroff
ersion 2: == Patch 1/1: ppc: spapr: Make VCPU ID handling private to SPAPR * Re-arranged so that spapr_vcpu_id() calls kvm_arch_vcpu_id() rather than the other way around. Sam Bobroff (1): ppc: spapr: Make VCPU ID handling private to SPAPR hw/ppc/ppc.c | 21 ---

Re: [Qemu-devel] [PATCH v2 1/1] ppc: spapr: Make VCPU ID handling private to SPAPR

2017-08-08 Thread Sam Bobroff
On Tue, Aug 08, 2017 at 04:24:01PM +1000, David Gibson wrote: > On Mon, Aug 07, 2017 at 04:33:29PM +1000, Sam Bobroff wrote: > > The concept of a VCPU ID that differs from the CPU's index > > (cpu->cpu_index) exists only within SPAPR machines so, move the > > f

[Qemu-devel] [PATCH v2 1/1] ppc: spapr: Make VCPU ID handling private to SPAPR

2017-08-07 Thread Sam Bobroff
The concept of a VCPU ID that differs from the CPU's index (cpu->cpu_index) exists only within SPAPR machines so, move the functions ppc_get_vcpu_id() and ppc_get_cpu_by_vcpu_id() into spapr.c and rename them appropriately. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- Chan

[Qemu-devel] [PATCH v2 0/1] Cleanup cpu_dt_id

2017-08-07 Thread Sam Bobroff
ID handling private to SPAPR * Re-arranged so that spapr_vcpu_id() calls kvm_arch_vcpu_id() rather than the other way around. Sam Bobroff (1): ppc: spapr: Make VCPU ID handling private to SPAPR hw/ppc/ppc.c | 21 - hw/ppc/spapr.c |

Re: [Qemu-devel] [PATCH 4/4] ppc: spapr: Make VCPU ID handling private to SPAPR

2017-08-07 Thread Sam Bobroff
On Fri, Aug 04, 2017 at 01:10:19PM +1000, David Gibson wrote: > On Thu, Aug 03, 2017 at 04:28:52PM +1000, Sam Bobroff wrote: > > The concept of a VCPU ID that differs from the CPU's index > > (cpu->cpu_index) exists only within SPAPR machines so, move the > > f

[Qemu-devel] [PATCH 0/4] Cleanup cpu_dt_id

2017-08-03 Thread Sam Bobroff
. (Alexander Graf: I've CC'd you because you're the maintainer of the e500 code.) Thanks to David Gibson for assistance with the design. Sam Bobroff (4): spapr: Fix bug in h_signal_sys_reset() e500: Use cpu_index instead of vcpu_dt_id ppc: spapr: Rename cpu_dt_id to vcpu_id ppc: spapr

[Qemu-devel] [PATCH 4/4] ppc: spapr: Make VCPU ID handling private to SPAPR

2017-08-03 Thread Sam Bobroff
The concept of a VCPU ID that differs from the CPU's index (cpu->cpu_index) exists only within SPAPR machines so, move the functions ppc_get_vcpu_id() and ppc_get_cpu_by_vcpu_id() into spapr.c and rename them appropriately. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- hw/

[Qemu-devel] [PATCH 2/4] e500: Use cpu_index instead of vcpu_dt_id

2017-08-03 Thread Sam Bobroff
with cpu_index == i). Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- hw/ppc/e500.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 62f1857206..2a6d34ceb1 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -382,7 +382,6 @@

[Qemu-devel] [PATCH 3/4] ppc: spapr: Rename cpu_dt_id to vcpu_id

2017-08-03 Thread Sam Bobroff
This field actually records the VCPU ID used by KVM and, although the value is also used in the device tree it is primarily the VCPU ID so rename it as such. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- hw/ppc/ppc.c| 8 hw/ppc/spapr.c

[Qemu-devel] [PATCH 1/4] spapr: Fix bug in h_signal_sys_reset()

2017-08-03 Thread Sam Bobroff
to be unused because the Linux kernel only uses the broadcast target. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- hw/ppc/spapr_hcall.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 72ea5a8247..07b3

Re: [Qemu-devel] [PATCH] spapr: Don't accidentally advertise HTM support on POWER9

2017-05-21 Thread Sam Bobroff
22: HTM */ > -0x80, 0x00, 0x80, 0x00, 0x80, 0x00, /* 18 - 23 */ > +0x80, 0x00, 0x80, 0x00, 0x00, 0x00, /* 18 - 23 */ > /* 24: Ext. Dec, 26: 64 bit ftrs, 28: PM ftrs */ > 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, /* 24 - 29 */ > /* 30: MMR, 32: LE atomic, 34: EBB + ext EBB */ > -- > 2.9.3 Looks good to me. Reviewed-by: Sam Bobroff <sam.bobr...@au1.ibm.com>

[Qemu-devel] [PATCH 2/2] ppc/xics: preserve P and Q bits for KVM IRQs

2017-04-27 Thread Sam Bobroff
the P bit has no effect, because the kernel will set it based on other data, but the loss of a set Q bit will cause a lost interrupt. This patch preserves the P and Q bits, correcting the problem. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- hw/intc/xics_kvm.c| 12

[Qemu-devel] [PATCH 1/2] ppc/xics: Fix stale irq->status bits after get

2017-04-27 Thread Sam Bobroff
ics_get_kvm_state() "or"s set bits into irq->status but does not mask out clear bits. Correct this by initializing the IRQ status to zero before adding bits to it. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- hw/intc/xics_kvm.c | 1 + 1 file changed, 1 insertion(

[Qemu-devel] [PATCH 0/2] ppc/xics: preserve P and Q bits for KVM IRQs

2017-04-27 Thread Sam Bobroff
Hi QEMU, As explained in the notes for the second patch, this is a change to hook up some new bits that have been added to KVM's XICS IRQs along with a small fix for a problem I noticed along the way. I tested by instrumenting the code directly, better ideas are welcome! Cheers, Sam. Sam

[Qemu-devel] [PATCH 1/1] target/ppc: Fix emulated userspace access to USPRG3

2017-04-19 Thread Sam Bobroff
read-only counterparts). This patch registers the new SPR for Book 3S processors and has it provide read-only access to SPR 0x113. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- target/ppc/translate_init.c | 9 + 1 file changed, 9 insertions(+) diff --git a/targ

Re: [Qemu-devel] [PATCH 1/1] target/ppc: Improve accuracy of guest HTM availability on P8s

2017-03-29 Thread Sam Bobroff
On Wed, Mar 29, 2017 at 07:39:25AM +0200, Thomas Huth wrote: > On 29.03.2017 07:01, Sam Bobroff wrote: > > On Power8 hosts it is currently theoretically possible for QEMU/KVM-HV > > guests > > to receive a ibm,pa-features property indicating that HTM support is &

[Qemu-devel] [PATCH 0/1] target/ppc: Improve accuracy of guest HTM availability on P8s

2017-03-28 Thread Sam Bobroff
-rc1) 2: Around kernel commit 4705e02498d6d5a7ab98dfee9595cd5e91db2017 (v4.6-rc1) Sam Bobroff (1): target/ppc: Improve accuracy of guest HTM availability on P8s target/ppc/kvm.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.12.1.382.gc0f9c7058

[Qemu-devel] [PATCH 1/1] target/ppc: Improve accuracy of guest HTM availability on P8s

2017-03-28 Thread Sam Bobroff
at boot time. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- target/ppc/kvm.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 9f1f132cef..8a54709ae4 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -49,6

[Qemu-devel] [PATCH for-2.10 1/1] scripts/update-linux-headers.sh: refactor extra files

2017-03-13 Thread Sam Bobroff
update-linux-headers.sh now has enough code in it to suggest some refactoring. Parameterize some of it to make adding new files a bit easier. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- scripts/update-linux-headers.sh | 44 ++--- 1 file c

[Qemu-devel] [PATCH for-2.10 0/1] scripts/update-linux-headers.sh: refactor extra files

2017-03-13 Thread Sam Bobroff
still be useful. There is no functional change, this is maintenance only. Cheers, Sam. Sam Bobroff (1): scripts/update-linux-headers.sh: refactor extra files scripts/update-linux-headers.sh | 44 ++--- 1 file changed, 24 insertions(+), 20 deletions

Re: [Qemu-devel] [RFC PATCH v2 04/12] Move virtio_mmio.h to fix update-linux-headers.sh

2017-02-27 Thread Sam Bobroff
On Fri, Feb 24, 2017 at 06:47:03PM +0200, Michael S. Tsirkin wrote: > On Thu, Feb 23, 2017 at 04:59:57PM +1100, Sam Bobroff wrote: > > Currently, running update-linux-headers.sh will produce a patch that > > deletes virtio_mmio.h, which is still needed. This happens because &g

[Qemu-devel] [RFC PATCH v2 05/12] Update headers using update-linux-headers.sh

2017-02-22 Thread Sam Bobroff
some kernel header files have become autogenerated. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- v2: * Added information about where the headers came from. include/standard-headers/linux/input-event-codes.h | 2 +- include/standard-headers/linux/pci_regs.h | 8 + i

[Qemu-devel] [RFC PATCH v2 12/12] spapr: Workaround for broken radix guests

2017-02-22 Thread Sam Bobroff
vector 1, and then removing the radix bit from ibm,pa-features. Note: This now requires regeneration of that node after CAS negotiation. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- hw/ppc/spapr.c | 15 +-- hw/ppc/spapr_hcall.c| 5 +++-- include/

[Qemu-devel] [RFC PATCH v2 11/12] spapr: Enable ISA 3.0 MMU mode selection via CAS

2017-02-22 Thread Sam Bobroff
has been added previously. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- v2: * Unused bits removed. * Logic and bit definitions changed due to architectural change. * Cleanly terminate QEMU if the guest requests an unavailable mode (as required by the new architecture). *

[Qemu-devel] [RFC PATCH v2 07/12] target-ppc: support KVM_CAP_PPC_MMU_RADIX, KVM_CAP_PPC_MMU_HASH_V3

2017-02-22 Thread Sam Bobroff
Query and cache the value of two new KVM capabilities that indicate KVM's support for new radix and hash modes of the MMU. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- v2: * cap_mmu_hash renamed to cap_mmu_hash_v3. target/ppc/kvm.c | 14 ++ target/ppc/kvm_ppc.

[Qemu-devel] [RFC PATCH v2 10/12] spapr: move spapr_populate_pa_features()

2017-02-22 Thread Sam Bobroff
In the next patch, spapr_fixup_cpu_dt() will need to call spapr_populate_pa_features() so move it's definition up without making any other changes. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- hw/ppc/spapr.c | 86 +-

[Qemu-devel] [RFC PATCH v2 01/12] spapr: Small cleanup of PPC MMU enums

2017-02-22 Thread Sam Bobroff
st and should ease maintenance. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- hw/ppc/spapr.c | 8 +++--- target/ppc/cpu-qom.h| 12 - target/ppc/kvm.c| 8 +++--- target/ppc/mmu-hash64.c | 10 target/ppc/mmu_helper.c | 67 -

[Qemu-devel] [RFC PATCH v2 09/12] spapr: Add h_register_process_table() hypercall

2017-02-22 Thread Sam Bobroff
Both radix and hash modes require guests to use h_register_process_table() to set up the MMU. Implement it using the new KVM ioctl KVM_PPC_CONFIGURE_V3_MMU. This hypercall is also necessary for fully emulated guests, so it will need to be reworked to integrate with Suraj's TCG patchset. --- v2:

[Qemu-devel] [RFC PATCH v2 08/12] spapr: Only setup HTP if necessary.

2017-02-22 Thread Sam Bobroff
If QEMU is using KVM, and KVM is capable of running in radix mode, guests can be run in real-mode without allocating a HPT (because KVM will use a minimal RPT). So in this case, we avoid creating the HPT at reset time and later (during CAS) create it if it is necessary. Signed-off-by: Sam Bobroff

[Qemu-devel] [RFC PATCH v2 06/12] spapr: Add ibm, processor-radix-AP-encodings to the device tree

2017-02-22 Thread Sam Bobroff
Use the new ioctl, KVM_PPC_GET_RMMU_INFO, to fetch radix MMU information from KVM and present the page encodings in the device tree under ibm,processor-radix-AP-encodings. This provides page size information to the guest which is necessary for it to use radix mode. Signed-off-by: Sam Bobroff

[Qemu-devel] [RFC PATCH v2 04/12] Move virtio_mmio.h to fix update-linux-headers.sh

2017-02-22 Thread Sam Bobroff
the update script) but it is not one of the files in that set. Fix this by moving that file into a new directory. In the future if that file is added to the "headers_install" target then this change should be reverted. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> ---

[Qemu-devel] [RFC PATCH v2 03/12] scripts/update-linux-headers.sh: add new files for ARM

2017-02-22 Thread Sam Bobroff
The kernel has added some new headers for ARM, so add these so that the script can be run successfully. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- v2: * Added the two new arm headers. scripts/update-linux-headers.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/s

[Qemu-devel] [RFC PATCH v2 00/12] ISA 3.00 KVM guest support

2017-02-22 Thread Sam Bobroff
t's own patch. * I'm sorry for the bitfield constants in spapr_dt_ov5_platform_support() but there don't seem to be convienent macros for converting an option vector specifier (OV_BIT(x,y)) into a byte-mask. I'm open to suggestions. Sam Bobroff (12): spapr: Small cleanup of PPC MMU enums s

[Qemu-devel] [RFC PATCH v2 02/12] scripts/update-linux-headers.sh: refactor extra files

2017-02-22 Thread Sam Bobroff
Refactor the architecture specific code to make it easier to add new special case files. There should be no change in functionality. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- v2: I've factored the script to make it easier to add new files. scripts/update-linux-headers.s

Re: [Qemu-devel] [RFC PATCH 3/9] spapr: Add ibm, processor-radix-AP-encodings to the device tree

2017-02-08 Thread Sam Bobroff
On Thu, Feb 09, 2017 at 01:14:08PM +1100, David Gibson wrote: > On Tue, Feb 07, 2017 at 01:56:46PM +1100, Sam Bobroff wrote: > > Use the new ioctl, KVM_PPC_GET_RMMU_INFO, to fetch radix MMU > > information from KVM and present the page encodings in the device tree > > under i

Re: [Qemu-devel] [Qemu-ppc] [RFC PATCH 2/9] Update headers using update-linux-headers.sh

2017-02-08 Thread Sam Bobroff
On Tue, Feb 07, 2017 at 01:59:52PM +0100, Thomas Huth wrote: > On 07.02.2017 03:56, Sam Bobroff wrote: > > This provides some new definitions needed by ISA 3.00 guests. > > > > It is a large change because this is the first import since > > some kernel header file

Re: [Qemu-devel] [RFC PATCH 2/9] Update headers using update-linux-headers.sh

2017-02-08 Thread Sam Bobroff
On Thu, Feb 09, 2017 at 12:55:49PM +1100, David Gibson wrote: > On Tue, Feb 07, 2017 at 01:56:45PM +1100, Sam Bobroff wrote: > > This provides some new definitions needed by ISA 3.00 guests. > > > > It is a large change because this is the first import since > > so

Re: [Qemu-devel] [RFC PATCH 1/9] spapr: fix off-by-one error in spapr_ovec_populate_dt()

2017-02-07 Thread Sam Bobroff
On Tue, Feb 07, 2017 at 04:12:47PM -0600, Michael Roth wrote: > Quoting Sam Bobroff (2017-02-06 20:56:44) > > The last byte of the option vector was missing due to an off-by-one > > error. Without this fix, client architecture support negotiation will > > fail because th

[Qemu-devel] [PATCH v2 1/1] target-ppc, tcg: fix usermode segfault with pthread_create()

2017-02-06 Thread Sam Bobroff
(), which causes the correct address to be used for the new thread and corrects the fault. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- v2: * Remove the NIP adjustment from the -TARGET_QEMU_ESIGRETURN case, it must break out with the same NIP as do_syscall(). linux-user/main.c | 3

[Qemu-devel] [RFC PATCH 6/9] spapr: Add h_register_process_table() hypercall

2017-02-06 Thread Sam Bobroff
Both radix and hash modes require guests to use h_register_process_table() to set up the MMU. Implement it using the new KVM ioctl KVM_PPC_CONFIGURE_V3_MMU. This hypercall is also necessary for fully emulated guests, so it will need to be reworked to integrate with Suraj's TCG patchset. ---

[Qemu-devel] [RFC PATCH 9/9] spapr: Small cleanup of PPC MMU enums

2017-02-06 Thread Sam Bobroff
st and should ease maintenance. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- hw/ppc/spapr.c | 10 +++- target/ppc/cpu-qom.h| 12 - target/ppc/kvm.c| 8 +++--- target/ppc/mmu-hash64.c | 10 ++

[Qemu-devel] [RFC PATCH 7/9] spapr: Set ISA 3.00 radix and hash bits in OV5

2017-02-06 Thread Sam Bobroff
and will cause ISA 3.00 guests to start using h_register_process_table(). Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- hw/ppc/spapr.c | 8 include/hw/ppc/spapr_ovec.h | 6 ++ 2 files changed, 14 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c

[Qemu-devel] [RFC PATCH 2/9] Update headers using update-linux-headers.sh

2017-02-06 Thread Sam Bobroff
been manually adjusted to prevent that. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- include/standard-headers/linux/input-event-codes.h | 2 +- include/standard-headers/linux/pci_regs.h | 8 + include/standard-headers/linux/virtio_ids.h| 1 + linux-headers/a

[Qemu-devel] [RFC PATCH 8/9] spapr: Advertise ISA 3.0 MMU features in pa_features

2017-02-06 Thread Sam Bobroff
call without indicating ISA 3.00 support (specifically, if they do not indicate that they support either new radix or new hash mode) then the radix bit is removed from ibm,pa-features to avoid triggering the bug. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- hw/ppc/spapr.c

[Qemu-devel] [RFC PATCH 4/9] target-ppc: support KVM_CAP_PPC_MMU_RADIX, KVM_CAP_PPC_MMU_HASH_V3

2017-02-06 Thread Sam Bobroff
Query and cache the value of two new KVM capabilities that indicate KVM's support for new radix and hash modes of the MMU. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- target/ppc/kvm.c | 14 ++ target/ppc/kvm_ppc.h | 12 2 files changed, 26 inse

[Qemu-devel] [RFC PATCH 0/9] ISA 3.00 KVM guest support

2017-02-06 Thread Sam Bobroff
d probably terminate with a descriptive message. Sam Bobroff (9): spapr: fix off-by-one error in spapr_ovec_populate_dt() Update headers using update-linux-headers.sh spapr: Add ibm,processor-radix-AP-encodings to the device tree target-ppc: support KVM_CAP_PPC_MMU_RADIX, KVM_CAP_PPC_M

[Qemu-devel] [RFC PATCH 5/9] spapr: Only setup HTP if necessary.

2017-02-06 Thread Sam Bobroff
Because KVM cannot support radix and hash modes concurrently, QEMU can avoid allocating a hash page table if KVM supports radix mode. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- hw/ppc/spapr.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/

[Qemu-devel] [RFC PATCH 3/9] spapr: Add ibm, processor-radix-AP-encodings to the device tree

2017-02-06 Thread Sam Bobroff
Use the new ioctl, KVM_PPC_GET_RMMU_INFO, to fetch radix MMU information from KVM and present the page encodings in the device tree under ibm,processor-radix-AP-encodings. This provides page size information to the guest which is necessary for it to use radix mode. Signed-off-by: Sam Bobroff

[Qemu-devel] [RFC PATCH 1/9] spapr: fix off-by-one error in spapr_ovec_populate_dt()

2017-02-06 Thread Sam Bobroff
The last byte of the option vector was missing due to an off-by-one error. Without this fix, client architecture support negotiation will fail because the last byte of option vector 5, which contains the MMU support, will be missed. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> ---

Re: [Qemu-devel] qemu-pcc 2.8.0 linux-user segfaults

2017-02-01 Thread Sam Bobroff
On Wed, Feb 01, 2017 at 03:25:05PM +, Peter Maydell wrote: > On 30 January 2017 at 23:52, Sam Bobroff <sam.bobr...@au1.ibm.com> wrote: > >> On 01/16/2017 03:56 PM, Aníbal Limón wrote: > >> > I'm trying to upgrade qemu to 2.8.0 in Openembedded-core and seg

Re: [Qemu-devel] qemu-pcc 2.8.0 linux-user segfaults

2017-01-30 Thread Sam Bobroff
On Mon, Jan 16, 2017 at 04:03:21PM -0600, Aníbal Limón wrote: > > > On 01/16/2017 03:56 PM, Aníbal Limón wrote: > > Hi folks, > > > > I'm trying to upgrade qemu to 2.8.0 in Openembedded-core and segfaults > > in qemu-ppc when is executing: Hi Aníbal, I've recently encountered a similar

[Qemu-devel] [PATCH 1/1] update-linux-headers: change SRCARCH to ARCH

2017-01-26 Thread Sam Bobroff
RCH, which corrects the problem. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- scripts/update-linux-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 72cf1fbf0a..ef11a8ab42 1007

Re: [Qemu-devel] update-linux-headers.sh fails on clean kernel dir

2017-01-24 Thread Sam Bobroff
On Tue, Jan 24, 2017 at 10:32:36AM +, Marc-André Lureau wrote: > Hi > > On Tue, Jan 24, 2017 at 8:41 AM Sam Bobroff <sam.bobr...@au1.ibm.com> wrote: > > > Hi QEMU developers, > > > > If I run scripts/update-linux-headers.sh from a clean checkout of QEMU

[Qemu-devel] update-linux-headers.sh fails on clean kernel dir

2017-01-23 Thread Sam Bobroff
Hi QEMU developers, If I run scripts/update-linux-headers.sh from a clean checkout of QEMU and point it at a clean checkout of a recent linux kernel (4.10-rc1 or later), it fails: $ scripts/update-linux-headers.sh ~/tmp/linux/ ... scripts/Makefile.headersinst:62: *** Missing generated UAPI

Re: [Qemu-devel] [PATCH 1/1] ppc: Fix MMU model values needed by PR KVM

2016-12-01 Thread Sam Bobroff
Ping? On Thu, Jul 21, 2016 at 08:07:25AM +0100, Mark Cave-Ayland wrote: > On 21/07/16 06:55, Sam Bobroff wrote: > > > Commit 4322e8c "ppc: Fix 64K pages support in full emulation" added > > the POWERPC_MMU_64K flag to the POWERPC_MMU_2_06 and POWE

[Qemu-devel] [PATCH v3 1/1] hw/net/spapr_llan: 6 byte mac address device tree entry

2016-11-21 Thread Sam Bobroff
in question are significant in a MAC address: they indicate a locally-administered unicast address.) So to maintain compatibility the old 8 byte value is presented when the lowest two bits of the first byte are not 10. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- v3: Made code comment

Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 1/1] hw/net/spapr_llan: 6 byte mac address device tree entry

2016-11-21 Thread Sam Bobroff
On Mon, Nov 21, 2016 at 11:14:26AM +0100, Thomas Huth wrote: > On 21.11.2016 06:04, Sam Bobroff wrote: > > The spapr-vlan device in QEMU has always presented it's MAC address in > > the device tree as an 8 byte value, even though PAPR requires it to be > > 6 bytes. This is

[Qemu-devel] [PATCH v2 1/1] hw/net/spapr_llan: 6 byte mac address device tree entry

2016-11-20 Thread Sam Bobroff
in question are significant in a MAC address: they indicate a locally-administered unicast address.) So to maintain compatibility the old 8 byte value is presented when the lowest two bits of the first byte are not 10. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- v2: Re-introduced t

[Qemu-devel] [PATCH 1/1] hw/net/spapr_llan: 6 byte mac address device tree entry

2016-11-16 Thread Sam Bobroff
breakage should be rare. The breakage would appear as the MAC address losing the first two bytes and receiving two bytes of garbage at the other end. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- hw/net/spapr_llan.c | 14 +- 1 file changed, 1 insertion(+), 13 del

Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 3/7] ppc/pnv: Add XSCOM infrastructure

2016-09-04 Thread Sam Bobroff
On Wed, Aug 31, 2016 at 06:34:11PM +0200, Cédric Le Goater wrote: > From: Benjamin Herrenschmidt > > XSCOM is an interface to a sideband bus provided by the POWER8 chip > pervasive unit, which gives access to a number of facilities in the > chip that are needed by the

[Qemu-devel] [PATCH 1/1] ppc: Fix MMU model values needed by PR KVM

2016-07-20 Thread Sam Bobroff
PC_MMU_64K flag to the POWERPC_MMU_2_06a and POWERPC_MMU_2_07a values, preventing the error. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- I recently discovered that I can't start QEMU with KVM PR for modern pseries machines: $ rmmod kvm_hv $ modprobe kvm-pr $ qemu-system-ppc64 -

[Qemu-devel] [PATCH v2 1/1] KVM: PPC: Introduce KVM_CAP_PPC_HTM

2016-07-19 Thread Sam Bobroff
Introduce a new KVM capability, KVM_CAP_PPC_HTM, that can be queried to determine if a PowerPC KVM guest should use HTM (Hardware Transactional Memory). This will be used by QEMU to populate the pa-features bits in the guest's device tree. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.

Re: [Qemu-devel] [1/1] KVM: PPC: Introduce KVM_CAP_PPC_HTM

2016-07-18 Thread Sam Bobroff
On Fri, Jul 08, 2016 at 08:49:49PM +1000, Michael Ellerman wrote: > On Wed, 2016-06-07 at 06:05:54 UTC, Sam bobroff wrote: > > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > > index 02416fe..06d79bc 100644 > > --- a/arch/powerpc/kvm/powerpc.c >

[Qemu-devel] [PATCH 1/1] KVM: PPC: Introduce KVM_CAP_PPC_HTM

2016-07-06 Thread Sam Bobroff
Introduce a new KVM capability, KVM_CAP_PPC_HTM, that can be queried to determine if a PowerPC KVM guest should use HTM (Hardware Transactional Memory). This will be used by QEMU to populate the pa-features bits in the guest's device tree. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.

[Qemu-devel] [PATCH v2 0/3] Rework spapr: Better handling of ibm, pa-features TM bit

2016-07-05 Thread Sam Bobroff
Here's version 2. Changes v1 -> v2: Patch 2/3: spapr: Set ibm, pa-features HTM from KVM_CAP_PPC_HTM * Improve readability of HTM bit set code. * Move the test for KVM into kvmppc_get_htm_support(). Sam Bobroff (3): spapr: Disable ibm, pa-features HTM bit Add KVM_CAP_PPC_HTM to li

[Qemu-devel] [PATCH v2 2/3] Add KVM_CAP_PPC_HTM to linux/kvm.h

2016-07-05 Thread Sam Bobroff
Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- linux-headers/linux/kvm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index e60e21b..37cb3e8 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@

[Qemu-devel] [PATCH v2 1/3] spapr: Disable ibm, pa-features HTM bit

2016-07-05 Thread Sam Bobroff
. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- hw/ppc/spapr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 78ebd9e..704aae7 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -635,7 +635,7 @@ static void spapr_populate_

[Qemu-devel] [PATCH v2 3/3] spapr: Set ibm, pa-features HTM from KVM_CAP_PPC_HTM

2016-07-05 Thread Sam Bobroff
based on KVM being KVM-HV and HTM being available to the QEMU process. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- v2: * Improve readability of HTM bit set code. * Move the test for KVM into kvmppc_get_htm_support(). hw/ppc/spapr.c | 3 +++ target-ppc/kvm.c

Re: [Qemu-devel] [PATCH 2/3] Add KVM_CAP_PPC_HTM to linux/kvm.h

2016-07-05 Thread Sam Bobroff
On Tue, Jul 05, 2016 at 04:05:58PM +1000, David Gibson wrote: > On Tue, Jul 05, 2016 at 03:19:23PM +1000, Sam Bobroff wrote: > > Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> > > Ok, so the usual procedure for updates to linux-headers is this: >1. Get the cha

[Qemu-devel] [PATCH 2/3] Add KVM_CAP_PPC_HTM to linux/kvm.h

2016-07-04 Thread Sam Bobroff
Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- linux-headers/linux/kvm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index e60e21b..37cb3e8 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@

[Qemu-devel] [PATCH 3/3] spapr: Set ibm, pa-features HTM from KVM_CAP_PPC_HTM

2016-07-04 Thread Sam Bobroff
based on KVM being KVM-HV and HTM being available to the QEMU process. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- hw/ppc/spapr.c | 3 ++- target-ppc/kvm.c | 27 +++ target-ppc/kvm_ppc.h | 6 ++ 3 files changed, 35 insertions(+), 1 de

[Qemu-devel] [PATCH 0/3] Rework spapr: Better handling of ibm, pa-features TM bit

2016-07-04 Thread Sam Bobroff
e possible in an attempt to be consistent. Sam Bobroff (3): spapr: Disable ibm, pa-features HTM bit Add KVM_CAP_PPC_HTM to linux/kvm.h spapr: Set ibm, pa-features HTM from KVM_CAP_PPC_HTM hw/ppc/spapr.c| 3 ++- linux-headers/linux/kvm.h | 1 + target-ppc/kvm.c

[Qemu-devel] [PATCH 1/3] spapr: Disable ibm, pa-features HTM bit

2016-07-04 Thread Sam Bobroff
. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- hw/ppc/spapr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 78ebd9e..704aae7 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -635,7 +635,7 @@ static void spapr_populate_

[Qemu-devel] [PATCH 1/1] Protect stderr from non-blocking mode

2016-01-27 Thread Sam Bobroff
lemented, we display a warning message. Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- This is somewhat of an RFC as the issue probably hasn't been noticed very often (ever?) and there are several approaches to addressing it. The discussion was a while ago, here: http://lists.nongnu.org/ar

Re: [Qemu-devel] Question about nonblocking stderr and lost logs

2015-12-15 Thread Sam Bobroff
On Mon, Dec 14, 2015 at 03:29:49PM +0800, Stefan Hajnoczi wrote: > On Mon, Dec 14, 2015 at 04:19:50PM +1100, Sam Bobroff wrote: > > On Thu, Dec 10, 2015 at 04:37:22PM +0800, Stefan Hajnoczi wrote: > > > On Mon, Dec 07, 2015 at 02:22:18PM +1100, Sam Bobroff wrote: > > > &

Re: [Qemu-devel] Question about nonblocking stderr and lost logs

2015-12-13 Thread Sam Bobroff
On Thu, Dec 10, 2015 at 04:37:22PM +0800, Stefan Hajnoczi wrote: > On Mon, Dec 07, 2015 at 02:22:18PM +1100, Sam Bobroff wrote: > > On Fri, Dec 04, 2015 at 02:33:01PM +0800, Stefan Hajnoczi wrote: > > > On Mon, Nov 30, 2015 at 04:34:47PM +1100, Sam Bobroff wrote: > >

Re: [Qemu-devel] [Qemu-ppc] [PATCHv2 07/10] pseries: DEFINE_SPAPR_MACHINE

2015-12-07 Thread Sam Bobroff
NE, > -.class_init= spapr_machine_2_1_class_init, > -.instance_init = spapr_machine_2_1_instance_init, > -}; > +DEFINE_SPAPR_MACHINE(2_1, "2.1"); > > static void spapr_machine_register_types(void) > { > type_register_static(_machine_info); > -type_register_static(_machine_2_1_info); > -type_register_static(_machine_2_2_info); > -type_register_static(_machine_2_3_info); > -type_register_static(_machine_2_4_info); > -type_register_static(_machine_2_5_info); > } > > type_init(spapr_machine_register_types) > -- > 2.5.0 Looks good to me. Just one nit: I couldn't help noticing that the suffix and verstr parameters to the macro were both encoding the same information. Did you consider a macro with the major and minor version as the parameters? e.g. #define DEFINE_SPAPR_MACHINE(major, minor) So usage would be: DEFINE_SPAPR_MACHINE(2, 1); Reviewed-by: Sam Bobroff <sam.bobr...@au1.ibm.com>

Re: [Qemu-devel] Question about nonblocking stderr and lost logs

2015-12-06 Thread Sam Bobroff
On Fri, Dec 04, 2015 at 02:33:01PM +0800, Stefan Hajnoczi wrote: > On Mon, Nov 30, 2015 at 04:34:47PM +1100, Sam Bobroff wrote: > > Hi QEMU programmers, > > > > While doing some experimental work on QEMU that has involved adding a lot of > > new log messages (u

[Qemu-devel] Question about nonblocking stderr and lost logs

2015-11-29 Thread Sam Bobroff
Hi QEMU programmers, While doing some experimental work on QEMU that has involved adding a lot of new log messages (using qemu_log_mask()), I've discovered that under some conditions a lot of my log messages go missing. I've tracked the issue down to qemu_logfile being left at the default

Re: [Qemu-devel] [PATCH 1/1] monitor: correct socket listen port

2015-10-29 Thread Sam Bobroff
On Thu, Oct 29, 2015 at 07:26:14AM +0100, Markus Armbruster wrote: > Sam Bobroff <sam.bobr...@au1.ibm.com> writes: > > > Currently when constructing an inet socket monitor (e.g. via "-monitor > > telent:localhost:12345,server,nowait") the port is ignored an

[Qemu-devel] [PATCH 1/1] monitor: correct socket listen port

2015-10-28 Thread Sam Bobroff
PI". The cause is that the has_port field is not set in the address, so later it is not copied by qapi_copy_SocketAddress(). This patch simply adds the missing "has_port = true". Signed-off-by: Sam Bobroff <sam.bobr...@au1.ibm.com> --- qemu-char.c | 1 + 1 file changed, 1 inse

Re: [Qemu-devel] Question about odd snapshot behaviour

2015-10-22 Thread Sam Bobroff
On Mon, Oct 19, 2015 at 02:50:17PM +0200, Kevin Wolf wrote: > [ CC: qemu-block ] > > Am 19.10.2015 um 07:27 hat Sam Bobroff geschrieben: > > Hi all, > > > > While working through the QEMU code that saves and loads snapshots, I've > > noticed some confusing behavi

[Qemu-devel] PPC VCPU ID packing via KVM_CAP_PPC_SMT

2015-10-18 Thread Sam Bobroff
Hi everyone, It's currently possible to configure QEMU and KVM such that (on a Power 7 or 8 host) users are unable to create as many VCPUs as they might reasonably expect. I'll outline one fairly straight forward solution (below) and I would welcome feedback: Does this seem a reasonable approach?

[Qemu-devel] Question about odd snapshot behaviour

2015-10-18 Thread Sam Bobroff
Hi all, While working through the QEMU code that saves and loads snapshots, I've noticed some confusing behaviour when using named VM snapshots that may need to be fixed somehow. This is what I've noticed: * If I create two empty qcow2 filesystems: fs1.qcow2 and fs2.qcow2: * e.g.

Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 1/2] spapr: Add support for hwrng when available

2015-09-08 Thread Sam Bobroff
On Tue, Sep 08, 2015 at 07:38:12AM +0200, Thomas Huth wrote: > On 08/09/15 07:03, Sam Bobroff wrote: > > On Tue, Sep 01, 2015 at 12:53:26PM +0200, Thomas Huth wrote: > >> On 01/09/15 02:38, David Gibson wrote: > >>> On Mon, Aug 31, 2015 at 08:46:01PM +0200, Thomas Hu

Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 1/2] spapr: Add support for hwrng when available

2015-09-07 Thread Sam Bobroff
On Tue, Sep 01, 2015 at 12:53:26PM +0200, Thomas Huth wrote: > On 01/09/15 02:38, David Gibson wrote: > > On Mon, Aug 31, 2015 at 08:46:01PM +0200, Thomas Huth wrote: > >> From: Michael Ellerman > >> > >> Some powerpc systems have support for a hardware random number

Re: [Qemu-devel] [Qemu-ppc] [PATCH v3 0/4] target-ppc: Add FWNMI support in qemu for powerKVM guests

2015-09-03 Thread Sam Bobroff
On Thu, Sep 03, 2015 at 03:05:21PM +1000, David Gibson wrote: [snip] > Hm.. so why can't the hypervisor code do the retrying? Aravinda replied to this earlier in the thread: "Retrying cannot be done internally in h_report_mc_err hcall: only one thread can succeed entering qemu upon parallel

Re: [Qemu-devel] [Qemu-ppc] [PATCH v3 0/4] target-ppc: Add FWNMI support in qemu for powerKVM guests

2015-09-02 Thread Sam Bobroff
On Tue, Sep 01, 2015 at 04:37:51PM +0530, Aravinda Prasad wrote: > > > On Monday 10 August 2015 09:35 AM, Sam Bobroff wrote: > > On Sun, Aug 09, 2015 at 03:53:02PM +0200, Alexander Graf wrote: > >> > >> > >> On 07.08.15 05:37, Sam Bobroff wrote: > &

Re: [Qemu-devel] [Qemu-ppc] [PATCH v3 0/4] target-ppc: Add FWNMI support in qemu for powerKVM guests

2015-09-02 Thread Sam Bobroff
On Thu, Sep 03, 2015 at 09:53:20AM +1000, David Gibson wrote: > On Wed, Sep 02, 2015 at 04:34:01PM +1000, Sam Bobroff wrote: > > On Tue, Sep 01, 2015 at 04:37:51PM +0530, Aravinda Prasad wrote: > > > > > > > > > On Monday 10 August 2015 09:35 AM, Sam Bobroff

  1   2   >