[PATCH v6 0/4] Add full zoned storage emulation to qcow2 driver

2023-11-26 Thread Sam Li
tefan): * fix zoned_mata allocation size * use bitwise or than addition * fix wp index overflow and locking * cleanups: comments, naming Sam Li (4): docs/qcow2: add the zoned format feature qcow2: add configurations for zoned format extension qcow2: add zoned emulation capability iotests:

[RFC v2 0/7] Add persistence to NVMe ZNS emulation

2023-11-27 Thread Sam Li
=${znsimg},id=nvmezns0,format=qcow2,if=none \ -device nvme-ns,drive=nvmezns0,bus=nvme0,nsid=1,uuid=xxx \ v1->v2: - split [v1 2/5] patch to three (doc, config, block layer API) - adapt qcow2 v6 Sam Li (7): docs/qcow2: add zd_extension_size option to the zoned format feature qcow2: add zd_extens

[RFC v2 2/7] qcow2: add zd_extension configurations to zoned metadata

2023-11-27 Thread Sam Li
Zone descriptor data is host definied data that is associated with each zone. Add zone descriptor extensions to zonedmeta struct. Signed-off-by: Sam Li --- block/qcow2.c| 69 +--- block/qcow2.h| 2 + include/block/block_int

[RFC v2 0/7] Add persistence to NVMe ZNS emulation

2023-11-27 Thread Sam Li
=${znsimg},id=nvmezns0,format=qcow2,if=none \ -device nvme-ns,drive=nvmezns0,bus=nvme0,nsid=1,uuid=xxx \ Sorry, send this one more time due to network problems. v1->v2: - split [v1 2/5] patch to three (doc, config, block layer API) - adapt qcow2 v6 Sam Li (7): docs/qcow2: add zd_extension_s

[RFC v2 1/7] docs/qcow2: add zd_extension_size option to the zoned format feature

2023-11-27 Thread Sam Li
Signed-off-by: Sam Li --- docs/interop/qcow2.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/interop/qcow2.txt b/docs/interop/qcow2.txt index 0f1938f056..458d05371a 100644 --- a/docs/interop/qcow2.txt +++ b/docs/interop/qcow2.txt @@ -428,6 +428,9 @@ The fields of the zoned

[RFC v2 3/7] hw/nvme: use blk_get_*() to access zone info in the block layer

2023-11-27 Thread Sam Li
The zone information is contained in the BlockLimits fileds. Add blk_get_*() functions to access the block layer and update zone info accessing in the NVMe device emulation. Signed-off-by: Sam Li --- block/block-backend.c | 72 +++ hw/nvme/ctrl.c

[RFC v2 5/7] hw/nvme: make the metadata of ZNS emulation persistent

2023-11-27 Thread Sam Li
zone state transition and manage zone resources. Signed-off-by: Sam Li --- block/qcow2.c|3 + hw/nvme/ctrl.c | 1106 +++--- hw/nvme/ns.c | 77 +-- hw/nvme/nvme.h | 85 +-- include/block

[RFC v2 7/7] hw/nvme: make ZDED persistent

2023-11-27 Thread Sam Li
attributes at the following eight bit of zone type bit of write pointers for each zone. The ZDED is stored as part of zoned metadata as write pointers. Signed-off-by: Sam Li --- block/qcow2.c| 45 hw/nvme/ctrl.c | 1 + include/block

[RFC v2 4/7] hw/nvme: add blk_get_zone_extension to access zd_extensions

2023-11-27 Thread Sam Li
Signed-off-by: Sam Li --- block/block-backend.c | 16 hw/nvme/ctrl.c| 20 ++-- hw/nvme/ns.c | 24 hw/nvme/nvme.h| 7 --- include/sysemu/block-backend-io.h | 2

[RFC v2 6/7] hw/nvme: refactor zone append write using block layer APIs

2023-11-27 Thread Sam Li
Signed-off-by: Sam Li --- block/qcow2.c| 2 +- hw/nvme/ctrl.c | 190 --- include/sysemu/dma.h | 3 + system/dma-helpers.c | 17 4 files changed, 162 insertions(+), 50 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index

Re: [RFC v2 0/7] Add persistence to NVMe ZNS emulation

2023-11-30 Thread Sam Li
Markus Armbruster 于2023年11月30日周四 18:11写道: > > Sam Li writes: > > > ZNS emulation follows NVMe ZNS spec but the state of namespace > > zones does not persist accross restarts of QEMU. This patch makes the > > metadata of ZNS emulation persistent by using new block layer

Re: [PATCH v6 2/4] qcow2: add configurations for zoned format extension

2023-12-16 Thread Sam Li
Markus Armbruster 于2023年11月30日周四 09:40写道: > > Sam Li writes: > > > To configure the zoned format feature on the qcow2 driver, it > > requires settings as: the device size, zone model, zone size, > > zone capacity, number of conventional zones, limits on zone > >

Re: [PATCH v6 0/4] Add full zoned storage emulation to qcow2 driver

2023-12-16 Thread Sam Li
d here > bdrv_graph_co_rdlock(); > ^ > 2 errors generated. > Turns out that my gcc 12.0 does not support -Wthread-safety-analysis flag. Need to use --cc=clang to reproduce it. Thanks! Sam

Re: [PATCH 2/2] linux-user: Replace use of lfs64 related functions and macros

2023-10-15 Thread Sam James
Did anything happen with this, or did it get stuck? We just had another user hit it in Gentoo at https://bugs.gentoo.org/915809. It looks like openembedded (obviously given the author) and Alpine have been using this for nearly a year. thanks, sam

Re: [PATCH v2] block/file-posix: fix update_zones_wp() caller

2023-10-16 Thread Sam Li
Sam Li 于2023年8月25日周五 12:06写道: > > When the zoned request fail, it needs to update only the wp of > the target zones for not disrupting the in-flight writes on > these other zones. The wp is updated successfully after the > request completes. > > Fixed the callers with righ

Re: [PATCH v5 2/4] qcow2: add configurations for zoned format extension

2023-11-16 Thread Sam Li
Stefan Hajnoczi 于2023年11月3日周五 11:24写道: > > On Mon, Oct 30, 2023 at 08:18:45PM +0800, Sam Li wrote: > > +typedef struct Qcow2ZoneListEntry { > > +QLIST_ENTRY(Qcow2ZoneListEntry) exp_open_zone_entry; > > +QLIST_ENTRY(Qcow2ZoneListEntry) imp_open_zone_ent

Re: [PATCH v5 2/4] qcow2: add configurations for zoned format extension

2023-11-16 Thread Sam Li
Markus Armbruster 于2023年11月3日周五 17:08写道: > > Eric Blake writes: > > > On Mon, Oct 30, 2023 at 08:18:45PM +0800, Sam Li wrote: > >> To configure the zoned format feature on the qcow2 driver, it > >> requires settings as: the device size, zone model, zone si

Re: [PATCH v5 2/4] qcow2: add configurations for zoned format extension

2023-11-16 Thread Sam Li
Hi Eric, Eric Blake 于2023年10月30日周一 22:53写道: > > On Mon, Oct 30, 2023 at 08:18:45PM +0800, Sam Li wrote: > > To configure the zoned format feature on the qcow2 driver, it > > requires settings as: the device size, zone model, zone size, > > zone capacity, number of conve

Re: [PATCH] file-posix: fix over-writing of returning zone_append offset

2023-10-30 Thread Sam Li
f-by: Naohiro Aota > --- > block/file-posix.c | 16 +++- > 1 file changed, 7 insertions(+), 9 deletions(-) Thanks! Reviewed-by: Sam Li > > diff --git a/block/file-posix.c b/block/file-posix.c > index 50e2b20d5c45..c39209358909 100644 > --- a/block/file-po

[PATCH v5 0/4] Add full zoned storage emulation to qcow2 driver

2023-10-30 Thread Sam Li
ned commands - make zone append change state to full when wp reaches end - add documentation to qcow2 zoned extension header - address review comments (Stefan): * fix zoned_mata allocation size * use bitwise or than addition * fix wp index overflow and locking * cleanups: comments, namin

[PATCH v5 1/4] docs/qcow2: add the zoned format feature

2023-10-30 Thread Sam Li
Add the specs for the zoned format feature of the qcow2 driver. The qcow2 file can be taken as zoned device and passed through by virtio-blk device or NVMe ZNS device to the guest given zoned information. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- docs/system/qemu-block

[PATCH v5 2/4] qcow2: add configurations for zoned format extension

2023-10-30 Thread Sam Li
command like this: $ qemu-img create -f qcow2 test.qcow2 -o size=768M -o zone_size=64M -o zone_capacity=64M -o conventional_zones=0 -o max_append_bytes=4096 -o max_open_zones=0 -o max_active_zones=0 -o zone_model=host-managed Signed-off-by: Sam Li fix config? --- block/qcow2.c

[PATCH v5 4/4] iotests: test the zoned format feature for qcow2 file

2023-10-30 Thread Sam Li
The zoned format feature can be tested by: $ tests/qemu-iotests/check -qcow2 zoned-qcow2 Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- tests/qemu-iotests/tests/zoned-qcow2 | 126 +++ tests/qemu-iotests/tests/zoned-qcow2.out | 118 + 2 files

[PATCH v5 3/4] qcow2: add zoned emulation capability

2023-10-30 Thread Sam Li
corresponding state changing. Zoned devices have a limit on zone resources, which puts constraints on write operations into zones. It is managed by active zone lists following LRU policy. Signed-off-by: Sam Li --- block/qcow2.c| 731 ++- block

Re: [PATCH v5 1/4] docs/qcow2: add the zoned format feature

2023-10-30 Thread Sam Li
Eric Blake 于2023年10月30日周一 22:05写道: > > On Mon, Oct 30, 2023 at 08:18:44PM +0800, Sam Li wrote: > > Add the specs for the zoned format feature of the qcow2 driver. > > The qcow2 file can be taken as zoned device and passed through by > > virtio-blk device or NVMe ZNS d

Re: [PATCH v5 2/4] qcow2: add configurations for zoned format extension

2023-10-30 Thread Sam Li
Hi Eric, Eric Blake 于2023年10月30日周一 22:53写道: > > On Mon, Oct 30, 2023 at 08:18:45PM +0800, Sam Li wrote: > > To configure the zoned format feature on the qcow2 driver, it > > requires settings as: the device size, zone model, zone size, > > zone capacity, number of conve

Re: [PATCH v2] block/file-posix: fix update_zones_wp() caller

2023-10-31 Thread Sam Li
Looks good, thanks! Hanna Czenczek 于2023年10月31日 周二17:24写道: > On 25.08.23 06:05, Sam Li wrote: > > When the zoned request fail, it needs to update only the wp of > the target zones for not disrupting the in-flight writes on > these other zones. The wp is updated successfully afte

Re: NVMe ZNS last zone size

2023-08-23 Thread Sam Li
Klaus Jensen 于2023年8月24日周四 02:53写道: > > On Aug 23 22:58, Sam Li wrote: > > Stefan Hajnoczi 于2023年8月23日周三 22:41写道: > > > > > > On Wed, 23 Aug 2023 at 10:24, Sam Li wrote: > > > > > > > > Hi Stefan, > > > > > > > >

Re: [PATCH 1/5] file-posix: Clear bs->bl.zoned on error

2023-08-24 Thread Sam Li
emory leak in the last error path in > raw_refresh_zoned_limits(). > > Signed-off-by: Hanna Czenczek > --- > block/file-posix.c | 21 - > 1 file changed, 12 insertions(+), 9 deletions(-) Reviewed-by: Sam Li

Re: [PATCH 2/5] file-posix: Check bs->bl.zoned for zone info

2023-08-24 Thread Sam Li
ng other than BLK_Z_NONE, other values and objects > like bs->wps and bs->bl.zone_size must be non-null/zero and valid; if it > is not, we cannot rely on their validity. > > Signed-off-by: Hanna Czenczek > --- > block/file-posix.c | 12 +++- > 1 file changed, 7 insertions(+), 5 deletions(-) Reviewed-by: Sam Li

Re: [PATCH 3/5] file-posix: Fix zone update in I/O error path

2023-08-24 Thread Sam Li
e-posix.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Sam Li

Re: [PATCH 0/5] file-posix: Clean up and fix zoned checks

2023-08-24 Thread Sam Li
s are changing the zone_size to 0 and free wps, It does simplify the code path. Thanks, Sam

Re: [PATCH 4/5] file-posix: Simplify raw_co_prw's 'out' zone code

2023-08-24 Thread Sam Li
Hanna Czenczek 于2023年8月24日周四 23:53写道: > > We duplicate the same condition three times here, pull it out to the top > level. > > Signed-off-by: Hanna Czenczek > --- > block/file-posix.c | 18 +- > 1 file changed, 5 insertions(+), 13 deletions(-) Reviewed-by: Sam Li

[PATCH] block/file-posix: fix update_zones_wp() caller

2023-08-24 Thread Sam Li
: Sam Li --- block/file-posix.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index b16e9c21a1..22559d6c2d 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2522,7 +2522,8 @@ out: } } else { if

Re: [PATCH] block/file-posix: fix update_zones_wp() caller

2023-08-24 Thread Sam Li
Damien Le Moal 于2023年8月25日周五 07:49写道: > > On 8/25/23 02:39, Sam Li wrote: > > When the zoned requests that may change wp fail, it needs to > > update only wps of the zones within the range of the requests > > for not disrupting the other in-flight requests. The wp is

Re: [PATCH] block/file-posix: fix update_zones_wp() caller

2023-08-24 Thread Sam Li
Damien Le Moal 于2023年8月25日周五 11:32写道: > > On 8/25/23 12:05, Sam Li wrote: > > Damien Le Moal 于2023年8月25日周五 07:49写道: > >> > >> On 8/25/23 02:39, Sam Li wrote: > >>> When the zoned requests that may change wp fail, it needs to > >>> update

[PATCH v2] block/file-posix: fix update_zones_wp() caller

2023-08-24 Thread Sam Li
When the zoned request fail, it needs to update only the wp of the target zones for not disrupting the in-flight writes on these other zones. The wp is updated successfully after the request completes. Fixed the callers with right offset and nr_zones. Signed-off-by: Sam Li --- block/file

Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension

2023-08-28 Thread Sam Li
Markus Armbruster 于2023年8月21日周一 21:13写道: > > Sam Li writes: > > > To configure the zoned format feature on the qcow2 driver, it > > requires following arguments: the device size, zoned profile, > > zoned model, zone size, zone capacity, number of conventional > >

Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension

2023-08-28 Thread Sam Li
Stefan Hajnoczi 于2023年8月21日周一 21:31写道: > > On Mon, Aug 14, 2023 at 04:58:00PM +0800, Sam Li wrote: > > diff --git a/block/qcow2.h b/block/qcow2.h > > index f789ce3ae0..3694c8d217 100644 > > --- a/block/qcow2.h > > +++ b/block/qcow2.h > >

Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension

2023-08-28 Thread Sam Li
Damien Le Moal 于2023年8月28日周一 18:13写道: > > On 8/28/23 18:22, Sam Li wrote: > > Stefan Hajnoczi 于2023年8月21日周一 21:31写道: > >> > >> On Mon, Aug 14, 2023 at 04:58:00PM +0800, Sam Li wrote: > >>> diff --git a/block/qcow2.h b/block/qcow2.h > >>>

Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension

2023-08-28 Thread Sam Li
Damien Le Moal 于2023年8月28日周一 18:22写道: > > On 8/28/23 19:18, Sam Li wrote: > > Damien Le Moal 于2023年8月28日周一 18:13写道: > >> > >> On 8/28/23 18:22, Sam Li wrote: > >>> Stefan Hajnoczi 于2023年8月21日周一 21:31写道: > >>>> > >>>> On M

Re: [PATCH v2 3/4] qcow2: add zoned emulation capability

2023-08-28 Thread Sam Li
Stefan Hajnoczi 于2023年8月23日周三 03:48写道: > > On Mon, Aug 14, 2023 at 04:58:01PM +0800, Sam Li wrote: > > By adding zone operations and zoned metadata, the zoned emulation > > capability enables full emulation support of zoned device using > > a qcow2 file. The zoned devic

Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension

2023-08-28 Thread Sam Li
Stefan Hajnoczi 于2023年8月21日周一 21:31写道: > > On Mon, Aug 14, 2023 at 04:58:00PM +0800, Sam Li wrote: > > diff --git a/block/qcow2.h b/block/qcow2.h > > index f789ce3ae0..3694c8d217 100644 > > --- a/block/qcow2.h > > +++ b/block/qcow2.h > >

[PATCH v3 1/4] docs/qcow2: add the zoned format feature

2023-08-28 Thread Sam Li
Add the specs for the zoned format feature of the qcow2 driver. The qcow2 file can be taken as zoned device and passed through by virtio-blk device or NVMe ZNS device to the guest given zoned information. Signed-off-by: Sam Li --- docs/system/qemu-block-drivers.rst.inc | 39

[PATCH v3 2/4] qcow2: add configurations for zoned format extension

2023-08-28 Thread Sam Li
file with zoned format, use command like this: $ qemu-img create -f qcow2 test.qcow2 -o size=768M -o zone_size=64M -o zone_capacity=64M -o nr_conv_zones=0 -o max_append_sectors=512 -o max_open_zones=0 -o max_active_zones=0 -o zone_model=1 Signed-off-by: Sam Li --- block/qcow2.c

[PATCH v3 0/4] Add full zoned storage emulation to qcow2 driver

2023-08-28 Thread Sam Li
cation size * use bitwise or than addition * fix wp index overflow and locking * cleanups: comments, naming Sam Li (4): docs/qcow2: add the zoned format feature qcow2: add configurations for zoned format extension qcow2: add zoned emulation capability iotests: test the zoned format featu

[PATCH v3 3/4] qcow2: add zoned emulation capability

2023-08-28 Thread Sam Li
corresponding state changing. Zoned devices have a limit on zone resources, which puts constraints on write operations into zones. Signed-off-by: Sam Li --- block/qcow2.c | 657 - block/qcow2.h | 2 + block/trace-events | 1

[PATCH v3 4/4] iotests: test the zoned format feature for qcow2 file

2023-08-28 Thread Sam Li
The zoned format feature can be tested by: $ tests/qemu-iotests/check -qcow2 zoned-qcow2 Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- tests/qemu-iotests/tests/zoned-qcow2 | 135 ++ tests/qemu-iotests/tests/zoned-qcow2.out | 140 +++ 2 files

Re: [PATCH v2 3/4] qcow2: add zoned emulation capability

2023-08-28 Thread Sam Li
Damien Le Moal 于2023年8月29日周二 14:06写道: > > On 8/28/23 20:55, Sam Li wrote: > >>> +/* close one implicitly open zones to make it available */ > >>> +for (int i = s->zoned_header.zone_nr_conv; > >>> +i < bs->bl.n

Re: [PATCH v2 3/4] qcow2: add zoned emulation capability

2023-08-29 Thread Sam Li
Damien Le Moal 于2023年8月29日周二 15:14写道: > > On 8/29/23 15:27, Sam Li wrote: > > Damien Le Moal 于2023年8月29日周二 14:06写道: > >> > >> On 8/28/23 20:55, Sam Li wrote: > >>>>> +/* close one implicitly open zones to make it

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 OPAL firmware and to a lesse

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. Th

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

2016-11-21 Thread Sam Bobroff
The two bits 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 --- v3: Made code comments more acc

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 POWERPC_MMU_2_07 >

Re: [Qemu-devel] [PATCH v5 1/1] crypto: add virtio-crypto driver

2016-12-07 Thread Sam Ravnborg
On Mon, Dec 05, 2016 at 03:12:52AM +, Gonglei (Arei) wrote: > I don't think the root cause of those warnings are introduced by > virtio-crypto driver. > > What's your opinion? Sam and David? Root cause here is that arch/sparc/include/asm/topology_64.h references cpu_

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

2016-11-16 Thread Sam Bobroff
er, so any 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 --- hw/net/spapr_llan.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --gi

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

2016-11-20 Thread Sam Bobroff
The two bits 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 --- v2: Re-introduced the old workaro

[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 --- v2: I've factored the script to make it easier to add new files. scripts/update-linux-headers.sh

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

2017-02-22 Thread Sam Bobroff
Legacy guest workaround moved to it'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 Bo

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

2017-02-22 Thread Sam Bobroff
d by 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 --- v2: * FWIW, here's one way of

[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 --- v2: * Added the two new arm headers. scripts/update-linux-headers.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/update-linux-headers.sh b

[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 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 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 --- 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 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 --- hw/ppc/spapr.c | 86 +- 1 file changed, 43 insertions(+

[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 --- v2: * cap_mmu_hash renamed to cap_mmu_hash_v3. target/ppc/kvm.c | 14 ++ target/ppc/kvm_ppc.h | 12 2

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

2017-02-22 Thread Sam Bobroff
_table(), which has been added previously. Signed-off-by: Sam Bobroff --- 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). * Legacy guest work

[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 --- hw/ppc/spapr.c | 15 +-- hw/ppc/spapr_hcall.c| 5 +++-- include/hw/ppc/spapr.h | 1

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

2017-02-22 Thread Sam Bobroff
since some kernel header files have become autogenerated. Signed-off-by: Sam Bobroff --- 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 + include/standard-headers/

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 > >

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

2016-07-20 Thread Sam Bobroff
POWERPC_MMU_64K flag to the POWERPC_MMU_2_06a and POWERPC_MMU_2_07a values, preventing the error. Signed-off-by: Sam Bobroff --- 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 -nographic -vga none -

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 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 --- v2:

[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 --- target/ppc/translate_init.c | 9 + 1 file changed, 9 insertions(+) diff --git a/target/ppc/translate_init.c b/target/ppc

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

2017-01-26 Thread Sam Bobroff
CARCH to ARCH, which corrects the problem. Signed-off-by: Sam Bobroff --- 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 100755 --- a/scripts/

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

2017-01-30 Thread Sam Bobroff
, I've recently encountered a similar problem and I've posted a fix. If you'd like to try it, it's here: https://lists.gnu.org/archive/html/qemu-ppc/2017-01/msg00413.html Cheers, Sam. > > /home/alimon/repos/poky/build-ppc/tmp/work/x86_64-linux/qemu-native/2.8.0-r0/build/pp

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 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 segfaults > >> > i

[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 --- hw/ppc/spapr_ovec.c | 2 +- 1

[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 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 --- hw/ppc/spapr.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/ppc/spapr.c b/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 --- target/ppc/kvm.c | 14 ++ target/ppc/kvm_ppc.h | 12 2 files changed, 26 insertions(+) diff --git a/targe

[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 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 --- hw/ppc/spapr.c | 125

[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 --- 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/asm-arm/kvm.h

[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 --- hw/ppc/spapr.c | 10 +++- 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 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 --- 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 index 1411e470c0..c6a3a638cd

[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. --- hw/pp

[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 --- 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 ++- 1 file changed, 2 insertions

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

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] [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 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

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

2017-03-13 Thread Sam Bobroff
might 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 dele

[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 --- scripts/update-linux-headers.sh | 44 ++--- 1 file changed, 24 insertions(+), 20

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

2017-01-23 Thread Sam Bobroff
removed by "make clean" in the kernel directory.) Does this seem correct? Should I send a patch even though it's a very small change? Cheers, Sam.

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 wrote: > > > Hi QEMU developers, > > > > If I run scripts/update-linux-headers.sh from a clean checkout of QEMU > > and point it at a cle

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

2017-05-21 Thread Sam Bobroff
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

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

2017-08-16 Thread Sam Bobroff
then kexecs to a new kernel and an NMI is received before the new kernel has registered it's handler, won't QEMU cause the guest to jump to the old, now invalid, handler address? Is this worth worrying about? Cheers, Sam.

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 > &

<    2   3   4   5   6   7   8   9   10   >