WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 2 of 4] xen: introduce PHYSDEVOP_get_nr_pirqs

To: Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 2 of 4] xen: introduce PHYSDEVOP_get_nr_pirqs
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Tue, 31 Aug 2010 12:19:03 +0100
Cc:
Delivery-date: Tue, 31 Aug 2010 04:20:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1283167504-7787-2-git-send-email-stefano.stabellini@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: ActINv3BbTioeLpfRfKhqTwJ6tH25wAx1Nfs
Thread-topic: [Xen-devel] [PATCH 2 of 4] xen: introduce PHYSDEVOP_get_nr_pirqs
User-agent: Microsoft-Entourage/12.26.0.100708
Useful why? What if we'd like nr_pirqs to be per-domain dynamic in future?

 -- Keir

On 30/08/2010 12:25, "Stefano Stabellini" <Stefano.Stabellini@xxxxxxxxxxxxx>
wrote:

> Introduce a new physdevop called PHYSDEVOP_get_nr_pirqs that allows PV
> and PV on HVM guests to get the number of pirqs available.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> 
> diff -r f2dc396b92aa xen/arch/x86/hvm/hvm.c
> --- a/xen/arch/x86/hvm/hvm.c Wed Aug 18 14:14:23 2010 +0100
> +++ b/xen/arch/x86/hvm/hvm.c Fri Aug 20 14:49:52 2010 +0100
> @@ -2290,6 +2290,7 @@ static long hvm_physdev_op(int cmd, XEN_
>          case PHYSDEVOP_unmap_pirq:
>          case PHYSDEVOP_eoi:
>          case PHYSDEVOP_irq_status_query:
> +        case PHYSDEVOP_get_nr_pirqs:
>              return do_physdev_op(cmd, arg);
>          default:
>              return -ENOSYS;
> @@ -2393,6 +2394,8 @@ static long hvm_physdev_op_compat32(
>          case PHYSDEVOP_eoi:
>          case PHYSDEVOP_irq_status_query:
>              return compat_physdev_op(cmd, arg);
> +        case PHYSDEVOP_get_nr_pirqs:
> +            return do_physdev_op(cmd, arg);
>          break;
>      default:
>              return -ENOSYS;
> diff -r f2dc396b92aa xen/arch/x86/physdev.c
> --- a/xen/arch/x86/physdev.c Wed Aug 18 14:14:23 2010 +0100
> +++ b/xen/arch/x86/physdev.c Fri Aug 20 14:49:52 2010 +0100
> @@ -572,6 +572,12 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
>                                setup_gsi.polarity);
>          break; 
>      }
> +    case PHYSDEVOP_get_nr_pirqs: {
> +        struct physdev_nr_pirqs out;
> +        out.nr_pirqs = v->domain->nr_pirqs;
> +        ret = copy_to_guest(arg, &out, 1) ? -EFAULT : 0;
> +        break;
> +    }
>      default:
>          ret = -ENOSYS;
>          break;
> diff -r f2dc396b92aa xen/include/public/physdev.h
> --- a/xen/include/public/physdev.h Wed Aug 18 14:14:23 2010 +0100
> +++ b/xen/include/public/physdev.h Fri Aug 20 14:49:52 2010 +0100
> @@ -240,6 +240,15 @@ struct physdev_setup_gsi {
>  typedef struct physdev_setup_gsi physdev_setup_gsi_t;
>  DEFINE_XEN_GUEST_HANDLE(physdev_setup_gsi_t);
>  
> +#define PHYSDEVOP_get_nr_pirqs    22
> +struct physdev_nr_pirqs {
> +    /* OUT */
> +    uint32_t nr_pirqs;
> +};
> +
> +typedef struct physdev_nr_pirqs physdev_nr_pirqs_t;
> +DEFINE_XEN_GUEST_HANDLE(physdev_nr_pirqs_t);
> +
>  /*
>   * Notify that some PIRQ-bound event channels have been unmasked.
>   * ** This command is obsolete since interface version 0x00030202 and is **
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>