xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] xen/x86: Fixup misc stale issues
@ 2016-10-14 16:02 Andrew Cooper
  2016-10-14 16:02 ` [PATCH 2/3] x86/mm: Use IS_ALIGNED() rather than open coding it Andrew Cooper
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Andrew Cooper @ 2016-10-14 16:02 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Jan Beulich

 * Dom0 does now have an arch_config passed.
 * hypercall() and smp_alloc_memory() no longer exist.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
---
 xen/arch/x86/setup.c            | 6 +-----
 xen/include/asm-x86/processor.h | 2 --
 xen/include/asm-x86/smp.h       | 2 --
 3 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 8ae897a..41f9a5b 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1493,11 +1493,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     if ( opt_dom0pvh )
         domcr_flags |= DOMCRF_pvh | DOMCRF_hap;
 
-    /*
-     * Create initial domain 0.
-     * x86 doesn't support arch-configuration. So it's fine to pass
-     * NULL.
-     */
+    /* Create initial domain 0. */
     dom0 = domain_create(0, domcr_flags, 0, &config);
     if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) == NULL) )
         panic("Error creating domain 0");
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index 3e6e355..6378afd 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -612,8 +612,6 @@ struct stubs {
 DECLARE_PER_CPU(struct stubs, stubs);
 unsigned long alloc_stub_page(unsigned int cpu, unsigned long *mfn);
 
-extern int hypercall(void);
-
 int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx,
           uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx);
 int rdmsr_hypervisor_regs(uint32_t idx, uint64_t *val);
diff --git a/xen/include/asm-x86/smp.h b/xen/include/asm-x86/smp.h
index 33c2c32..e3782bb 100644
--- a/xen/include/asm-x86/smp.h
+++ b/xen/include/asm-x86/smp.h
@@ -23,8 +23,6 @@
 /*
  * Private routines/data
  */
- 
-extern void smp_alloc_memory(void);
 DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
 DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] x86/mm: Use IS_ALIGNED() rather than open coding it
  2016-10-14 16:02 [PATCH 1/3] xen/x86: Fixup misc stale issues Andrew Cooper
@ 2016-10-14 16:02 ` Andrew Cooper
  2016-10-20 16:37   ` George Dunlap
  2016-10-14 16:02 ` [PATCH 3/3] x86/svm: Drop adjustment of X86_FEATURE_APIC Andrew Cooper
  2016-10-24  9:26 ` [PATCH 1/3] xen/x86: Fixup misc stale issues Jan Beulich
  2 siblings, 1 reply; 8+ messages in thread
From: Andrew Cooper @ 2016-10-14 16:02 UTC (permalink / raw)
  To: Xen-devel; +Cc: George Dunlap, Andrew Cooper, Jan Beulich

Drop repeated identical BUILD_BUG_ON()'s

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/arch/x86/x86_64/mm.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index b8b6b70..0083beb 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -540,7 +540,7 @@ void __init paging_init(void)
                  sizeof(*machine_to_phys_mapping));
     for ( i = 0; i < (mpt_size >> L2_PAGETABLE_SHIFT); i++ )
     {
-        BUILD_BUG_ON(RO_MPT_VIRT_START & ((1UL << L3_PAGETABLE_SHIFT) - 1));
+        BUILD_BUG_ON(!IS_ALIGNED(RO_MPT_VIRT_START, L3_PAGETABLE_SHIFT));
         va = RO_MPT_VIRT_START + (i << L2_PAGETABLE_SHIFT);
         memflags = MEMF_node(phys_to_nid(i <<
             (L2_PAGETABLE_SHIFT - 3 + PAGE_SHIFT)));
@@ -776,8 +776,8 @@ static int setup_frametable_chunk(void *start, void *end,
     unsigned long mfn;
     int err;
 
-    ASSERT(!(s & ((1 << L2_PAGETABLE_SHIFT) - 1)));
-    ASSERT(!(e & ((1 << L2_PAGETABLE_SHIFT) - 1)));
+    ASSERT(IS_ALIGNED(s, L2_PAGETABLE_SHIFT));
+    ASSERT(IS_ALIGNED(e, L2_PAGETABLE_SHIFT));
 
     for ( ; s < e; s += (1UL << L2_PAGETABLE_SHIFT))
     {
@@ -838,8 +838,8 @@ void __init subarch_init_memory(void)
     l3_pgentry_t l3e;
     l2_pgentry_t l2e;
 
-    BUILD_BUG_ON(RDWR_MPT_VIRT_START & ((1UL << L3_PAGETABLE_SHIFT) - 1));
-    BUILD_BUG_ON(RDWR_MPT_VIRT_END   & ((1UL << L3_PAGETABLE_SHIFT) - 1));
+    BUILD_BUG_ON(!IS_ALIGNED(RDWR_MPT_VIRT_START, L3_PAGETABLE_SHIFT));
+    BUILD_BUG_ON(!IS_ALIGNED(RDWR_MPT_VIRT_END,   L3_PAGETABLE_SHIFT));
     /* M2P table is mappable read-only by privileged domains. */
     for ( v  = RDWR_MPT_VIRT_START;
           v != RDWR_MPT_VIRT_END;
@@ -934,8 +934,6 @@ long subarch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&xmml, arg, 1) )
             return -EFAULT;
 
-        BUILD_BUG_ON(RDWR_MPT_VIRT_START & ((1UL << L3_PAGETABLE_SHIFT) - 1));
-        BUILD_BUG_ON(RDWR_MPT_VIRT_END   & ((1UL << L3_PAGETABLE_SHIFT) - 1));
         for ( i = 0, v = RDWR_MPT_VIRT_START, last_mfn = 0;
               (i != xmml.max_extents) &&
               (v < (unsigned long)(machine_to_phys_mapping + max_page));
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] x86/svm: Drop adjustment of X86_FEATURE_APIC
  2016-10-14 16:02 [PATCH 1/3] xen/x86: Fixup misc stale issues Andrew Cooper
  2016-10-14 16:02 ` [PATCH 2/3] x86/mm: Use IS_ALIGNED() rather than open coding it Andrew Cooper
@ 2016-10-14 16:02 ` Andrew Cooper
  2016-10-14 16:34   ` Boris Ostrovsky
  2016-10-24  9:26 ` [PATCH 1/3] xen/x86: Fixup misc stale issues Jan Beulich
  2 siblings, 1 reply; 8+ messages in thread
From: Andrew Cooper @ 2016-10-14 16:02 UTC (permalink / raw)
  To: Xen-devel
  Cc: Andrew Cooper, Boris Ostrovsky, Suravee Suthikulpanit,
	Jan Beulich

The common hvm_cpuid() code already does this.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
CC: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
 xen/arch/x86/hvm/svm/svm.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 0ed3e73..16427f6 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1572,11 +1572,6 @@ static void svm_cpuid_intercept(
     hvm_cpuid(input, eax, ebx, ecx, edx);
 
     switch (input) {
-    case 0x80000001:
-        /* Fix up VLAPIC details. */
-        if ( vlapic_hw_disabled(vcpu_vlapic(v)) )
-            __clear_bit(X86_FEATURE_APIC & 31, edx);
-        break;
     case 0x8000001c: 
     {
         /* LWP capability CPUID */
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] x86/svm: Drop adjustment of X86_FEATURE_APIC
  2016-10-14 16:02 ` [PATCH 3/3] x86/svm: Drop adjustment of X86_FEATURE_APIC Andrew Cooper
@ 2016-10-14 16:34   ` Boris Ostrovsky
  0 siblings, 0 replies; 8+ messages in thread
From: Boris Ostrovsky @ 2016-10-14 16:34 UTC (permalink / raw)
  To: Andrew Cooper, Xen-devel; +Cc: Suravee Suthikulpanit, Jan Beulich

On 10/14/2016 12:02 PM, Andrew Cooper wrote:
> The common hvm_cpuid() code already does this.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> CC: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] x86/mm: Use IS_ALIGNED() rather than open coding it
  2016-10-14 16:02 ` [PATCH 2/3] x86/mm: Use IS_ALIGNED() rather than open coding it Andrew Cooper
@ 2016-10-20 16:37   ` George Dunlap
  2016-10-20 16:48     ` Andrew Cooper
  0 siblings, 1 reply; 8+ messages in thread
From: George Dunlap @ 2016-10-20 16:37 UTC (permalink / raw)
  To: Andrew Cooper, Xen-devel; +Cc: George Dunlap, Jan Beulich

On 14/10/16 17:02, Andrew Cooper wrote:
> Drop repeated identical BUILD_BUG_ON()'s
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: George Dunlap <george.dunlap@eu.citrix.com>
> ---
>  xen/arch/x86/x86_64/mm.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
> index b8b6b70..0083beb 100644
> --- a/xen/arch/x86/x86_64/mm.c
> +++ b/xen/arch/x86/x86_64/mm.c
> @@ -540,7 +540,7 @@ void __init paging_init(void)
>                   sizeof(*machine_to_phys_mapping));
>      for ( i = 0; i < (mpt_size >> L2_PAGETABLE_SHIFT); i++ )
>      {
> -        BUILD_BUG_ON(RO_MPT_VIRT_START & ((1UL << L3_PAGETABLE_SHIFT) - 1));
> +        BUILD_BUG_ON(!IS_ALIGNED(RO_MPT_VIRT_START, L3_PAGETABLE_SHIFT));

This doesn't look right.  This is what I have for IS_ALIGNED (in
xen/include/xen/config.h):

#define IS_ALIGNED(val, align) (((val) & ((align) - 1)) == 0)

There's no shift in the #define, but you've taken it out of the calling
code.

Did I miss something?

 -George



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] x86/mm: Use IS_ALIGNED() rather than open coding it
  2016-10-20 16:37   ` George Dunlap
@ 2016-10-20 16:48     ` Andrew Cooper
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Cooper @ 2016-10-20 16:48 UTC (permalink / raw)
  To: George Dunlap, Xen-devel; +Cc: George Dunlap, Jan Beulich

On 20/10/16 17:37, George Dunlap wrote:
> On 14/10/16 17:02, Andrew Cooper wrote:
>> Drop repeated identical BUILD_BUG_ON()'s
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Jan Beulich <JBeulich@suse.com>
>> CC: George Dunlap <george.dunlap@eu.citrix.com>
>> ---
>>  xen/arch/x86/x86_64/mm.c | 12 +++++-------
>>  1 file changed, 5 insertions(+), 7 deletions(-)
>>
>> diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
>> index b8b6b70..0083beb 100644
>> --- a/xen/arch/x86/x86_64/mm.c
>> +++ b/xen/arch/x86/x86_64/mm.c
>> @@ -540,7 +540,7 @@ void __init paging_init(void)
>>                   sizeof(*machine_to_phys_mapping));
>>      for ( i = 0; i < (mpt_size >> L2_PAGETABLE_SHIFT); i++ )
>>      {
>> -        BUILD_BUG_ON(RO_MPT_VIRT_START & ((1UL << L3_PAGETABLE_SHIFT) - 1));
>> +        BUILD_BUG_ON(!IS_ALIGNED(RO_MPT_VIRT_START, L3_PAGETABLE_SHIFT));
> This doesn't look right.  This is what I have for IS_ALIGNED (in
> xen/include/xen/config.h):
>
> #define IS_ALIGNED(val, align) (((val) & ((align) - 1)) == 0)
>
> There's no shift in the #define, but you've taken it out of the calling
> code.
>
> Did I miss something?

No.  I did.  Sorry for the noise.

This was originally part of a larger series, which I thought I had
cherrypicked out correctly but clearly haven't.

I will drop it for now.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] xen/x86: Fixup misc stale issues
  2016-10-14 16:02 [PATCH 1/3] xen/x86: Fixup misc stale issues Andrew Cooper
  2016-10-14 16:02 ` [PATCH 2/3] x86/mm: Use IS_ALIGNED() rather than open coding it Andrew Cooper
  2016-10-14 16:02 ` [PATCH 3/3] x86/svm: Drop adjustment of X86_FEATURE_APIC Andrew Cooper
@ 2016-10-24  9:26 ` Jan Beulich
  2016-10-24 10:15   ` Wei Liu
  2 siblings, 1 reply; 8+ messages in thread
From: Jan Beulich @ 2016-10-24  9:26 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Xen-devel

 >>> On 14.10.16 at 18:02, <andrew.cooper3@citrix.com> wrote:
> * Dom0 does now have an arch_config passed.
>  * hypercall() and smp_alloc_memory() no longer exist.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] xen/x86: Fixup misc stale issues
  2016-10-24  9:26 ` [PATCH 1/3] xen/x86: Fixup misc stale issues Jan Beulich
@ 2016-10-24 10:15   ` Wei Liu
  0 siblings, 0 replies; 8+ messages in thread
From: Wei Liu @ 2016-10-24 10:15 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Andrew Cooper, Wei Liu, Xen-devel

On Mon, Oct 24, 2016 at 03:26:20AM -0600, Jan Beulich wrote:
>  >>> On 14.10.16 at 18:02, <andrew.cooper3@citrix.com> wrote:
> > * Dom0 does now have an arch_config passed.
> >  * hypercall() and smp_alloc_memory() no longer exist.
> > 
> > Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Acked-by: Jan Beulich <jbeulich@suse.com>

Release-acked-by: Wei Liu <wei.liu2@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-10-24 10:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-14 16:02 [PATCH 1/3] xen/x86: Fixup misc stale issues Andrew Cooper
2016-10-14 16:02 ` [PATCH 2/3] x86/mm: Use IS_ALIGNED() rather than open coding it Andrew Cooper
2016-10-20 16:37   ` George Dunlap
2016-10-20 16:48     ` Andrew Cooper
2016-10-14 16:02 ` [PATCH 3/3] x86/svm: Drop adjustment of X86_FEATURE_APIC Andrew Cooper
2016-10-14 16:34   ` Boris Ostrovsky
2016-10-24  9:26 ` [PATCH 1/3] xen/x86: Fixup misc stale issues Jan Beulich
2016-10-24 10:15   ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).