Re: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access

2024-07-09 Thread David Gibson
On Mon, Jul 08, 2024 at 04:59:30PM +0100, Peter Maydell wrote: > On Mon, 8 Jul 2024 at 08:49, Nicholas Piggin wrote: > > > > On Sun Jul 7, 2024 at 9:46 AM AEST, David Gibson wrote: > > > On Sat, Jul 06, 2024 at 11:37:08AM +0100, Peter Maydell wrote: > > > >

Re: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access

2024-07-09 Thread David Gibson
On Mon, Jul 08, 2024 at 05:49:32PM +1000, Nicholas Piggin wrote: > On Sun Jul 7, 2024 at 9:46 AM AEST, David Gibson wrote: > > On Sat, Jul 06, 2024 at 11:37:08AM +0100, Peter Maydell wrote: > > > On Fri, 5 Jul 2024 at 06:13, David Gibson > > > wrote: > > > >

Re: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access

2024-07-06 Thread David Gibson
On Sat, Jul 06, 2024 at 11:37:08AM +0100, Peter Maydell wrote: > On Fri, 5 Jul 2024 at 06:13, David Gibson wrote: > > > > On Fri, Jul 05, 2024 at 02:40:19PM +1000, Nicholas Piggin wrote: > > > On Fri Jul 5, 2024 at 11:41 AM AEST, David Gibson wrote: > > > >

Re: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access

2024-07-04 Thread David Gibson
On Fri, Jul 05, 2024 at 02:40:19PM +1000, Nicholas Piggin wrote: > On Fri Jul 5, 2024 at 11:41 AM AEST, David Gibson wrote: > > On Fri, Jul 05, 2024 at 11:18:47AM +1000, Nicholas Piggin wrote: > > > On Thu Jul 4, 2024 at 10:15 PM AEST, Peter Maydell wrote: > > > >

Re: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access

2024-07-04 Thread David Gibson
On Fri, Jul 05, 2024 at 11:18:47AM +1000, Nicholas Piggin wrote: > On Thu Jul 4, 2024 at 10:15 PM AEST, Peter Maydell wrote: > > On Sat, 29 Jun 2024 at 04:17, David Gibson > > wrote: > > > > > > On Fri, Jun 28, 2024 at 04:20:02PM +0100, Peter Maydell wrote: >

Re: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access

2024-07-04 Thread David Gibson
On Thu, Jul 04, 2024 at 01:15:57PM +0100, Peter Maydell wrote: > On Sat, 29 Jun 2024 at 04:17, David Gibson > wrote: > > > > On Fri, Jun 28, 2024 at 04:20:02PM +0100, Peter Maydell wrote: > > > On Thu, 27 Jun 2024 at 14:39, Akihiko Odaki > > > wrote: > &

Re: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access

2024-06-28 Thread David Gibson
better way to do what this is doing, > but neither we (in system/device_tree.c) nor libfdt seem to > provide one. libfdt does provide unaligned access helpers (fdt32_ld() etc.), but not an automatic aligned-or-unaligned helper. Maybe we should add that? -- David Gibson (he or they)

Re: [PATCH] hw/net: prevent potential NULL dereference

2024-05-30 Thread David Gibson
On Thu, May 30, 2024 at 10:03:51AM +0100, Peter Maydell wrote: > On Thu, 30 May 2024 at 01:52, David Gibson > wrote: > > > > On Wed, May 29, 2024 at 02:07:18PM +0300, Oleg Sviridov wrote: > > > Pointer, returned from function 'spapr_vio_find_by_reg', m

Re: [PATCH] hw/net: prevent potential NULL dereference

2024-05-29 Thread David Gibson
int i; > > +if (!dev) { > +return H_PARAMETER; > +} > + > for (i = 0; i < ETH_ALEN; i++) { > dev->nicconf.macaddr.a[ETH_ALEN - i - 1] = macaddr & 0xff; > macaddr >>= 8; -- David Gibson| I'll h

Re: [PATCH v2 09/10] ppc: Make Power11 as default cpu type for 'pseries' and 'powernv'

2024-04-28 Thread David Gibson
gt; C. > > > > > > > Cc: Cédric Le Goater > > Cc: Daniel Henrique Barboza > > Cc: David Gibson > > Cc: Frédéric Barrat > > Cc: Harsh Prateek Bora > > Cc: Mahesh J Salgaonkar > > Cc: Madhavan Srinivasan > > Cc: Nicholas Piggin

Re: [PATCH v2 04/10] ppc/spapr: Remove copy-paste from pa-features

2024-03-13 Thread David Gibson
41 */ > /* 42: PM, 44: PC RA, 46: SC vec'd */ > 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, /* 42 - 47 */ > /* 48: SIMD, 50: QP BFP, 52: String */ -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimal

Re: [PATCH v2 03/10] ppc/spapr|pnv: Remove SAO from pa-features

2024-03-13 Thread David Gibson
/* 0: MMU|FPU|SLB|RUN|DABR|NX, 1: fri[nzpm]|DABRX|SPRG3|SLB0|PP110 */ > -/* 2: VPM|DS205|PPR|DS202|DS206, 3: LSD|URG, SSO, 5: LE|CFAR|EB|LSQ > */ > -0xf6, 0x1f, 0xc7, 0xc0, 0x80, 0xf0, /* 0 - 5 */ > +/* 2: VPM|DS205|PPR|DS202|DS206, 3: LSD|URG, 5: LE|CFAR|EB|LS

Re: [PATCH v8 2/2] ppc: spapr: Enable 2nd DAWR on Power10 pSeries machine

2024-02-27 Thread David Gibson
2 @@ static target_ulong > > h_set_mode_resource_set_ciabr(PowerPCCPU *cpu, > > return H_SUCCESS; > > } > > > > -static target_ulong h_set_mode_resource_set_dawr0(PowerPCCPU *cpu, > > - SpaprMachineSt

Re: [PATCH] spapr: avoid overhead of finding vhyp class in critical operations

2024-02-25 Thread David Gibson
} > base = ppc_hash64_hpt_base(cpu); > @@ -837,9 +831,7 @@ static void ppc_hash64_set_c(PowerPCCPU *cpu, hwaddr > ptex, uint64_t pte1) > hwaddr base, offset = ptex * HASH_PTE_SIZE_64 + HPTE64_DW1_C; > > if (cpu->vhyp) { > -PPCVirtualHypervisorClass *

Re: [PATCH] MAINTAINERS: Remove myself as reviewer from PPC

2024-02-20 Thread David Gibson
Odd Fixes > F: target/ppc/kvm.c > > @@ -1502,7 +1500,6 @@ F: tests/avocado/ppc_prep_40p.py > sPAPR (pseries) > M: Nicholas Piggin > R: Daniel Henrique Barboza > -R: Cédric Le Goater > R: David Gibson > R: Harsh Prateek Bora > L: qemu-...@nongnu.org

Re: spapr watchdog vs watchdog_perform_action() / QMP watchdog-set-action

2024-01-28 Thread David Gibson
> "action is reset because the user never expressed a preference" > and "action is reset because the user specifically asked for that", > but I guess in theory we could make that distinction. (Conveniently > there is no QMP action for "query current watchdog-act

Re: [PATCH 2/8] ppc/spapr|pnv: Remove SAO from pa-features when running MTTCG

2024-01-24 Thread David Gibson
On Tue, Jan 23, 2024 at 11:57:56AM +1000, Nicholas Piggin wrote: > On Fri Jan 19, 2024 at 10:23 AM AEST, David Gibson wrote: > > On Fri, Jan 19, 2024 at 12:09:36AM +1000, Nicholas Piggin wrote: > > > SAO is a page table attribute that strengthens the memory ordering of > &g

Re: [PATCH 2/8] ppc/spapr|pnv: Remove SAO from pa-features when running MTTCG

2024-01-18 Thread David Gibson
t; + * academic. > + */ > +pa_features[4 + 2] &= ~0x80; Oof.. I see the reasoning but modifying guest visible parameters based on host capabilities without a cap really worries me nonetheless. > +} > + > if (ppc_hash64_has(cpu, PPC_HASH64_CI_LA

Re: [PATCH] ppc: qtest already exports qtest_rtas_call()

2023-10-30 Thread David Gibson
gt; > ninja: build stopped: subcommand failed. > > make: *** [Makefile:162: run-ninja] Error 1 > > > > Signed-off-by: Juan Quintela > > > Reviewed-by: Cédric Le Goater I think changing the name of one of the functions would be even better. Making it static mea

Re: [PATCH 4/4] hw/ppc/spapr: Rename 'softmmu' -> 'tcg'

2023-10-02 Thread David Gibson
en: ['CONFIG_PSERIES', 'CONFIG_TCG'], if_true: files( > - 'spapr_softmmu.c', > + 'spapr_tcg.c', > )) > ppc_ss.add(when: 'CONFIG_SPAPR_RNG', if_true: files('spapr_rng.c')) > ppc_ss.add(when: ['CO

Re: [PATCH 3/4] hw/ppc/spapr_hcall: Rename {softmmu -> tcgppc}_resize_hpt_prepare/commit

2023-10-02 Thread David Gibson
} else if (tcg_enabled()) { > -return softmmu_resize_hpt_commit(cpu, spapr, flags, shift); > +return tcgppc_resize_hpt_commit(cpu, spapr, flags, shift); > } else { > g_assert_not_reached(); > } -- 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] MAINTAINERS: Nick Piggin PPC maintainer, other PPC changes

2023-09-15 Thread David Gibson
uired knowledge and motivation to drive the boat. > > - Greg Kurz is being removed from all qemu-ppc entries. Greg has moved > to other areas of interest and will retire from qemu-ppc. Thanks Mr > Kurz for all the years of service. > > - David Gibson was removed as 'R

Re: [PATCH] hw/ppc/spapr: Test whether TCG is enabled with tcg_enabled()

2023-06-20 Thread David Gibson
use here we don't care about > KVM, we really want to test for TCG. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Gibson > --- > hw/ppc/spapr.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c &

Re: [PATCH 3/3] net: socket: remove net_init_socket()

2023-06-14 Thread David Gibson
rent Vivier Reviewed-by: David Gibson > --- > net/socket.c | 43 +-- > 1 file changed, 17 insertions(+), 26 deletions(-) > > diff --git a/net/socket.c b/net/socket.c > index 6b1f0fec3a10..8e3702e1f3a8 100644 > --- a/net/socket.c >

Re: [PATCH 2/3] net: socket: move fd type checking to its own function

2023-06-14 Thread David Gibson
On Fri, 9 Jun 2023 09:27:47 +0200 Laurent Vivier wrote: > Signed-off-by: Laurent Vivier Reviewed-by: David Gibson > --- > net/socket.c | 28 > 1 file changed, 20 insertions(+), 8 deletions(-) > > diff --git a/net/socket.c b/net/socket.c &g

Re: [PATCH 1/3] net: socket: prepare to cleanup net_init_socket()

2023-06-14 Thread David Gibson
Reviewed-by: David Gibson > --- > net/socket.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/net/socket.c b/net/socket.c > index ba6e5b0b0035..24dcaa55bc46 100644 > --- a/net/socket.c > +++ b/net/socket.c > @@ -587,7 +587,7 @@ static int

Re: [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE)

2022-12-21 Thread David Gibson
On Wed, Dec 21, 2022 at 10:15:28PM +, Peter Maydell wrote: > On Wed, 21 Dec 2022 at 16:03, Cédric Le Goater wrote: > > > > On 12/21/22 13:33, Peter Maydell wrote: > > > On Wed, 21 Dec 2022 at 01:35, David Gibson > > > wrote: > > >> On Mon, De

Re: [PATCH-for-8.0 4/4] hw/ppc/spapr_ovec: Avoid target_ulong spapr_ovec_parse_vector()

2022-12-21 Thread David Gibson
> > The code is not consistent in another places : > > > >   hw/ppc/spapr_tpm_proxy.c uses a uint64_t > >   hw/ppc/spapr_hcall.c, a target_ulong > >   hw/ppc/spapr_rtas.c, a hwaddr > >   hw/ppc/spapr_drc.c, a hwaddr indirectly > > > > Should we ch

Re: [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE)

2022-12-20 Thread David Gibson
On Mon, Dec 19, 2022 at 10:39:40AM +, Peter Maydell wrote: > On Mon, 19 Dec 2022 at 06:35, David Gibson > wrote: > > > > On Fri, Dec 16, 2022 at 09:39:19PM +, Peter Maydell wrote: > > > On Fri, 16 Dec 2022 at 19:11, Daniel Henrique Barboza > > > wrote

Re: [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE)

2022-12-18 Thread David Gibson
ndianness which can depend on a bunch of factors. When these macros were created, an ISA nearly always used the same endianness, but that's not really true any more - not just for POWER, but for a bunch of targets. So from that point of view, I think getting rid of tswap() - particular

Re: [PATCH for-8.0] MAINTAINERS: downgrade PPC KVM/TCG CPUs and pSeries to 'Odd Fixes'

2022-11-17 Thread David Gibson
the middle > > of the 7.2 development cycle. > > > > Great thanks Daniel for all your contributions over > the years, and for being the one steering the vessel > to the dry dock. This is it. Seconded. Reviewed-by: David Gibson > > > Change the status of PPC KVM

Re: [PATCH v10 05/17] net: introduce qemu_set_info_str() function

2022-10-06 Thread David Gibson
On Wed, Oct 05, 2022 at 06:20:39PM +0200, Laurent Vivier wrote: > Embed the setting of info_str in a function. > > Signed-off-by: Laurent Vivier Reviewed-by: David Gibson > --- > include/net/net.h | 1 + > net/l2tpv3.c | 3 +-- > net/net.c | 17 +++

Re: [PATCH v10 08/17] net: stream: Don't ignore EINVAL on netdev socket connection

2022-10-06 Thread David Gibson
Stefano Brivio > [lvivier: applied to net/stream.c] > Signed-off-by: Laurent Vivier > Reviewed-by: Daniel P. Berrangé Reviewed-by: David Gibson > --- > net/stream.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/net/stream.c b/net/stream.c >

Re: [PATCH v10 07/17] net: socket: Don't ignore EINVAL on netdev socket connection

2022-10-06 Thread David Gibson
no Brivio > Signed-off-by: Laurent Vivier Reviewed-by: David Gibson > --- > net/socket.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/net/socket.c b/net/socket.c > index ade1ecf38b87..4944bb70d580 100644 > --- a/net/socket.c >

Re: [PATCH v9 05/16] qapi: net: add stream and dgram netdevs

2022-10-05 Thread David Gibson
On Wed, Oct 05, 2022 at 12:08:27PM +0200, Laurent Vivier wrote: > On 9/28/22 07:55, David Gibson wrote: > > > +static int net_stream_server_init(NetClientState *peer, > > > + const char *model, > > > +

Re: [PATCH v9 08/16] net: stream: add unix socket

2022-10-05 Thread David Gibson
On Wed, Oct 05, 2022 at 03:38:09PM +0200, Laurent Vivier wrote: > On 9/28/22 08:12, David Gibson wrote: > > > @@ -253,9 +253,27 @@ static void net_stream_accept(void *opaque) > > > s->fd = fd; > > > s->nc.link_down = false; > > >

Re: [PATCH] MAINTAINERS: step back from PPC

2022-09-30 Thread David Gibson
t > > funded for this work. > > > > Signed-off-by: Cédric Le Goater > > --- > > End of an era. Thank you for all the dedication and accomplishments ! Seconded. Reviewed-by: David Gibson > > Reviewed-by: Greg Kurz > > > MAINTAINERS | 10 +-

Re: [PATCH v9 05/16] qapi: net: add stream and dgram netdevs

2022-09-28 Thread David Gibson
gt; +break; > +default: > + error_setg(errp, "only support inet or fd type"); > +return -1; > +} > + > +s = net_stream_fd_init_stream(peer, model, name, fd, connected); > + > +pstrcpy(s->nc.info_str, sizeof(s->nc.info_

Re: [PATCH v9 01/16] net: introduce convert_host_port()

2022-09-27 Thread David Gibson
On Mon, Sep 26, 2022 at 09:50:33PM +0200, Laurent Vivier wrote: > Signed-off-by: Laurent Vivier > Reviewed-by: Stefano Brivio Reviewed-by: David Gibson > --- > include/qemu/sockets.h | 2 ++ > net/net.c | 62 ++ > 2

Re: [PATCH v9 03/16] net: simplify net_client_parse() error management

2022-09-27 Thread David Gibson
> Reviewed-by: Markus Armbruster Reviewed-by: David Gibson > --- > include/net/net.h | 2 +- > net/net.c | 6 ++ > softmmu/vl.c | 12 +++- > 3 files changed, 6 insertions(+), 14 deletions(-) > > diff --git a/include/net/net.h b/include/net/ne

Re: [PATCH v9 13/16] qemu-sockets: update socket_uri() and socket_parse() to be consistent

2022-09-27 Thread David Gibson
gt; Reviewed-by: Dr. David Alan Gilbert > Reviewed-by: Markus Armbruster Reviewed-by: David Gibson > --- > util/qemu-sockets.c | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c > index 9f6f655fd526..a9

Re: [PATCH v9 11/16] net: dgram: add unix socket

2022-09-27 Thread David Gibson
On Mon, Sep 26, 2022 at 09:50:43PM +0200, Laurent Vivier wrote: > Signed-off-by: Laurent Vivier > Reviewed-by: Stefano Brivio Reviewed-by: David Gibson Although one note below. > --- > net/dgram.c | 65 ++--- > qapi/net.json

Re: [PATCH v9 08/16] net: stream: add unix socket

2022-09-27 Thread David Gibson
#or connect to (server=false) > # @server: create server socket (default: true) > # > -# Only SocketAddress types 'inet' and 'fd' are supported. > +# Only SocketAddress types 'unix', 'inet' and 'fd' are supported. > # >

Re: [PATCH v9 09/16] net: dgram: make dgram_dst generic

2022-09-27 Thread David Gibson
;u.inet.port, > errp) < 0) { > @@ -492,9 +503,12 @@ static int net_dgram_init(NetClientState *peer, > } > qemu_socket_set_nonblock(fd); > > +dgram_dst = g_malloc(sizeof(raddr_in)); > +memcpy(dgram_dst, &raddr_in, sizeof(raddr_in)); > + > info_str = g_strdup_printf("udp=%s:%d/%s:%d", > - inet_ntoa(laddr_in.sin_addr), ntohs(laddr_in.sin_port), > - inet_ntoa(raddr_in.sin_addr), ntohs(raddr_in.sin_port)); > +inet_ntoa(laddr_in.sin_addr), > ntohs(laddr_in.sin_port), > +inet_ntoa(raddr_in.sin_addr), > ntohs(raddr_in.sin_port)); > > break; > } > @@ -521,7 +535,8 @@ static int net_dgram_init(NetClientState *peer, > } > > if (remote) { > -s->dgram_dst = raddr_in; > +g_assert(s->dgram_dst == NULL); > +s->dgram_dst = dgram_dst; > > pstrcpy(s->nc.info_str, sizeof(s->nc.info_str), info_str); > g_free(info_str); -- 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 v8 06/14] net: stream: Don't ignore EINVAL on netdev socket connection

2022-09-13 Thread David Gibson
} else { > error_setg_errno(errp, errno, "can't connect socket"); -- 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 v8 11/14] qemu-sockets: move and rename SocketAddress_to_str()

2022-09-13 Thread David Gibson
s from a string. > > Signed-off-by: Laurent Vivier Reviewed-by: David Gibson > --- > include/qemu/sockets.h | 2 +- > monitor/hmp-cmds.c | 23 +-- > util/qemu-sockets.c| 20 > 3 files changed, 22 insertions(+), 23 deletio

Re: [PATCH v8 07/14] net: stream: add unix socket

2022-09-13 Thread David Gibson
'inet' and 'fd' are supported. > +# Only SocketAddress types 'unix', 'inet' and 'fd' are supported. > # > # Since: 7.1 > ## > diff --git a/qemu-options.hx b/qemu-options.hx > index bb16a61bae8e..8870bcce6bcd 100644 > --- a/qemu-options.hx > +++ b/qemu-options.hx > @@ -2733,6 +2733,7 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, > "configure a network backend to connect to another > network\n" > "using an UDP tunnel\n" > "-netdev > stream,id=str[,server=on|off],addr.type=inet,addr.host=host,addr.port=port\n" > +"-netdev stream,id=str[,server=on|off],addr.type=unix,addr.path=path\n" > "-netdev stream,id=str[,server=on|off],addr.type=fd,addr.str=h\n" > "configure a network backend to connect to another > network\n" > "using a socket connection in stream mode.\n" -- 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 v8 05/14] qapi: net: add stream and dgram netdevs

2022-09-13 Thread David Gibson
d.str, errp); > +if (fd == -1) { > +return -1; > +} > +ret = qemu_socket_try_set_nonblock(fd); > +if (ret < 0) { > + error_setg_errno(errp, -ret, "%s: Can't use file descriptor %d", > +

Re: [PATCH v8 02/14] net: remove the @errp argument of net_client_inits()

2022-09-13 Thread David Gibson
vier > Reviewed-by: Markus Armbruster Reviewed-by: David Gibson > --- > include/net/net.h | 2 +- > net/net.c | 20 +++- > softmmu/vl.c | 2 +- > 3 files changed, 9 insertions(+), 15 deletions(-) > > diff --git a/include/net/net.h b/include/

Re: [PATCH v8 03/14] net: simplify net_client_parse() error management

2022-09-13 Thread David Gibson
> Reviewed-by: Markus Armbruster Reviewed-by: David Gibson > --- > include/net/net.h | 2 +- > net/net.c | 6 ++ > softmmu/vl.c | 12 +++- > 3 files changed, 6 insertions(+), 14 deletions(-) > > diff --git a/include/net/net.h b/include/net/ne

Re: [PATCH v8 01/14] net: introduce convert_host_port()

2022-09-13 Thread David Gibson
On Tue, Sep 13, 2022 at 08:39:47AM +0200, Laurent Vivier wrote: > Signed-off-by: Laurent Vivier > Reviewed-by: Stefano Brivio Reviewed-by: David Gibson Although, if you do respin, an actual commit message would be nice to have. > --- > include/qemu/sockets.h | 2 ++

Re: [PATCH for-7.2 v4 15/21] qmp/hmp, device_tree.c: introduce 'info fdt' command

2022-08-31 Thread David Gibson
On Tue, Aug 30, 2022 at 12:43:23PM +0200, Markus Armbruster wrote: > David Gibson writes: > > > On Mon, Aug 29, 2022 at 07:00:55PM -0300, Daniel Henrique Barboza wrote: > >> > >> > >> On 8/29/22 00:34, David Gibson wrote: > >> > On Fri, Aug 26

Re: [PATCH for-7.2 v2 10/20] hw/ppc: set machine->fdt in spapr machine

2022-08-31 Thread David Gibson
On Mon, Aug 22, 2022 at 07:30:36AM -0300, Daniel Henrique Barboza wrote: > > > On 8/22/22 00:29, Alexey Kardashevskiy wrote: > > > > > > On 22/08/2022 13:05, David Gibson wrote: > > > On Fri, Aug 19, 2022 at 06:42:34AM -0300, Daniel Henrique Barboza wrote:

Re: [PATCH for-7.2 v4 15/21] qmp/hmp, device_tree.c: introduce 'info fdt' command

2022-08-29 Thread David Gibson
On Mon, Aug 29, 2022 at 07:00:55PM -0300, Daniel Henrique Barboza wrote: > > > On 8/29/22 00:34, David Gibson wrote: > > On Fri, Aug 26, 2022 at 11:11:44AM -0300, Daniel Henrique Barboza wrote: > > > Reading the FDT requires that the user saves the fdt_blob and then use

Re: [PATCH for-7.2 v4 15/21] qmp/hmp, device_tree.c: introduce 'info fdt' command

2022-08-28 Thread David Gibson
void *fdt = current_machine->fdt; > +int padding = depth * 4; > +int property = 0; > +int prop_size; > + > +g_string_append_printf(buf, "%*s%s {\n", padding, "", > + fdt_get_name(fdt, nod

Re: [PATCH for-7.2 v4 10/21] hw/ppc: set machine->fdt in spapr machine

2022-08-28 Thread David Gibson
dt property / dumpdtb etc. as describing specifically the boot time DT before guest firmware or OS does any further mangling of it. That's effectively what it means for all the other embedded cases, though in those cases the firmware usually doesn't need to do further modifications, unlike a

Re: [PATCH for-7.2 v2 10/20] hw/ppc: set machine->fdt in spapr machine

2022-08-21 Thread David Gibson
I suspect what Alexey was suggesting though, was merely to make ms::fdt accessible as a single bytestring property on the machine QOM object. Effectively it's just "dumpdtb" but as a property get. I'm not 100% certain if QOM can safely repre

Re: [PATCH for-7.2 v2 10/20] hw/ppc: set machine->fdt in spapr machine

2022-08-18 Thread David Gibson
uot; etc. obviously have additional funtionality in formatting the contents more helpfully. > Another thing is that on every HMP dump I'd probably rebuild the entire FDT > for the reasons David explained. Thanks, This would require per-machine hooks, however. -- David Gibson

Re: [PATCH for-7.2 v2 15/20] qmp/hmp, device_tree.c: introduce 'info fdt' command

2022-08-17 Thread David Gibson
On Mon, Aug 15, 2022 at 07:48:14PM -0300, Daniel Henrique Barboza wrote: > > > On 8/8/22 01:21, David Gibson wrote: > > On Fri, Aug 05, 2022 at 06:39:43AM -0300, Daniel Henrique Barboza wrote: > > > Reading the FDT requires that the user saves the fdt_blob and then use

Re: [PATCH 2/2] hw/mips/boston: Pack fdt in fdt filter

2022-08-17 Thread David Gibson
1, ram_high_sz); > >> +fdt_pack(fdt); > >> fdt = g_realloc(fdt, fdt_totalsize(fdt)); > >> qemu_fdt_dumpdtb(fdt, fdt_sz); > >> > > > > Why not pack by default in qemu_fdt_dumpdtb()? > > qemu_fdt_dumpdtb() is exp

Re: [PATCH for-7.2 v3 20/20] hmp, device_tree.c: add 'info fdt ' support

2022-08-17 Thread David Gibson
dt) { > error_setg(errp, "Unable to find the machine FDT"); > return NULL; > } > > -node = fdt_path_offset(current_machine->fdt, nodepath); > +node = fdt_path_offset(fdt, nodepath); > if (node < 0) { > error_setg(errp, "n

Re: [RFC PATCH 01/13] target/ppc: define PPC_INTERRUPT_* values directly

2022-08-17 Thread David Gibson
t; directly like that to save some clutter. No functional change intended. > > Signed-off-by: Matheus Ferst Good idea. Reviewed-by: David Gibson > --- > hw/ppc/ppc.c | 10 +++--- > hw/ppc/trace-events | 2 +- > target/ppc/cpu.h | 40 +++-

Re: [PATCH for-7.2 v3 16/20] device_tree.c: support string array prop in fdt_format_node()

2022-08-17 Thread David Gibson
buf, int node, int depth) > { > const struct fdt_property *prop = NULL; > @@ -681,7 +738,12 @@ static void fdt_format_node(GString *buf, int node, int > depth) > prop = fdt_get_property_by_offset(fdt, property, &prop_size); > propname = fdt_string(fdt, fdt32_to_cpu(prop->nameoff)); > > -g_string_append_printf(buf, "%*s%s;\n", padding, "", propname); > +if (fdt_prop_is_string_array(prop->data, prop_size)) { > +fdt_prop_format_string_array(buf, propname, prop->data, > + prop_size, padding); > +} else { > +g_string_append_printf(buf, "%*s%s;\n", padding, "", propname); > +} > } > > padding -= 4; -- 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 for-7.2 v3 18/20] device_node.c: enable 'info fdt' to print subnodes

2022-08-17 Thread David Gibson
; +} > + > padding -= 4; > g_string_append_printf(buf, "%*s}\n", padding, ""); > } > @@ -821,7 +834,7 @@ HumanReadableText *qemu_fdt_qmp_query_fdt(const char > *nodepath, Error **errp) > return NULL; > } > > -fd

Re: [PATCH for-7.2 v3 10/20] hw/ppc: set machine->fdt in spapr machine

2022-08-17 Thread David Gibson
gt; spapr->fdt_initial_size = spapr->fdt_size; > spapr->fdt_blob = fdt; > > +/* > + * Set the machine->fdt pointer again since we just freed > + * it above (by freeing spapr->fdt_blob). We set this > + * pointer to enable support for 'dumpdtb' and &

Re: [PATCH for-7.2 v2 10/20] hw/ppc: set machine->fdt in spapr machine

2022-08-14 Thread David Gibson
On Fri, Aug 12, 2022 at 07:23:09PM -0300, Daniel Henrique Barboza wrote: > > > On 8/8/22 00:26, David Gibson wrote: > > On Fri, Aug 05, 2022 at 06:39:38AM -0300, Daniel Henrique Barboza wrote: > > > The pSeries machine never bothered with the common machine->fdt >

Re: [PATCH for-7.2 v2 01/20] hw/arm: do not free machine->fdt in arm_load_dtb()

2022-08-14 Thread David Gibson
On Fri, Aug 12, 2022 at 07:03:26PM -0300, Daniel Henrique Barboza wrote: > David, > > On 8/8/22 00:23, David Gibson wrote: > > On Fri, Aug 05, 2022 at 06:39:29AM -0300, Daniel Henrique Barboza wrote: > > > At this moment, arm_load_dtb() can free machine->fdt when > &

Re: [PATCH for-7.2 v2 16/20] device_tree.c: support string props in fdt_format_node()

2022-08-10 Thread David Gibson
On Wed, Aug 10, 2022 at 04:40:18PM -0300, Daniel Henrique Barboza wrote: > > > On 8/8/22 01:36, David Gibson wrote: > > On Fri, Aug 05, 2022 at 06:39:44AM -0300, Daniel Henrique Barboza wrote: > > > To support printing string properties in 'info fdt' we need

Re: [PATCH for-7.2 v2 15/20] qmp/hmp, device_tree.c: introduce 'info fdt' command

2022-08-07 Thread David Gibson
; +propname = fdt_string(fdt, fdt32_to_cpu(prop->nameoff)); > + > +g_string_append_printf(buf, "%*s%s;\n", padding, "", propname); > +} > + > +padding -= 4; > +g_string_append_printf(buf, "%*s}\n", padding, ""); So

Re: [PATCH for-7.2 v2 16/20] device_tree.c: support string props in fdt_format_node()

2022-08-07 Thread David Gibson
s%s = '%s'\n", > + padding, "", propname, prop->data); If you're going for dts like output, I'd suggest going all the way. That means \" instead of \' and a ';' at the end of the line. > +} else { > +g_string_append_printf(buf, "%*s%s;\n", padding, "", propname); > +} > } > > padding -= 4; -- 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 for-7.2 v2 17/20] device_tree.c: support remaining FDT prop types

2022-08-07 Thread David Gibson
adding, "", propname); > +continue; > +} > + > if (fdt_prop_is_string(prop->data, prop_size)) { > g_string_append_printf(buf, "%*s%s = '%s'\n", > padding, "", pro

Re: [PATCH for-7.2 v2 09/20] hw/ppc: set machine->fdt in pnv_reset()

2022-08-07 Thread David Gibson
ry? > > hmmm I think it's possible if we issue a 'system_reset' via the > monitor. Right. I'm not certain about pnv, but on most platforms there's a way to trigger system_reset from the guest side as well. > I'll put a g_free(machine->fdt) before the assignment.

Re: [PATCH for-7.2 v2 01/20] hw/arm: do not free machine->fdt in arm_load_dtb()

2022-08-07 Thread David Gibson
ms->fdt = fdt; > > return size; fdt_pack() could change (reduce) the effective size of the dtb blob, so returning a 'size' value from above rather than the new value of fdt_totalsize(fdt) doesn't see right. I believe some of the other patches in the series hav

Re: [PATCH for-7.2 v2 10/20] hw/ppc: set machine->fdt in spapr machine

2022-08-07 Thread David Gibson
e just freed > + * it above (by freeing spapr->fdt_blob). We set this > + * pointer to enable support for 'dumpdtb' and 'info fdt' > + * HMP commands. > + */ > +MACHINE(spapr)->fdt = fdt; > + > return H_SUCCESS; > } > -- 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 for-7.2 v2 14/20] qmp/hmp, device_tree.c: introduce dumpdtb

2022-08-07 Thread David Gibson
quot;arguments": { "filename": "/tmp/fdt.dtb" } } > +# > +## > +{ 'command': 'dumpdtb', > + 'data': { 'filename': 'str' } } > diff --git a/softmmu/device_tree.c b/softmmu/device_tree.c > index 6c

Re: [PATCH v2] target/ppc/kvm: Skip current and parent directories in kvmppc_find_cpu_dt

2022-07-12 Thread David Gibson
osas Reviewed-by: David Gibson and, I believe, mea culpa. > --- > v2: > - Skip current and parent directories. > > v1: > https://lore.kernel.org/qemu-devel/20220711193743.51456-1-muri...@linux.ibm.com/ > > target/ppc/kvm.c | 6 ++ > 1 file changed, 6 insertio

Re: [RFC PATCH] target/ppc: don't print TB in ppc_cpu_dump_state if it's not initialized

2022-07-12 Thread David Gibson
) > > - " DECR " TARGET_FMT_lu > > + " DECR " TARGET_FMT_lu > > #endif > > - "\n", > > - cpu_ppc_load_tbu(env), cpu_ppc_load_tbl(env) > > + "\n

Re: [PATCH] target/ppc/kvm: Skip ".." directory in kvmppc_find_cpu_dt

2022-07-12 Thread David Gibson
ing problems now, but it would be technically more correct to also skip ".", wouldn't it? > +continue; > +} > + > snprintf(buf, buf_len, "%s%s/clock-frequency", PROC_DEVTREE_CPU, > dirp->d_name); >

Re: [RFC 07/18] vfio: Add base object for VFIOContainer

2022-04-28 Thread David Gibson
On Thu, Apr 14, 2022 at 03:46:59AM -0700, Yi Liu wrote: > Qomify the VFIOContainer object which acts as a base class for a > container. This base class is derived into the legacy VFIO container > and later on, into the new iommufd based container. You certainly need the abstraction, but I'm not su

Re: [PATCH for-7.1 1/1] hw/ppc: check if spapr_drc_index() returns NULL in spapr_nvdimm.c

2022-04-06 Thread David Gibson
{ > +error_report("papr_scm: Could not find nvdimm device with DRC 0x%u", > + state->drcidx); > +return; > +} > + > +s_nvdimm = SPAPR_NVDIMM(drc->dev); > > state->hcall_ret = hcall_ret; > QLIST_REMOVE(state, node); -- 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: [RFC PATCH 1/1] kvm-all.c: hint Valgrind that kvm_get_one_reg() inits memory

2022-04-06 Thread David Gibson
w valgrind to get the benefits. > More generally, how much use is running QEMU with KVM enabled > under valgrind anyway? Valgrind has no way of knowing about > writes to memory that the guest vCPUs do... Those should be limited to the guest memory area though, which as mmap()ed space would a

Re: [RFC PATCH 1/1] kvm-all.c: hint Valgrind that kvm_get_one_reg() inits memory

2022-04-06 Thread David Gibson
e in the > function but it will bring benefit for its other callers. > > This patch uses the memcheck VALGRING_MAKE_MEM_DEFINED() to mark the > 'target' variable as initialized if the ioctl is successful. > > Cc: Paolo Bonzini > Signed-off-by: Daniel Henrique Barboz

Re: [PATCH v2 2/4] target/ppc: init 'lpcr' in kvmppc_enable_cap_large_decr()

2022-03-31 Thread David Gibson
is annotation inside kvm_get_one_reg, so that it > > covers all kvm hosts.  But it's too late to do this for 7.0. > > I wasn't planning on pushing these changes for 7.0 since they aren't fixing > mem > leaks or anything really bad. It's more of a quality of

Re: [PATCH v2 2/4] target/ppc: init 'lpcr' in kvmppc_enable_cap_large_decr()

2022-03-31 Thread David Gibson
On Thu, Mar 31, 2022 at 02:17:42PM -0300, Daniel Henrique Barboza wrote: > > > On 3/30/22 22:25, David Gibson wrote: > > On Wed, Mar 30, 2022 at 09:17:15PM -0300, Daniel Henrique Barboza wrote: > > > 'lpcr' is used as an input of kvm_get_one_reg(). Valgrind do

Re: [RFC PATCH 1/2] spapr: Report correct GTSE support via ov5

2022-03-30 Thread David Gibson
On Mon, Mar 14, 2022 at 07:10:10PM -0300, Fabiano Rosas wrote: > David Gibson writes: > > > On Tue, Mar 08, 2022 at 10:23:59PM -0300, Fabiano Rosas wrote: > >> QEMU reports MMU support to the guest via the ibm,architecture-vec-5 > >> property of the /chosen node.

Re: [PATCH v2 2/4] target/ppc: init 'lpcr' in kvmppc_enable_cap_large_decr()

2022-03-30 Thread David Gibson
t lpcr; > + uint64_t lpcr = 0; > > kvm_get_one_reg(cs, KVM_REG_PPC_LPCR_64, &lpcr); > /* Do we need to modify the LPCR? */ -- 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 v2 1/4] target/ppc: initialize 'val' union in kvm_get_one_spr()

2022-03-30 Thread David Gibson
> ==707578==at 0xB11F08: kvm_get_one_spr (kvm.c:543) > > Initializing 'val' has no impact in the logic and makes Valgrind output > more bearable. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Daniel Henrique Barboza Reviewed-by: David Gibson >

Re: [PATCH v2 1/1] hw/ppc: free env->tb_env in spapr_unrealize_vcpu()

2022-03-29 Thread David Gibson
9B: qdev_realize (qdev.c:333) > ==636935== > > This patch adds a cpu_ppc_tb_free() helper in hw/ppc/ppc.c to allow us > to free the timebase. This leak is then solved by calling > cpu_ppc_tb_free() in spapr_unrealize_vcpu(). > > Fixes: 6f4b5c3ec590 ("spapr: CPU hot unplug s

Re: [PATCH 0/2] ppc: fix vcpu hotunplug leak in spapr_realize_vcpu

2022-03-28 Thread David Gibson
aniel Henrique Barboza (2): > hw/ppc/ppc.c: add cpu_ppc_tb_free() > hw/ppc: free env->tb_env in spapr_unrealize_vcpu() > > hw/ppc/ppc.c| 7 +++ > hw/ppc/spapr_cpu_core.c | 3 +++ > include/hw/ppc/ppc.h| 1 + > 3 files changed, 11 insertions(+) >

Re: [RFC PATCH 1/6] target/ppc: Add support for the Processor Attention instruction

2022-03-25 Thread David Gibson
v->excp_model == POWERPC_EXCP_POWER10) { > > +attn = !!(env->spr[SPR_HID0] & HID0_POWER9_ATTN); > > +} > > The excp_model is not a CPU identifier. This should ideally be a flag > set during init_proc. Something like HID0_ATTN_P8/HID0_ATTN_P9. >

Re: [PATCH for-7.1 2/4] hw/ppc: use qdev to register physical DRC vmstates

2022-03-22 Thread David Gibson
t;unrealize = unrealize_physical; > +dk->vmsd = &vmstate_spapr_drc_physical; > + > drck->dr_entity_sense = physical_entity_sense; > drck->isolate = drc_isolate_physical; > drck->unisolate = drc_unisolate_physical; -- David Gibson| I'

Re: [PATCH for-7.1 0/4] use dc->vmsd with spapr devices vmstate

2022-03-22 Thread David Gibson
d when testing migration scenarios with > hotplug/unplug of devices. Looks good tome. -- 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_!

Re: [PATCH for-7.1 0/9] spapr: add drc->index, remove spapr_drc_index()

2022-03-21 Thread David Gibson
On Mon, Mar 21, 2022 at 04:58:47AM -0300, Daniel Henrique Barboza wrote: > > > On 3/21/22 00:55, David Gibson wrote: > > On Fri, Mar 18, 2022 at 02:33:11PM -0300, Daniel Henrique Barboza wrote: > > > Hi, > > > > > > I decided to make this chang

Re: [PATCH 1/3] spapr: Ignore nested KVM hypercalls when not running TCG

2022-03-21 Thread David Gibson
On Fri, Mar 18, 2022 at 10:41:19AM -0300, Fabiano Rosas wrote: > David Gibson writes: > > > On Thu, Mar 17, 2022 at 02:20:47PM -0300, Fabiano Rosas wrote: > >> It is possible that nested KVM hypercalls reach QEMU while we're > >> running KVM. The spapr virtu

Re: [PATCH for-7.1 0/9] spapr: add drc->index, remove spapr_drc_index()

2022-03-20 Thread David Gibson
| 18 - > hw/ppc/spapr_drc.c | 79 +++--- > hw/ppc/spapr_events.c | 4 +- > hw/ppc/spapr_nvdimm.c | 10 ++--- > hw/ppc/spapr_pci.c | 5 +-- > include/hw/ppc/spapr_drc.h | 2 +- > 6 files changed, 48 insertio

Re: Question about vmstate_register(), dc->vmsd and instance_id

2022-03-19 Thread David Gibson
On Fri, Mar 18, 2022 at 04:51:10PM -0300, Daniel Henrique Barboza wrote: > > > On 3/18/22 00:43, David Gibson wrote: > > On Thu, Mar 17, 2022 at 04:29:14PM +, Dr. David Alan Gilbert wrote: > > > * Peter Maydell (peter.mayd...@linaro.org) wrote: > > > >

Re: [PATCH 3/3] spapr: Move nested KVM hypercalls under a TCG only config.

2022-03-17 Thread David Gibson
rcall(KVMPPC_H_UPDATE_DT, h_update_dt); > - > -spapr_register_hypercall(KVMPPC_H_SET_PARTITION_TABLE, h_set_ptbl); > -spapr_register_hypercall(KVMPPC_H_ENTER_NESTED, h_enter_nested); > -spapr_register_hypercall(KVMPPC_H_TLB_INVALIDATE, h_tlb_invalidate); > -s

Re: Question about vmstate_register(), dc->vmsd and instance_id

2022-03-17 Thread David Gibson
ith the same name, and no bus for them to be named by, then > the instance_id is used to uniquify them. Thanks for the information. I remember deciding at the time that just using vmsd wouldn't work for the DRCs because we needed this fixed index. At the time either qdev_set_legacy_

Re: [PATCH 1/3] spapr: Ignore nested KVM hypercalls when not running TCG

2022-03-17 Thread David Gibson
; +if (!tcg_enabled()) { > +return H_FUNCTION; > +} > + > if (spapr->nested_ptcr == 0) { > return H_NOT_AVAILABLE; > } -- 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 v3 1/4] target/ppc: Fix masked PVR matching

2022-03-12 Thread David Gibson
Class *pcc, uint32_t pvr) > { > -if ((pvr & CPU_POWERPC_POWER_SERVER_MASK) == CPU_POWERPC_POWER10_BASE) { > +uint32_t base = pvr & CPU_POWERPC_POWER_SERVER_MASK; > +uint32_t pcc_base = pcc->pvr & CPU_POWERPC_POWER_SERVER_MASK; > + > +if (base != pcc_ba

  1   2   3   4   5   6   7   8   9   10   >