causes a
> linking failure.
Just curious what is required to make virtio-mem & virtio-pmem compatible with
virtio-mmio?
Maybe late but still:
Reviewed-by: Pankaj Gupta
Thanks,
Pankaj
>
> Cc: David Hildenbrand
> Reported-by: Michael Tokarev
> Signed-off-by: Paolo Bonzini
&g
coverity #1546886
fixes: 9861405a8f ("i386/sev: Invoke launch_updata_data() for SEV class")
Signed-off-by: Pankaj Gupta
---
target/i386/sev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/target/i386/sev.c b/target/i386/sev.c
index 7c9df621de..f18432f58e 10
Pankaj Gupta (3):
i386/sev: fix unreachable code coverity issue
i386/sev: Move SEV_COMMON null check before dereferencing
i386/sev: Return when sev_common is null
target/i386/sev.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
--
2.34.1
coverity #1546885
fixes: 16dcf200dc ("i386/sev: Introduce "sev-common" type to encapsulate common
SEV state")
Signed-off-by: Pankaj Gupta
---
target/i386/sev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/i386/sev.c b/target/i386/sev.c
index f18432f58e..c40
Set 'finish->id_block_en' when block_size read.
coverity #1546887
fixes: 7b34df4426 ("i386/sev: Introduce 'sev-snp-guest' object")
Signed-off-by: Pankaj Gupta
---
target/i386/sev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/target/i38
From: Michael Roth
SNP guests will rely on this bit to determine certain feature support.
Signed-off-by: Michael Roth
Signed-off-by: Pankaj Gupta
---
target/i386/cpu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index bc2dceb647..914bef442c
From: Michael Roth
Add a simple helper to check if the current guest type is SNP. Also have
SNP-enabled imply that SEV-ES is enabled as well, and fix up any places
where the sev_es_enabled() check is expecting a pure/non-SNP guest.
Signed-off-by: Michael Roth
Signed-off-by: Pankaj Gupta
Co-developed-by: Michael Roth
Signed-off-by: Michael Roth
Signed-off-by: Pankaj Gupta
---
linux-headers/asm-loongarch/bitsperlong.h | 23 ++
linux-headers/asm-loongarch/kvm.h | 4 ++
linux-headers/asm-loongarch/mman.h| 9
linux-headers/asm-riscv/kvm.h
junction with -bios
i386/kvm: Add KVM_EXIT_HYPERCALL handling for KVM_HC_MAP_GPA_RANGE
i386/sev: Enable KVM_HC_MAP_GPA_RANGE hcall for SNP guests
Pankaj Gupta (9):
i386/sev: Replace error_report with error_setg
linux-headers: Update to current kvm/next
i386/sev: Move sev_launch_update to
accordingly for
sev-guest vs. sev-snp-guest objects and add handling for SNP.
Signed-off-by: Pankaj Gupta
---
target/i386/sev.c | 21 ++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/target/i386/sev.c b/target/i386/sev.c
index 458ff5040d..8ca486f5d2 100644
--- a
From: Michael Roth
For SEV-SNP guests, launch measurement is queried from within the guest
during attestation, so don't attempt to return it as part of
query-sev-launch-measure.
Signed-off-by: Michael Roth
Signed-off-by: Pankaj Gupta
---
target/i386/sev.c | 4 +++-
1 file chang
From: Dov Murik
Move the declaration of PaddedSevHashTable before SevSnpGuest so
we can add a new such field to the latter.
No functional change intended.
Signed-off-by: Dov Murik
Signed-off-by: Michael Roth
Signed-off-by: Pankaj Gupta
---
target/i386/sev.c | 56
Signed-off-by: Pankaj Gupta
---
target/i386/sev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/target/i386/sev.c b/target/i386/sev.c
index d30b68c11e..67ed32e5ea 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -952,13 +952,13 @@ static int sev_kvm_init
for launching
SEV-SNP guest update their handling of query-sev appropriately).
The corresponding HMP command has also been fixed up similarly.
Signed-off-by: Michael Roth
Co-developed-by:Pankaj Gupta
Signed-off-by: Pankaj Gupta
---
qapi/misc-target.json | 72 +++
image.
Signed-off-by: Michael Roth
Signed-off-by: Pankaj Gupta
---
hw/i386/pc_sysfw.c | 47 +-
1 file changed, 30 insertions(+), 17 deletions(-)
diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c
index def77a442d..7f97e62b16 100644
--- a/hw/i386
use the name
'sev_guest'
In order to enable kernel-hashes for SNP, pull it from
SevGuestProperties to its parent SevCommonProperties so
it will be available for both SEV and SNP.
Signed-off-by: Michael Roth
Co-developed-by: Dov Murik
Signed-off-by: Dov Murik
Ack
From: Brijesh Singh
The SNP_LAUNCH_START is called first to create a cryptographic launch
context within the firmware.
Signed-off-by: Brijesh Singh
Signed-off-by: Michael Roth
Co-developed-by: Pankaj Gupta
Signed-off-by: Pankaj Gupta
---
target/i386/sev.c| 39
From: Dov Murik
Extract the building of the kernel hashes table out from
sev_add_kernel_loader_hashes() to allow building it in
other memory areas (for SNP support).
No functional change intended.
Signed-off-by: Dov Murik
Signed-off-by: Michael Roth
Signed-off-by: Pankaj Gupta
---
target
: Michael Roth
Signed-off-by: Pankaj Gupta
---
hw/i386/x86-common.c | 22 --
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c
index f41cb0a6a8..059de65f36 100644
--- a/hw/i386/x86-common.c
+++ b/hw/i386/x86-common.c
@@ -999,10
page is reserved for SEV
launch secrets which are not usable anyway on SNP.
If the user disabled kernel hashes, QEMU pre-validates the kernel hashes
page as a zero page.
Signed-off-by: Dov Murik
Signed-off-by: Michael Roth
Signed-off-by: Pankaj Gupta
---
include/hw/i386/pc.h | 2 ++
target
-by: Michael Roth
Signed-off-by: Pankaj Gupta
---
hw/i386/pc_sysfw.c| 12 +++-
hw/i386/x86-common.c | 2 +-
include/hw/i386/x86.h | 2 +-
target/i386/sev-sysemu-stub.c | 2 +-
target/i386/sev.c | 15 +++
target/i386/sev.h
to retieve the SEV
metadata pointer from the OVMF GUID list.
Signed-off-by: Brijesh Singh
Signed-off-by: Michael Roth
Signed-off-by: Pankaj Gupta
---
hw/i386/pc_sysfw.c | 4
include/hw/i386/pc.h | 26 ++
target/i386/sev.c| 31
Some aspects of the init routine SEV are specific to SEV and not
applicable for SNP guests, so move the SEV-specific bits into
separate class method and retain only the common functionality.
Co-developed-by: Michael Roth
Signed-off-by: Michael Roth
Signed-off-by: Pankaj Gupta
---
target/i386
From: Michael Roth
KVM will forward GHCB page-state change requests to userspace in the
form of KVM_HC_MAP_GPA_RANGE, so make sure the hypercall handling is
enabled for SNP guests.
Signed-off-by: Michael Roth
Signed-off-by: Pankaj Gupta
---
target/i386/sev.c | 5 +
1 file changed, 5
th
Acked-by: Markus Armbruster (for QAPI schema)
Signed-off-by: Michael Roth
Co-developed-by: Pankaj Gupta
Signed-off-by: Pankaj Gupta
---
docs/system/i386/amd-memory-encryption.rst | 70 +-
qapi/qom.json | 57 +
target/i386/sev.c
point so that QEMU don't
continue trying to re-sync vCPU data during guest runtime.
Signed-off-by: Michael Roth
Signed-off-by: Pankaj Gupta
---
target/i386/sev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/i386/sev.c b/target/i386/sev.c
index cd47c195cd..2ca9a86bf3 100644
--
From: Brijesh Singh
OVMF reserves various pages so they can be pre-initialized/validated
prior to launching the guest. Add support for populating these pages
with the expected content.
Signed-off-by: Brijesh Singh
Signed-off-by: Michael Roth
Co-developed-by: Pankaj Gupta
Signed-off-by
Add launch_update_data() in SevCommonStateClass and
invoke as sev_launch_update_data() for SEV object.
Signed-off-by: Pankaj Gupta
---
target/i386/sev.c | 15 +++
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/target/i386/sev.c b/target/i386/sev.c
index c5c703bc8d
Signed-off-by: Pankaj Gupta
---
target/i386/kvm/kvm.c| 55
target/i386/kvm/kvm_i386.h | 1 +
target/i386/kvm/trace-events | 1 +
3 files changed, 57 insertions(+)
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 6c864e4611
From: Xiaoyao Li
Introduce memory_region_init_ram_guest_memfd() to allocate private
guset memfd on the MemoryRegion initialization. It's for the use case of
TDVF, which must be private on TDX case.
Signed-off-by: Xiaoyao Li
Signed-off-by: Michael Roth
Signed-off-by: Pankaj Gupta
---
in
Signed-off-by: Pankaj Gupta
---
target/i386/sev.c | 164 +-
1 file changed, 162 insertions(+), 2 deletions(-)
diff --git a/target/i386/sev.c b/target/i386/sev.c
index 504f641038..4388ffe867 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -214,6
: Pankaj Gupta
---
target/i386/sev.c | 13 ++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/target/i386/sev.c b/target/i386/sev.c
index 79eb21c7d0..3bdb88f2ed 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -69,6 +69,8 @@ struct SevCommonState {
struct
: Pankaj Gupta
---
target/i386/sev.c | 11 +++
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/target/i386/sev.c b/target/i386/sev.c
index 3bdb88f2ed..c141f4fed4 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -71,6 +71,7 @@ struct SevCommonStateClass
-off-by: Michael Roth
Co-developed-by: Pankaj Gupta
Signed-off-by: Pankaj Gupta
---
target/i386/sev.c| 112 ++-
target/i386/trace-events | 2 +
2 files changed, 113 insertions(+), 1 deletion(-)
diff --git a/target/i386/sev.c b/target/i386/sev.c
index
running existing SNP guest kernels.
Signed-off-by: Michael Roth
[pankaj: Added sev_snp_enabled() check]
Signed-off-by: Pankaj Gupta
---
hw/i386/pc.c | 14 ++
hw/i386/pc_sysfw.c | 13 ++---
2 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/hw/i386/pc.c b
Invoke as sev_snp_launch_update_data() for SNP object.
Signed-off-by: Pankaj Gupta
---
target/i386/sev.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/target/i386/sev.c b/target/i386/sev.c
index 7a0c2ee10f..7d2f67e2f3 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
SNP does not support SMM and requires guest_memfd for
private guest memory, so add SNP specific kvm_init()
functionality in snp_kvm_init() class method.
Signed-off-by: Michael Roth
Co-developed-by: Pankaj Gupta
Signed-off-by: Pankaj Gupta
---
target/i386/sev.c | 23 ++-
1
oryBackend *hostmem = dimm->hostmem;
>
> -error_setg(errp, "'unarmed' property must be off since memdev %s "
> +error_setg(errp, "'unarmed' property must be on since memdev %s "
> "is read-only",
> object_get_canonical_path_component(OBJECT(hostmem)));
> return;
With the suggested minor change.
Reviewed-by: Pankaj Gupta
uot;: false,
> +#"name": "virtio-crypto",
> +#"started": true,
> +#"device-id": 20,
> +#"backend-features": 0,
> +#"start-on-kick": false,
> +#"isr": 1,
> +#"broken": false,
> +#"status": 15,
> +#"num-vqs": 2,
> +#"guest-features": 5100273664,
> +#"host-features": 6325010432,
> +#"use-guest-notifier-mask": true,
> +#"vm-running": true,
> +#"queue-sel": 1,
> +#"disabled": false,
> +#"vhost-started": false,
> +#"use-started": true
> +# }
> +#}
> +#
> +# 2. Poll for the status of virtio-net (vhost-net is active)
> +#
> +# -> { "execute": "x-query-virtio-status",
> +# "arguments": { "path":
> "/machine/peripheral-anon/device[1]/virtio-backend" }
> +#}
> +# <- { "return": {
> +#"device-endian": "little",
> +#"bus-name": "",
> +#"disabled-legacy-check": false,
> +#"name": "virtio-net",
> +#"started": true,
> +#"device-id": 1,
> +#"vhost-dev": {
> +# "n-tmp-sections": 4,
> +# "n-mem-sections": 4,
> +# "max-queues": 1,
> +# "backend-cap": 2,
> +# "log-size": 0,
> +# "backend-features": 0,
> +# "nvqs": 2,
> +# "protocol-features": 0,
> +# "vq-index": 0,
> +# "log-enabled": false,
> +# "acked-features": 5100306432,
> +# "features": 13908344832
> +#},
> +#"backend-features": 6337593319,
> +#"start-on-kick": false,
> +#"isr": 1,
> +#"broken": false,
> +#"status": 15,
> +#"num-vqs": 3,
> +#"guest-features": 5111807911,
> +#"host-features": 6337593319,
> +#"use-guest-notifier-mask": true,
> +#"vm-running": true,
> +#"queue-sel": 2,
> +#"disabled": false,
> +#"vhost-started": true,
> +#"use-started": true
> +# }
> +#}
> +#
> +##
> +
> +{ 'command': 'x-query-virtio-status',
> + 'data': { 'path': 'str' },
> + 'returns': 'VirtioStatus',
> + 'features': [ 'unstable' ] }
Reviewed-by: Pankaj Gupta
[
> +#{
> +#"path": "/machine/peripheral-anon/device[4]/virtio-backend",
> +#"name": "virtio-input"
> +#},
> +#{
> +#"path": "/machine/peripheral/crypto0/virtio-backend",
> +#"name": "virtio-crypto"
> +#},
> +#{
> +#"path": "/machine/peripheral-anon/device[2]/virtio-backend",
> +#"name": "virtio-scsi"
> +#},
> +#{
> +#"path": "/machine/peripheral-anon/device[1]/virtio-backend",
> +#"name": "virtio-net"
> +#},
> +#{
> +#"path": "/machine/peripheral-anon/device[0]/virtio-backend",
> +#"name": "virtio-serial"
> +#}
> +# ]
> +#}
> +#
> +##
> +
> +{ 'command': 'x-query-virtio',
> + 'returns': [ 'VirtioInfo' ],
> + 'features': [ 'unstable' ] }
> diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c
> index 7f103ea..fd00ee2 100644
> --- a/tests/qtest/qmp-cmd-test.c
> +++ b/tests/qtest/qmp-cmd-test.c
> @@ -103,6 +103,7 @@ static bool query_is_ignored(const char *cmd)
> "query-gic-capabilities", /* arm */
> /* Success depends on target-specific build configuration: */
> "query-pci", /* CONFIG_PCI */
> +"x-query-virtio", /* CONFIG_VIRTIO */
> /* Success depends on launching SEV guest */
> "query-sev-launch-measure",
> /* Success depends on Host or Hypervisor SEV support */
Reviewed-by: Pankaj Gupta
gt; b/include/hw/virtio/vhost-vsock-common.h
> index d8b565b..076b7ab 100644
> --- a/include/hw/virtio/vhost-vsock-common.h
> +++ b/include/hw/virtio/vhost-vsock-common.h
> @@ -44,7 +44,7 @@ int vhost_vsock_common_start(VirtIODevice *vdev);
> void vhost_vsock_common_stop(VirtIODevice *vdev);
> int vhost_vsock_common_pre_save(void *opaque);
> int vhost_vsock_common_post_load(void *opaque, int version_id);
> -void vhost_vsock_common_realize(VirtIODevice *vdev, const char *name);
> +void vhost_vsock_common_realize(VirtIODevice *vdev);
> void vhost_vsock_common_unrealize(VirtIODevice *vdev);
> uint64_t vhost_vsock_common_get_features(VirtIODevice *vdev, uint64_t
> features,
> Error **errp);
> diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
> index 2179b75..afff9e1 100644
> --- a/include/hw/virtio/virtio-gpu.h
> +++ b/include/hw/virtio/virtio-gpu.h
> @@ -22,6 +22,7 @@
> #include "sysemu/vhost-user-backend.h"
>
> #include "standard-headers/linux/virtio_gpu.h"
> +#include "standard-headers/linux/virtio_ids.h"
> #include "qom/object.h"
>
> #define TYPE_VIRTIO_GPU_BASE "virtio-gpu-base"
> @@ -37,8 +38,6 @@ OBJECT_DECLARE_SIMPLE_TYPE(VirtIOGPUGL, VIRTIO_GPU_GL)
> #define TYPE_VHOST_USER_GPU "vhost-user-gpu"
> OBJECT_DECLARE_SIMPLE_TYPE(VhostUserGPU, VHOST_USER_GPU)
>
> -#define VIRTIO_ID_GPU 16
> -
> struct virtio_gpu_simple_resource {
> uint32_t resource_id;
> uint32_t width;
> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
> index f095637..2a0be70 100644
> --- a/include/hw/virtio/virtio.h
> +++ b/include/hw/virtio/virtio.h
> @@ -165,8 +165,8 @@ struct VirtioDeviceClass {
> void virtio_instance_init_common(Object *proxy_obj, void *data,
> size_t vdev_size, const char *vdev_name);
>
> -void virtio_init(VirtIODevice *vdev, const char *name,
> - uint16_t device_id, size_t config_size);
> +void virtio_init(VirtIODevice *vdev, uint16_t device_id, size_t config_size);
> +
> void virtio_cleanup(VirtIODevice *vdev);
>
> void virtio_error(VirtIODevice *vdev, const char *fmt, ...) GCC_FMT_ATTR(2,
> 3);
Reviewed-by: Pankaj Gupta
> +ERROR(errp, "Error: could not set REUSEADDR option");
> +goto err_dest_init_bind_addr;
> +}
> for (e = res; e != NULL; e = e->ai_next) {
> inet_ntop(e->ai_family,
> &((struct sockaddr_in *) e->ai_dst_addr)->sin_addr, ip, sizeof
> ip);
Reviewed-by: Pankaj Gupta
> > > > migration/rdma.c | 2 +-
> > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/migration/rdma.c b/migration/rdma.c
> > > > index c7c7a384875b..2e223170d06d 100644
> > > > --- a/migration/rdma.c
> > > > +++ b/migration/rdma.c
> > > > @@ -4238,7 +4238,7 @@ void r
> > > So it can handle more incoming requests.
> > >
> > > Signed-off-by: Jack Wang
> > > ---
> > > migration/rdma.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/migration/rdma.c b/migration/rdma.c
> > > index c7c7a384875b..2e223170d06d 100644
> > > --- a/m
> > > This allow address could be reused to avoid rdma_bind_addr error
> > > out.
> >
> > Seems we are proposing to allow multiple connections on same source ip
> > port pair?
> according to the man page, it's more about the destination side which
> is the incoming side.[1]
By source here I meant
> This allow address could be reused to avoid rdma_bind_addr error
> out.
Seems we are proposing to allow multiple connections on same source ip
port pair?
>
> Signed-off-by: Jack Wang
> ---
> migration/rdma.c | 7 +++
> 1 file changed, 7 insertions(+)
>
> diff --git a/migration/rdma.c b/mig
> So it can handle more incoming requests.
>
> Signed-off-by: Jack Wang
> ---
> migration/rdma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/migration/rdma.c b/migration/rdma.c
> index c7c7a384875b..2e223170d06d 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> > I mean, that would be fundamentally broken, because the fsync() would
> > corrupt the file. So I assume in a sane environment, the dst could only
> > have stale clean pagecache pages. And we'd have to get rid of these to
> > re-read everything from file.
> > >>>
> > >>> In c
> I mean, that would be fundamentally broken, because the fsync() would
> corrupt the file. So I assume in a sane environment, the dst could only
> have stale clean pagecache pages. And we'd have to get rid of these to
> re-read everything from file.
> >>>
> >>> In case of write
> >> I mean, that would be fundamentally broken, because the fsync() would
> >> corrupt the file. So I assume in a sane environment, the dst could only
> >> have stale clean pagecache pages. And we'd have to get rid of these to
> >> re-read everything from file.
> >
> > In case of write back cache
Thank you David for replying!
> > From: Pankaj Gupta >
> >
> > Enable live migration support for virtio-pmem device.
> > Tested this: with live migration on same host.
> >
> > Need suggestion on below points to support virtio-pmem live migration
> > be
zini
> Cc: Michael S. Tsirkin
> Cc: Pankaj Gupta
> Cc: Daniel P. Berrangé
> Cc: Michal Privoznik
> Signed-off-by: David Hildenbrand
> ---
> util/oslib-posix.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/util/oslib-posix.c b/util/oslib-posix.c
> i
From: Pankaj Gupta >
Enable live migration support for virtio-pmem device.
Tested this: with live migration on same host.
Need suggestion on below points to support virtio-pmem live migration
between two separate host systems:
- There is still possibility of stale page cache page at
CESSIBLE_PROP,
> VirtIOMEM,
> -unplugged_inaccessible, ON_OFF_AUTO_OFF),
> +unplugged_inaccessible, ON_OFF_AUTO_AUTO),
> #endif
> DEFINE_PROP_END_OF_LIST(),
> };
With correction in commit message pointed by Michal.
Reviewed-by: Pankaj Gupta
Update nvdimm option value in example command from "-machine pc,nvdimm"
to "-machine pc,nvdimm=on" as former complains with the below error:
"qemu-system-x86_64: -machine pc,nvdimm: Expected '=' after parameter 'nvdimm'"
Reviewed-by: Laur
; Thanks,
> Laurent
>
> >> Update nvdimm option value in example command from "-machine pc,nvdimm"
> >> to "-machine pc,nvdimm=on" as former complains with the below error:
> >>
> >> "qemu-system-x86_64: -machine pc,nvdimm: Expe
ping
> Update nvdimm option value in example command from "-machine pc,nvdimm"
> to "-machine pc,nvdimm=on" as former complains with the below error:
>
> "qemu-system-x86_64: -machine pc,nvdimm: Expected '=' after parameter
> 'nvdimm'
gt; DEFINE_CCW_MACHINE(6_1, "6.1", false);
>
> diff --git a/include/hw/boards.h b/include/hw/boards.h
> index 463a5514f9..2ae039b74f 100644
> --- a/include/hw/boards.h
> +++ b/include/hw/boards.h
> @@ -247,6 +247,7 @@ struct MachineClass {
> bool nvdimm_supported;
> bool numa_mem_supported;
> bool auto_enable_numa;
> +bool smp_prefer_sockets;
> const char *default_ram_id;
>
> HotplugHandler *(*get_hotplug_handler)(MachineState *machine,
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 06f819177e..451d2cd817 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -238,7 +238,8 @@ SRST
> Historically preference was given to the coarsest topology parameters
> when computing missing values (ie sockets preferred over cores, which
> were preferred over threads), however, this behaviour is considered
> -liable to change.
> +liable to change. Prior to 6.2 the preference was sockets over cores
> +over threads. Since 6.2 the preference is cores over sockets over
> threads.
> ERST
>
> DEF("numa", HAS_ARG, QEMU_OPTION_numa,
> --
Reviewed-by: Pankaj Gupta
> On 2021/8/14 0:30, Pankaj Gupta wrote:
> >> In the real SMP hardware topology world, it's much more likely that
> >> we have high cores-per-socket counts and few sockets totally. While
> >> the current preference of sockets over cores in smp parsing results
> In the real SMP hardware topology world, it's much more likely that
> we have high cores-per-socket counts and few sockets totally. While
> the current preference of sockets over cores in smp parsing results
> in a virtual cpu topology with low cores-per-sockets counts and a
> large number of soc
> >> In the real SMP hardware topology world, it's much more likely that
> >> we have high cores-per-socket counts and few sockets totally. While
> >> the current preference of sockets over cores in smp parsing results
> >> in a virtual cpu topology with low cores-per-sockets counts and a
> >> larg
ED | RAM_RESIZEABLE | RAM_PREALLOC |
>RAM_NORESERVE)) == 0);
> assert(!host ^ (ram_flags & RAM_PREALLOC));
> --
> 2.31.1
Reviewed-by: Pankaj Gupta
>
>
dies * sockets);
> -threads = threads > 0 ? threads : 1;
> -} else if (sockets * dies * cores * threads < cpus) {
> +threads = maxcpus / (sockets * dies * cores);
> +}
> +
> +if (sockets * dies * cores * threads < cpus) {
> error_setg(errp, "cpu topology: "
> "sockets (%u) * dies (%u) * cores (%u) * threads (%u) < "
> "smp_cpus (%u)",
> @@ -750,8 +752,6 @@ static void pc_smp_parse(MachineState *ms,
> SMPConfiguration *config, Error **err
> return;
> }
>
> -maxcpus = maxcpus > 0 ? maxcpus : cpus;
> -
> if (maxcpus < cpus) {
> error_setg(errp, "maxcpus must be equal to or greater than smp");
> return;
Reviewed-by: Pankaj Gupta
rror_setg(errp, "Invalid CPU topology deprecated: "
> +error_setg(errp, "Invalid CPU topology: "
> + "maxcpus must be equal to or greater than smp: "
> "sockets (%u) * dies (%u) * cores (%u) * threads (%u) "
> - "!= maxcpus (%u)",
> - sockets, dies, cores, threads,
> - maxcpus);
> + "== maxcpus (%u) < smp_cpus (%u)",
> + sockets, dies, cores, threads, maxcpus, cpus);
> return;
> }
>
Reviewed-by: Pankaj Gupta
goto out_free;
> +qapi_free_SMPConfiguration(config);
> }
> -
> -/* sanity-check smp_cpus and max_cpus against mc */
> -if (ms->smp.cpus < mc->min_cpus) {
> -error_setg(errp, "Invalid SMP CPUs %d. The min CPUs "
> - "supported by machine '%s' is %d",
> - ms->smp.cpus,
> - mc->name, mc->min_cpus);
> -} else if (ms->smp.max_cpus > mc->max_cpus) {
> -error_setg(errp, "Invalid SMP CPUs %d. The max CPUs "
> - "supported by machine '%s' is %d",
> - ms->smp.max_cpus,
> - mc->name, mc->max_cpus);
> -}
> -
> -out_free:
> -qapi_free_SMPConfiguration(config);
> }
>
> static void machine_class_init(ObjectClass *oc, void *data)
Looks good.
Reviewed-by: Pankaj Gupta
> In the real SMP hardware topology world, it's much more likely that
> we have high cores-per-socket counts and few sockets totally. While
> the current preference of sockets over cores in smp parsing results
> in a virtual cpu topology with low cores-per-sockets counts and a
> large number of soc
return false;
> +}
> touch_fn = do_madv_populate_write_pages;
> } else {
> touch_fn = do_touch_pages;
Reviewed-by: Pankaj Gupta
t; @@ -546,7 +554,7 @@ static bool touch_all_pages(char *area, size_t hpagesize,
> size_t numpages,
> {
> static gsize initialized = 0;
> MemsetContext context = {
> -.num_threads = get_memset_num_threads(smp_cpus),
> +.num_threads = get_memset_num_threads(hpagesize, numpages, smp_cpus),
> };
> size_t numpages_per_thread, leftover;
> void *(*touch_fn)(void *);
Reviewed-by: Pankaj Gupta
'%s' is %d",
> - current_machine->smp.max_cpus,
> + ms->smp.max_cpus,
> mc->name, mc->max_cpus);
> }
>
Reviewed-by: Pankaj Gupta
Update nvdimm option value in example command from "-machine pc,nvdimm"
to "-machine pc,nvdimm=on" as former complains with the below error:
"qemu-system-x86_64: -machine pc,nvdimm: Expected '=' after parameter 'nvdimm'"
Signed-off-by: Pankaj Gup
> > On Mon, Jul 19 2021, Yanan Wang wrote:
> >
> >> Hi,
> >>
> >> This is v2 of the series [1] that I have posted to introduce some smp
> >> parsing
> >> fixes and improvement, much more work has been processed compared to RFC
> >> v1.
> >>
> >> [1] https://lists.gnu.org/archive/html/qemu-devel/
te *x86ms = X86_MACHINE(machine);
> -Error *local_err = NULL;
>
> microvm_memory_init(mms);
>
> x86_cpus_init(x86ms, CPU_VERSION_LATEST);
> -if (local_err) {
> -error_report_err(local_err);
> - exit(1);
> -}
>
> microvm_devices_init(mms);
> }
> --
> 2.31.1
Reviewed-by: Pankaj Gupta
opts_list->implied_opt_name, &help,
> &error_fatal);
> if (help) {
> qemu_opts_print_help(opts_list, true);
> - return;
> +exit(0);
> }
> opts = qdict_new();
> qdict_put(opts, propname, prop);
> --
Reviewed-by: Pankaj Gupta
_process_incoming(QIOChannel *ioc,
> Error **errp)
> return;
> }
>
> -if (migration_incoming_setup(f, &local_err)) {
> -error_propagate(errp, local_err);
> +if (!migration_incoming_setup(f, errp)) {
> return;
> }
>
Reviewed-by: Pankaj Gupta
> >
> > Cc: Paolo Bonzini
> > Cc: "Michael S. Tsirkin"
> > Cc: Igor Mammedov
> > Cc: Eduardo Habkost
> > Cc: Dr. David Alan Gilbert
> > Cc: Marek Kedzierski
> > Cc: Pankaj Gupta
> >
> > David Hildenbran
ichael S. Tsirkin"
> Cc: Igor Mammedov
> Cc: Eduardo Habkost
> Cc: Dr. David Alan Gilbert
> Cc: Marek Kedzierski
> Cc: Pankaj Gupta
>
> David Hildenbrand (3):
> util/oslib-posix: Support MADV_POPULATE_WRITE for os_mem_prealloc()
> util/oslib-posix: Introduce and
-DEFINE_CCW_MACHINE(6_1, "6.1", true);
> +DEFINE_CCW_MACHINE(6_1, "6.1", false);
>
> static void ccw_machine_6_0_instance_options(MachineState *machine)
> {
> diff --git a/include/hw/boards.h b/include/hw/boards.h
> index b6161cee88..2832f0f8aa 100644
> --- a/include/hw/boards.h
> +++ b/include/hw/boards.h
> @@ -354,6 +354,9 @@ struct MachineState {
> } \
> type_init(machine_initfn##_register_types)
>
> +extern GlobalProperty hw_compat_6_1[];
> +extern const size_t hw_compat_6_1_len;
> +
> extern GlobalProperty hw_compat_6_0[];
> extern const size_t hw_compat_6_0_len;
>
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index 88dffe7517..97b4ab79b5 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -196,6 +196,9 @@ void pc_system_parse_ovmf_flash(uint8_t *flash_ptr,
> size_t flash_size);
> void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,
> const CPUArchIdList *apic_ids, GArray *entry);
>
> +extern GlobalProperty pc_compat_6_1[];
> +extern const size_t pc_compat_6_1_len;
> +
> extern GlobalProperty pc_compat_6_0[];
> extern const size_t pc_compat_6_0_len;
>
> --
Reviewed-by: Pankaj Gupta
t->raw[i].iov_base,
> pkt->raw[i].iov_len,
> - DMA_DIRECTION_TO_DEVICE, 0);
> +if (pkt->max_raw_frags > 0) {
> +assert(pkt->raw);
> +for (i = 0; i < pkt->raw_frags; i++) {
> + assert(pkt->raw[i].iov_base);
> +pci_dma_unmap(pkt->pci_dev, pkt->raw[i].iov_base,
> + pkt->raw[i].iov_len, DMA_DIRECTION_TO_DEVICE, 0);
> +}
> }
> pkt->raw_frags = 0;
>
Reviewed-by: Pankaj Gupta
b/softmmu/memory.c
> @@ -1811,6 +1811,12 @@ bool memory_region_is_ram_device(MemoryRegion *mr)
> return mr->ram_device;
> }
>
> +bool memory_region_is_mapped_shared(MemoryRegion *mr)
> +{
> +return memory_access_is_direct(mr, false) &&
> + (mr->ram_block->flags & RAM_SHARED);
> +}
> +
> uint8_t memory_region_get_dirty_log_mask(MemoryRegion *mr)
> {
> uint8_t mask = mr->dirty_log_mask;
Reviewed-by: Pankaj Gupta
quot; \
> -" -numa node,memdev=mem"
> +"share=on -numa node,memdev=mem"
> #define QEMU_CMD_CHR" -chardev socket,id=%s,path=%s%s"
> #define QEMU_CMD_NETDEV " -netdev vhost-user,id=hs0,chardev=%s,vhostforce"
>
Reviewed-by: Pankaj Gupta
Simulate an SMP system with n CPUs. On the PC target, up to 255 CPUs
> are supported. On Sparc32 target, Linux limits the number of usable
> CPUs to 4. For the PC target, the number of cores per die, the
> --
Reviewed-by: Pankaj Gupta
rs
> +must be specified. Values for any omitted parameters will be computed
> +from those which are given. Historically preference was given to the
> +coarsest topology parameters when computing missing values (ie sockets
> +preferred over cores, which were preferred over threads), however, this
> +behaviour is considered liable to change.
> ERST
>
> DEF("numa", HAS_ARG, QEMU_OPTION_numa,
> --
Reviewed-by: Pankaj Gupta
ation of the host CPUs in use. In a deployment with a
> mixture of host CPU models between machines, if live migration
> --
Reviewed-by: Pankaj Gupta
xcpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]``
> Simulate an SMP system with n CPUs. On the PC target, up to 255 CPUs
> are supported. On Sparc32 target, Linux limits the number of usable
> CPUs to 4. For the PC target, the number of cores per die, the
> --
Reviewed-by: Pankaj Gupta
processors on the machine
> */
> typedef struct CpuTopology {
> unsigned int cpus;
> +unsigned int sockets;
> unsigned int dies;
> unsigned int cores;
> unsigned int threads;
> -unsigned int sockets;
> unsigned int max_cpus;
> } CpuTopology;
Reviewed-by: Pankaj Gupta
O_URING
> -typedef struct LuringState LuringState;
> LuringState *luring_init(Error **errp);
> void luring_cleanup(LuringState *s);
> int coroutine_fn luring_co_submit(BlockDriverState *bs, LuringState *s, int
> fd,
> --
Reviewed-by: Pankaj Gupta
smp
> [cpus=]n[,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]``
> Simulate an SMP system with n CPUs. On the PC target, up to 255 CPUs
> are supported. On Sparc32 target, Linux limits the number of usable
> CPUs to 4. For the PC target, the number of cores per die, the
Looks cleaner. With the nit mentioned by Dan:
Reviewed-by: Pankaj Gupta
more than 31 bit.
>
> Let's use 1ULL instead and make sure we're not shifting by more than 63
> bit by asserting that any bit in container->pgsizes is set.
>
> Fixes: CID 1458134
> Cc: Alex Williamson
> Cc: Eduardo Habkost
> Cc: "Michael S. Tsirkin"
uot; PRIu16 ")",
> + props->node_id,
> numa_info[props->node_id].initiator);
> return;
> }
> numa_info[props->node_id].has_cpu = true;
Reviewed-by: Pankaj Gupta
gion],
> sysmem_info->offsets[region],
> errp);
>
Reviewed-by: Pankaj Gupta
bpmem=disabled
> + --enable-libpmem) libpmem="enabled"
>;;
> - --disable-libpmem) libpmem=enabled
> + --disable-libpmem) libpmem="disabled"
>;;
>--enable-xkbcommon) xkbcommon="enabled"
>;;
Reviewed-by: Pankaj Gupta
struct PostcopyNotifyData {
> enum PostcopyNotifyReason reason;
> Error **errp;
> -};
> +} PostcopyNotifyData;
>
> void postcopy_add_notifier(NotifierWithReturn *nn);
> void postcopy_remove_notifier(NotifierWithReturn *n);
> --
Reviewed-by: Pankaj Gupta
+CC Danpb
> >>> Marc-André, I'd like your opinion for this one, in particular the use of
> >>> g_source_remove().
> >>>
> >>
> >> My opinion isn't really worth much, my review would have a bit more value.
> >>
> >> GSource has indeed some peculiar lifetime management, that I got wrong in
> >> the
> > The proposal that "sync-dax=unsafe" for non-PPC architectures, is a
> > fundamental misrepresentation of how this is supposed to work. Rather
> > than make "sync-dax" a first class citizen of the device-description
> > interface I'm proposing that you make this a separate device-type.
> > This
*chr, bool pretty, Error
> **errp)
> } else {
> qemu_chr_fe_set_handlers(&mon->common.chr, monitor_can_read,
> monitor_qmp_read, monitor_qmp_event,
> - NULL, &mon->common, NULL, true);
> + monitor_qmp_change, &mon->common, NULL,
> true);
> monitor_list_append(&mon->common);
> }
> }
Overall patch looks good to me.
Reviewed-by: Pankaj Gupta
-47,7 +47,7 @@ static int worker_cb(void *opaque)
> err = 1;
> }
>
> -virtio_stw_p(req_data->vdev, &req_data->resp.ret, err);
> +virtio_stl_p(req_data->vdev, &req_data->resp.ret, err);
>
> return 0;
> }
Thanks!
Reviewed-by: Pankaj Gupta
rote:
>
>
>
> > -Original Message-----
> > From: Pankaj Gupta
> > Sent: Monday, March 1, 2021 2:22 PM
> > To: Moger, Babu
> > Cc: Pankaj Gupta ; Paolo Bonzini
> > ; richard.hender...@linaro.org; Eduardo Habkost
> > ; Qemu Developers
> > Subject: Re:
> Pankaj, Sure.
>
> I will add signoff from you if it is fine with you.
Sure. Thank you!
>
> Signed-off-by: Pankaj Gupta
Please use: Pankaj Gupta
Thanks,
Pankaj
> > Hi Babu,
> >
> > I tried to test below patch for AMD EPYC Rome CPU and I got below error [1]:
> >
> > Also, I noticed SSBD CPU flag for guest was still available even without
> > this
> > patch, I noticed that for the guest, AMD_SSBD not got set.
> >
> > Guest:
> > 0x8008 0x00: eax=0x3
Hi Babu,
I tried to test below patch for AMD EPYC Rome CPU and I got below error [1]:
Also, I noticed SSBD CPU flag for guest was still available even
without this patch,
I noticed that for the guest, AMD_SSBD not got set.
Guest:
0x8008 0x00: eax=0x3028 ebx=0x9205 ecx=0x2003 edx=
1 - 100 of 570 matches
Mail list logo