xen/x86: Fixup misc stale issues
PATCH 1/3 xen/x86: Fixup misc stale issues
* Dom0 does now have an arch_config passed.
* hypercall() and smp_alloc_memory() no longer exist.
---
CC: Jan Beulich <[email protected]>
--- 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(-)
xen/arch/x86/setup.c +1 -5
@@ -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" );
xen/include/asm-x86/processor.h +0 -2
@@ -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);
xen/include/asm-x86/smp.h +0 -2
@@ -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);
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
PATCH 2/3 x86/mm: Use IS_ALIGNED() rather than open coding it
Drop repeated identical BUILD_BUG_ON()'s
---
CC: Jan Beulich <[email protected]>
CC: George Dunlap <[email protected]>
--- xen/arch/x86/x86_64/mm.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
xen/arch/x86/x86_64/mm.c +5 -7
@@ -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));
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 2/3] x86/mm: Use IS_ALIGNED() rather than open coding it
Quoted 15 lines · Andrew Cooper
Drop repeated identical BUILD_BUG_ON()'s
Signed-off-by Andrew Cooper <[email protected]>---
CC: Jan Beulich <[email protected]>
CC: George Dunlap <[email protected]>--- xen/arch/x86/x86_64/mm.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)xen/arch/x86/x86_64/mm.c +0
-0
xen/arch/x86/x86_64/mm.c void __init paging_init(void) · line 543
Quoted 5 lines
xen/arch/x86/x86_64/mm.c +1
-1@@ -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
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH 2/3] x86/mm: Use IS_ALIGNED() rather than open coding it
Quoted 24 lines · George Dunlap
Quoted 15 lines · Andrew Cooper
Drop repeated identical BUILD_BUG_ON()'s
Signed-off-by Andrew Cooper <[email protected]>---
CC: Jan Beulich <[email protected]>
CC: George Dunlap <[email protected]>--- xen/arch/x86/x86_64/mm.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)xen/arch/x86/x86_64/mm.c +0
-0xen/arch/x86/x86_64/mm.c void __init paging_init(void) · line 543
Quoted 5 lines
xen/arch/x86/x86_64/mm.c +1
-1@@ -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(inxen/include/xen/config.h):
Quoted 6 lines
#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
[email protected]
https://lists.xen.org/xen-devel
PATCH 3/3 x86/svm: Drop adjustment of X86_FEATURE_APIC
In reply to Andrew CooperThe common hvm_cpuid() code already does this.
---
CC: Jan Beulich <[email protected]>
CC: Boris Ostrovsky <[email protected]>
CC: Suravee Suthikulpanit <[email protected]>
--- xen/arch/x86/hvm/svm/svm.c | 5 ----- 1 file changed, 5 deletions(-)
xen/arch/x86/hvm/svm/svm.c +0 -5
@@ -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 */
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 3/3] x86/svm: Drop adjustment of X86_FEATURE_APIC
Quoted 7 lines · Andrew Cooper
The common
hvm_cpuid()code already does this.Signed-off-by Andrew Cooper <[email protected]>---
CC: Jan Beulich <[email protected]>
CC: Boris Ostrovsky <[email protected]>
CC: Suravee Suthikulpanit <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 14.10.16 at 18:02, <[email protected]> wrote:
* Dom0 does now have an
arch_configpassed.
*hypercall()andsmp_alloc_memory()no longer exist.Signed-off-by Andrew Cooper <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 7 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 14.10.16 at 18:02, <[email protected]> wrote:
* Dom0 does now have an
arch_configpassed.
*hypercall()andsmp_alloc_memory()no longer exist.Signed-off-by Andrew Cooper <[email protected]>Acked-by Jan Beulich <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel