Re: [Xen-devel] [PATCH] x86/hvm: Fix use-after-free introduced by c/s 428607a

2016-02-02 Thread Corneliu ZUZU
in the future. Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com> --- CC: Jan Beulich <jbeul...@suse.com> CC: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/hvm/hvm.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/hvm.c

Re: [Xen-devel] [PATCH] x86/hvm: Fix use-after-free introduced by c/s 428607a

2016-02-02 Thread Corneliu ZUZU
On 2/2/2016 12:52 PM, Jan Beulich wrote: NULLing the pointers would cause things like rtc_deinit() to always blow up when it followed the NULL pointer. IMO, we should unconditionally always NULL pointers when freeing a pointer which isn't in local scope. It would make issues such as these

Re: [Xen-devel] [PATCH] x86/hvm: Fix use-after-free introduced by c/s 428607a

2016-02-02 Thread Corneliu ZUZU
On 2/2/2016 2:05 PM, Andrew Cooper wrote: Xen and PV guests share the virtual address space, in exactly the same way as a native kernel and its userspace. PV guests can map pages at 0. Therefore, if Xen were to accidentally follow a NULL pointer, it may not result in a pagefault. (Hardware

Re: [Xen-devel] [PATCH] x86: shrink 'struct domain', was already PAGE_SIZE

2016-02-01 Thread Corneliu ZUZU
/xfree it @ hvm_domain_initialise/hvm_domain_destroy. After this change, the domain structure shrunk w/ 1152 bytes (>1K!). Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Reviewed-by: Jan Beulich <jbeul...@suse.com> albeit ... --- a/xen/include/asm-x86/hvm/vpt.h +++ b/xen/include/asm-x86/hvm/v

Re: [Xen-devel] [PATCH] x86: shrink 'struct domain', was already PAGE_SIZE

2016-02-01 Thread Corneliu ZUZU
On 2/1/2016 1:07 PM, Andrew Cooper wrote: On 01/02/16 07:42, Corneliu ZUZU wrote: The X86 domain structure already occupied PAGE_SIZE (4096). Looking @ the memory layout of the structure, we could see that overall most was occupied by (used the pahole tool on domain.o): * sizeof(domain.arch

[Xen-devel] [PATCH] x86: shrink 'struct domain', was already PAGE_SIZE

2016-01-31 Thread Corneliu ZUZU
;1K!). Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/hvm/hpet.c | 5 ++--- xen/arch/x86/hvm/hvm.c | 9 - xen/arch/x86/hvm/pmtimer.c | 18 +- xen/arch/x86/hvm/rtc.c | 5 ++--- xen/arch/x86/hvm/vpt.c

[Xen-devel] X86 arch_domain ginormous, sizeof(struct domain) already == PAGE_SIZE

2016-01-29 Thread Corneliu ZUZU
I'm trying to refactor some arch-specific code into common code and was surprised to find out that the x86 domain structure already occupies PAGE_SIZE bytes, couldn't even add an unsigned short field in it w/o causing a compile-time error. I'm using the master branch of

Re: [Xen-devel] X86 arch_domain ginormous, sizeof(struct domain) already == PAGE_SIZE

2016-01-29 Thread Corneliu ZUZU
On 1/29/2016 6:47 PM, Lengyel, Tamas wrote: by leaving there only the x86-specific part, i.e.: struct { uint8_t mov_to_msr_enabled : 1; uint8_t mov_to_msr_extended : 1; } monitor; and moving the rest directly into the domain

Re: [Xen-devel] X86 arch_domain ginormous, sizeof(struct domain) already == PAGE_SIZE

2016-01-29 Thread Corneliu ZUZU
On 1/29/2016 7:09 PM, Jan Beulich wrote: On 29.01.16 at 17:24, wrote: One could shrink the domain structure by transforming some of its fields to pointers, e.g. I could transform the pl_time field into a pointer and dynamically allocate its data when domain_create is

Re: [Xen-devel] [PATCH] ARM: Support for guest-request vm-events

2016-01-28 Thread Corneliu ZUZU
On 1/28/2016 2:45 PM, Ian Campbell wrote: On Thu, 2016-01-28 at 14:36 +0200, CORNELIU ZUZU wrote: On 1/28/2016 1:23 PM, Ian Campbell wrote: On Thu, 2016-01-28 at 13:17 +0200, Corneliu ZUZU wrote: This patch implements ARM support for guest-request vm-events. The code has been ported from x86

Re: [Xen-devel] [PATCH] ARM: Support for guest-request vm-events

2016-01-28 Thread CORNELIU ZUZU
On 1/28/2016 1:23 PM, Ian Campbell wrote: On Thu, 2016-01-28 at 13:17 +0200, Corneliu ZUZU wrote: This patch implements ARM support for guest-request vm-events. The code has been ported from x86 side w/ minor adjustments. I've not looked at the patch yet, but if it only involves minor

[Xen-devel] [PATCH] ARM: Support for guest-request vm-events

2016-01-28 Thread Corneliu ZUZU
This patch implements ARM support for guest-request vm-events. The code has been ported from x86 side w/ minor adjustments. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/arm/Makefile | 2 + xen/arch/arm/event.c| 86 +++

[Xen-devel] [PATCH V2] arm: p2m.c bug-fix: hypervisor hang on __p2m_get_mem_access

2016-01-27 Thread Corneliu ZUZU
ookup call from __p2m_get_mem_access with a call to __p2m_lookup. Following Ian's suggestion, we also add an ASSERT to ensure that the p2m lock is taken upon __p2m_get_mem_access entry. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/arm/p2m.c | 4 +++- 1 file changed, 3 inse

[Xen-devel] [PATCH] arm: p2m.c bug-fix: hypervisor hang on __p2m_get_mem_access

2016-01-26 Thread Corneliu ZUZU
ookup call from __p2m_get_mem_access with a call to __p2m_lookup. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/arm/p2m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 2190908..a9157e5 100644 --- a/xen/arch/arm

<    1   2   3   4