lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 08 Oct 2012 13:23:32 +0800
From:	Wen Congyang <wency@...fujitsu.com>
To:	Andi Kleen <andi@...stfloor.org>
CC:	Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>, x86@...nel.org,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	linuxppc-dev@...ts.ozlabs.org, linux-acpi@...r.kernel.org,
	linux-s390@...r.kernel.org, linux-sh@...r.kernel.org,
	linux-ia64@...r.kernel.org, cmetcalf@...era.com,
	sparclinux@...r.kernel.org, rientjes@...gle.com, liuj97@...il.com,
	len.brown@...el.com, cl@...ux.com, minchan.kim@...il.com,
	akpm@...ux-foundation.org, kosaki.motohiro@...fujitsu.com
Subject: Re: [PATCH 8/10] memory-hotplug : remove page table of x86_64 architecture

At 10/08/2012 12:37 PM, Andi Kleen Wrote:
> Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com> writes:
>> +			}
>> +
>> +			/*
>> +			 * We use 2M page, but we need to remove part of them,
>> +			 * so split 2M page to 4K page.
>> +			 */
>> +			pte = alloc_low_page(&pte_phys);
> 
> What happens when the allocation fails?
> 
> alloc_low_page seems to be buggy there too, it would __pa a NULL 
> pointer.

Yes, it will cause kernek panicked in __pa() if CONFI_DEBUG_VIRTUAL is set.
Otherwise, it will return a NULL pointer. I will update this patch to deal
with NULL pointer.

> 
>> +		if (pud_large(*pud)) {
>> +			if ((addr & ~PUD_MASK) == 0 && next <= end) {
>> +				set_pud(pud, __pud(0));
>> +				pages++;
>> +				continue;
>> +			}
>> +
>> +			/*
>> +			 * We use 1G page, but we need to remove part of them,
>> +			 * so split 1G page to 2M page.
>> +			 */
>> +			pmd = alloc_low_page(&pmd_phys);
> 
> Same here
> 
>> +			__split_large_page((pte_t *)pud, addr, (pte_t *)pmd);
>> +
>> +			spin_lock(&init_mm.page_table_lock);
>> +			pud_populate(&init_mm, pud, __va(pmd_phys));
>> +			spin_unlock(&init_mm.page_table_lock);
>> +		}
>> +
>> +		pmd = map_low_page(pmd_offset(pud, 0));
>> +		phys_pmd_remove(pmd, addr, end);
>> +		unmap_low_page(pmd);
>> +		__flush_tlb_all();
>> +	}
>> +	__flush_tlb_all();
> 
> This doesn't flush the other CPUs doesn't it?

How to flush the other CPU's tlb? use on_each_cpu() to run __flush_tlb_all()
on each online cpu?

Thanks
Wen Congyang

> 
> -Andi
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ