All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: kevin.tian@intel.com, suravee.suthikulpanit@amd.com,
	andrew.cooper3@citrix.com, tim@xen.org,
	dietmar.hahn@ts.fujitsu.com, xen-devel@lists.xen.org,
	Aravind.Gopalakrishnan@amd.com, jun.nakajima@intel.com,
	dgdegra@tycho.nsa.gov
Subject: Re: [PATCH v20 02/13] x86/VPMU: Add public xenpmu.h
Date: Mon, 20 Apr 2015 12:38:04 -0400	[thread overview]
Message-ID: <55352B6C.3040300@oracle.com> (raw)
In-Reply-To: <5534D9E80200007800073962@mail.emea.novell.com>


On 04/20/2015 04:50 AM, Jan Beulich wrote:
>>>> On 09.04.15 at 17:44, <boris.ostrovsky@oracle.com> wrote:
>> --- /dev/null
>> +++ b/xen/include/public/pmu.h
>> @@ -0,0 +1,38 @@
>> +#ifndef __XEN_PUBLIC_PMU_H__
>> +#define __XEN_PUBLIC_PMU_H__
>> +
>> +#include "xen.h"
>> +#if defined(__i386__) || defined(__x86_64__)
>> +#include "arch-x86/pmu.h"
>> +#elif defined (__arm__) || defined (__aarch64__)
>> +#include "arch-arm.h"
>> +#else
>> +#error "Unsupported architecture"
>> +#endif
>> +
>> +#define XENPMU_VER_MAJ    0
>> +#define XENPMU_VER_MIN    1
>> +
>> +
>> +/* Shared between hypervisor and PV domain */
>> +struct xen_pmu_data {
> Iirc this sharing is r/o - if so, please state so in the comment. If not,
> please extend the comment to briefly explain why writable sharing
> is safe/secure.

This data structure is writeable by guest (specifically, PMU registers 
and APIC_LVTPC). There is a flag (PMU_CACHED, which is part of this 
structure) that the hypervisor sets to let the guest know that it can 
write those fields without having to trap. When the guest is done, it 
issues XENPMU_flush command and the hypervisor writes out those values 
to HW.

I'll update the comments to make this clear.

-boris

  reply	other threads:[~2015-04-20 16:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09 15:44 [PATCH v20 00/13] x86/PMU: Xen PMU PV(H) support Boris Ostrovsky
2015-04-09 15:44 ` [PATCH v20 01/13] common/symbols: Export hypervisor symbols to privileged guest Boris Ostrovsky
2015-04-09 15:44 ` [PATCH v20 02/13] x86/VPMU: Add public xenpmu.h Boris Ostrovsky
2015-04-20  8:50   ` Jan Beulich
2015-04-20 16:38     ` Boris Ostrovsky [this message]
2015-04-21  7:53       ` Jan Beulich
2015-04-21 13:38         ` Boris Ostrovsky
2015-04-21 14:03           ` Jan Beulich
2015-04-09 15:44 ` [PATCH v20 03/13] x86/VPMU: Make vpmu not HVM-specific Boris Ostrovsky
2015-04-09 15:44 ` [PATCH v20 04/13] x86/VPMU: Interface for setting PMU mode and flags Boris Ostrovsky
2015-04-09 15:44 ` [PATCH v20 05/13] x86/VPMU: Initialize VPMUs with __initcall Boris Ostrovsky
2015-04-09 15:44 ` [PATCH v20 06/13] x86/VPMU: Initialize PMU for PV(H) guests Boris Ostrovsky
2015-04-20  9:00   ` Jan Beulich
2015-04-09 15:44 ` [PATCH v20 07/13] x86/VPMU: Save VPMU state for PV guests during context switch Boris Ostrovsky
2015-04-09 15:44 ` [PATCH v20 08/13] x86/VPMU: When handling MSR accesses, leave fault injection to callers Boris Ostrovsky
2015-04-09 15:44 ` [PATCH v20 09/13] x86/VPMU: Add support for PMU register handling on PV guests Boris Ostrovsky
2015-04-09 15:44 ` [PATCH v20 10/13] x86/VPMU: Handle PMU interrupts for PV(H) guests Boris Ostrovsky
2015-04-09 15:44 ` [PATCH v20 11/13] x86/VPMU: Merge vpmu_rdmsr and vpmu_wrmsr Boris Ostrovsky
2015-04-09 15:44 ` [PATCH v20 12/13] x86/VPMU: Add privileged PMU mode Boris Ostrovsky
2015-04-09 15:44 ` [PATCH v20 13/13] x86/VPMU: Move VPMU files up from hvm/ directory Boris Ostrovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55352B6C.3040300@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=Aravind.Gopalakrishnan@amd.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=dietmar.hahn@ts.fujitsu.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.