All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eugene Fedotov <e.fedotov@samsung.com>
To: xen-devel@lists.xen.org
Subject: Re: [PATCH v4 8/9] xen/arm: Implement hypercall for dirty page tracing
Date: Mon, 07 Oct 2013 19:51:22 +0400	[thread overview]
Message-ID: <5252D87A.2050305@samsung.com> (raw)
In-Reply-To: <5252B0EC.4010809@citrix.com>

07.10.2013 17:02, Julien Grall:
> I think checking !page_fault is nearly everywhere is error-prone when
> this function will be modified.
>
> Can you do something like this?
>
> if ( page_fault )
>    // Your code to handle page fault
> else
> {
>    // handle_mmio
> }
>
> It will avoid && !page_fault.
Yes, but I think at page fault condition we should check whether address 
belong MMIO regions (page fault at MMIO addr is possible, but we don't 
need that memory to transfer)
>
>> >          goto bad_data_abort;
>> >  
>> >      rc = gva_to_ipa(info.gva, &info.gpa);
>> >-    if ( rc == -EFAULT )
>> >+    if ( rc == -EFAULT && !page_fault )
>> >          goto bad_data_abort;
>> >  
>> >      /* XXX: Decode the instruction if ISS is not valid */
>> >-    if ( !dabt.valid )
>> >+    if ( !dabt.valid && !page_fault )
>> >          goto bad_data_abort;
>> >  
>> >      /*
>> >       * Erratum 766422: Thumb store translation fault to Hypervisor may
>> >       * not have correct HSR Rt value.
>> >       */
>> >-    if ( cpu_has_erratum_766422() && (regs->cpsr & PSR_THUMB) && dabt.write )
>> >+    if ( cpu_has_erratum_766422() && (regs->cpsr & PSR_THUMB) && dabt.write
>> >+            && !page_fault)
>> >      {
>> >          rc = decode_instruction(regs, &info.dabt);
>> >          if ( rc )
>> >@@ -1358,6 +1361,16 @@ static void do_trap_data_abort_guest(struct cpu_user_regs *regs,
>> >          return;
>> >      }
>> >  
>> >+    /* handle permission fault on write */
>> >+    if ( page_fault )
>> >+    {
>> >+        if ( current->domain->arch.dirty.mode == 0 )
>> >+           goto bad_data_abort;
>> >+
>> >+        handle_page_fault(current->domain, info.gpa);
> You must call advance_pc(regs, hsr) here.
>
Let me explain. I think the difference between handle_page_fault and 
handle_mmio is that the ongoing memory operation (that trapped here) 
should be repeated after handle_page_fault (the page fault handler 
clears read-only bit), but should be stepped out after handle_mmio (to 
do this we call advance_pc to increase the pc register). So, advance_pc 
is intentionally missed.

Best regards,
Evgeny.

  reply	other threads:[~2013-10-07 15:51 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-04  4:43 [PATCH v4 0/9] xen/arm: live migration support in arndale board Jaeyong Yoo
2013-10-04  4:43 ` [PATCH v4 1/9] xen/arm: Implement hvm save and restore Jaeyong Yoo
2013-10-07 12:49   ` Julien Grall
2013-10-04  4:43 ` [PATCH v4 2/9] xen/arm: Add more registers for saving and restoring vcpu registers Jaeyong Yoo
2013-10-10 10:40   ` Ian Campbell
2013-10-11  8:30     ` Jaeyong Yoo
2013-10-11  8:43       ` Ian Campbell
2013-10-11 10:22         ` Tim Deegan
2013-10-11 10:25           ` Ian Campbell
2013-10-14  4:39             ` Jaeyong Yoo
2013-10-17  2:14               ` Jaeyong Yoo
2013-10-17 10:01                 ` Ian Campbell
2013-10-04  4:43 ` [PATCH v4 3/9] xen/arm: Implement set_memory_map hypercall for arm Jaeyong Yoo
2013-10-10 10:56   ` Ian Campbell
2013-10-11 10:06     ` Eugene Fedotov
2013-10-11 10:09       ` Ian Campbell
2013-10-11 10:18         ` Tim Deegan
2013-10-31  8:56         ` Eugene Fedotov
2013-11-01  9:04           ` Ian Campbell
2013-11-01  9:14           ` Ian Campbell
2013-11-01  9:51             ` Eugene Fedotov
2013-11-01  9:48               ` Ian Campbell
2013-11-01 10:08                 ` Eugene Fedotov
2013-11-01 10:30                   ` Ian Campbell
2013-10-04  4:44 ` [PATCH v4 4/9] xen/arm: Implement get_maximum_gpfn " Jaeyong Yoo
2013-10-04  4:44 ` [PATCH v4 5/9] xen/arm: Implement modify_returncode Jaeyong Yoo
2013-10-04  4:44 ` [PATCH v4 6/9] xen/arm: Fixing clear_guest_offset macro Jaeyong Yoo
2013-10-07 12:53   ` Julien Grall
2013-10-10 12:00     ` Ian Campbell
2013-10-04  4:44 ` [PATCH v4 7/9] xen/arm: Implement virtual-linear page table for guest p2m mapping in live migration Jaeyong Yoo
2013-10-16 12:50   ` Ian Campbell
2013-10-17  8:58     ` Jaeyong Yoo
2013-10-17 10:06       ` Ian Campbell
2013-10-17 10:25         ` Jaeyong Yoo
2013-10-04  4:44 ` [PATCH v4 8/9] xen/arm: Implement hypercall for dirty page tracing Jaeyong Yoo
2013-10-07 13:02   ` Julien Grall
2013-10-07 15:51     ` Eugene Fedotov [this message]
2013-10-10 14:10       ` Julien Grall
2013-10-16 13:44   ` Ian Campbell
2013-10-17 10:12     ` Jaeyong Yoo
2013-10-17 10:30       ` Ian Campbell
2013-10-17 11:05         ` Jaeyong Yoo
2013-10-17 11:47           ` Ian Campbell
2013-10-18  4:17             ` Jaeyong Yoo
2013-10-18  9:11               ` Ian Campbell
2013-10-04  4:44 ` [PATCH v4 9/9] xen/arm: Implement toolstack for xl restore/save and migrate Jaeyong Yoo
2013-10-16 13:55   ` Ian Campbell
2013-10-17 10:14     ` Jaeyong Yoo
  -- strict thread matches above, loose matches on Subject: below --
2013-10-08  6:29 [PATCH v4 8/9] xen/arm: Implement hypercall for dirty page tracing Jaeyong Yoo
2013-10-08  8:46 ` Ian Campbell
2013-10-08  9:46   ` Jaeyong Yoo
2013-10-08 15:36     ` Eugene Fedotov
2013-10-10 14:13       ` Julien Grall
2013-10-16 13:44         ` Ian Campbell
2013-10-20  4:22 Jaeyong Yoo

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=5252D87A.2050305@samsung.com \
    --to=e.fedotov@samsung.com \
    --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.