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]
Message-ID: <568AD8F3.2050600@oracle.com>
Date:	Mon, 4 Jan 2016 20:41:23 +0000
From:	Joao Martins <joao.m.martins@...cle.com>
To:	Boris Ostrovsky <boris.ostrovsky@...cle.com>,
	linux-kernel@...r.kernel.org, xen-devel@...ts.xen.org
Cc:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	David Vrabel <david.vrabel@...rix.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org
Subject: Re: [PATCH RFC 2/3] x86/xen/time: setup vcpu 0 time info page



On 01/04/2016 04:07 PM, Boris Ostrovsky wrote:
> On 12/28/2015 04:52 PM, Joao Martins wrote:
>> +
>> +static int xen_setup_vsyscall_time_info(int cpu)
>> +{
>> +	struct pvclock_vsyscall_time_info *ti;
>> +	struct vcpu_register_time_memory_area t;
>> +	struct pvclock_vcpu_time_info *pvti;
>> +	unsigned long mem;
>> +	int ret, size;
>> +	u8 flags;
>> +
>> +	ret = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_time_memory_area,
>> +				 cpu, NULL);
>> +	if (ret == -ENOSYS) {
>> +		pr_debug("xen: vcpu_time_info placement not supported\n");
>> +		return -ENOTSUPP;
>> +	}
> 
> I don't think this is necessary.
> 
OK, I will remove it.

>> +
>> +	size = PAGE_ALIGN(sizeof(struct pvclock_vsyscall_time_info));
>> +	mem = memblock_alloc(size, PAGE_SIZE);
>> +	if (!mem)
>> +		return -ENOMEM;
>> +
>> +	ti = __va(mem);
>> +	memset(ti, 0, size);
> 
> Can you just use get_zeroed_page()? (struct pvclock_vsyscall_time_info 
> is always less than a page, isn't it?).
Yeah, I can use get_zeroed_page() (struct pvclock_vsyscall_time_info is always
less than a page).

Additionally perhaps this region shouldn't be freed if PVCLOCK_TSC_STABLE_BIT
isn't supported, because otherwise I would end up corrupting data elsewhere
since the pvti would still be periodically updated by Xen, right?

> 
> 
> -boris
> 
--
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