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

Re: [PATCH 3/3] hvm/pirq: allow control domains usage of PHYSDEVOP_{un,}map_pirq


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Thu, 3 Mar 2022 10:45:54 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=KWu0hAmcLTlQGm/dUUSB0eIHCRr1dfI5IWrBk76qluY=; b=jLVT8lLDuoRjUafzLQRqYyX3sIlNpIb8+6dynlEG4bRvL7i+zO5dSjAgsIw7W6BsJSe6NNxMx9ugWgbdnHz/K/QgMegyERQwAnf2vhfhiw4BfCmo50p1sR0rNMVobCzhccdmRRabRhH3z6piWS6pI/H2wHSyNVrMS0mhueMqI4vLca1K6mCYNhwZ30X4++35SPD37VkeRadvURg6p/8CvOY8hMR4uC5xatKoQ5Gb6eIRhnKWJVwJQmIxnvXPcDsrXb86fS7ZhuQKMAoZwdNE9BBtbcwSqbKi8mzYkHeAcJZcoHHBBwk/Km9iL3jQJjlpu60rh39t9LDHbty1+6yoxw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iWzoFE1S5xtpTMyIF0GyFrDGllyETpb0sVKj4rU1rS4mugq5/MGm7oCDHkh8czKgG41wihIa2HtDPRypJEWBjdiREJGhpGbi4dArqlxV2O1cmjCcfUzHdeH305zTNPsbBCe2A2RE0zV81i6ZvEpGfhdjZs9F1NsMI3l2wtACCRAPvOksrCJUT4LztrvLabkP2Ep/M0VuSCAb31U2pGUaFEYyk5Y+H1eZUSJhJgaUf0QTng0TBYYAz56K53axAAYxr9p1g4cwUtKah7phRnjpWzBXYSa06F3Q3DxQfYRtUJlUzkv4+ogVffp6gIMSbVu4W+Q5EhIfQXZDNwvyH0WhZA==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Alex Olson <this.is.a0lson@xxxxxxxxx>
  • Delivery-date: Thu, 03 Mar 2022 10:46:04 +0000
  • Ironport-data: A9a23:QeSQDqgZzA2Z4bwKsp0jbEMcX161VxAKZh0ujC45NGQN5FlHY01je htvWj3TMq3ZZGugfNgjOomz8kID7MLRmIUyTVFvqyEzFngb9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oDJ9CU6jefSLlbFILas1hpZHGeIcw98z0M78wIFqtQw24LhWFvW4 YqaT/D3YzdJ5RYlagr41IrbwP9flKyaVOQw5wFWiVhj5TcyplFNZH4tDfjZw0jQG+G4KtWSV efbpIxVy0uCl/sb5nFJpZ6gGqECaua60QFjERO6UYD66vRJjnRaPqrWqJPwwKqY4tmEt4kZ9 TlDiXC/YVgCF7Xgg9YBaUkbEAJEPZN2/Y31Infq5KR/z2WeG5ft6/BnDUVwNowE4OdnR2pJ8 JT0KhhUMErF3bjvhuvmFK883azPL+GyVG8bklhmwSvUErANRpfbTr+RzdRZwC0xloZFGvO2i 88xN2cwPE+QOEIn1lE/LpwZnri323/GSB5jok2kt6QIvXTw01kkuFTqGIWMIYHbLSlPpW6Ho krW8mK/BQsVXPSDyTuetHO3wOaXmTj8XqodEbS58rhhh1j77nweDlgaWEW2pdG9i1WiQJRPJ koM4C0soKMuskuxQbHVXRe1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t2lWXo+Wh+AX0gZo8SQlzxbhmpwwUcUzNEW2i5ozuNxd7BUo+ Dfdqh4nrBHScEbKap7GecaWMOyTmjAWwjFPm6eKUnuUKsHJ3XOoZjq56hd3pDhRLUYiJ8p3J jRWlJRsmA/P0roFM2VxZVOtgvARW2sNA6dvP22J6IJzYEUaICbQxFrEmpe4PdIi89vd/HmZw ==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYLunWut2cJ/LWfU2xlp5ijbCQIayteeMA
  • Thread-topic: [PATCH 3/3] hvm/pirq: allow control domains usage of PHYSDEVOP_{un,}map_pirq

On 03/03/2022 10:30, Roger Pau Monne wrote:
> Control domains (including domains having control over a single other
> guest) need access to PHYSDEVOP_{un,}map_pirq in order to setup
> bindings of interrupts from devices assigned to the controlled guest.
>
> As such relax the check for HVM based guests and allow the usage of
> the hypercalls for any control domains. Note that further safety
> checks will be performed in order to assert that the current domain
> has the right permissions against the target of the hypercall.
>
> Reported-by: Alex Olson <this.is.a0lson@xxxxxxxxx>
> Reported-by: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> ---
>  xen/arch/x86/hvm/hypercall.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
> index 030243810e..9128e4d025 100644
> --- a/xen/arch/x86/hvm/hypercall.c
> +++ b/xen/arch/x86/hvm/hypercall.c
> @@ -87,6 +87,13 @@ static long hvm_physdev_op(int cmd, 
> XEN_GUEST_HANDLE_PARAM(void) arg)
>      {
>      case PHYSDEVOP_map_pirq:
>      case PHYSDEVOP_unmap_pirq:
> +        /*
> +         * Control domain (and domains controlling others) need to use
> +         * PHYSDEVOP_{un,}map_pirq in order to setup interrupts for 
> passthrough
> +         * devices on behalf of other guests.
> +         */
> +        if ( is_control_domain(currd) || currd->target )
> +            break;

Hmm.  In a split control/hardware domain model, then qemu is in the
hardware domain rather than the control domain.  I suspect this wants
extending with || is_hardware_domain(currd).

Also, the sentence about later safety checks really ought to be in this
source comment too.

~Andrew

 


Rackspace

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