[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 3/3] xen/iommu: cleanup iommu related domctl handling
- To: Juergen Gross <jgross@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
- Date: Tue, 19 Apr 2022 14:51:29 +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=1bGjvuGeCAJgCVQvm2LlKcqO3Lx3z96RbJej+sRv9BQ=; b=nAvTHYbFWnwHxiyKzvLwkMDOBLqIUaG2E9s/zm/mrU8GKqUgZ0bcbHpNBvx5Xa/whDR9BjDyRFYNz9OCVPgRbMgUEV5cdKQgvKnczOX8BSJoZiFhD7NErxYlJHh9x+VFUdNoVQAKZLJwqOAmumwxzGQUHoG22zuJS2iJ8KYScMvKlUUMwgCbVR9iB1Mf+JFfYtOutUiQM26dzHpbnXeLcEIrrHe0LV+wXeviOmTpnr8fEG9+F9KVGpqLcpTaouK4/VDLMKeD24n2M1gyOPi/e0gJbT5UhSo/usSYcFtkyFvDTdMt4LKK/TAKHMUtIPppnEdPrleyEAw82Tk8FxNgJQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gSwUShQ2ZWhdXdyMgfPDQWSWfAu6ebU0PQ55+tHTrFojh1LHpHg2eG69Dht0lCskPCvnTtwC4fbdXHKxAttPijb6NyReTqsfKM2OzgDLaMOEeGNumKwoSzt7qEqGYtI0tTPGRvTxFQJdayYh/+B5PMQEjqLolNX3Z2nsQBrJ+IU4+fFNtlULz3nIXbfzGqXDKTGww/tcJooxwVBtkGGLMFbZYvuq8NK9qpBCnZpFEySenLmsL3+SdkUEk4BlPwMoNErtRMMS24QxOkcnQiFkOU3rcAhzslWJ4UHZZp8YLrtL6+wCRcoYH/Pz7kArHyyDRiZqIiD28fLtrvKbRUS8ZA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>
- Delivery-date: Tue, 19 Apr 2022 14:51:37 +0000
- Ironport-data: A9a23:9O5Jy6DRVfFfDxVW/8niw5YqxClBgxIJ4kV8jS/XYbTApGwhhjJVz mIfCmqOMv2IM2qkL9EnPdyz/EkOu5bSytc1QQY4rX1jcSlH+JHPbTi7wuYcHM8wwunrFh8PA xA2M4GYRCwMZiaA4E/raNANlFEkvU2ybuOU5NXsZ2YgHWeIdA970Ug5w7Jg09Yx6TSEK1jlV e3a8pW31GCNg1aYAkpMg05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKB2n5WuFp8tuSH I4v+l0bElTxpH/BAvv9+lryn9ZjrrT6ZWBigVIOM0Sub4QrSoXfHc/XOdJFAXq7hQllkPggy 95vnMaWSj0DBZbIgO0cdydqLx5XaPguFL/veRBTsOS15mifKj7A5qsrC0s7e4oF5uxwHGdCs +QCLywAZQyCgOTwx6+nTu5rhYIoK8yD0IE34yk8i22GS6t5B8mcGM0m5vcBtNs0rulIEezTe Iwybj13YQ6bSxZOJk0WGNQ1m+LAanzXLWwC+QnI+PZfD277zSV9l6PoE/zvasWQY+J2hlnf/ 07qxjGsav0dHJnFodafyVquifXIhjjTQ58JGfuz8fsCqE2ewCkfBQMbUXO/oOKlkQiuVtRHM UsW9yEy668o+ySDVcLhVhe1pHqFuB80WNdKFeA+rgaXxcL84RudB2UCZi5MbpohrsBebTYnz EOTltXlQzlmqqSISGm1/62R6zi1PEA9E2gGYiMVSBof1PPqqoozkxHnQ85qFei+ididMTP6z i2OrSM+r64OlsNN3KK+lXjYhxq8q56PSRQ6jjg7RUqg5wJ9IYKgOYqh7AGC6e4addnCCF6co HIDhs6SqvgUCo2AnzCMR+NLG6y14/GCM3vXhlsH84QdyglBMkWLJeh4iAyS7m8wWirYUVcFu HPuhD4=
- Ironport-hdrordr: A9a23:DdHqj6nTy7junIudVdmBuqSk8WrpDfLW3DAbv31ZSRFFG/Fw9/ rCoB3U73/JYVcqKRUdcLW7UpVoLkmyyXcY2+cs1NSZLWzbUQmTXeJfBOLZqlWNJ8SXzIVgPM xbAspD4bPLbGSTjazBkXSF+9RL+qj6zEh/792usEuETmtRGt9dBx8SMHf9LqXvLjM2fqbQEv Cnl6x6jgvlQ1s7ROKhCEIIWuDSzue77q4PMXY9dmcaABDlt0LR1ILH
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHYU/TJLaBiHx5iEEKhPVMRqRiW+az3UfwA
- Thread-topic: [PATCH v3 3/3] xen/iommu: cleanup iommu related domctl handling
On 19/04/2022 14:52, Juergen Gross wrote:
> Today iommu_do_domctl() is being called from arch_do_domctl() in the
> "default:" case of a switch statement. This has led already to crashes
> due to unvalidated parameters.
>
> Fix that by moving the call of iommu_do_domctl() to the main switch
> statement of do_domctl().
>
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
> ---
> Another possibility would even be to merge iommu_do_domctl() completely
> into do_domctl(), but I wanted to start with a less intrusive variant.
> V3:
> - new patch
I definitely prefer this approach, thanks. In addition to being
clearer, it's also faster because there isn't a long line of "do you
understand this subop?" calls when we know exactly what it is.
However, I think we need stub for the !HAS_PASSTHROUGH case now that it
is being called from common code.
I'd forgotten that it was used on ARM now, and yes - it absolutely
should be called from somewhere common, not from the arch hooks.
~Andrew
|