[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1 09/12] accel/xen/xen-all: export xenstore_record_dm_state


  • To: Oleksandr Tyshchenko <olekstysh@xxxxxxxxx>, stefano.stabellini@xxxxxxx
  • From: Vikram Garhwal <vikram.garhwal@xxxxxxx>
  • Date: Fri, 28 Oct 2022 22:36:47 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yAZfOlArbuKXJhaY3JUE9hUW9sR5OF62WoBXcVnF9QE=; b=ilyZnRkO80a/HM2S6kN7r2LKPSFgzbkOIZJpkFDrop3fUpxE9n99iWT1RZ8sdM8Zy12k2lbdR6LwdEfU3JUcjxfBeYwnMUjQfWuU9btszLp4lvLYEcBC+Wr0+LhW1Q+Ya0eMaXAAWs1mKwVoNA+ivvrEUv5qj0NY7XhLJMP8C4zWtFqUVOWZTxIJ7LOwj04NLIcOzTAPXvnCiYpEO98SxS5WXESbAsA7ADc0Bf3z2cpHWQdoXEy6QVq30nP75zXh65BVS4mxqFpMZ7DTq0QiB5g8SiKBWfL/igak1ZBwCLLQAP5FzuY7gE5h1QiTNGL7FZaP/kFyW1GZSMp3zpJfwg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h79VgrUk/yqhewfGbzHBByIp7dtZm31WydBCUufA304AYjEeg238lC8ra6a6sruGHYd/aact09nka1Y2k4CvOpv1Anq57slZXSvSsK3OcuH8VCKWpCVFzSln528rHMECjnWEPI6v+IRZLEKLlVUGRVkvnG0qHL7FQMDfB2t6z9KeqKxYTNjct8YcWQHH9sKjHRR/j5d+uEJVYjzFH3k4/h42lYbuvEUC7B9ekg1LsCwjkuHUUJtzxgD6A12+o6Au0iOwBxZLNZrrPIUM5VS729Rrc5nyb0pVZ8EJHBwAvV3up/0QTrXKUIJ7vo2ElPNnWlOe60zkVLtpuf1apjCxCA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: qemu-devel@xxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Alex Bennée <alex.bennee@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Sat, 29 Oct 2022 05:37:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Oleksandr,

On 10/28/22 1:26 PM, Oleksandr Tyshchenko wrote:


On Thu, Oct 27, 2022 at 12:24 PM Alex Bennée <alex.bennee@xxxxxxxxxx> wrote:

Hello all



    Vikram Garhwal <vikram.garhwal@xxxxxxx> writes:

    > xenstore_record_dm_state() will also be used in aarch64 xenpv
    machine.
    >
    > Signed-off-by: Vikram Garhwal <vikram.garhwal@xxxxxxx>
    > Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
    > ---
    >  accel/xen/xen-all.c  | 2 +-
    >  include/hw/xen/xen.h | 2 ++
    >  2 files changed, 3 insertions(+), 1 deletion(-)
    >
    > diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c
    > index 69aa7d018b..276625b78b 100644
    > --- a/accel/xen/xen-all.c
    > +++ b/accel/xen/xen-all.c
    > @@ -100,7 +100,7 @@ void xenstore_store_pv_console_info(int i,
    Chardev *chr)
    >  }
    >
    >
    > -static void xenstore_record_dm_state(struct xs_handle *xs,
    const char *state)
    > +void xenstore_record_dm_state(struct xs_handle *xs, const char
    *state)
    >  {
    >      char path[50];
    >
    > diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h
    > index afdf9c436a..31e9538a5c 100644
    > --- a/include/hw/xen/xen.h
    > +++ b/include/hw/xen/xen.h
    > @@ -9,6 +9,7 @@
    >   */
    >
    >  #include "exec/cpu-common.h"
    > +#include <xenstore.h>

    This is breaking a bunch of the builds and generally we try and avoid
    adding system includes in headers (apart from osdep.h) for this
    reason.
    In fact there is a comment just above to that fact.

    I think you can just add struct xs_handle to typedefs.h (or maybe just
    xen.h) and directly include xenstore.h in xen-all.c following the
    usual
    rules:

    https://qemu.readthedocs.io/en/latest/devel/style.html#include-directives

    It might be worth doing an audit to see what else is including xen.h
    needlessly or should be using sysemu/xen.h.

    >
    >  /* xen-machine.c */
    >  enum xen_mode {
    > @@ -31,5 +32,6 @@ qemu_irq *xen_interrupt_controller_init(void);
    >  void xenstore_store_pv_console_info(int i, Chardev *chr);
    >
    >  void xen_register_framebuffer(struct MemoryRegion *mr);
    > +void xenstore_record_dm_state(struct xs_handle *xs, const char
    *state);
    >
    >  #endif /* QEMU_HW_XEN_H */


-- Alex Bennée



For considering:
I think this patch and some other changes done in "[PATCH v1 10/12] hw/arm: introduce xenpv machine" (the opening of Xen interfaces and calling xenstore_record_dm_state() in hw/arm/xen_arm.c:xen_init_ioreq()) could be avoided if we enable the Xen accelerator (either by passing "-M xenpv,accel=xen" or by adding mc->default_machine_opts = "accel=xen"; to hw/arm/xen_arm.c:xen_arm_machine_class_init() or by some other method). These actions are already done in accel/xen/xen-all.c:xen_init(). Please note, that I am not too familiar with that code, so there might be nuances.

Besides that, Xen accelerator will be needed for the xen-mapcache to be in use (this is needed for mapping guest memory), there are a few xen_enabled() checks spreading around that code to perform Xen specific actions.

Unfortunately, I am not that familiar with xen as accelerator function. Let me check and get back to you.
--
Regards,

Oleksandr Tyshchenko



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.