[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 6/8] x86/iommu: call pi_update_irte through an hvm_function callback
- To: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Thu, 12 Jan 2023 13:37:05 +0100
- 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LoZp68UQ9//guHuBEsj9AbqZ0JtSUVb8y30mnObDHNI=; b=RE6Htba0Wdxgz9BV6iznpu//oC2oNLXWcWBjFiDWDYYwBDbOYARzRYHFU9plV8H/Du4wNkLbiF6BeysCBJvmohwY9K2ULwouM5BZYZHRkbJs3EQK37vu4sMmVOObgLZHcjhLCWqdRfImzZ1eFk6cn+anzpZrD9qRzBTN1YwRHcgq4+m8HCYQU1WT9VlNx7F54jQnzfA/t0N4DHyHKnzazE6a/yb9kNAeyCxGjx8mQJ7QN/wiMW38VCgBtn183ktZ3YEWNeq7rsE7FEWiqd2ze7EMlecbHajdQej/hlZ4zIBztEfkmSDPyZxxEuQTWRQa9F6cQzxIDTKpMuuB46/LCQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XyVBY/W5EUfzWR936HNMzRbE942tx6bMwkYbmpsrKKboggy+vgzm5lQmS5x0pGnEKUDxzuSx70H4lNdypZz3ayJjZNre+/89F4KFBCnRGanA3C2Oo8X56WFLoCCHsKfb6zHRCcDF8fnkZNwuKhNYwSkjJ6IiESOSnEDbTR7dxkwickoyVivKrqUmH0a3Bo0LtUK9dTT+Ni3rR8RhOgtPdAKGgmTly5EteFwxD1WLKq/9tuZ5AZLssB6VCZNJcmb1U5Q976TdCkRJB1PeumMfq1nscg+VI07KK+/gGvS0FJmXf5VhYbSZvhtb/9ROhNSz4i+QAXXO5HwcSGZLJBgkwA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Thu, 12 Jan 2023 12:37:17 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 12.01.2023 13:16, Jan Beulich wrote:
> On 04.01.2023 09:45, Xenia Ragiadakou wrote:
>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> @@ -2143,6 +2143,14 @@ static bool cf_check vmx_test_pir(const struct vcpu
>> *v, uint8_t vec)
>> return pi_test_pir(vec, &v->arch.hvm.vmx.pi_desc);
>> }
>>
>> +static int cf_check vmx_pi_update_irte(const struct vcpu *v,
>> + const struct pirq *pirq, uint8_t
>> gvec)
>> +{
>> + const struct pi_desc *pi_desc = v ? &v->arch.hvm.vmx.pi_desc : NULL;
>> +
>> + return pi_update_irte(pi_desc, pirq, gvec);
>> +}
>
> This being the only caller of pi_update_irte(), I don't see the point in
> having the extra wrapper. Adjust pi_update_irte() such that it can be
> used as the intended hook directly. Plus perhaps prefix it with vtd_.
Plus move it to vtd/x86/hvm.c (!HVM builds shouldn't need it), albeit I
realize this could be done independent of your work. In principle the
function shouldn't be VT-d specific (and could hence live in x86/hvm.c),
as msi_msg_write_remap_rte() is already available as IOMMU hook anyway,
provided struct pi_desc turns out compatible with what's going to be
needed for AMD.
Jan
|