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

Re: [Xen-devel] [PATCH v5 5/6] xen/x86: add PHYSDEVOP_msi_control


  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Fri, 19 Jul 2019 10:40:58 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.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-SenderADCheck; bh=muBU1ItzFW2zI883cGX73Euh46WgcFKkd4RIJqILg4g=; b=ZQO0GrxutL5ifxgTEu3blgYLVkzEz2PWIsr2Ck6YLMyBs5CCmXzyqlJ0ZQHylJo3UR3tebLAd3uQVcMRE5aU0b4cWnrdBN4agHv+U/MmqRKldt3T8QDNJApwjq815drzncUDS0OT1MP2n0EHrFEQ1eaSCo460akfh9ZSEqBNdxRXDHv3arD2udM8KBFPE+uCA6FmTTSegLSMn5bgpm1eA+vNSeIOeZ3+X4EUDIW56TpiHEELbUhn2jCXBuLt4yP5H68oLfAZkvuvnWLJotutL73ehRo6DgksZolIYcVJnlzg6ExIYPm1R3s7/701JqfiGFlNOXXPOhFdOX0pjDM7pQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HpmXEPiL+Ec0PmdE55nWNxLCJAQsJC3lr+UNtMdGSkHbPD3GIYXky9JJW6IX9mFAoX0WZO/klA1wZnoGGpXvpE6Zo2aQYw/e488LFwnJn5DUTFAaw66zoI07QkVmw9LAVksd6YL2Tl9zhr8iChSlM+Xh0bUE3HDXAbtlPobTHfI1m7Ab5fYKaOqCmJ9b4ycc233l89kkX4B2DFbqaMlCrp4Jcym2oLCCEGnIdsw2WwxsMrRKXDm8kVok12JvwpMdpUkRajAI1T/1nqgCOSuGtKTxXdVwD/lATkvgaQcTtMeoVN2mhaXIH6BLQcnMfHnQo4Jnoii8Dt1eW2k32yzgdA==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, Julien Grall <julien.grall@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 19 Jul 2019 10:43:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVPDtOMbEO/dU1S0mmyHfOXncKyabRxG0A
  • Thread-topic: [Xen-devel] [PATCH v5 5/6] xen/x86: add PHYSDEVOP_msi_control

On 17.07.2019 03:00, Marek Marczykowski-Górecki  wrote:
> --- a/xen/arch/x86/physdev.c
> +++ b/xen/arch/x86/physdev.c
> @@ -662,6 +662,31 @@ ret_t do_physdev_op(int cmd, 
> XEN_GUEST_HANDLE_PARAM(void) arg)
>           break;
>       }
>   
> +    case PHYSDEVOP_msi_control: {
> +        struct physdev_msi_control op;
> +        struct pci_dev *pdev;
> +
> +        ret = -EFAULT;
> +        if ( copy_from_guest(&op, arg, 1) )
> +            break;
> +
> +        ret = -EINVAL;
> +        if ( op.flags & ~(PHYSDEVOP_MSI_CONTROL_MSIX | 
> PHYSDEVOP_MSI_CONTROL_ENABLE) )
> +            break;
> +
> +        pcidevs_lock();
> +        pdev = pci_get_pdev(op.seg, op.bus, op.devfn);
> +        if ( pdev )
> +            ret = msi_control(pdev,
> +                              op.flags & PHYSDEVOP_MSI_CONTROL_MSIX,
> +                              op.flags & PHYSDEVOP_MSI_CONTROL_ENABLE);

Note that pci_get_pdev() returns hidden devices as well. That's
not a problem for the other two uses in this file, but I think
you want to explicitly deny access to hidden ones here,
irrespective of the XSM check.

Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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