xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Kevin Tian <kevin.tian@intel.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Razvan Cojocaru <rcojocaru@bitdefender.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Tim Deegan <tim@xen.org>, Xen-devel <xen-devel@lists.xen.org>,
	Julien Grall <julien.grall@arm.com>,
	Paul Durrant <paul.durrant@citrix.com>,
	Tamas K Lengyel <tamas@tklengyel.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Brian Woods <brian.woods@amd.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [PATCH 4/7] x86/hvm: Rename v->arch.hvm_vcpu to v->arch.hvm
Date: Thu, 30 Aug 2018 17:03:45 +0100	[thread overview]
Message-ID: <c6a0604c-01ba-0a8a-349a-9f38d0a940e3@citrix.com> (raw)
In-Reply-To: <5B8804B302000078001E391B@prv1-mh.provo.novell.com>

On 30/08/18 15:52, Jan Beulich wrote:
>>>> On 28.08.18 at 19:39, <andrew.cooper3@citrix.com> wrote:
>>>> On 28.08.18 at 19:39, <andrew.cooper3@citrix.com> wrote:
>> The trailing _vcpu suffix is redundant, but adds to code volume.  Drop it.
>>
>> Reflow lines as appropriate, and switch to using the new XFREE/etc wrappers
>> where applicable.
> I couldn't find any such conversion, so perhaps better to delete that
> part of the description.

Fixed.

>
>> No functional change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Thanks.

>
>> @@ -3888,19 +3886,19 @@ void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip)
>>      v->arch.user_regs.rip = ip;
>>      memset(&v->arch.debugreg, 0, sizeof(v->arch.debugreg));
>>  
>> -    v->arch.hvm_vcpu.guest_cr[0] = X86_CR0_ET;
>> +    v->arch.hvm.guest_cr[0] = X86_CR0_ET;
>>      hvm_update_guest_cr(v, 0);
>>  
>> -    v->arch.hvm_vcpu.guest_cr[2] = 0;
>> +    v->arch.hvm.guest_cr[2] = 0;
>>      hvm_update_guest_cr(v, 2);
>>  
>> -    v->arch.hvm_vcpu.guest_cr[3] = 0;
>> +    v->arch.hvm.guest_cr[3] = 0;
>>      hvm_update_guest_cr(v, 3);
>>  
>> -    v->arch.hvm_vcpu.guest_cr[4] = 0;
>> +    v->arch.hvm.guest_cr[4] = 0;
>>      hvm_update_guest_cr(v, 4);
>>  
>> -    v->arch.hvm_vcpu.guest_efer = 0;
>> +    v->arch.hvm.guest_efer = 0;
>>      hvm_update_guest_efer(v);
> Noticing this, a thought unrelated to this series: Wouldn't we be better off
> setting all the structure fields first, and only then invoke all the functions?
> Just like arch_set_info_hvm_guest() does?

Actually, arch_set_info_hvm_guest() is broken in a related way.  When
nested virt is in the mix, the usual rules for which control bits can be
changed are relaxed, and you can get into a number of corner cases where
these helpers don't do the correct thing.  (e.g. when a 32bit PAE guest
tries vmexiting to a PCID hypervisor).

Resolving this mess is on the todo list, which includes this function,
and others.

~Andrew

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

  reply	other threads:[~2018-08-30 16:03 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28 17:38 [PATCH 0/7] x86: Structure naming and consistency improvements Andrew Cooper
2018-08-28 17:39 ` [PATCH 1/7] x86/pv: Rename d->arch.pv_domain to d->arch.pv Andrew Cooper
2018-08-29  7:45   ` Wei Liu
2018-08-29 15:55   ` Jan Beulich
2018-08-28 17:39 ` [PATCH 2/7] x86/pv: Rename v->arch.pv_vcpu to v->arch.pv Andrew Cooper
2018-08-29  7:53   ` Wei Liu
2018-08-29 16:01   ` Jan Beulich
2018-08-28 17:39 ` [PATCH 3/7] xen/hvm: Rename d->arch.hvm_domain to d->arch.hvm Andrew Cooper
2018-08-28 18:56   ` Razvan Cojocaru
2018-08-29  7:56   ` Wei Liu
2018-08-30  1:34   ` Tian, Kevin
2018-08-30 14:39   ` Jan Beulich
2018-08-30 16:44   ` Julien Grall
2018-09-03  8:11   ` Paul Durrant
2018-08-28 17:39 ` [PATCH 4/7] x86/hvm: Rename v->arch.hvm_vcpu to v->arch.hvm Andrew Cooper
2018-08-28 18:59   ` Razvan Cojocaru
2018-08-29  7:57   ` Wei Liu
2018-08-30  1:34   ` Tian, Kevin
2018-08-30 14:52   ` Jan Beulich
2018-08-30 16:03     ` Andrew Cooper [this message]
2018-09-03  8:13   ` Paul Durrant
2018-08-28 17:39 ` [PATCH 5/7] x86/vtx: Rename arch_vmx_struct to vmx_vcpu Andrew Cooper
2018-08-29  8:03   ` Wei Liu
2018-08-29 11:17     ` Andrew Cooper
2018-08-29 13:16       ` Wei Liu
2018-08-30  1:36   ` Tian, Kevin
2018-08-30 14:54   ` Jan Beulich
2018-08-30 15:47     ` Andrew Cooper
2018-08-31  1:35       ` Tian, Kevin
2018-08-28 17:39 ` [PATCH 6/7] x86/svm: Rename arch_svm_struct to svm_vcpu Andrew Cooper
2018-08-30 14:54   ` Jan Beulich
2018-08-28 17:39 ` [PATCH 7/7] x86/hvm: Drop hvm_{vmx,svm} shorthands Andrew Cooper
2018-08-29  8:03   ` Wei Liu
2018-08-30  1:39   ` Tian, Kevin
2018-08-30 16:08     ` Andrew Cooper
2018-08-30 15:03   ` Jan Beulich
2018-08-30 23:11   ` Boris Ostrovsky
2018-08-30 23:14     ` Boris Ostrovsky
2018-08-30 23:18       ` Andrew Cooper

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=c6a0604c-01ba-0a8a-349a-9f38d0a940e3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=brian.woods@amd.com \
    --cc=julien.grall@arm.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=paul.durrant@citrix.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=tamas@tklengyel.com \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).