[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sh_unshadow_for_p2m_change() vs p2m_set_entry()
- To: Tim Deegan <tim@xxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Fri, 1 Oct 2021 07:59:33 +0200
- 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=G9G37LirOMccvt1T8p/BOjzvkJxVoSMMiY2ReACiTdQ=; b=WXndeGLlDb2XBUCj0P2AzaDzCiZfEZrbhvO9vPIVdlutCljqThIhWf9xTi4YX7ImoslM+7kMe29I59LAIuRBQo5IWDKhRzIosHFbBcIZFMQHiCl3G+YskdHxY5DbupIglTK6069ODsUCDJGeflVEVDvGS9mBFn7JLuc63Buo3nLl2roXuvNiszOueOUqm4sb5P/zbBFPHS5VK8IbTZ5VXL18Q98PyrYYIW+CCor7w22gDxMNTvKGbBLnsFohk0NmrwfXtSXrmlezqFNjDbhhzJS61o1uVeTZoTEzpK7WrITvL+UqOmF3gPPw8HTfGwpILQPPVXYw/oobsqxr2cRYrQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l5J3yCYFXvrsAqVxQD90bC1jvUQ2kPkfHMvHkxdR/jISnNr8+dcOxHgZX5h94+ZI1PQ3PePVuZoqF1ACsFeGRJsKlcSYYDqpxJvGNPrDvtciz/h5W1UyL6sAWafig2Zp+wyYDEuuVWgaTdsBMfK1uJpoge/maADfYufvVKGcqAhOTpZSQjdy3Oo9KGyyCbMM/uPT1TszvrAb87i6I4ZeVgUlvU2yUwHVdGUiO09CUU6be9rCj6qHGRGkQiBTjToQz6heZ11l7UKuzUS2U9xu4KcCCFj0Od639ZM+GFtq3ujdz6KGhBaMmhFwzZQYoxd4ZZPAdQ1ULFCdc5AjchhRug==
- Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Fri, 01 Oct 2021 05:59:58 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 27.09.2021 22:25, Tim Deegan wrote:
> At 13:31 +0200 on 24 Sep (1632490304), Jan Beulich wrote:
>> The 2M logic also first checks _PAGE_PRESENT (and _PAGE_PSE), while
>> the 4k logic appears to infer that the old page was present from
>> p2m_is_{valid,grant}().
>
> I think the p2m_type check is the right one (rather than
> _PAGE_PRESENT), since that's the one that the p2m lookups will obey
> when causing things to get shadowed. But the extra _PAGE_PSE check
> should stay.
Actually, having transformed things into patch form, I'm now puzzled
by you explicitly saying this. Wasn't this check wrong in the first
place? I don't see anything preventing an L1 page table getting
zapped (or replaced by a 2M mapping) all in one go. The full range
of GFNs would need checking in this case as well, just like in the
opposite case (2M mapping getting replaced by an L1 pt).
This scenario may not be overly likely right now, but would become
more likely once we start re-coalescing large pages (which I'm
planning to investigate using the same scheme currently proposed
on the IOMMU side, to see whether this actually happens frequently
enough to be worthwhile).
Jan
|