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: <4E8AECE2.7090206@redhat.com>
Date:	Tue, 04 Oct 2011 13:24:18 +0200
From:	Avi Kivity <avi@...hat.com>
To:	Gleb Natapov <gleb@...hat.com>
CC:	linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
	joerg.roedel@....com, mingo@...e.hu, a.p.zijlstra@...llo.nl
Subject: Re: [PATCH 8/9] KVM, VMX: Add support for guest/host-only profiling

On 10/04/2011 01:17 PM, Gleb Natapov wrote:
> >
> >  I mean, CONFIG_KVM&&  !CONFIG_PERF_EVENTS is an unlikely
> >  combination.  If you're using kvm, you usually want PERF_EVENTS.
> >
> Who knows. Think about someone building appliance with embedded KVM and
> trying to achieve minimal code footprint.

Saving a few dozen bytes, then launching a 1GB guest?

> It is much easier to add ifdefs
> at the development stage then trying to figure out later what can be
> ifdeffed. If we will do:
>   if (!(cnt = perf_guest_get_msrs_count())
> 	return;
>
> at the beginning of atomic_switch_perf_msrs() then compiler can
> eliminate dead code in case of !CONFIG_PERF_EVENTS since
> perf_guest_get_msrs_count() will become 0, but this will add two
> function calls on vmentry in CONFIG_PERF_EVENTS case.
>

Then move it to the beginning:

    nr_msrs = perf_get_guest_msrs(&msr_buffer);
    for (i = 0; i < nr_msrs; ++i)
           add_atomic_switch_msr((*msr_buffer)[i], nr);

the compiler will kill the loop if nr_msrs is statically 0.

-- 
error compiling committee.c: too many arguments to function

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