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

Re: [PATCH Linux v2 7/7] xen: Add new Xen pv-op pte_get_and_clear.


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Kevin Lampis <kevin.lampis@xxxxxxxxxx>
  • Date: Tue, 15 Sep 2026 17:42:33 +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=arcselector10001; 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=p4gN79TQcPC5idfvpcfAo9WIw4i8UsGMHqTsnqefc7w=; b=NRZwooYzgo+fudkqNo6iO1/LbO3GNNZrLpydH7OCtuCIABbZJXT4T3E6KA/jHIleIYvDqI8l7gI/kS0dWQMc+nAKk3YT1Qyfr9PicBZbBmITcKDzId93xgTAnlb5crMEJt4s5nb7IYcGRf8GnyS8AxVenzQFGW9lkLOjj53/uvL6y75exk3QEoqaskMXYxTkzakdVK5SeZhHhtZA/BZkkd3uge5U+8/SLTQrgXiCAlJLOmGqBztNZ7thoChQv6WJh9VTATKfvYr06Wv7HE+oGUuxXtVbK0+vfOhx/MGHRrojD6eVAJBGIVLRZ29DuIzyzv75z3b0LGJpG4jeh/4E7A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vPRURJwUI9cbGGOtBMdGPEurIWB/B1bwqvf1XO/wcKCfL5vePF8BTr+fVFyxtRMAb/zUEVk50ef/gkcJQVCn4K/7awWIZGLATYitCMG/yXpFVFGGsrLLoxS61v8gD8R8g7vi6IaG6Vlok+dQVdKec8bruNj7c2lmWjjSU+EbbXmhxarl6Q3UBZtGdhVpjvvqfV7lfuj3hZAZmfYIgOjS0xW3Y8GgrIrioFOyS4Hd/8t0iwXGeIQoYQ9QtjsTEM5Oyv2D/qJr/kdgwtWpsJ9gY7Pv4xZYJvY/B4F+sAen5ODte6s9xLjXN/QYT/o9fl0n2ybyh+XC4EnHvlcnqEpgVw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>, "teddy.astie@xxxxxxxxxx" <teddy.astie@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Tue, 15 Sep 2026 17:42:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels:
  • Thread-index: AQHdQWMkTXxtUlg8hk+HuEHbfTb847bJVMcAgAaZYss=
  • Thread-topic: [PATCH Linux v2 7/7] xen: Add new Xen pv-op pte_get_and_clear.

>> diff --git a/arch/x86/include/asm/paravirt.h 
>> b/arch/x86/include/asm/paravirt.h
>> index 0591aa38fd85..0a3a286c46f0 100644
>> --- a/arch/x86/include/asm/paravirt.h
>> +++ b/arch/x86/include/asm/paravirt.h
>> @@ -373,6 +373,11 @@ static inline void set_pmd(pmd_t *pmdp, pmd_t pmd)
>>        PVOP_VCALL2(pv_ops, mmu.set_pmd, pmdp, native_pmd_val(pmd));
>>  }
>> 
>> +static inline pte_t pte_get_and_clear(pte_t *ptep)
>> +{
>> +     return (pte_t){PVOP_CALL1(pte_t, mmu.pte_get_and_clear, ptep)};
>> +}
>> +
>>  static inline pmd_t __pmd(pmdval_t val)
>>  {
>>        return (pmd_t) { PVOP_ALT_CALLEE1(pmdval_t, pv_ops, mmu.make_pmd, val,
>> diff --git a/arch/x86/include/asm/paravirt_types.h 
>> b/arch/x86/include/asm/paravirt_types.h
>> index b4c4a23e77a1..1bd4c19450b5 100644
>> --- a/arch/x86/include/asm/paravirt_types.h
>> +++ b/arch/x86/include/asm/paravirt_types.h
>> @@ -135,6 +135,7 @@ struct pv_mmu_ops {
>>        /* Pagetable manipulation functions */
>>        void (*set_pte)(pte_t *ptep, pte_t pteval);
>>        void (*set_pmd)(pmd_t *pmdp, pmd_t pmdval);
>> +     pte_t (*pte_get_and_clear)(pte_t *ptep);
>> 
>>        pte_t (*ptep_modify_prot_start)(struct vm_area_struct *vma, unsigned 
>>long addr,
>>                                        pte_t *ptep);
>> diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
>> index ac295ca6c92f..b0d7d6520984 100644
>> --- a/arch/x86/include/asm/pgtable.h
>> +++ b/arch/x86/include/asm/pgtable.h
>> @@ -58,6 +58,7 @@ extern pmdval_t early_pmd_flags;
>>  #include <asm/paravirt.h>
>>  #else  /* !CONFIG_PARAVIRT_XXL */
>>  #define set_pte(ptep, pte)           native_set_pte(ptep, pte)
>> +#define pte_get_and_clear(ptep)      native_ptep_get_and_clear(ptep)
>> 
>>  #define set_pte_atomic(ptep, pte)                                    \
>>        native_set_pte_atomic(ptep, pte)
>> @@ -1243,7 +1244,7 @@ bool ptep_clear_flush_young(struct vm_area_struct *vma,
>>  static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long 
>>addr,
>>                                       pte_t *ptep)
>>  {
>> -     pte_t pte = native_ptep_get_and_clear(ptep);
>> ++    pte_t pte = pte_get_and_clear(ptep);
>
>This looks like a typo, on a path you didn't compile.

I don't understand what you mean here.

If `CONFIG_PARAVIRT_XXL` is not set then `pte_get_and_clear()` is replaced
with `native_ptep_get_and_clear()` by the preprocessor.

If `CONFIG_PARAVIRT_XXL` is set then we jump through the pv-op machinery
starting in arch/x86/include/asm/paravirt.h:pte_get_and_clear().


 


Rackspace

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