public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Alexander Gordeev <agordeev@redhat.com>, kvm@vger.kernel.org
Cc: "Andrew Jones" <drjones@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [kvm-unit-tests PATCH v8 08/12] x86: Cleanup PAGE_* constants
Date: Mon, 6 Jun 2016 17:21:23 +0200	[thread overview]
Message-ID: <d00a3576-b5e2-4c3f-535b-b6a9ac3b945b@redhat.com> (raw)
In-Reply-To: <67978bcc43b1e15d826583ce26b828ea4bdc6b7e.1465207665.git.agordeev@redhat.com>



On 06/06/2016 12:25, Alexander Gordeev wrote:
> Cc: Andrew Jones <drjones@redhat.com>
> Cc: Thomas Huth <thuth@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Radim Krčmář <rkrcmar@redhat.com>
> Reviewed-by: Andrew Jones <drjones@redhat.com>
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> ---
>  lib/x86/asm/page.h | 10 +++++++++-
>  x86/access.c       |  4 +---
>  x86/vmx.h          |  2 +-
>  3 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/lib/x86/asm/page.h b/lib/x86/asm/page.h
> index d4580b40f5e8..916462d758ac 100644
> --- a/lib/x86/asm/page.h
> +++ b/lib/x86/asm/page.h
> @@ -7,7 +7,14 @@
>   */
>  
>  
> -#define PAGE_SIZE	4096ul
> +#include <linux/const.h>

No linux/ includes here, but you can just use the existing

#define PAGE_SIZE	4096ul

definition.

Paolo

> +
> +#define PAGE_SHIFT	12
> +#define PAGE_SIZE	(_AC(1,UL) << PAGE_SHIFT)
> +#define PAGE_MASK	(~(PAGE_SIZE-1))
> +
> +#ifndef __ASSEMBLY__
> +
>  #ifdef __x86_64__
>  #define LARGE_PAGE_SIZE	(512 * PAGE_SIZE)
>  #else
> @@ -30,4 +37,5 @@
>  #define	PGDIR_MASK	1023
>  #endif
>  
> +#endif /* !__ASSEMBLY__ */
>  #endif
> diff --git a/x86/access.c b/x86/access.c
> index 4acaee5c6b4d..aaf805d1ea7c 100644
> --- a/x86/access.c
> +++ b/x86/access.c
> @@ -2,6 +2,7 @@
>  #include "libcflat.h"
>  #include "desc.h"
>  #include "processor.h"
> +#include "asm/page.h"
>  
>  #define smp_id() 0
>  
> @@ -15,9 +16,6 @@ static int cpuid_7_ebx;
>  static int cpuid_7_ecx;
>  static int invalid_mask;
>  
> -#define PAGE_SIZE ((pt_element_t)4096)
> -#define PAGE_MASK (~(PAGE_SIZE-1))
> -
>  #define PT_BASE_ADDR_MASK ((pt_element_t)((((pt_element_t)1 << 40) - 1) & PAGE_MASK))
>  #define PT_PSE_BASE_ADDR_MASK (PT_BASE_ADDR_MASK & ~(1ull << 21))
>  
> diff --git a/x86/vmx.h b/x86/vmx.h
> index d6bc217cb1cf..27f345190bee 100644
> --- a/x86/vmx.h
> +++ b/x86/vmx.h
> @@ -4,6 +4,7 @@
>  #include "libcflat.h"
>  #include "processor.h"
>  #include "bitops.h"
> +#include "asm/page.h"
>  
>  struct vmcs {
>  	u32 revision_id; /* vmcs revision identifier */
> @@ -476,7 +477,6 @@ enum Ctrl1 {
>  #define EPT_PGDIR_ENTRIES	(1 << EPT_PGDIR_WIDTH)
>  #define EPT_LEVEL_SHIFT(level)	(((level)-1) * EPT_PGDIR_WIDTH + 12)
>  #define EPT_ADDR_MASK		GENMASK_ULL(51, 12)
> -#define PAGE_MASK		(~(PAGE_SIZE-1))
>  #define PAGE_MASK_2M		(~(PAGE_SIZE_2M-1))
>  
>  #define EPT_VLT_RD		1
> 

  reply	other threads:[~2016-06-06 15:21 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-06 10:25 [kvm-unit-tests PATCH v8 00/12] Cleanup low-level arch code Alexander Gordeev
2016-06-06 10:25 ` [kvm-unit-tests PATCH v8 01/12] Remove unused and unnecessary PHYS32 macro Alexander Gordeev
2016-06-06 10:25 ` [kvm-unit-tests PATCH v8 02/12] Move phys_addr_t type definition to lib/libcflat.h Alexander Gordeev
2016-06-06 10:25 ` [kvm-unit-tests PATCH v8 03/12] x86: Introduce lib/x86/asm/page.h Alexander Gordeev
2016-06-06 10:25 ` [kvm-unit-tests PATCH v8 04/12] x86: Introduce lib/x86/asm/io.h Alexander Gordeev
2016-06-06 10:25 ` [kvm-unit-tests PATCH v8 05/12] x86: Introduce lib/x86/asm/barrier.h Alexander Gordeev
2016-06-06 10:25 ` [kvm-unit-tests PATCH v8 06/12] io: Separate overrides of virt_to_phys() and phys_to_virt() Alexander Gordeev
2016-06-06 10:25 ` [kvm-unit-tests PATCH v8 07/12] io: Disallow memory re-ordering for generic memory barriers Alexander Gordeev
2016-06-06 10:25 ` [kvm-unit-tests PATCH v8 08/12] x86: Cleanup PAGE_* constants Alexander Gordeev
2016-06-06 15:21   ` Paolo Bonzini [this message]
2016-06-08  7:59     ` Alexander Gordeev
2016-06-08  7:58       ` Paolo Bonzini
2016-06-08 10:07         ` Andrew Jones
2016-06-08 10:19           ` Paolo Bonzini
2016-06-06 10:25 ` [kvm-unit-tests PATCH v8 09/12] x86: Cleanup PT_*_MASK flags Alexander Gordeev
2016-06-06 10:25 ` [kvm-unit-tests PATCH v8 10/12] io: Make ioremap() prototype conform to Linux one Alexander Gordeev
2016-06-06 10:25 ` [kvm-unit-tests PATCH v8 11/12] x86: io: Factor out ioremap() Alexander Gordeev
2016-06-06 10:25 ` [kvm-unit-tests PATCH v8 12/12] io: Unify IO accessors across architectures Alexander Gordeev
2016-06-06 12:22   ` Andrew Jones
2016-06-10  6:36     ` [kvm-unit-tests PATCH v9 12/12] ppc64: Introduce lib/ppc64/asm/barrier.h Alexander Gordeev
2016-06-10  7:01       ` Andrew Jones
2016-06-10  7:08         ` Andrew Jones
2016-06-10  8:17           ` [kvm-unit-tests PATCH v10 " Alexander Gordeev
2016-06-13 10:49             ` Andrew Jones
2016-06-13 13:34               ` Paolo Bonzini
2016-06-13 14:04                 ` Andrew Jones
2016-06-13 14:16                   ` Paolo Bonzini
2016-07-11 14:52                   ` Paolo Bonzini
2016-06-10  6:37     ` [kvm-unit-tests PATCH v9 13/12] io: Unify IO accessors across architectures Alexander Gordeev
2016-06-10  7:07       ` Andrew Jones
2016-06-10  8:13         ` Alexander Gordeev
2016-06-10  8:17         ` [kvm-unit-tests PATCH v10 " Alexander Gordeev
2016-06-13 10:51           ` Andrew Jones
2016-06-13 13:35       ` [kvm-unit-tests PATCH v9 " Paolo Bonzini
2016-06-13 13:57         ` Andrew Jones
2016-06-13 14:03           ` Paolo Bonzini
2016-06-13 14:17             ` Andrew Jones
2016-06-29  8:24               ` Alexander Gordeev
2016-07-09 20:39                 ` Alexander Gordeev
2016-07-11 15:01                   ` Paolo Bonzini
2016-07-11 16:17                     ` Alexander Gordeev
2016-07-11 16:15                       ` Paolo Bonzini
2016-07-12  8:27                       ` Andrew Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d00a3576-b5e2-4c3f-535b-b6a9ac3b945b@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=agordeev@redhat.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=rkrcmar@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox