[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RFC] x86: Fix XEN_DOMCTL_gdbsx_guestmemio crash
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
- Date: Thu, 21 Apr 2022 09:46:00 +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=5SUBrspTLvRt4QobPVFslbzu6SyJIfpnPnCedK6hGsw=; b=DZ5ymCsuZ44HI9atoS6OKDIJzt8XIIiC0P5xUUJAJ/vkRP17BztljABn+ZpRxRllYgdnDRJ9TnYAd4vRBQJihNqYOsu8XSUOO5X8pmC4f66T67NMaFax0pKPbApdO1iKgdV7XBJCC95DGfkJUBb8URp0PWTpiJ5jueHq4Mb0epzDSNimSI2mNjMWfLelGPLYYHwrayDUrkoniLdAJjXJMz2jnc4PeK7uk34h5FVSyH9wR3jr25PAJgfuDRB2rQ1Vpw1Pv4FahsSU9qB0mqZFx9W7QCzF0U3DDHTpmQxYNg70ewPO92A3u7sHL9ly5nJitN84oHZ/WxZ7/sadNKKRyw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DItxplop08xUHaO6FcDfv2apWRQZBP/kUNxI+kJUtwTLxz0cJuO5Cz5iNZ0YC4jP1b/AYL6us9RYYNyXgtUosHpDv1a7sCaAtL+GJTpxszjJxPSbUVMqO1YNMK4anZvffKhgtzP7BrkAwdOwIkCc3E3Bec+XFCfd141c05rNHKR61UR1VK+mhL6I/2a0j6yvdTcJw2VIT8ptyOEn/pcPGp6s2K/QsjUDNDu6mb5wEI+HEplNPKZIyR6tQUkMzLHgxQ5+o8BlxzN3RSzLD6jgQcdoSlOhRNYp71xk4wmM+70mvIkzXB/6cVpxzxxRFVHp5PxX9KB5lgLIvsbSvksEFw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: George Dunlap <George.Dunlap@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Thu, 21 Apr 2022 09:46:30 +0000
- Ironport-data: A9a23:dD2696hR1425mcxc6VeTLb98X161gBEKZh0ujC45NGQN5FlHY01je htvWT3Sb6yKZzfwKdEnO9m18R5QsJaHm4NqQVA++yg1F3wb9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oDJ9CU6jefSLlbFILas1hpZHGeIcw98z0M78wIFqtQw24LhX1nU4 YqaT/D3YzdJ5RYlagr41IrbwP9flKyaVOQw5wFWiVhj5TcyplFNZH4tDfjZw0jQG+G4KtWSV efbpIxVy0uCl/sb5nFJpZ6gGqECaua60QFjERO6UYD66vRJjnRaPqrWqJPwwKqY4tmEt4kZ9 TlDiXC/YToIY7z2o8g3aTRZS34kLa9q+5zjPlHq5KR/z2WeG5ft69NHKRhveKc+qqNwC2wI8 uEEIjcQaBzFn/ix3L+wVuhrgIIkMdXvO4Qc/HpnyFk1D95/GcyFH/qMuI8ehWht7ixNNa+2i 84xQDxjdhnfJTZIPU8aEskWl+a0nHjvNTZfrTp5oIJpsjmCl1Eri9ABNvKEXs3JacZR3XyU+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vv4YHsrXH/ 6uJZM+OY6XEVfT
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHYVM9arFIsZUO7iUKZeaUlLxEzCaz49teAgAEjSoCAAAV3AA==
- Thread-topic: [PATCH RFC] x86: Fix XEN_DOMCTL_gdbsx_guestmemio crash
On 21/04/2022 10:26, Jan Beulich wrote:
> On 20.04.2022 18:03, Juergen Gross wrote:
>> On 20.04.22 17:56, Andrew Cooper wrote:
>>> When CONFIG_GDBSX is compiled out, iommu_do_domctl() falls over a NULL
>>> pointer. It isn't really correct for processing of XEN_DOMCTL_gdbsx_* to
>>> fall
>>> into the default case when compiled out.
>>>
>>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>>> ---
>>> CC: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
>>> CC: Jan Beulich <JBeulich@xxxxxxxx>
>>> CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
>>> CC: Wei Liu <wl@xxxxxxx>
>>> CC: Julien Grall <julien@xxxxxxx>
>>> CC: Juergen Gross <jgross@xxxxxxxx>
>>> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>>> CC: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
>>> CC: Bertrand Marquis <bertrand.marquis@xxxxxxx>
>>>
>>> RFC, because this has implications across the codebase. The tl;dr is that
>>> case FOO:'s shouldn't be compiled out; we still know what the subops are,
>>> even
>>> when the functionality is compiled out.
>>>
>>> There are several ways to express this. Alternatives would be:
>>>
>>> case XEN_DOMCTL_gdbsx_guestmemio:
>>> if ( !IS_ENABLED(CONFIG_GDBSX) )
>>> {
>>> rc = -EOPNOTSUPP;
>>> break;
>>> }
>>> ...;
>>>
>>> but given my debugger series creating gdbsx.c, I was also considering:
>>>
>>> case XEN_DOMCTL_gdbsx_guestmemio:
>>> case XEN_DOMCTL_gdbsx_pausevcpu:
>>> case XEN_DOMCTL_gdbsx_unpausevcpu:
>>> case XEN_DOMCTL_gdbsx_domstatus:
>>> rc = gdbsx_do_domctl(d, iop);
>>> break;
>> I'd go this route.
> +1 if we already start enumerating sub-system domctl-s (as proposed
> for the IOMMU ones as well).
Ok, so that seems like general agreement for "we shouldn't compile out
case statements" which is something we should apply across the codebase
going forward.
For gdbsx_do_domctl() specifically, that's going to want to wait until
"[PATCH v5 0/6] Clean up common/arch split for debugger.h" has gone in,
but I don't anticipate any issues there.
~Andrew
|