All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Huang <w1.huang@samsung.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xen.org
Cc: keir@xen.org, ian.campbell@citrix.com,
	stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com,
	julien.grall@linaro.org, tim@xen.org, jaeyong.yoo@samsung.com,
	jbeulich@suse.com, yjhyun.yoo@samsung.com
Subject: Re: [RFC v3 4/6] xen/arm: Add save/restore support for guest core registers
Date: Fri, 09 May 2014 11:35:18 -0500	[thread overview]
Message-ID: <536D03C6.4080800@samsung.com> (raw)
In-Reply-To: <536C0EF9.3080303@citrix.com>

On 05/08/2014 06:10 PM, Andrew Cooper wrote:
> On 08/05/2014 22:18, Wei Huang wrote:
>> +#ifdef CONFIG_ARM_32
>> +    v->arch.ifar = ctxt.ifar;
>> +    v->arch.dfar = ctxt.dfar;
>> +    v->arch.dfsr = ctxt.dfsr;
>> +#else
>> +    v->arch.far = ctxt.far;
>> +    v->arch.esr = ctxt.esr;
>> +#endif
>
> Where you have code like this, please use a union in the structure to
> reduce its size.
I thought about it from your comments. We can only combine ifar and dfar 
into the far register. But it became a bit confusing. Will try again.
>
>> +    /* ======= Guest Core Registers =======
>> +     *   - Each reg is multiplexed for AArch64 and AArch32 guests, if possible
>> +     *   - Each comments, /AArch64_reg, AArch32_reg/, describes its
>> +     *     corresponding 64- and 32-bit register name. "NA" means
>> +     *     "Not Applicable".
>> +     *   - Check "struct vcpu_guest_core_regs" for details.
>> +     */
>> +    uint64_t x0;     /* x0, r0_usr */
>> +    uint64_t x1;     /* x1, r1_usr */
>> +    uint64_t x2;     /* x2, r2_usr */
>> +    uint64_t x3;     /* x3, r3_usr */
>> +    uint64_t x4;     /* x4, r4_usr */
>> +    uint64_t x5;     /* x5, r5_usr */
>> +    uint64_t x6;     /* x6, r6_usr */
>> +    uint64_t x7;     /* x7, r7_usr */
>> +    uint64_t x8;     /* x8, r8_usr */
>> +    uint64_t x9;     /* x9, r9_usr */
>> +    uint64_t x10;    /* x10, r10_usr */
>> +    uint64_t x11;    /* x11, r11_usr */
>> +    uint64_t x12;    /* x12, r12_usr */
>> +    uint64_t x13;    /* x13, sp_usr */
>> +    uint64_t x14;    /* x14, lr_usr; */
>> +    uint64_t x15;    /* x15, __unused_sp_hyp */
>> +    uint64_t x16;    /* x16, lr_irq */
>> +    uint64_t x17;    /* x17, sp_irq */
>> +    uint64_t x18;    /* x18, lr_svc */
>> +    uint64_t x19;    /* x19, sp_svc */
>> +    uint64_t x20;    /* x20, lr_abt */
>> +    uint64_t x21;    /* x21, sp_abt */
>> +    uint64_t x22;    /* x22, lr_und */
>> +    uint64_t x23;    /* x23, sp_und */
>> +    uint64_t x24;    /* x24, r8_fiq */
>> +    uint64_t x25;    /* x25, r9_fiq */
>> +    uint64_t x26;    /* x26, r10_fiq */
>> +    uint64_t x27;    /* x27, r11_fiq */
>> +    uint64_t x28;    /* x28, r12_fiq */
>> +    uint64_t x29;    /* fp, sp_fiq */
>> +    uint64_t x30;    /* lr, lr_fiq */
>
> Please use "uint64_t x[31];" and some loops.
>
Register multiplexing is very confusing when 32-bit VM is running on a 
64-bit Xen. Even though your request is reasonable, I still consider 
expanding the register names here helpful. At least it gives me space to 
add comments to show the register mapping layout. I believe others will 
find it useful as well.

  reply	other threads:[~2014-05-09 16:35 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08 21:18 [RFC v3 0/6] xen/arm: ARM save/restore/migration support Wei Huang
2014-05-08 21:18 ` [RFC v3 1/6] xen/arm: Add basic save/restore support for ARM Wei Huang
2014-05-08 22:11   ` Andrew Cooper
2014-05-08 22:20     ` Wei Huang
2014-05-09  8:56       ` Julien Grall
2014-05-14 10:27         ` Ian Campbell
2014-05-14 10:25     ` Ian Campbell
2014-05-14 10:46       ` Andrew Cooper
2014-05-14 13:22         ` Ian Campbell
2014-05-09  9:06   ` Julien Grall
2014-05-09  9:42   ` Jan Beulich
2014-05-14 10:37   ` Ian Campbell
2014-05-14 18:54     ` Wei Huang
2014-05-08 21:18 ` [RFC v3 2/6] xen/arm: Add save/restore support for ARM GIC V2 Wei Huang
2014-05-08 22:47   ` Andrew Cooper
2014-05-09 14:12     ` Wei Huang
2014-05-09 14:24       ` Ian Campbell
2014-05-11 16:15         ` Julien Grall
2014-05-13 14:53     ` Wei Huang
2014-05-09  9:17   ` Julien Grall
2014-05-14 11:07   ` Ian Campbell
2014-05-14 12:05     ` Julien Grall
2014-05-14 12:23       ` Tim Deegan
2014-05-14 13:24         ` Ian Campbell
2014-05-15 17:15   ` Julien Grall
2014-05-16  7:36     ` Ian Campbell
2014-05-08 21:18 ` [RFC v3 3/6] xen/arm: Add save/restore support for ARM arch timer Wei Huang
2014-05-08 23:02   ` Andrew Cooper
2014-05-11  9:01     ` Julien Grall
2014-05-11  8:58   ` Julien Grall
2014-05-12  8:35     ` Ian Campbell
2014-05-12 11:42       ` Julien Grall
2014-05-14 11:14   ` Ian Campbell
2014-05-14 12:13     ` Julien Grall
2014-05-14 13:23       ` Ian Campbell
2014-05-14 19:04     ` Wei Huang
2014-05-08 21:18 ` [RFC v3 4/6] xen/arm: Add save/restore support for guest core registers Wei Huang
2014-05-08 23:10   ` Andrew Cooper
2014-05-09 16:35     ` Wei Huang [this message]
2014-05-09 16:52       ` Ian Campbell
2014-05-11  9:06   ` Julien Grall
2014-05-14 11:16     ` Ian Campbell
2014-05-14 12:23       ` Julien Grall
2014-05-14 13:25         ` Ian Campbell
2014-05-14 13:31           ` Julien Grall
2014-05-14 11:37   ` Ian Campbell
2014-05-08 21:18 ` [RFC v3 5/6] xen/arm: Add log_dirty support for ARM Wei Huang
2014-05-08 23:46   ` Andrew Cooper
2014-05-14 11:51     ` Ian Campbell
2014-05-11 15:28   ` Julien Grall
2014-05-12 14:00     ` Wei Huang
2014-05-12 14:11       ` Julien Grall
2014-05-14 12:04         ` Ian Campbell
2014-05-14 11:57     ` Ian Campbell
2014-05-14 12:20       ` Julien Grall
2014-05-14 13:24         ` Ian Campbell
2014-05-14 13:18   ` Ian Campbell
2014-05-16 10:59   ` Julien Grall
2014-05-08 21:18 ` [RFC v3 6/6] xen/arm: Implement toolstack for xl restore/save/migration Wei Huang
2014-05-14 13:20   ` Ian Campbell
2014-05-14 13:24     ` Andrew Cooper
2014-05-11  9:23 ` [RFC v3 0/6] xen/arm: ARM save/restore/migration support Julien Grall
2014-05-12 14:37   ` Wei Huang
2014-05-13 14:41     ` Julien Grall
2014-05-12 14:17 ` Julien Grall
2014-05-12 14:52   ` Wei Huang
2014-05-12 15:01     ` Ian Campbell

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=536D03C6.4080800@samsung.com \
    --to=w1.huang@samsung.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jaeyong.yoo@samsung.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@linaro.org \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    --cc=yjhyun.yoo@samsung.com \
    /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.