All of lore.kernel.org
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rcojocaru@bitdefender.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Corneliu ZUZU <czuzu@bitdefender.com>
Cc: Tamas K Lengyel <tamas@tklengyel.com>, Keir Fraser <keir@xen.org>,
	Ian Campbell <ian.campbell@citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xen.org,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH] arm/monitor vm-events: Implement guest-request support
Date: Fri, 19 Feb 2016 15:56:05 +0200	[thread overview]
Message-ID: <56C71EF5.1020804@bitdefender.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1602191324120.17248@kaball.uk.xensource.com>

On 02/19/2016 03:49 PM, Stefano Stabellini wrote:
> On Thu, 18 Feb 2016, Corneliu ZUZU wrote:
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index cd4da04..768ad32 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -356,6 +356,7 @@ M:	Tamas K Lengyel <tamas@tklengyel.com>
>>  S:	Supported
>>  F:	xen/common/vm_event.c
>>  F:	xen/common/mem_access.c
>> +F:	xen/common/hvm/event.c
>>  F:	xen/common/monitor.c
>>  F:	xen/arch/x86/hvm/event.c
>>  F:	xen/arch/x86/monitor.c
> 
> This needs an Ack from Tamas or Razvan

The MAINTAINERS change is fine with me. Unless Tamas has an issue with
it (which he most likely doesn't), it should be fine.

>> diff --git a/xen/arch/arm/hvm.c b/xen/arch/arm/hvm.c
>> index 056db1a..767edd1 100644
>> --- a/xen/arch/arm/hvm.c
>> +++ b/xen/arch/arm/hvm.c
>> @@ -22,6 +22,7 @@
>>  #include <xen/errno.h>
>>  #include <xen/guest_access.h>
>>  #include <xen/sched.h>
>> +#include <xen/hvm/event.h>
>>  
>>  #include <xsm/xsm.h>
>>  
>> @@ -72,6 +73,13 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
>>          break;
>>      }
>>  
>> +    case HVMOP_guest_request_vm_event:
>> +        if ( guest_handle_is_null(arg) )
>> +            hvm_event_guest_request();
>> +        else
>> +            rc = -EINVAL;
>> +        break;
>> +
>>      default:
>>      {
>>          gdprintk(XENLOG_DEBUG, "HVMOP op=%lu: not implemented\n", op);
>> diff --git a/xen/common/Makefile b/xen/common/Makefile
>> index 0d76efe..703faa5 100644
>> --- a/xen/common/Makefile
>> +++ b/xen/common/Makefile
>> @@ -67,7 +67,7 @@ obj-$(xenoprof)    += xenoprof.o
>>  
>>  obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall.o tmem_xen.o xlat.o)
>>  
>> -subdir-$(CONFIG_X86) += hvm
>> +subdir-y += hvm
>>  
>>  subdir-$(coverage) += gcov
>>  
>> diff --git a/xen/common/hvm/Makefile b/xen/common/hvm/Makefile
>> index a464a57..11e109d 100644
>> --- a/xen/common/hvm/Makefile
>> +++ b/xen/common/hvm/Makefile
>> @@ -1 +1,2 @@
>> -obj-y += save.o
>> +obj-$(CONFIG_X86) += save.o
>> +obj-y += event.o
>> diff --git a/xen/common/hvm/event.c b/xen/common/hvm/event.c
>> new file mode 100644
>> index 0000000..28ceadc
>> --- /dev/null
>> +++ b/xen/common/hvm/event.c
>> @@ -0,0 +1,96 @@
>> +/*
>> + * xen/common/hvm/event.c
>> + *
>> + * Common hardware virtual machine event abstractions.
>> + *
>> + * Copyright (c) 2004, Intel Corporation.
>> + * Copyright (c) 2005, International Business Machines Corporation.
>> + * Copyright (c) 2008, Citrix Systems, Inc.
>> + * Copyright (c) 2016, Bitdefender S.R.L.
>> + *
>> + * This program is free software; you can redistribute it and/or modify it
>> + * under the terms and conditions of the GNU General Public License,
>> + * version 2, as published by the Free Software Foundation.
>> + *
>> + * This program is distributed in the hope it will be useful, but WITHOUT
>> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
>> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
>> + * more details.
>> + *
>> + * You should have received a copy of the GNU General Public License along with
>> + * this program; If not, see <http://www.gnu.org/licenses/>.
>> + */
>> +
>> +#include <xen/hvm/event.h>
>> +#include <xen/vm_event.h>
>> +#include <asm/hvm/event.h>
>> +#if CONFIG_X86
>> +#include <asm/altp2m.h>
>> +#endif
>> +
>> +int hvm_event_traps(struct vcpu *v, uint8_t sync, vm_event_request_t *req)
>> +{
>> +    int rc;
>> +    struct domain *d = v->domain;
>> +
>> +    rc = vm_event_claim_slot(d, &d->vm_event->monitor);
>> +    switch ( rc )
>> +    {
>> +    case 0:
>> +        break;
>> +    case -ENOSYS:
>> +        /*
>> +         * If there was no ring to handle the event, then
>> +         * simply continue executing normally.
>> +         */
>> +        return 1;
>> +    default:
>> +        return rc;
>> +    };
>> +
>> +    if ( sync )
>> +    {
>> +        req->flags |= VM_EVENT_FLAG_VCPU_PAUSED;
>> +        vm_event_vcpu_pause(v);
>> +    }
>> +
>> +#if CONFIG_X86
>> +    if ( altp2m_active(d) )
> 
> I would rather
> 
> #define altp2m_active(d) (0)
> 
> on ARM, removing the two ifdefs in this file.

I second that, not a big fan of the #ifdefs.


Thanks,
Razvan

  reply	other threads:[~2016-02-19 13:56 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18 19:35 [PATCH] arm/monitor vm-events: Implement guest-request support Corneliu ZUZU
2016-02-18 20:08 ` Razvan Cojocaru
2016-02-18 21:25   ` Tamas K Lengyel
2016-02-19  5:44     ` Corneliu ZUZU
2016-02-19 13:49 ` Stefano Stabellini
2016-02-19 13:56   ` Razvan Cojocaru [this message]
2016-02-19 15:56   ` Corneliu ZUZU
2016-02-19 16:00     ` Stefano Stabellini
2016-02-19 16:05       ` Andrew Cooper
2016-02-19 16:10         ` Corneliu ZUZU
2016-02-19 17:47           ` Stefano Stabellini
2016-02-19 17:54             ` Tamas K Lengyel
2016-02-19 18:11               ` Corneliu ZUZU
2016-02-19 18:27                 ` Tamas K Lengyel
2016-02-19 18:33                   ` Corneliu ZUZU
2016-02-19 18:42                     ` Tamas K Lengyel
2016-02-19 20:46                       ` Corneliu ZUZU
2016-02-19 14:26 ` Jan Beulich
2016-02-19 16:02   ` Tamas K Lengyel
2016-02-19 16:35     ` Corneliu ZUZU
2016-02-19 16:25   ` Corneliu ZUZU
2016-02-19 17:15     ` Jan Beulich
2016-02-19 18:01       ` Corneliu ZUZU
2016-02-22 10:14         ` Jan Beulich
2016-02-22 11:26           ` Corneliu ZUZU
2016-02-22 11:38             ` Jan Beulich
2016-02-22 11:40               ` Razvan Cojocaru
2016-02-23  9:09 ` Corneliu ZUZU
2016-02-23 10:54   ` Razvan Cojocaru
2016-02-23 11:00     ` Corneliu ZUZU
2016-02-23 11:06       ` Razvan Cojocaru
2016-02-23 14:28         ` Tamas K Lengyel
2016-02-23 14:30   ` Tamas K Lengyel
2016-02-23 14:57     ` Corneliu ZUZU

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56C71EF5.1020804@bitdefender.com \
    --to=rcojocaru@bitdefender.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=czuzu@bitdefender.com \
    --cc=ian.campbell@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tamas@tklengyel.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.