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

Re: [PATCH v2.2 8/7] x86/IOMMU: Use altcall, and __initconst_cf_clobber


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Tue, 1 Mar 2022 14:58:40 +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=j6G4UMWqA/hPTRe/kzbfqxxngv/FBfgFnY0TcfNZOQc=; b=CAEbbmKGp5iKZs/cR/CPQhFXM1ieDrY5wRtqZUoM7oeeN8UkThy2+eh0Mo8D2ZTflD6Z5yT8kDVTjIQEwxUV/6cdccbcq3STZ990sB1jkOHA+O5hsr2aOHbYgIGnyxY7ezb/2CuXnnsiwkalXOw2l4WHRX031PTag3O0D5k6BEnjCysVj5dcIZDhxn955B3yM9e0I/uQKGU3pkJdwu7P5LNRw761/uEF7nG9JKUFK58xjuD4oXY4Isj3kDQR/zd8tAHxw2KuPmLIQW+cvSYaWQP2ywQyf+uaz45iZ5IOuSPIg2xIFcm6hLJ1LmAflRx1y/KY5Ehy1043kfi+77N88g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CrFlZPrzQvCrZ72GVgkAfE7Sxj2g0d0+GL9S5ISANXudc/x1AjJ9Z0AjcWeMp7qDb/0p6G1t5AHP4zOfz8Fw7/s1HCRbkzL96BniuA8EJfqgBYLjBFu1+fXiyKhI36RVHwwbEe3uRYqeHXLmP2Lgb4dd7r50K/fuJtmtRL14toBg90DdhtpD7GKEYOAGVTGzM6fT34byW82GzmkYd3KGU9VC3meTehUiFM4CsDRxDBBA6MwhzAzsoia9KJ68tvnwyRnnSwPHD1sPJFk68+S/H8W+vHdawOkSzTSPRdyFrvTT0z9+ataDkSRFyUeSNM+q2mQnRcSF+3sS7Jd++3ne6g==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 01 Mar 2022 14:58:49 +0000
  • Ironport-data: A9a23:0hIU6qAbg6/KTxVW/zTjw5YqxClBgxIJ4kV8jS/XYbTApDh30DUOx mIcW27XOaqNZzP2KIwnaYiy8BsBusTSyYNnQQY4rX1jcSlH+JHPbTi7wuYcHM8wwunrFh8PA xA2M4GYRCwMZiaA4E/raNANlFEkvU2ybuOU5NXsZ2YgHWeIdA970Ug5w7Vh29Yy6TSEK1jlV e3a8pW31GCNg1aYAkpMg05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKB2n5WuFp8tuSH I4v+l0bElTxpH/BAvv9+lryn9ZjrrT6ZWBigVIOM0Sub4QrSoXfHc/XOdJFAXq7hQllkPhyy N4Uqs3uaz4KBfHRoucvYjgIQx1XaPguFL/veRBTsOSWxkzCNXDt3+9vHAc9OohwFuRfWD8Us 6ZCcXZUM07F17neLLGTE4GAguwKKsXxMZxZkXZn1TzDVt4tQIzZQrWM7thdtNs1rp4TQ62EP JZGAdZpRCvKPUF+OGgKNIkFsdmDhHynXB9Wp3vA8MLb5ECMlVcsgdABKuH9atGMAMlYgEucj mbH5HjiRAEXMsSFzjiI+W7qgfXA9QvkXKoCGbv+8eRl6HWRzGEODBwdVXOgvOK0zEW5Xrpix 1c8o3R06/JorQryE4e7D0bQTGO4UgA0WNpbSvJrtiO06ZGI/jyaNFklHm59QYlz3CMpfgAC2 liMltLvIDVgtryJVH6QnoupQSOO1Ts9djFbO3JdJecRy5y6+dxo0EqTJjp2OPPt1rXI9SfML ydmRcTUr5EaloY12qqy5jgraBr898GSHmbZCug6N19JDz+Vhqb4P+RECnCBtJ6sybp1qHHb5 BDofODEsYgz4WmlznDlfQn0NOjBCwy5GDPdm0VzOJIq6i6g/XWuFagJvm0gfBgybJpdIGa4C KM2he+3zMUIVJdNRfUqC79d9uxwlfSwfTgbfqq8giVyjmhZK1bcoXAGib+41GHxikk8+ZzTy r/AGftA+U0yUPw9pBLvHr91+eZymkgWmDOCLbimnk/P+efPOxaopUItbQLmghYRt/jf/m04M r93aqO39vmoeLamM3mPrNVKdghiwLpSLcmelvG7v9Wre2JOMGogF+XQ0fUmfYlklL5SjeDG4 je2XUow9bY1rSSvxdmiApy7VI7SYA==
  • Ironport-hdrordr: A9a23:Z7zTwKGoSyibvhI2pLqFSJHXdLJyesId70hD6qkvc3Jom52j+P xGws526fatskdsZJkh8erwXJVp2RvnhNBICPoqTMiftW7dySqVxeBZnMTfKljbehEWmdQtrZ uIH5IOauEYSGIK8PoSgzPIU+rIouP3i5xA7N22pxwGIGEaCJ2IrT0JcDpzencGHjWubqBJc6 Z0k/A33gZIDk5nCPhTaEN1OtTrlpnurtbLcBQGDxko5E2lljWz8oP3FBCew1M3Ty5P6a1Kyx mHryXJooGY992rwB7V0GHeq75MnsH699dFDMuQzuAINzTXjBqybogJYczBgNl1mpDr1L8Zqq iKn/4SBbU015oXRBDtnfLZ4Xil7N/p0Q679bbXuwq5nSWzfkNFNyMIv/MpTvKe0Tt8gDg06t M544rS3aAnfS/ojWDz4cPFWAptkVfxqX0+kfQLh3gaSocGbqRNxLZvtn+9Pa1wVB4S0rpXW9 WGzfusk8p+YBefdTTUr2NvyNujUjA6GQqHWFELvoiQ3yJNlH50wkMEzIhH901wuK4VWt1B/a DJI65onLZBQosfar98Hv4IRY+yBnbWSRzBPWqOKRDsFb0BOXjKt5nriY9Fqd2CadgN1t8/iZ 7BWFRXuSo7fF/vE9SH2NlR/hXEUAyGLH3QIwFllu5EU5HHNc/W2He4OSITeuOb0oEiPvE=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYJ+IV6PtRJY8p5U2wBnUH9jKzdqyj8n0AgAa3aoA=
  • Thread-topic: [PATCH v2.2 8/7] x86/IOMMU: Use altcall, and __initconst_cf_clobber

On 25/02/2022 08:24, Jan Beulich wrote:
> On 22.02.2022 12:47, Andrew Cooper wrote:
>> --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
>> +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
>> @@ -628,7 +628,7 @@ static void cf_check amd_dump_page_tables(struct domain 
>> *d)
>>                                hd->arch.amd.paging_mode, 0, 0);
>>  }
>>  
>> -static const struct iommu_ops __initconstrel _iommu_ops = {
>> +static const struct iommu_ops __initconst_cf_clobber _iommu_ops = {
> Following my initcall related remark on x86'es time.c I'm afraid I don't
> see how this and ...
>
>> @@ -2794,7 +2793,7 @@ static int __init cf_check 
>> intel_iommu_quarantine_init(struct domain *d)
>>      return rc;
>>  }
>>  
>> -static struct iommu_ops __initdata vtd_ops = {
>> +static const struct iommu_ops __initconst_cf_clobber vtd_ops = {
> ... this actually works. But I guess I must be overlooking something, as
> I'm sure that you did test the change.
>
> Both ops structures reference a function, through .adjust_irq_affinities,
> which isn't __init but which is used (besides here) for an initcall. With
> the ENDBR removed by the time initcalls are run, these should cause #CP.

This doesn't explode because the indirect calls are resolved to direct
calls before the ENDBR's are clobbered to NOP4.

But I really do need to write a proper sphinx doc explaining how this
works and the safety considerations.

~Andrew

 


Rackspace

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