All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandru Stefan ISAILA <aisaila@bitdefender.com>
To: Tamas K Lengyel <tamas@tklengyel.com>
Cc: Petre Ovidiu PIRCALABU <ppircalabu@bitdefender.com>,
	"sstabellini@kernel.org" <sstabellini@kernel.org>,
	"julien@xen.org" <julien@xen.org>,
	Razvan COJOCARU <rcojocaru@bitdefender.com>,
	"wl@xen.org" <wl@xen.org>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"George.Dunlap@eu.citrix.com" <George.Dunlap@eu.citrix.com>,
	"andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
	"ian.jackson@eu.citrix.com" <ian.jackson@eu.citrix.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"roger.pau@citrix.com" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH V2 1/2] x86/altp2m: Add hypercall to set a range of sve bits
Date: Thu, 7 Nov 2019 07:46:34 +0000	[thread overview]
Message-ID: <17cc5e81-c229-18fb-41da-64219abb74e7@bitdefender.com> (raw)
In-Reply-To: <CABfawhmw2d1Ktm2Qkpv6gdCJ6vWXWesxQgqgdRqx0edTBkf3jw@mail.gmail.com>



On 06.11.2019 23:06, Tamas K Lengyel wrote:
> On Wed, Nov 6, 2019 at 7:35 AM Alexandru Stefan ISAILA
> <aisaila@bitdefender.com> wrote:
>>
>> By default the sve bits are not set.
>> This patch adds a new hypercall, xc_altp2m_set_supress_ve_multi(),
>> to set a range of sve bits.
>> The core function, p2m_set_suppress_ve_multi(), does not brake in case
>> of a error and it is doing a best effort for setting the bits in the
>> given range. A check for continuation is made in order to have
>> preemption on big ranges.
>>
>> Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com>
>>
>> ---
>> Changes since V1:
>>          - Remove "continue"
>>          - Add a new field in xen_hvm_altp2m_suppress_ve to store the
>> continuation value
>>          - Have p2m_set_suppress_ve_multi() take
>> xen_hvm_altp2m_suppress_ve as a param.
>> ---
>>   tools/libxc/include/xenctrl.h   |  3 ++
>>   tools/libxc/xc_altp2m.c         | 25 ++++++++++++++
>>   xen/arch/x86/hvm/hvm.c          | 20 ++++++++++--
>>   xen/arch/x86/mm/p2m.c           | 58 +++++++++++++++++++++++++++++++++
>>   xen/include/public/hvm/hvm_op.h |  5 ++-
>>   xen/include/xen/mem_access.h    |  3 ++
>>   6 files changed, 111 insertions(+), 3 deletions(-)
>>
>> diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
>> index f4431687b3..21b644f459 100644
>> --- a/tools/libxc/include/xenctrl.h
>> +++ b/tools/libxc/include/xenctrl.h
>> @@ -1923,6 +1923,9 @@ int xc_altp2m_switch_to_view(xc_interface *handle, uint32_t domid,
>>                                uint16_t view_id);
>>   int xc_altp2m_set_suppress_ve(xc_interface *handle, uint32_t domid,
>>                                 uint16_t view_id, xen_pfn_t gfn, bool sve);
>> +int xc_altp2m_set_supress_ve_multi(xc_interface *handle, uint32_t domid,
>> +                                   uint16_t view_id, xen_pfn_t start_gfn,
>> +                                   uint32_t nr, bool sve);
>>   int xc_altp2m_get_suppress_ve(xc_interface *handle, uint32_t domid,
>>                                 uint16_t view_id, xen_pfn_t gfn, bool *sve);
>>   int xc_altp2m_set_mem_access(xc_interface *handle, uint32_t domid,
>> diff --git a/tools/libxc/xc_altp2m.c b/tools/libxc/xc_altp2m.c
>> index 09dad0355e..6605d9abbe 100644
>> --- a/tools/libxc/xc_altp2m.c
>> +++ b/tools/libxc/xc_altp2m.c
>> @@ -234,6 +234,31 @@ int xc_altp2m_set_suppress_ve(xc_interface *handle, uint32_t domid,
>>       return rc;
>>   }
>>
>> +int xc_altp2m_set_supress_ve_multi(xc_interface *handle, uint32_t domid,
>> +                                   uint16_t view_id, xen_pfn_t start_gfn,
>> +                                   uint32_t nr, bool sve)
>> +{
>> +    int rc;
>> +    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
>> +
>> +    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
> 
> Does xc_hypercall_buffer_alloc null-initialize the structure?
> 

It calls xencall_alloc_buffer_pages() which calls memset(p, 0, nr_pages 
* PAGE_SIZE) before returning.

Alex
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-11-07  7:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06 15:35 [Xen-devel] [PATCH V2 1/2] x86/altp2m: Add hypercall to set a range of sve bits Alexandru Stefan ISAILA
2019-11-06 15:35 ` [Xen-devel] [PATCH V2 2/2] x86/mm: Make use of the default access param from xc_altp2m_create_view Alexandru Stefan ISAILA
2019-11-12 12:02   ` Jan Beulich
2019-11-18  8:38     ` Alexandru Stefan ISAILA
2019-11-18  9:53       ` Jan Beulich
2019-11-19 19:31         ` Tamas K Lengyel
2019-11-06 21:06 ` [Xen-devel] [PATCH V2 1/2] x86/altp2m: Add hypercall to set a range of sve bits Tamas K Lengyel
2019-11-07  7:46   ` Alexandru Stefan ISAILA [this message]
2019-11-07 15:00     ` Tamas K Lengyel
2019-11-08  8:31 ` Alexandru Stefan ISAILA
2019-11-12 11:54 ` Jan Beulich
2019-11-12 14:05   ` Tamas K Lengyel
2019-11-12 14:31     ` Jan Beulich
2019-11-13 14:51       ` Tamas K Lengyel
2019-11-13 14:57         ` Tamas K Lengyel
2019-11-13 16:52           ` Jan Beulich
2019-11-13 18:38             ` Tamas K Lengyel
2019-11-18 13:39   ` Alexandru Stefan ISAILA
2019-11-18 13:39   ` Alexandru Stefan ISAILA
2019-11-18 14:09     ` Jan Beulich
2019-11-19  9:05       ` Alexandru Stefan ISAILA
2019-11-19  9:23         ` Jan Beulich
2019-11-20  8:29           ` Alexandru Stefan ISAILA
2019-11-20  8:41             ` Jan Beulich
2019-11-20  8:48               ` Alexandru Stefan ISAILA

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=17cc5e81-c229-18fb-41da-64219abb74e7@bitdefender.com \
    --to=aisaila@bitdefender.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=konrad.wilk@oracle.com \
    --cc=ppircalabu@bitdefender.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=tamas@tklengyel.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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.