Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EF62DC46CD2 for ; Tue, 9 Jan 2024 10:46:46 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.664397.1034593 (Exim 4.92) (envelope-from ) id 1rN9d1-0007XM-45; Tue, 09 Jan 2024 10:46:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 664397.1034593; Tue, 09 Jan 2024 10:46:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rN9d1-0007XF-1T; Tue, 09 Jan 2024 10:46:39 +0000 Received: by outflank-mailman (input) for mailman id 664397; Tue, 09 Jan 2024 10:46:37 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rN9cz-0007Wy-95 for xen-devel@lists.xenproject.org; Tue, 09 Jan 2024 10:46:37 +0000 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [2a00:1450:4864:20::229]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5bc0502e-aedc-11ee-9b0f-b553b5be7939; Tue, 09 Jan 2024 11:46:35 +0100 (CET) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2cd5b467209so18964141fa.3 for ; Tue, 09 Jan 2024 02:46:35 -0800 (PST) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id a1-20020a0566380b0100b0046e3e617619sm89329jab.129.2024.01.09.02.46.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Jan 2024 02:46:34 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5bc0502e-aedc-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1704797194; x=1705401994; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=s7d4cIB5bsW9KfOflQAbYSMNcJblVOTlRM+NdoN79qc=; b=OyL6aLaB05gIUG3w3S0i0/A0BfwSlgdfyRa7wR8K0UIysoE3TyvDE4ONSHS0lP81P9 K0u8Y8wN85m5vjd+jVTz87KrW2xBzRVWT4wd94XIVSlgirNqT9ye4NYRGcgPf6RtM2kZ WCsrEjqAP3k0wZM2/vdMFm6OHJ/txuyI7p8jjei1eaPknbyNqkHnrVDYfqisCifdmS+w 8XYxbPTkU34XRRug4YOa6IlKOqtwEPxOE1qi3zs5AUUN3F6hum5H2/RAOHtLleqigXup nnWHi0A4DXv0jNTTQQtlraKWEtCyNljpR17FyGoUC08pvLtwClARggX0zHz6MN+nUM0g V6jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704797194; x=1705401994; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=s7d4cIB5bsW9KfOflQAbYSMNcJblVOTlRM+NdoN79qc=; b=xC89iilCismIEwsxyyUH+7hYekrX5/ElGzKTC/EnMHSRHK8KU1xENi3PW4cBG6B/wk RyFmtElRK0sr3ml8lE0hVuhuXVHo0n15XFxH+o5N5UTuqaRg8xnU9zmVnAvcGKxRLsCX wEZTM/7dJENfO4mJLWWkNKXxkLHa9Yjkcv+wikhEtxIasVX7ZGbK/B7ImMU2Lcihf9PJ hBx2DzDH8Kh+5UXDexzo5CrA1bhXtMvOuED8DNdK38TZwc70z63LY+TG7srQHOUqWZ+H dSQeocbcruN0kdQjeck9gTD1WjpyZqchpskjdJxOLnXS6egdeipztlPUzoKfOCDiECFk 9lQg== X-Gm-Message-State: AOJu0Yx2WGlxEYzz0vAdP/06XWBOBKZgY0fIQ2PhT9zmcPQNK70tGcux XY2X3R/Kvqj+HqdICcBFFbugyXWnPLiF X-Google-Smtp-Source: AGHT+IFkgza7CCKM6tWVM7sGOMl7Bqr+8PZLAbyB31/dvhOndx1U8t4sE61hzO2toosgsNPPNGIHPA== X-Received: by 2002:a05:651c:4c6:b0:2cd:241c:849a with SMTP id e6-20020a05651c04c600b002cd241c849amr2701743lji.79.1704797194642; Tue, 09 Jan 2024 02:46:34 -0800 (PST) Message-ID: Date: Tue, 9 Jan 2024 11:46:30 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC XEN PATCH v4 4/5] domctl: Use gsi to grant/revoke irq permission Content-Language: en-US To: "Chen, Jiqian" Cc: "xen-devel@lists.xenproject.org" , Andrew Cooper , Wei Liu , George Dunlap , Julien Grall , Anthony PERARD , Juergen Gross , "Hildebrand, Stewart" , "Huang, Ray" , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini References: <20240105070920.350113-1-Jiqian.Chen@amd.com> <20240105070920.350113-5-Jiqian.Chen@amd.com> <882bd39a-8a29-4f4f-b64f-765c4858b1c8@suse.com> From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZ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5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 09.01.2024 11:16, Chen, Jiqian wrote: > On 2024/1/9 17:38, Jan Beulich wrote: >> On 09.01.2024 09:18, Chen, Jiqian wrote: >>> A new hypercall using for granting gsi? If so, how does the caller know to call which hypercall to grant permission, XEN_DOMCTL_irq_permission or that new hypercall? >> >> Either we add a feature indicator, or the caller simply tries the >> new GSI interface first. > I am still not sure how to use and implement it. > Taking pci_add_dm_done as an example, for now its implementation is: > pci_add_dm_done > xc_physdev_map_pirq > xc_domain_irq_permission(,,pirq,) > XEN_DOMCTL_irq_permission > > And assume the new hypercall is XEN_DOMCTL_gsi_permission, do you mean: > pci_add_dm_done > xc_physdev_map_pirq > ret = xc_domain_gsi_permission(,,gsi,) > XEN_DOMCTL_gsi_permission > if ( ret != 0 ) > xc_domain_irq_permission(,,pirq,) > XEN_DOMCTL_irq_permission No, falling back shouldn't be "blind". Fallback should only happen when the new sub-op isn't implemented (hence why a feature indicator may be necessary), and only if calling the existing sub-op promises to be useful (which iirc would limit that to the PV Dom0 case). > But if so, I have a question that in XEN_DOMCTL_gsi_permission, when to fail and when to success? I'm afraid I don't understand the question. Behavior there isn't to be fundamentally different from that for XEN_DOMCTL_irq_permission. It's just that the incoming value is in another value space. > Or do you mean: > pci_add_dm_done > xc_physdev_map_pirq > ret = xc_domain_irq_permission(,,pirq,) > XEN_DOMCTL_irq_permission > if ( ret != 0 ) > xc_domain_gsi_permission(,,gsi,) > XEN_DOMCTL_gsi_permission No, this looks the wrong way round. > And in XEN_DOMCTL_gsi_permission, as long as the current domain has the access of gsi, then granting gsi to caller should be successful. Right? I think so; see above. Jan