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

Re: [PATCH v2] x86/livepatch: Fix livepatch application when CET is active


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 17 Apr 2023 20:34:44 +0100
  • 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=wwi354LYQz9HN1BxA3lYJIr3XX6+lUTpBdgKKHkHq7A=; b=FETas9sxy7qZQORcy/bRZNRziOJWDe/YE8jQRS/sjIetDoT2+tKeFy+a1/djpRSyynoe1SX/6koe1y2kC/ixJRjPLf43jnZzIhdMthexFrARogU+LjO0sk8tuK04Q6xo6TFCcD8veQM5HI/eli+Nx1OxCauF0aypMPu+teVDSOB0SokPSC+X4u89P8ARqNbnbxle17rklAbUZVKhXgEX0HIaj9B8wH21e0tKA+XdEYvhJ319OhAb5Dpher55id/HlLzxXs5v+uNI+opAnAwLC3Qvx6MWsKZqHbfYhFI50NEJ77zKrdh0XfRFXWRMBYYpH57+yZUU3JiY+a/kd81UdA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QSjKuuDoEC1xU2ah714KK/PB30IQAsHAZ9zBgwJpdU+wcoXr9G3misGAJNKRlsYZLnuwCXolzRbUZc8iNW6LX1pnFDXLJANLlR4qrTlRsTuqWKJftnSUO+K3e2QsU2Vpj+Wq0CGiVSjCILLFFrai7MhFWQmcXtLMd9/BZNkEdVYkHlf7dg0vguLSpD5BqMJiKN5AoA+HDj1zjqU+MJ8ZxXQAh5jj/9q9rWV7a/HamWHu8ZYzRGWDZCcRxOScZk+boPr0sn/XlRyrSH1RAToPa2g6BlXzJ1HD11tIdnPCzNdFyheXuJaD2CIk0VTSUWe1n5eWZOZuq6wTtM0rmy2MuQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 17 Apr 2023 19:35:26 +0000
  • Ironport-data: A9a23:gx2zmqqIKXbSpUXj/F6IUQY7l0xeBmLdZBIvgKrLsJaIsI4StFCzt garIBmGMqnbZ2HyKN53bti28EkAvMPVxtYyGgNqqy4wESwboJuZCYyVIHmrMnLJJKUvbq7FA +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev NL2sqX3NUSsnjV5KQr40YrawP9UlKm06WJwUmAWP6gR5weCziZNVfrzGInqR5fGatgMdgKFb 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay RAXAGwSNE/EnfPt+oqQWsh2n+UfJ/nEJZxK7xmMzRmBZRonabbqZvyToPN9gnI3jM0IGuvCb c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3jeeraYWJEjCJbZw9ckKwj 2TK5WnmRDodM8SS02Gt+XOwnO7f2yj8Xer+EZXhrq4w0Q3CmjZ75Bs+CGv8hqeSoHaCRogFd Vwd8BEO9Ixj+xn+JjX6d1jiyJKehTYeUddNF+wx6CmW17HZpQ2eAwAsUTppeNEg8sgsSlQC1 ViPhdrlQyNutL69TmiU/bOZ6zi1PEA9PWIEICMJUwYBy93iu50oyALCSM55F6y4hcGzHiv/q w1mtwA7jrQXyMIOiaOy+Amehyr2/8eVCAko+g/QQ2SpqBtjY5KobJCp7l6d6utcKIGeTR+Ku 31sd9Wi0d3ixKqlzESlKNjh1pnwjxpZGFUwWWJSIqQ=
  • Ironport-hdrordr: A9a23:CEGJwKlvSAWw/dCoe1ZbmrP2GdjpDfLo3DAbv31ZSRFFG/Fw9/ rCoB17726QtN91YhsdcL+7V5VoLUmzyXcX2/hyAV7BZmnbUQKTRekP0WKL+Vbd8kbFh41gPM lbEpSXCLfLfCJHZcSR2njELz73quP3jJxBho3lvghQpRkBUdAF0+/gYDzranGfQmN9dP0EPa vZ3OVrjRy6d08aa8yqb0N1JNQq97Xw5fTbiQdtPW9f1DWz
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 17/04/2023 3:51 pm, Jan Beulich wrote:
> On 17.04.2023 16:41, Andrew Cooper wrote:
>> On 17/04/2023 2:59 pm, Jan Beulich wrote:
>>> On 17.04.2023 15:52, Andrew Cooper wrote:
>>>> @@ -5879,6 +5880,73 @@ int destroy_xen_mappings(unsigned long s, unsigned 
>>>> long e)
>>>>      return modify_xen_mappings(s, e, _PAGE_NONE);
>>>>  }
>>>>  
>>>> +/*
>>>> + * Similar to modify_xen_mappings(), but used by the alternatives and
>>>> + * livepatch in weird contexts.  All synchronization, TLB flushing, etc 
>>>> is the
>>>> + * responsibility of the caller, and *MUST* not be introduced here.
>>>> + *
>>>> + * Must be limited to XEN_VIRT_{START,END}, i.e. over l2_xenmap[].
>>>> + * Must be called with present flags, and over present mappings.
>>>> + * Must be called on leaf page boundaries.
>>> This last sentence, while wording-wise correct, could do with making more
>>> explicit that it is the caller's responsibility to know whether large page
>>> mappings are in use, due to ...
>> The meaning here is really "this doesn't shatter superpages", and this
>> was the most concise I could come up with.
>>
>> Would ", i.e. won't shatter 2M pages." as a clarification work?
> Yes, that would definitely help. Nevertheless I was more after something
> like "..., i.e. for 2M mappings on 2M boundaries." Which, thinking about
> it, points out that while you have a respective check for the start
> address, the full 2M page would be changed even if the end address wasn't
> 2M aligned (but fell in the middle of a 2M page).

There's no nice way to check for because a range that starts on a 4k
non-2M boundary can legitimately end on a 2M boundary at 4k granularity.

How about ", i.e. s and e must not be in the middle of a superpage." then?

~Andrew



 


Rackspace

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