[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] x86/mm: account for PGT_pae_xen_l2 in recently added assertion
- To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
- Date: Fri, 10 Jun 2022 08:12:42 +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=bmMrXtdP7KrwxUTAv7qdDLC9sk211vTy7IMy+N9vuRg=; b=kzU5K9yJtoLNwxrv3M/1yQrMXws7o0iIopiWgSG2vFFExFe/EQFkFy4qbBJaBuU/par6Ssj09V6ZY0R+TOI/PXCTCPVLXCRVrn52RW8G+stLE9m5sAmsUGXkuMHeAWxh8nM9B7pnkPl4bj+25vUqCcMQiJ4hqmdfxe4VjX4yfoVkSHAvV6lk4vCwmxVEWbBljYdte2Ft5JymwCKUY+vVMSrgULZxWL95EWJh9NUqtjp/txD0PVEyQSVJP/2R2+HqnJSPpLArb8I7YyPzBhoit/J47SvEm2nEx+E486EeywLI9BduRBrjVD8sIyIQdPbhIdVOQ1td70kMb8uN7wvi6w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ljlthibyRFjM1Kjnx5yuzGeGBA3dQpkOZ2Cly2Zm05tKV2lM0WVUo64MssIP+BCBwQTyk2F8g4TQ/MKm1gX+Juceh0BFLFwqPaufh5qowTYIMdfYlZJp1T91CgmpK4xw8bx5BlCeKIr3kw4hhGtmEsJkwGQyoyV9Co6MZyxjarblHHXxhJUNAuciEYS4f3b3O641lrkrzOdcYPPIKesoF0xjbE6MvuD6jjpDLrgehJ5euOlutsBkRqFkVg99WHkioyQDIu5j931TMgmnZlDzGmUY3zZrSztnyHtZMUv+4wrYSsDmcng+PfbkZo5E7NkIQKzxOURArlffyhBc+t4CPQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>
- Delivery-date: Fri, 10 Jun 2022 08:13:00 +0000
- Ironport-data: A9a23:jprdpKxSV+KKKocpCjZ6t+dExyrEfRIJ4+MujC+fZmUNrF6WrkUGn GNMWjrTO/reMGehcoxyOt/n/UNXusSDmIdrGwJurSAxQypGp/SeCIXCJC8cHc8zwu4v7q5Dx 59DAjUVBJlsFhcwnj/0bv656yMUOZigHtIQMsadUsxKbVIiGX5JZS5LwbZj2NY22IDhWmthh PupyyHhEA79s9JLGjp8B5Kr8HuDa9yr5Vv0FnRnDRx6lAe2e0s9VfrzFonoR5fMeaFGH/bSe gr25OrRElU1XfsaIojNfr7TKiXmS1NJVOSEoiI+t6OK2nCuqsGuu0qS2TV1hUp/0l20c95NJ Npl5JKuVxlzObb2vaciYx94HzMjJKB+9+qSSZS/mZT7I0zuVVLJmq0rJmdpeIoS96BwHH1E8 uEeJHYVdBefiumqwbW9DO5xmsAkK8qtN4Qa0p1i5WiBUbB6HtacG+OTvYAwMDQY36iiGd73Y cYDZCUpRxPHexBVYX8cCY4knffujX76G9FdgA3P+/ZpszaMpOB3+LzvbOrzdOapfNtqu3qTi WHl/E7LHQ5PYbRzzhLAqBpAnNTnnyn2RYYTH72Q7eNxjRuYwWl7IA0bUx63rOe0jma6WslDM AoE9yw2t68w+Ue3CN7nUHWQv3qsrhMaHd1KHIUHBBqlz6PV50OTADcCRzsYMNg+7pZuGnoty 0ODmM7vCXp3qrqJRHmB97CS6zSvJSwSKmxEbigBJecY3+TeTEgIpkqnZr5e/GSd17UZxRmYL +i2kRUD
- Ironport-hdrordr: A9a23:3Tig86H0a2zoOLHrpLqFsZLXdLJyesId70hD6qkvc3Fom52j/f xGws5x6fatskdrZJkh8erwW5Vp2RvnhNJICPoqTM2ftW7dySSVxeBZnMbfKljbdxEWmdQtsp uIH5IeNDS0NykDsS+Y2nj3Lz9D+qjgzEnAv463oBlQpENRGthdBmxCe2Sm+zhNNW177O0CZf +hD6R8xwaISDAyVICWF3MFV+/Mq5ngj5T9eyMLABYh9U2nkS6owKSSKWnZ4j4uFxd0hZsy+2 nMlAL0oo+5teug9xPa32jPq7xLhdrazMdZDsDksLlXFtyssHfrWG1SYczHgNkHmpDp1L/sqq iLn/4UBbU315oWRBDtnfKi4Xi57N9k0Q6e9bbRuwqenSW+fkN6NyMJv/MmTvOSgXBQw+1Uwe ZF2XmUuIFQCg6FlCPh58LQXxUvjUasp2E++NRjx0C3fLFuHoO5l7ZvtX+90a1wbh7S+cQiCq 1jHcvc7PFZfReTaG3YpHBmxJipUm4oFhmLT0AesojNugIm1kxR3g8d3ogSj30A/JUyR91N4P nFKL1hkPVLQtUNZaxwCe8dSY+8C3DLQxjLLGWOSG6XX50vKjbIsdr68b817OaldNgBy4Yzgo 3IVBdCuWs7ayvVeLqzNV1wg2TwqUmGLETQI5tllulEU5XHNcnWGDzGTkwymM29pPhaCtHHWp +ISedrP8M=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHYfJt5YVvowoL3VkeMPGEizKI7eK1ISn8A
- Thread-topic: [PATCH] x86/mm: account for PGT_pae_xen_l2 in recently added assertion
On 10/06/2022 08:26, Jan Beulich wrote:
> While PGT_pae_xen_l2 will be zapped once the type refcount of an L2 page
> reaches zero, it'll be retained as long as the type refcount is non-
> zero. Hence any checking against the requested type needs to either zap
> the bit from the type or include it in the used mask.
>
> Fixes: 9186e96b199e ("x86/pv: Clean up _get_page_type()")
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
pae_xen_l2 being outside of the typemask is deeply confusing to work
with. It also renders all of the comments trying to explain the
structure of this logic wrong.
I'm a little concerned with type usage in the non-coherent path too.
It's safe, but is (along side the IOMMU path) a misleading example to
surrounding code.
Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
I can't think of anything better to do in the short term.
> ---
> The check around the TLB flush which was moved for XSA-401 also looks to
> needlessly trigger a flush when "type" has the bit set (while "x"
> wouldn't). That's no different from original behavior, but still looks
> inefficient.
It's not the only inefficiency here. Still plenty of improvements to be
had in _get_page_type().
~Andrew
|