Re: [PATCH kvm-unit-tests 8/9] s390x: add vmalloc support

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

 



On 10/01/2018 22:53, David Hildenbrand wrote:
>  
> +typedef uint64_t pgdval_t;		/* Region-1 table entry */
> +typedef uint64_t p4dval_t;		/* Region-2 table entry*/
> +typedef uint64_t pudval_t;		/* Region-3 table Entry */
> +typedef uint64_t pmdval_t;		/* Segment table entry */
> +typedef uint64_t pteval_t;		/* Page table entry */
> +
> +typedef struct { pgdval_t pgd; } pgd_t;
> +typedef struct { p4dval_t p4d; } p4d_t;
> +typedef struct { pudval_t pud; } pud_t;
> +typedef struct { pmdval_t pmd; } pmd_t;
> +typedef struct { pteval_t pte; } pte_t;
> +
> +#define pgd_val(x)	((x).pgd)
> +#define p4d_val(x)	((x).p4d)
> +#define pud_val(x)	((x).pud)
> +#define pmd_val(x)	((x).pmd)
> +#define pte_val(x)	((x).pte)
> +
> +#define __pgd(x)	((pgd_t) { (x) } )
> +#define __p4d(x)	((p4d_t) { (x) } )
> +#define __pud(x)	((pud_t) { (x) } )
> +#define __pmd(x)	((pmd_t) { (x) } )
> +#define __pte(x)	((pte_t) { (x) } )
> +

You don't need to do this.  Using recursive functions as in x86 is
perfectly okay (just use pte_t as an opaque struct for type safety) if
you prefer.

Paolo



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux