Re: [PATCH 3/3] powerpc/mm/hash: Avoid multiple HPT resize-downs on memory hotunplug

2021-04-18 Thread David Gibson
On Fri, Apr 09, 2021 at 12:31:03AM -0300, Leonardo Bras wrote: > Hello David, thanks for commenting. > > On Tue, 2021-03-23 at 10:45 +1100, David Gibson wrote: > > > @@ -805,6 +808,10 @@ static int resize_hpt_for_hotplug(unsigned long > > > new_mem_size, bool shrin

Re: [PATCH 2/3] powerpc/mm/hash: Avoid multiple HPT resize-ups on memory hotplug

2021-04-18 Thread David Gibson
On Thu, Apr 08, 2021 at 11:51:36PM -0300, Leonardo Bras wrote: > Hello David, thanks for the feedback! > > On Mon, 2021-03-22 at 18:55 +1100, David Gibson wrote: > > > +void hash_memory_batch_expand_prepare(unsigned long newsize) > > > +{ > > > + /* > >

Re: [PATCH] vfio/pci: Add missing range check in vfio_pci_mmap

2021-04-12 Thread David Gibson
r.kernel.org > Signed-off-by: Christian A. Ehrhardt Reviewed-by: David Gibson > --- > drivers/vfio/pci/vfio_pci.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c > index 65e7e6b44578..5023e2

Re: [PATCH 3/3] powerpc/mm/hash: Avoid multiple HPT resize-downs on memory hotunplug

2021-03-22 Thread David Gibson
memory_batch_shrink_end(); > rc = -EINVAL; > } else { > for_each_drmem_lmb(lmb) { > @@ -814,6 +828,7 @@ static int dlpar_memory_add_by_ic(u32 lmbs_to_add, u32 > drc_index) > if (rc) { > pr_err

Re: [PATCH 2/3] powerpc/mm/hash: Avoid multiple HPT resize-ups on memory hotplug

2021-03-22 Thread David Gibson
lmbs_to_add) > return -EINVAL; > > + memory_batch_expand_prepare(memblock_phys_mem_size() + lmbs_to_add * > drmem_lmb_size()); > + > for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) { > if (lmb->flags & DRCONF_MEM_

Re: [PATCH 1/3] powerpc/mm/hash: Avoid resizing-down HPT on first memory hotplug

2021-03-22 Thread David Gibson
d long start, > unsigned long end) > int rc = htab_remove_mapping(start, end, mmu_linear_psize, >mmu_kernel_ssize); > > - if (resize_hpt_for_hotplug(memblock_phys_mem_size()) == -ENOSPC) > + if (resize_hpt_for_hotplug(memblock_

Re: [PATCH V4 0/3] scripts: dtc: Build fdtoverlay

2021-02-21 Thread David Gibson
On Thu, Feb 04, 2021 at 08:25:23AM -0600, Rob Herring wrote: > On Sun, Jan 31, 2021 at 10:39 PM David Gibson > wrote: > > > > On Mon, Jan 25, 2021 at 09:42:21PM -0600, Frank Rowand wrote: > > > Hi David, > > > > > > On 1/22/21 12:34 AM, David Gibson

Re: [PATCH V7 4/6] kbuild: Add support to build overlays (%.dtbo)

2021-02-05 Thread David Gibson
equire a change in the DTC compiler. Not really. It would need a change to automatically recognize that extension, but you can easily work around that by explicitly giving the -I option to specify the input type. -- David Gibson| I'll have my music baroque, and my code davi

Re: [PATCH V4 0/3] scripts: dtc: Build fdtoverlay

2021-01-31 Thread David Gibson
On Mon, Jan 25, 2021 at 09:42:21PM -0600, Frank Rowand wrote: > Hi David, > > On 1/22/21 12:34 AM, David Gibson wrote: > > On Wed, Jan 20, 2021 at 10:47:40AM +0530, Viresh Kumar wrote: > >> +David. > >> > >> On 19-01-21, 11:12, Frank Rowand wrote: &g

Re: [PATCH V6 5/6] of: unittest: Create overlay_common.dtsi and testcases_common.dtsi

2021-01-22 Thread David Gibson
etailed justification. It really looks like the unittest stuff is doing some very bogus stuff that should be fixed first, before trying to do this on top. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _t

Re: [PATCH V6 2/6] scripts: dtc: Build fdtoverlay tool

2021-01-22 Thread David Gibson
_empty_tree.o fdt_addresses.o fdt_overlay.o > +libfdt = $(addprefix libfdt/,$(libfdt-objs)) > +fdtoverlay-objs := $(libfdt) fdtoverlay.o util.o > + > # Source files need to get at the userspace version of libfdt_env.h to > compile > HOST_EXTRACFLAGS += -I $(srctree)/$(src)

Re: [PATCH V4 0/3] scripts: dtc: Build fdtoverlay

2021-01-21 Thread David Gibson
e usable in embedded systems, without an allocator or much else available. Of course it would be possible to write a friendly command line tool specifically for applying overlays, which could give better errors. fdtoverlay as it stands isn't really that - it was pretty much written just to i

Re: [PATCH V5 5/5] of: unittest: Statically apply overlays using fdtoverlay

2021-01-21 Thread David Gibson
On Fri, Jan 22, 2021 at 08:40:49AM +0530, Viresh Kumar wrote: > On 22-01-21, 10:39, David Gibson wrote: > > No, it definitely will not work in general. It might kinda work in a > > few trivial cases, but it absolutely will not do the neccessary > > handling in some cases. &

Re: [PATCH V5 5/5] of: unittest: Statically apply overlays using fdtoverlay

2021-01-21 Thread David Gibson
On Thu, Jan 21, 2021 at 12:27:28PM +0530, Viresh Kumar wrote: > On 21-01-21, 17:34, David Gibson wrote: > > No, this is the wrong way around. The expected operation here is that > > you apply overlay (1) to the base tree, giving you, say, output1.dtb. > > output1.dtb is (eff

Re: [PATCH V5 5/5] of: unittest: Statically apply overlays using fdtoverlay

2021-01-21 Thread David Gibson
sed to be a base tree or an overlay. I'm still not seeing any reasonable use for the plugin version either, fwiw. > > 4) create a new file overlay_base_static.dts: >// SPDX-License-Identifier: GPL-2.0 >/dts-v1/; >#include overlay_base_dtsi > >

Re: [PATCH V5 5/5] of: unittest: Statically apply overlays using fdtoverlay

2021-01-20 Thread David Gibson
(just a quick hack to see if the method might work). So I > >> would > >> have to set things up properly to really test this. > >> > >> If this does work, it would remove my objections to you trying to transform > >> the existing unittest .dts test dat

Re: [PATCH] of: unittest: Statically apply overlays using fdtoverlay

2021-01-20 Thread David Gibson
ow how > normal devicetree knowledgeable people look at the contents of some of the > .dts test data files and think that they are incorrect. That is because > the way that unittest uses them is not normal. Trying to modify one or two > of the many unittest .dts test data files so that

Re: [PATCH V5 4/5] kbuild: Add support to build overlays (%.dtbo)

2021-01-20 Thread David Gibson
On Thu, Jan 21, 2021 at 09:43:00AM +0530, Viresh Kumar wrote: > On 21-01-21, 11:49, David Gibson wrote: > > If you're using overlays, you probably need the -@ flag, for both the > > base file and the overlays, which AFAICT is not already the case. > > I think the

Re: [PATCH V5 5/5] of: unittest: Statically apply overlays using fdtoverlay

2021-01-20 Thread David Gibson
erlay to it. However, a dtbo is a weirdly structured dtb, so applying an overlay to it is very unlikely to give you something useful. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _o

Re: [PATCH V5 5/5] of: unittest: Statically apply overlays using fdtoverlay

2021-01-20 Thread David Gibson
e the same effect applied to base.dtb as (1) and (2) applied in sequence. Merging overlays is something that could make sense, but fdtoverlay will not do it at present. > This is very similar to what I tried with the intermediate.dtb > earlier. > -- David Gibson| I&

Re: [PATCH V5 3/5] scripts: dtc: Remove the unused fdtdump.c file

2021-01-20 Thread David Gibson
On Thu, Jan 21, 2021 at 09:47:57AM +0530, Viresh Kumar wrote: > On 21-01-21, 11:44, David Gibson wrote: > > On Wed, Jan 20, 2021 at 12:36:45PM +0530, Viresh Kumar wrote: > > > This was copied from external DTC repository long back and isn't used > > > anymore. Over

Re: [PATCH V5 4/5] kbuild: Add support to build overlays (%.dtbo)

2021-01-20 Thread David Gibson
> +extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtbo,%.dt.yaml, $(dtb-)) > endif > > # Add subdir path > @@ -324,7 +326,7 @@ cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x > assembler-with-cpp -o $(dtc-tmp) $< ; > -d $(depfile).dtc.tmp $(dtc-tmp) ; \ >

Re: [PATCH V5 5/5] of: unittest: Statically apply overlays using fdtoverlay

2021-01-20 Thread David Gibson
gpio_04b.dtb > + > +quiet_cmd_fdtoverlay = FDTOVERLAY $@ > + cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $^ > + > +$(obj)/static_test.dtb: $(obj)/testcases.dtb $(addprefix > $(obj)/,$(apply_static_overlay)) > + $(call if_changed,fdtoverlay) > + >

Re: [PATCH V5 3/5] scripts: dtc: Remove the unused fdtdump.c file

2021-01-20 Thread David Gibson
intf("%*s// [NOP]\n", depth * shift, ""); > - continue; > - } > - > - if (tag != FDT_PROP) { > - fprintf(stderr, "%*s ** Unknown tag 0x%08x\n", depth * > shift, "", tag); > -

Re: [PATCH] of: unittest: Statically apply overlays using fdtoverlay

2021-01-17 Thread David Gibson
erlay_gpio_01.dtb overlay_gpio_02a.dtb \ >overlay_gpio_02b.dtb overlay_gpio_03.dtb \ > overlay_gpio_04a.dtb overlay_gpio_04b.dtb \ > - intermediate-overlay.dtb > +

Re: [PATCH] dtc: Allow overlays to have .dtbo extension

2021-01-11 Thread David Gibson
;; > return fallback; > @@ -357,6 +359,8 @@ int main(int argc, char *argv[]) > #endif > } else if (streq(outform, "dtb")) { > dt_to_blob(outf, dti, outversion); > + } else if (streq(outform, "dtbo")) { > + dt_to_blob(ou

[PATCH] powerpc: kvm: Increase HDEC threshold to enter guest

2020-08-10 Thread David Gibson
L kernels without obvious differences in this area. I'm still trying to determine what the cause of that difference is, but I think it's worth applying this change as a precaution in the interim. Signed-off-by: David Gibson --- arch/powerpc/kvm/book3s_hv.c | 4 ++-- 1 file changed,

Re: [PATCH v4 0/2] dtc: Improve checks for i2c reg properties

2020-06-22 Thread David Gibson
a second patch to check for 10 bit vs 7 bit addresses. > > Joel Stanley (2): > checks: Remove warning for I2C_OWN_SLAVE_ADDRESS > checks: Improve i2c reg property checking > > checks.c | 14 -- > 1 file changed, 12 insertions(+), 2 deletions(-) > -- Davi

[PATCHv2] tpm: ibmvtpm: Wait for ready buffer before probing for TPM2 attributes

2020-06-18 Thread David Gibson
located. Fixes: 18b3670d79ae9 ("tpm: ibmvtpm: Add support for TPM2") Signed-off-by: David Gibson --- Changes from v1: * Fixed a formatting error in the commit message * Added some more detail to the commit message drivers/char/tpm/tpm_ibmvtpm.c | 14 +++--- 1 file ch

[PATCH] tpm: ibmvtpm: Wait for ready buffer before probing for TPM2 attributes

2020-06-04 Thread David Gibson
hypervisor / TPM implementation doesn't respond quickly enough. I find it fails almost every time with an 8 vcpu guest under KVM with software emulated TPM. Fixes: 18b3670d79ae9 "tpm: ibmvtpm: Add support for TPM2" Signed-off-by: David Gibson --- drivers/char/tpm/tpm_ibmvtpm.c |

Re: [PATCH v3 2/2] checks: Improve i2c reg property checking

2020-06-04 Thread David Gibson
I know it seems trivial, but I'm a bit flat out right now. Can you please resend with the 1U fix applied. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_

Re: SPDX conversion under scripts/dtc/ of Linux Kernel

2019-06-20 Thread David Gibson
The policy is everything > is upstream first and any changes to dtc in the kernel are rejected. > > > > > > > What shall we do? > > > > > > [1] Convert upstream DTC to SPDX > > > > > > This will be a happy solution if it is acceptable in DTC

Re: [PATCH] powerpc/mm: move warning from resize_hpt_for_hotplug()

2019-03-07 Thread David Gibson
ot;); > > return ret; > } > diff --git a/arch/powerpc/platforms/pseries/lpar.c > b/arch/powerpc/platforms/pseries/lpar.c > index f2a9f0adc2d3..b407034a80ba 100644 > --- a/arch/powerpc/platforms/pseries/lpar.c > +++ b/arch/powerpc/platforms/pseries/lpar.c > @@ -918,7 +9

Re: [PATCH v2] powerpc/mm: move a KERN_WARNING message to pr_debug()

2019-02-06 Thread David Gibson
if (rc && (rc != -ENODEV)) > - printk(KERN_WARNING > -"Unable to resize hash page table to target > order %d: %d\n", > -target_hpt_shift, rc); > + if (rc) > +

Re: [PATCH V6 0/4] mm/kvm/vfio/ppc64: Migrate compound pages out of CMA region

2019-01-10 Thread David Gibson
makes ppc different is that we need a substantial CMA allocation every time we start a (POWER8) guest for the HPT. It's the fact that running guests on a system both means we need the CMA unfragment and (with vfio added in) can cause CMA fragmentation which makes this particularly problematic. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson signature.asc Description: PGP signature

Re: [PATCH] PCI: Add no-D3 quirk for Mellanox ConnectX-[45]

2019-01-08 Thread David Gibson
the card side. > > We are IBM :-) So far, it seems to be that the card is doing something > not quite right, but we don't know what. We might need to engage > Mellanox themselves. Possibly. On the other hand, I've had it reported that this is a software regression at least

Re: [PATCH] PCI: Add no-D3 quirk for Mellanox ConnectX-[45]

2019-01-03 Thread David Gibson
On Thu, Dec 06, 2018 at 08:45:09AM +0200, Leon Romanovsky wrote: > On Thu, Dec 06, 2018 at 03:19:51PM +1100, David Gibson wrote: > > Mellanox ConnectX-5 IB cards (MT27800) seem to cause a call trace when > > unbound from their regular driver and attached to vfio-pci in order t

Re: [PATCH] PCI: Add no-D3 quirk for Mellanox ConnectX-[45]

2018-12-11 Thread David Gibson
nging any > behavior), and 2) add the ConnectX devices to the quirk. That way > the ConnectX change is smaller and more easily > understood/reverted/etc. Sure. Would it make sense to send (1) as an independent cleanup, while I'm still working out exactly what (if anything)

Re: [PATCH] PCI: Add no-D3 quirk for Mellanox ConnectX-[45]

2018-12-10 Thread David Gibson
On Thu, Dec 06, 2018 at 08:45:09AM +0200, Leon Romanovsky wrote: > On Thu, Dec 06, 2018 at 03:19:51PM +1100, David Gibson wrote: > > Mellanox ConnectX-5 IB cards (MT27800) seem to cause a call trace when > > unbound from their regular driver and attached to vfio-pci in order t

Re: [PATCH v4] drivers/vfio: Fix a redundant copy bug

2018-11-18 Thread David Gibson
(struct vfio_eeh_pe_op, > > > err.mask); > > > - if (op.argsz < minsz) > > > + start = offsetof(struct vfio_eeh_pe_op, err.type); > > > + end = offsetofend(struct vfio_eeh_pe_op, > > > err.mask);

Re: Portable DT Connectors with regard to FPGAs

2018-09-24 Thread David Gibson
parent bus's address space (as an identity mapping or otherwise). > > Alan > > [1] > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/fpga/fpga-region.txt > > [2] https://lkml.org/lkml/2016/7/20/560 > -- David

Re: [PATCH] vfio-pci: Disable binding to PFs with SR-IOV enabled

2018-07-12 Thread David Gibson
re simply refuse to bind to PFs with SR-IOV enabled > with a warning message indicating the issue. Users can resolve this > by re-binding to the host driver and disabling SR-IOV before > attempting to use the device with vfio-pci. > > Signed-off-by: Alex Williamson Reviewed-by: D

Re: [PATCH] powerpc/pseries: include linux/types.h in asm/hvcall.h

2018-01-15 Thread David Gibson
| 1 + > > 1 file changed, 1 insertion(+) > > Thanks. None of my ~250 defconfig test builds hit this, what config are > you using? I also hit this, but only when I backported the change to RH's 3.10 kernel. I assumed something since then had added an indirect includ

[PATCH] KVM: PPC: Book3S HV: Always flush TLB in kvmppc_alloc_reset_hpt()

2018-01-09 Thread David Gibson
rrors. Signed-off-by: David Gibson --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) Paul, this is based on Paolo's KVM tree, but it should apply without modification to pretty much any vaguely current tree. It's a pretty nasty bug -

Re: [PATCH 0/4] Fix use after free in HPT resizing code and related minor improvements

2017-12-03 Thread David Gibson
4 from this series on top of the revised patches and post those separately (as a cleanup with less urgency than the actual fix). A couple of people have also suggested CCing k...@vger.kernel.org on the next round in addition to the lists already included. -- David Gibson

[PATCH] Revert "powerpc: Do not call ppc_md.panic in fadump panic notifier"

2017-12-03 Thread David Gibson
, revert it for now until we figure out how to do it properly. Signed-off-by: David Gibson --- arch/powerpc/include/asm/machdep.h | 1 + arch/powerpc/include/asm/setup.h | 1 + arch/powerpc/kernel/fadump.c | 22 -- arch/powerpc/kernel/setup-common.c | 27

Re: [PATCH 4/4] KVM: PPC: Book3S HV: Remove redundant parameter from resize_hpt_release()

2017-11-29 Thread David Gibson
ce > associated with resize structure we going to release. > > Also kill check for resize being NULL to make code > simpler and we called with resize != NULL in all > places except kvm_vm_ioctl_resize_hpt_commit(). > > Signed-off-by: Serhii Popovych Reviewed-by: Davi

Re: [PATCH 0/4] Fix use after free in HPT resizing code and related minor improvements

2017-11-29 Thread David Gibson
1 file changed, 82 insertions(+), 57 deletions(-) Paul, these (at least 1-3) fix (another :() host crash bug which can be triggered by guest and/or userspace actions. Please merge ASAP. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.a

Re: [PATCH 3/4] KVM: PPC: Book3S HV: Fix use after free in case of multiple resize requests

2017-11-29 Thread David Gibson
e9183ce0] [c0114250] worker_thread+0x1a0/0x520 > [ 635.280655] [c007e9183d80] [c012010c] kthread+0xec/0x100 > [ 635.280724] [c007e9183e30] [c000a4b8] > ret_from_kernel_thread+0x5c/0xa4 > [ 635.280814] Instruction dump: > [ 6

Re: [PATCH 2/4] KVM: PPC: Book3S HV: Improve kvmppc_allocate_hpt()/kvmppc_free_hpt()

2017-11-29 Thread David Gibson
r !hpt if allocated from CMA: neither > pfn_to_kaddr() nor page_to_pfn() is 0 in case of page != NULL. > > Signed-off-by: Serhii Popovych Reviewed-by: David Gibson > --- > arch/powerpc/kvm/book3s_64_mmu_hv.c | 54 > ++--- >

Re: [PATCH 1/4] KVM: PPC: Book3S HV: Drop prepare_done from struct kvm_resize_hpt and cleanups

2017-11-29 Thread David Gibson
resize_hpt_allocate() > returns -EBUSY that is treated specially. > > Change comparison against zero to make checkpatch.pl happy. > > Signed-off-by: Serhii Popovych Reviewed-by: David Gibson > --- > arch/powerpc/kvm/book3s_64_mmu_hv.c | 42 > ++--

Re: [PATCH 3/5] powerpc-pseries: Delete an unnecessary variable initialisation in iommu_pseries_alloc_group()

2017-10-19 Thread David Gibson
imagine that static analysis tools would catch NULL > dereferences but it's actually really really hard. We used to have > an __uninitialized_var() macro which was used to silence GCC false > positives, but now we initialize the pointers to NULL instead. So > most of the code that yo

Re: dtc issue with overlays starting in next-20171009

2017-10-18 Thread David Gibson
ht. You can check some things in overlays, but when parsing something requires information from the base tree, there is indeed not much that can be done. > > You can avoid the problem in your example dts with > > "-Wno-interrupts_property" > > > > dtc -Wno-interrupts_property fpga_01_a.dts > > > > The larger set of other checks that might trigger the assert is too large > > for me to want to add "-Wno-" flags for all of them to the command line > > (as temporary workarounds). > > David thought more switches were better. Right, as a rule, I like fine configurability of the checks. But.. there's a trick to make things easier to configure in batches: when you enable a warning, you automatically enable all warnings that warning has as prerequisites. And when you disable a warning, every other warning that has it as a prerequisite is also disabled. So by adding some dummy checks with the right depencies, you can allow enabling and disabling of groups of related checks with a single command line option. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson signature.asc Description: PGP signature

Re: dtc issue with overlays starting in next-20171009

2017-10-18 Thread David Gibson
7;t validate overlays which is unfortunate. I don't think > >> that's a solvable problem unless you have the base DT. > > > > Yes, maybe. But there are still some useful warnings for overlays, maybe. > > I'm > > not sure what the implications of the

Re: dtc issue with overlays starting in next-20171009

2017-10-18 Thread David Gibson
ddress-cells = <2>; > #size-cells = <1>; > > fpga_pr_region0 { > compatible = "fpga-region"; > fpga-bridges = <&freeze_controller_0>; > ranges; &g

Re: [RFC] yamldt v0.5, now a DTS compiler too

2017-10-10 Thread David Gibson
On Tue, Oct 10, 2017 at 06:19:03PM +0300, Pantelis Antoniou wrote: > Hi David, > > > On Oct 10, 2017, at 04:50 , David Gibson > > wrote: > > > > On Mon, Oct 09, 2017 at 06:07:28PM +0300, Pantelis Antoniou wrote: > >> Hi David, > >> > >&g

Re: [RFC] yamldt v0.5, now a DTS compiler too

2017-10-09 Thread David Gibson
On Mon, Oct 09, 2017 at 06:07:28PM +0300, Pantelis Antoniou wrote: > Hi David, > > > On Oct 9, 2017, at 03:00 , David Gibson wrote: > > > > On Sun, Oct 08, 2017 at 04:08:03PM -0700, Frank Rowand wrote: > >> On 10/07/17 03:23, Pantelis Antoniou wrote: > >

Re: [RFC] yamldt v0.5, now a DTS compiler too

2017-10-08 Thread David Gibson
ay is a > connector. In addition, no amount of schema validation can really protect the kernel from a bad DT. Even if the schemas can 100% verify that the DT is "syntactically" correct, which is ambitious, it can't protect against a DT which is in the right form, but cont

Re: [RFC PATCH v5 1/5] iommu: Add capabilities to a group

2017-08-09 Thread David Gibson
ing; this is useful when deciding whether or not to allow mapping > of MSIX table to the userspace. Various architectures will enable it > when they decide that it is safe to do so. > > Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson This seems like a reasonable concept th

Re: [RFC PATCH v5 5/5] vfio-pci: Allow to expose MSI-X table to userspace when safe

2017-08-09 Thread David Gibson
by > an IOMMU group. > > Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson > --- > include/linux/vfio.h | 1 + > drivers/vfio/pci/vfio_pci.c | 20 +--- > drivers/vfio/pci/vfio_pci_rdwr.c | 5 - > drivers/vfio/vfio.c

Re: [PATCH v2] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH

2017-07-25 Thread David Gibson
t; to > make use of IS_ENABLED() macro because CONFIG_VFIO_SPAPR_EEH is a tristate > option. > > This issue was found during a randconfig build. Logs are here: > > http://kisskb.ellerman.id.au/kisskb/buildresult/12982362/ > > Signed-off-by: Murilo Opsfelder Arauj

Re: [PATCH] powerpc/pseries: Fix of_node_put() underflow during pseries remove

2017-07-23 Thread David Gibson
; dlpar_detach_node() and pSeries_reconfig_remove_node() call > of_detach_node(), and thus the node should not be released > in this case too. > > Signed-off-by: Laurent Vivier Reviewed-by: David Gibson > --- > arch/powerpc/platforms/pseries/reconfig.c | 1 - > 1 file changed, 1 deletion(-) &g

[PATCH] virtio_scsi: Always try to read VPD pages

2017-04-12 Thread David Gibson
nd for the storvsc (Hyper-V) SCSI controller, although that exists for slightly different reasons. A specific case which causes this is a volume from IBM's IPR RAID controller (which presents as an SPC-2 device, although it does support VPD) passed through with qemu's 'scsi-block'

[PATCH] powerpc/pseries: Don't give a warning when HPT resizing isn't available

2017-03-16 Thread David Gibson
we'll give a harmless, but scary warning. This patch suppresses the warning in this case. It will still warn if the feature is supposed to be available, but didn't work. Signed-off-by: David Gibson --- arch/powerpc/mm/hash_utils_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(

Re: [PATCH] KVM: Prevent double-free on HPT resize commit path

2017-02-27 Thread David Gibson
On Wed, Feb 15, 2017 at 02:40:04PM +1100, David Gibson wrote: > resize_hpt_release(), called once the HPT resize of a KVM guest is > completed (successfully or unsuccessfully) free()s the state structure for > the resize. It is currently not safe to call with a NULL pointer. > >

[PATCH] KVM: Prevent double-free on HPT resize commit path

2017-02-14 Thread David Gibson
resize_hpt_release() with a NULL resize pointer. Found by Dan Carpenter with a static checker. Reported-by: Dan Carpenter Signed-off-by: David Gibson --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch

Re: [PATCHv2 00/11] KVM implementation of PAPR HPT resizing extension

2017-01-31 Thread David Gibson
On Wed, Feb 01, 2017 at 09:18:13AM +1100, Paul Mackerras wrote: > On Tue, Dec 20, 2016 at 04:48:56PM +1100, David Gibson wrote: > > Here is the KVM implementation for the proposed PAPR extension which > > allows the runtime resizing of a PAPR guest's Hashed Page Table (HPT).

Re: [PATCH] vfio/spapr: fail tce_iommu_attach_group() when iommu_data is null

2017-01-30 Thread David Gibson
128d10282d16 100644 > > --- a/drivers/vfio/vfio_iommu_spapr_tce.c > > +++ b/drivers/vfio/vfio_iommu_spapr_tce.c > > @@ -1270,6 +1270,10 @@ static int tce_iommu_attach_group(void *iommu_data, > > /* pr_debug("tce_vfio: Attaching group #%u to iommu %p\n", > >

[PATCHv2 11/11] powerpc/kvm: Advertise availablity of HPT resizing on KVM HV

2016-12-19 Thread David Gibson
This updates the KVM_CAP_SPAPR_RESIZE_HPT capability to advertise the presence of in-kernel HPT resizing on KVM HV. Signed-off-by: David Gibson --- arch/powerpc/kvm/powerpc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index

[PATCHv2 06/11] powerpc/kvm: Split HPT allocation from activation

2016-12-19 Thread David Gibson
cator at each size. As far as I can tell this change should be harmless. To match, we make kvmppc_free_hpt() just free the actual HPT itself. The call to kvmppc_free_lpid() that was there, we move to the single caller. Signed-off-by: David Gibson --- arch/powerpc/include/asm/kvm_book3s_64.h

[PATCHv2 02/11] powerpc/kvm: HPT resizing documentation and reserved numbers

2016-12-19 Thread David Gibson
resize implementation can be used, it's necessary to check KVM_CAP_PPC_ALLOC_HTAB. Unfortunately older kernels incorrectly set KVM_CAP_PPC_ALLOC_HTAB even with KVM PR. If userspace it want to support resizing with KVM PR on such kernels, it will need a workaround. Signed-off-by: David G

[PATCHv2 10/11] powerpc/kvm: KVM-HV HPT resizing implementation

2016-12-19 Thread David Gibson
This adds the "guts" of the implementation for the HPT resizing PAPR extension. It has the code to allocate and clear a new HPT, rehash an existing HPT's entries into it, and accomplish the switchover for a KVM guest from the old HPT to the new one. Signed-off-by: David Gibson --

[PATCHv2 05/11] powerpc/kvm: Don't store values derivable from HPT order

2016-12-19 Thread David Gibson
ff-by: David Gibson Reviewed-by: Thomas Huth --- arch/powerpc/include/asm/kvm_book3s_64.h | 12 arch/powerpc/include/asm/kvm_host.h | 2 -- arch/powerpc/kvm/book3s_64_mmu_hv.c | 28 +--- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 18 +- 4

[PATCHv2 03/11] powerpc/kvm: Rename kvm_alloc_hpt() for clarity

2016-12-19 Thread David Gibson
kvm_alloc_hpt_cma(). Similarly, kvm_release_hpt() is renamed kvm_free_hpt_cma(). Signed-off-by: David Gibson Reviewed-by: Thomas Huth --- arch/powerpc/include/asm/kvm_ppc.h | 4 ++-- arch/powerpc/kvm/book3s_64_mmu_hv.c | 8 arch/powerpc/kvm/book3s_hv_builtin.c | 8 3 files

[PATCHv2 04/11] powerpc/kvm: Gather HPT related variables into sub-structure

2016-12-19 Thread David Gibson
ation. Signed-off-by: David Gibson --- arch/powerpc/include/asm/kvm_host.h | 20 ++--- arch/powerpc/kvm/book3s_64_mmu_hv.c | 90 ++--- arch/powerpc/kvm/book3s_hv.c| 2 +- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 62 - 4 files change

[PATCHv2 08/11] powerpc/kvm: Create kvmppc_unmap_hpte_helper()

2016-12-19 Thread David Gibson
reverse mappings. To prepare with this, we split out the logic from kvm_unmap_rmapp() to evict a single HPTE, moving it to a new helper function. Signed-off-by: David Gibson --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 77 + 1 file changed, 44 insertions(+), 33

[PATCHv2 09/11] powerpc/kvm: Outline of KVM-HV HPT resizing implementation

2016-12-19 Thread David Gibson
. The actual guts of the implementation isn't here yet, so for now the calls will always fail. Signed-off-by: David Gibson --- arch/powerpc/include/asm/kvm_host.h | 3 + arch/powerpc/include/asm/kvm_ppc.h | 4 + arch/powerpc/kvm/book3s_64_mmu_hv.c

[PATCHv2 01/11] Documentation: Correct duplicate section number in kvm/api.txt

2016-12-19 Thread David Gibson
Both KVM_CREATE_SPAPR_TCE_64 and KVM_REINJECT_CONTROL have section number 4.98 in Documentation/virtual/kvm/api.txt, presumably due to a naive merge. This corrects the duplication. Signed-off-by: David Gibson --- Documentation/virtual/kvm/api.txt | 2 +- 1 file changed, 1 insertion(+), 1

[PATCHv2 00/11] KVM implementation of PAPR HPT resizing extension

2016-12-19 Thread David Gibson
rmation to Documentation/virtual/kvm/api.txt * Assorted minor cleanups based on review comments David Gibson (11): Documentation: Correct duplicate section number in kvm/api.txt powerpc/kvm: HPT resizing documentation and reserved numbers powerpc/kvm: Rename kvm_alloc_hpt() for clarity p

[PATCHv2 07/11] powerpc/kvm: Allow KVM_PPC_ALLOCATE_HTAB ioctl() to change HPT size

2016-12-19 Thread David Gibson
size. This patch also updates Documentation/virtual/kvm/api.txt to reflect the new behaviour. In fact the documentation was already slightly incorrect since 572abd5 "KVM: PPC: Book3S HV: Don't fall back to smaller HPT size in allocation ioctl" Signed-off-by: David Gibson --- Docum

Re: [PATCH 06/11] powerpc/kvm: Allow KVM_PPC_ALLOCATE_HTAB ioctl() to change HPT size

2016-12-19 Thread David Gibson
On Mon, Dec 19, 2016 at 08:49:24AM +0100, Thomas Huth wrote: > On 19.12.2016 01:48, David Gibson wrote: > > On Fri, Dec 16, 2016 at 01:44:57PM +0100, Thomas Huth wrote: > >> On 15.12.2016 06:53, David Gibson wrote: > >>> The KVM_PPC_ALLOCATE_HTAB ioctl() is used

Re: [PATCH 01/11] powerpc/kvm: Reserve capabilities and ioctls for HPT resizing

2016-12-19 Thread David Gibson
On Fri, Dec 16, 2016 at 02:15:30PM +0100, Thomas Huth wrote: > On 15.12.2016 06:53, David Gibson wrote: > > This adds a new powerpc-specific KVM_CAP_SPAPR_RESIZE_HPT capability to > > advertise whether KVM is capable of handling the PAPR extensions for > > resizing the has

Re: [PATCH 01/11] powerpc/kvm: Reserve capabilities and ioctls for HPT resizing

2016-12-19 Thread David Gibson
On Fri, Dec 16, 2016 at 10:25:55AM +0100, Thomas Huth wrote: > On 15.12.2016 06:53, David Gibson wrote: > > This adds a new powerpc-specific KVM_CAP_SPAPR_RESIZE_HPT capability to > > advertise whether KVM is capable of handling the PAPR extensions for > > resizing the has

Re: [PATCH 03/11] powerpc/kvm: Gather HPT related variables into sub-structure

2016-12-18 Thread David Gibson
On Fri, Dec 16, 2016 at 10:24:17AM +0100, Thomas Huth wrote: > On 15.12.2016 06:53, David Gibson wrote: > > Currently, the powerpc kvm_arch structure contains a number of variables > > tracking the state of the guest's hashed page table (HPT) in KVM HV. This > > patch

Re: [PATCH 06/11] powerpc/kvm: Allow KVM_PPC_ALLOCATE_HTAB ioctl() to change HPT size

2016-12-18 Thread David Gibson
On Fri, Dec 16, 2016 at 01:44:57PM +0100, Thomas Huth wrote: > On 15.12.2016 06:53, David Gibson wrote: > > The KVM_PPC_ALLOCATE_HTAB ioctl() is used to set the size of hashed page > > table (HPT) that userspace expects a guest VM to have, and is also used to > > clear that HP

Re: [PATCH 04/11] powerpc/kvm: Don't store values derivable from HPT order

2016-12-18 Thread David Gibson
On Fri, Dec 16, 2016 at 11:39:26AM +0100, Thomas Huth wrote: > On 15.12.2016 06:53, David Gibson wrote: > > Currently the kvm_hpt_info structure stores the hashed page table's order, > > and also the number of HPTEs it contains and a mask for its size. The > > last two

Re: [PATCH 05/11] powerpc/kvm: Split HPT allocation from activation

2016-12-18 Thread David Gibson
On Fri, Dec 16, 2016 at 12:57:26PM +0100, Thomas Huth wrote: > On 15.12.2016 06:53, David Gibson wrote: > > Currently, kvmppc_alloc_hpt() both allocates a new hashed page table (HPT) > > and sets it up as the active page table for a VM. For the upcoming HPT > > resize imple

[PATCH 04/11] powerpc/kvm: Don't store values derivable from HPT order

2016-12-14 Thread David Gibson
ff-by: David Gibson --- arch/powerpc/include/asm/kvm_book3s_64.h | 12 arch/powerpc/include/asm/kvm_host.h | 2 -- arch/powerpc/kvm/book3s_64_mmu_hv.c | 28 +--- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 18 +- 4 files changed, 34 inser

[PATCH 03/11] powerpc/kvm: Gather HPT related variables into sub-structure

2016-12-14 Thread David Gibson
ation. Signed-off-by: David Gibson --- arch/powerpc/include/asm/kvm_host.h | 16 --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 90 ++--- arch/powerpc/kvm/book3s_hv.c| 2 +- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 62 - 4 files change

[PATCH 02/11] powerpc/kvm: Rename kvm_alloc_hpt() for clarity

2016-12-14 Thread David Gibson
kvm_alloc_hpt_cma(). Similarly, kvm_release_hpt() is renamed kvm_free_hpt_cma(). Signed-off-by: David Gibson --- arch/powerpc/include/asm/kvm_ppc.h | 4 ++-- arch/powerpc/kvm/book3s_64_mmu_hv.c | 8 arch/powerpc/kvm/book3s_hv_builtin.c | 8 3 files changed, 10 insertions

[PATCH 06/11] powerpc/kvm: Allow KVM_PPC_ALLOCATE_HTAB ioctl() to change HPT size

2016-12-14 Thread David Gibson
size. Signed-off-by: David Gibson --- arch/powerpc/include/asm/kvm_ppc.h | 2 +- arch/powerpc/kvm/book3s_64_mmu_hv.c | 53 - arch/powerpc/kvm/book3s_hv.c| 5 +--- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/arch/powerpc/includ

[PATCH 05/11] powerpc/kvm: Split HPT allocation from activation

2016-12-14 Thread David Gibson
cator at each size. As far as I can tell this change should be harmless. To match, we make kvmppc_free_hpt() just free the actual HPT itself. The call to kvmppc_free_lpid() that was there, we move to the single caller. Signed-off-by: David Gibson --- arch/powerpc/include/asm/kvm_book3s_64.h

[PATCH 07/11] powerpc/kvm: Create kvmppc_unmap_hpte_helper()

2016-12-14 Thread David Gibson
reverse mappings. To prepare with this, we split out the logic from kvm_unmap_rmapp() to evict a single HPTE, moving it to a new helper function. Signed-off-by: David Gibson --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 77 + 1 file changed, 44 insertions(+), 33

[PATCH 08/11] powerpc/kvm: KVM-HV HPT resizing stub implementation

2016-12-14 Thread David Gibson
This patch adds a stub (always failing) implementation of the ioctl()s for the HPT resizing PAPR extension. Signed-off-by: David Gibson --- arch/powerpc/include/asm/kvm_ppc.h | 4 arch/powerpc/kvm/book3s_64_mmu_hv.c | 16 arch/powerpc/kvm/book3s_hv.c| 22

[PATCH 10/11] powerpc/kvm: KVM-HV HPT resizing implementation

2016-12-14 Thread David Gibson
This adds the "guts" of the implementation for the HPT resizing PAPR extension. It has the code to allocate and clear a new HPT, rehash an existing HPT's entries into it, and accomplish the switchover for a KVM guest from the old HPT to the new one. Signed-off-by: David Gibson --

[PATCH 00/11] KVM implementation of PAPR HPT resizing extension

2016-12-14 Thread David Gibson
https://github.com/dgibson/qemu/tree/upstream/hpt-resize I'm posting these now, in the hopes that both these and the corresponding guest side patches can be staged and merged for the 4.11 window. David Gibson (11): powerpc/kvm: Reserve capabilities and ioctls for HPT resizing powerpc/k

[PATCH 01/11] powerpc/kvm: Reserve capabilities and ioctls for HPT resizing

2016-12-14 Thread David Gibson
ut the intention is to return 2 once HPT resize is implemented for KVM HV. Signed-off-by: David Gibson --- arch/powerpc/kvm/powerpc.c | 3 +++ include/uapi/linux/kvm.h | 10 ++ 2 files changed, 13 insertions(+) diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c in

[PATCH 11/11] powerpc/kvm: Advertise availablity of HPT resizing on KVM HV

2016-12-14 Thread David Gibson
This updates the KVM_CAP_SPAPR_RESIZE_HPT capability to advertise the presence of in-kernel HPT resizing on KVM HV. In fact the HPT resizing isn't fully implemented, but this allows us to experiment with what's there. Signed-off-by: David Gibson --- arch/powerpc/kvm/powerpc.c | 5 +++

[PATCH 09/11] powerpc/kvm: Outline of KVM-HV HPT resizing implementation

2016-12-14 Thread David Gibson
paths. Signed-off-by: David Gibson --- arch/powerpc/include/asm/kvm_host.h | 3 + arch/powerpc/kvm/book3s_64_mmu_hv.c | 179 +++- arch/powerpc/kvm/book3s_hv.c| 3 + 3 files changed, 183 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm

Re: [patch 6/6] [RFD] timekeeping: Get rid of cycle_t

2016-12-08 Thread David Gibson
On Thu, Dec 08, 2016 at 08:49:45PM -, Thomas Gleixner wrote: > Kill the ever confusing typedef and use u64. > > NOT FOR INCLUSION - Must be regenerated at some point via coccinelle > > Not-Signed-off-by: Thomas Gleixner Not-Reviewed-by: David Gibson The concept seems se

  1   2   3   4   5   >