Re: [PATCH v3 4/5] KVM/x86/vPMU: Add APIs to support host save/restore the guest lbr stack

From: Peter Zijlstra
Date: Thu Sep 20 2018 - 08:17:43 EST


On Thu, Sep 20, 2018 at 06:05:58PM +0800, Wei Wang wrote:
> diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h
> index 1562863..a91fdef 100644
> --- a/arch/x86/events/perf_event.h
> +++ b/arch/x86/events/perf_event.h
> @@ -223,6 +223,7 @@ struct cpu_hw_events {
> */
> u64 intel_ctrl_guest_mask;
> u64 intel_ctrl_host_mask;
> + bool guest_lbr;
> struct perf_guest_switch_msr guest_switch_msrs[X86_PMC_IDX_MAX];
>
> /*

Please, no bools in aggregate types.

Either use a bitfield or u8, there's more LBR related bools, convert and
group the lot to avoid holes.