- Mar 02, 2018
-
-
Markus Armbruster authored
Move qapi-schema.json to qapi/, so it's next to its modules, and all files get generated to qapi/, not just the ones generated for modules. Consistently name the generated files qapi-MODULE.EXT: qmp-commands.[ch] become qapi-commands.[ch], qapi-event.[ch] become qapi-events.[ch], and qmp-introspect.[ch] become qapi-introspect.[ch]. This gets rid of the temporary hacks in scripts/qapi/commands.py, scripts/qapi/events.py, and scripts/qapi/common.py. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20180211093607.27351-28-armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Michael Roth <mdroth@linux.vnet.ibm.com> [eblake: Fix trailing dot in tpm.c, undo temporary hack for OSX toolchain] Signed-off-by:
Eric Blake <eblake@redhat.com>
-
Markus Armbruster authored
In my "build everything" tree, a change to the types in qapi-schema.json triggers a recompile of about 4800 out of 5100 objects. The previous commit split up qmp-commands.h, qmp-event.h, qmp-visit.h, qapi-types.h. Each of these headers still includes all its shards. Reduce compile time by including just the shards we actually need. To illustrate the benefits: adding a type to qapi/migration.json now recompiles some 2300 instead of 4800 objects. The next commit will improve it further. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20180211093607.27351-24-armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> [eblake: rebase to master] Signed-off-by:
Eric Blake <eblake@redhat.com>
-
- Mar 01, 2018
-
-
Gonglei (Arei) authored
Signed-off-by:
Gonglei <arei.gonglei@huawei.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Gonglei (Arei) authored
Introduce two vhost-user meassges: VHOST_USER_CREATE_CRYPTO_SESSION and VHOST_USER_CLOSE_CRYPTO_SESSION. At this point, the QEMU side support crypto operation in cryptodev host-user backend. Signed-off-by:
Gonglei <arei.gonglei@huawei.com> Signed-off-by:
Longpeng(Mike) <longpeng2@huawei.com> Signed-off-by:
Jay Zhou <jianjay.zhou@huawei.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Gonglei (Arei) authored
Impliment the vhost-crypto's funtions, such as startup, stop and notification etc. Introduce an enum QCryptoCryptoDevBackendOptionsType in order to identify the cryptodev vhost backend is vhost-user or vhost-kernel-module (If exist). At this point, the cryptdoev-vhost-user works. Signed-off-by:
Gonglei <arei.gonglei@huawei.com> Signed-off-by:
Longpeng(Mike) <longpeng2@huawei.com> Signed-off-by:
Jay Zhou <jianjay.zhou@huawei.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Gonglei (Arei) authored
Usage: -chardev socket,id=charcrypto0,path=/path/to/your/socket -object cryptodev-vhost-user,id=cryptodev0,chardev=charcrypto0 -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 Signed-off-by:
Gonglei <arei.gonglei@huawei.com> Signed-off-by:
Longpeng(Mike) <longpeng2@huawei.com> Signed-off-by:
Jay Zhou <jianjay.zhou@huawei.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
- Feb 19, 2018
-
-
Marcel Apfelbaum authored
Currently only file backed memory backend can be created with a "share" flag in order to allow sharing guest RAM with other processes in the host. Add the "share" flag also to RAM Memory Backend in order to allow remapping parts of the guest RAM to different host virtual addresses. This is needed by the RDMA devices in order to remap non-contiguous QEMU virtual addresses to a contiguous virtual address range. Moved the "share" flag to the Host Memory base class, modified phys_mem_alloc to include the new parameter and a new interface memory_region_init_ram_shared_nomigrate. There are no functional changes if the new flag is not used. Reviewed-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Marcel Apfelbaum <marcel@redhat.com>
-
- Feb 09, 2018
-
-
Markus Armbruster authored
Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-6-armbru@redhat.com>
-
Markus Armbruster authored
Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-4-armbru@redhat.com>
-
- Feb 07, 2018
-
-
Marc-André Lureau authored
Add a new memory backend, similar to hostmem-file, except that it doesn't need to create files. It also enforces memory sealing. This backend is mainly useful for sharing the memory with other processes. Note that Linux supports transparent huge-pages of shmem/memfd memory since 4.8. It is relatively easier to set up THP than a dedicate hugepage mount point by using "madvise" in /sys/kernel/mm/transparent_hugepage/shmem_enabled. Since 4.14, memfd allows to set hugetlb requirement explicitly. Pending for merge in 4.16 is memfd sealing support for hugetlb backed memory. Usage: -object memory-backend-memfd,id=mem1,size=1G Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20180201132757.23063-5-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jan 29, 2018
-
-
Marc-André Lureau authored
Use an Error** for request to let the caller handle error reporting. This will also allow to inform the frontend of a backend error. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
Marc-André Lureau authored
The TPM backend uses a GThreadPool to handle IO in a seperate thread. However, GThreadPool isn't integrated with Qemu main loops, making it unnecessarily complicated to deal with. Qemu has a AIO threadpool, that is better integrated with loops and various IO functions, provides completion BH by default etc. Remove the only user of GThreadPool from qemu, use AIO threadpool. Note that the backend: - no longer accepts queing multiple requests (unneeded so far) - increase ref to itself when handling a command, for extra safety - tpm_backend_thread_end() is renamed tpm_backend_finish_sync() and will wait for completion of BH (request_completed), which will help migration handling. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
- Jan 19, 2018
-
-
Haozhong Zhang authored
When mmap(2) the backend files, QEMU uses the host page size (getpagesize(2)) by default as the alignment of mapping address. However, some backends may require alignments different than the page size. For example, mmap a device DAX (e.g., /dev/dax0.0) on Linux kernel 4.13 to an address, which is 4K-aligned but not 2M-aligned, fails with a kernel message like [617494.969768] dax dax0.0: qemu-system-x86: dax_mmap: fail, unaligned vma (0x7fa37c579000 - 0x7fa43c579000, 0x1fffff) Because there is no common approach to get such alignment requirement, we add the 'align' option to 'memory-backend-file', so that users or management utils, which have enough knowledge about the backend, can specify a proper alignment via this option. Signed-off-by:
Haozhong Zhang <haozhong.zhang@intel.com> Message-Id: <20171211072806.2812-2-haozhong.zhang@intel.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> [ehabkost: fixed typo, fixed error_setg() format string] Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com>
-
- Dec 15, 2017
-
-
Stefan Berger authored
Convert the tpm_emulator backend to get the current buffer size of the external device and set it to the buffer size that the frontend (TIS) requests. Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com>
-
Stefan Berger authored
Rather than setting the size of the TPM buffer in the front-end, query the backend for the size of the buffer. In this patch we just move the hard-coded buffer size of 4096 to the backends. Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com>
-
Marc-André Lureau authored
QEMU code doesn't generally have assert() for mandatory callbacks/function pointers, probably because the crash is pretty obvious. Document the methods instead of going into the code. Make get_tpm_options() mandatory to implement (since all backend implementation have it). Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
Marc-André Lureau authored
Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
Marc-André Lureau authored
No need to store the mode in the backend, or to let the frontend set it itself. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
Marc-André Lureau authored
Backend can give more accurate error description, and lift out the job from the frontend. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
Marc-André Lureau authored
Lift from the backend implementation the responsability to call the request_completed() callback outside of thread context. This also simplify frontend/interface work, as they no longer need to care whether the callback is called from a different thread. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
Marc-André Lureau authored
Store the TPM interface, the actual object may be different from TPMState. Keep a reference on the interface, and check the backend wasn't already initialized. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
Marc-André Lureau authored
This is a better location than hw/tpm, since we are going to use the interface from outside hw/tpm. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
- Oct 19, 2017
-
-
Marc-André Lureau authored
Simplify the TPM backend setup, move callback to TPM interface. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
Marc-André Lureau authored
This will simplify backend / interface objects relationship, so the frontend interface will simply have to implement the TPM QOM interface. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
Marc-André Lureau authored
This simplifies a bit locality handling, and argument passing, and could pave the way to queuing requests (if that makes sense). Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
Marc-André Lureau authored
There is only handling of request so far in both backends. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
Marc-André Lureau authored
No backend use it. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
Marc-André Lureau authored
Use TPMBackendClass to hold class methods/fields. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
- Oct 13, 2017
-
-
Amarnath Valluri authored
buffer reallocation is very unlikely to be backend specific. Hence move inside the tis. Signed-off-by:
Amarnath Valluri <amarnath.valluri@intel.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
Amarnath Valluri authored
TPM configuration options are backend implementation details and shall not be part of base TPMBackend object, and these shall not be accessed directly outside of the class, hence added a new interface method, get_tpm_options() to TPMDriverOps., which shall be implemented by the derived classes to return configured tpm options. A new tpm backend api - tpm_backend_query_tpm() which uses _get_tpm_options() to prepare TpmInfo. Signed-off-by:
Amarnath Valluri <amarnath.valluri@intel.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
Amarnath Valluri authored
This allows backend implementations left optional interface methods. For mandatory methods assertion checks added. Took the opportunity to remove unused methods: - tpm_backend_get_desc() - TPMDriverOps->handle_startup_error Signed-off-by:
Amarnath Valluri <amarnath.valluri@intel.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan <Berger<stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
Amarnath Valluri authored
Initialize and free TPMBackend data members in it's own instance_init() and instance_finalize methods. Took the opportunity to remove unneeded destroy() method from TpmDriverOps interface as TPMBackend is a Qemu Object, we can use object_unref() inplace of tpm_backend_destroy() to free the backend object, hence removed destroy() from TPMDriverOps interface. Signed-off-by:
Amarnath Valluri <amarnath.valluri@intel.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
Amarnath Valluri authored
Move thread handling inside TPMBackend, this way backend implementations need not to maintain their own thread life cycle, instead they needs to implement 'handle_request()' class method that always been called from a thread. This change made tpm_backend_int.h kind of useless, hence removed it. Signed-off-by:
Amarnath Valluri <amarnath.valluri@intel.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by:
Stefan Berger <stefanb@linux.vnet.ibm.com>
-
- Sep 19, 2017
-
-
Eduardo Habkost authored
The new option can be used to indicate that the file contents can be destroyed and don't need to be flushed to disk when QEMU exits or when the memory backend object is removed. Internally, it will trigger a madvise(MADV_REMOVE) call when the memory backend is removed. Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20170824192315.5897-4-ehabkost@redhat.com> [ehabkost: fixup: improved documentation] Reviewed-by:
Daniel P. Berrange <berrange@redhat.com> Tested-by:
Zack Cornelius <zack.cornelius@kove.net> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com>
-
- Sep 04, 2017
-
-
Marc-André Lureau authored
Currently, a FOO_lookup is an array of strings terminated by a NULL sentinel. A future patch will generate enums with "holes". NULL-termination will cease to work then. To prepare for that, store the length in the FOO_lookup by wrapping it in a struct and adding a member for the length. The sentinel will be dropped next. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170822132255.23945-13-marcandre.lureau@redhat.com> [Basically redone] Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <1503564371-26090-16-git-send-email-armbru@redhat.com> [Rebased]
-
Markus Armbruster authored
Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <1503564371-26090-14-git-send-email-armbru@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com>
-
- Sep 01, 2017
-
-
Eduardo Habkost authored
The errp argument is ignored by all implementations of the method, and user_creatable_del() would break if any implementation set an error (because it calls error_setg(errp) if the function returns false). Remove the unused parameter. Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20170829220337.23427-1-ehabkost@redhat.com> Reviewed-by:
Gonglei <arei.gonglei@huawei.com> Reviewed-by:
Igor Mammedov <imammedo@redhat.com> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com>
-
- Jul 14, 2017
-
-
Peter Maydell authored
Rename memory_region_init_ram() to memory_region_init_ram_nomigrate(). This leaves the way clear for us to provide a memory_region_init_ram() which does handle migration. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Message-id: 1499438577-7674-4-git-send-email-peter.maydell@linaro.org
-
Anton Nefedov authored
Frontends should have an interface to setup the handler of a backend change. The interface will be used in the next commits Signed-off-by:
Anton Nefedov <anton.nefedov@virtuozzo.com> Reviewed-by:
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <1499342940-56739-3-git-send-email-anton.nefedov@virtuozzo.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jul 11, 2017
-
-
Daniel P. Berrangé authored
The content of the backends/trace-events file was entirely removed in commit 6b10e573 Author: Marc-André Lureau <marcandre.lureau@redhat.com> Date: Mon May 29 12:39:42 2017 +0400 char: move char devices to chardev/ Leaving the empty file around, causes tracetool to generate an empty .dtrace file which makes the dtrace compiler throw a syntax error. Signed-off-by:
Daniel P. Berrange <berrange@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20170629162046.4135-1-berrange@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-