[llvmlinux] [PATCH] DO-NOT-UPSTREAM xen, LLVMLinux: Remove VLAIS from xen mmu

Behan Webster behanw at converseincode.com
Sun Dec 14 03:21:35 UTC 2014


arch/x86_64. Jan-Simon is likely going to link i586 to x86_64 anyways.

Behan

On 12/13/14 19:19, Vinícius Tinti wrote:
> Hi,
>
> I have patched the VLAIS on Xen but I am not sure if I should place it
> on arch/i586 and arch/x86_64 or just put it on arch/all.
> Which one should I pick? I would prefer to put it in arch/all to get
> visibility however it does not affect any other target.
>
> Regards,
> Vinícius
>
> On Sun, Dec 14, 2014 at 1:16 AM, Vinícius Tinti <viniciustinti at gmail.com> wrote:
>> Signed-off-by: Vinícius Tinti <viniciustinti at gmail.com>
>> ---
>>   arch/x86/xen/mmu.c | 35 ++++++++++++++++++-----------------
>>   1 file changed, 18 insertions(+), 17 deletions(-)
>>
>> diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
>> index a8a1a3d..fcad962 100644
>> --- a/arch/x86/xen/mmu.c
>> +++ b/arch/x86/xen/mmu.c
>> @@ -1304,36 +1304,37 @@ static void xen_flush_tlb_others(const struct cpumask *cpus,
>>                                   struct mm_struct *mm, unsigned long start,
>>                                   unsigned long end)
>>   {
>> -       struct {
>> -               struct mmuext_op op;
>> -#ifdef CONFIG_SMP
>> -               DECLARE_BITMAP(mask, num_processors);
>> -#else
>> -               DECLARE_BITMAP(mask, NR_CPUS);
>> -#endif
>> -       } *args;
>>          struct multicall_space mcs;
>> +       struct mmuext_op *op;
>> +       struct cpumask *mask;
>>
>>          trace_xen_mmu_flush_tlb_others(cpus, mm, start, end);
>>
>>          if (cpumask_empty(cpus))
>>                  return;         /* nothing to do */
>>
>> -       mcs = xen_mc_entry(sizeof(*args));
>> -       args = mcs.args;
>> -       args->op.arg2.vcpumask = to_cpumask(args->mask);
>> +#ifdef CONFIG_SMP
>> +       mcs = xen_mc_entry(sizeof(struct mmuext_op) + BITS_TO_LONGS(num_processors)*sizeof(unsigned long));
>> +#else
>> +       mcs = xen_mc_entry(sizeof(struct mmuext_op) + BITS_TO_LONGS(NR_CPUS)*sizeof(unsigned long));
>> +#endif
>> +       /* Extract fields */
>> +       op = mcs.args;
>> +       mask = to_cpumask(mcs.args + sizeof(struct mmuext_op));
>> +
>> +       op->arg2.vcpumask = mask;
>>
>>          /* Remove us, and any offline CPUS. */
>> -       cpumask_and(to_cpumask(args->mask), cpus, cpu_online_mask);
>> -       cpumask_clear_cpu(smp_processor_id(), to_cpumask(args->mask));
>> +       cpumask_and(mask, cpus, cpu_online_mask);
>> +       cpumask_clear_cpu(smp_processor_id(), mask);
>>
>> -       args->op.cmd = MMUEXT_TLB_FLUSH_MULTI;
>> +       op->cmd = MMUEXT_TLB_FLUSH_MULTI;
>>          if (end != TLB_FLUSH_ALL && (end - start) <= PAGE_SIZE) {
>> -               args->op.cmd = MMUEXT_INVLPG_MULTI;
>> -               args->op.arg1.linear_addr = start;
>> +               op->cmd = MMUEXT_INVLPG_MULTI;
>> +               op->arg1.linear_addr = start;
>>          }
>>
>> -       MULTI_mmuext_op(mcs.mc, &args->op, 1, NULL, DOMID_SELF);
>> +       MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF);
>>
>>          xen_mc_issue(PARAVIRT_LAZY_MMU);
>>   }
>> --
>> 2.1.3
>>
>
>


-- 
Behan Webster
behanw at converseincode.com



More information about the LLVMLinux mailing list