From: He Chen <he.chen@linux.intel.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Paul Lai <paul.c.lai@intel.com>, Feng Wu <feng.wu@intel.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v7] xen/sm{e, a}p: allow disabling sm{e, a}p for Xen itself
Date: Tue, 11 Oct 2016 10:23:17 +0800 [thread overview]
Message-ID: <20161011022317.GA25468@he> (raw)
In-Reply-To: <57FBA2C9020000780011623F@prv-mh.provo.novell.com>
On Mon, Oct 10, 2016 at 06:16:41AM -0600, Jan Beulich wrote:
> >>> On 09.10.16 at 10:20, <he.chen@linux.intel.com> wrote:
> > Changes in v7:
> > * bugfix: fix the bug that this patch doesn't work on machine without SMAP.
> > * test: This patch has not been tested (on 32-bit PV environment).
> > Really sorry for that since I have took several days trying to
> > setup a 32-bit PV guest but finally failed.
>
> Well, I don't know what to say. And since you don't say what your
> problem is/was, I also don't see how anyone could help.
>
Apologies for sending out a patch without testing it entirely.
To be honest, I am not so fimilar with 32-bit PV guest...
I create a HVM guest and then compile linux kernel with the configuration
suggested by https://wiki.xen.org/wiki/Mainline_Linux_Kernel_Configs
after that, I copy vmlinuz and initramfs from guest to host and I boot
guest with PV cfg file below:
```
name="rhel32"
memory=2048
vcpus=2
on_crash="destroy"
on_poweroff="destroy"
on_reboot="restart"
localtime=0
builder="linux"
kernel="/root/xen_guest/rhel32pv/vmlinuz-4.8.0+"
ramdisk="/root/xen_guest/rhel32pv/initramfs-4.8.0+.img"
extra="root=/dev/xvda"
disk=['file:/root/xen_guest/rhel32pv/rhel32.img,xvda,w',]
vif=[ 'mac=00:15:3e:22:f5:1b','bridge=xenbr0']
```
The guest fail to boot and error message says can not find modules in
/lib/module...
I also try to install a PV guest directly by netboot way, but I am
blocked at "installing kernel" step, error shows and let me try.
The problems are trivial, and may I ask for some "how to build a 32-bit
PV guest on 64-bit host" reference wiki page or threads?
> > @@ -1404,12 +1448,16 @@ void __init noreturn __start_xen(unsigned long mbi_p)
> >
> > if ( !opt_smep )
> > setup_clear_cpu_cap(X86_FEATURE_SMEP);
> > - if ( cpu_has_smep )
> > + else if ( cpu_has_smep && opt_smep == 1 )
>
> How about
>
> if ( cpu_has_smep && opt_smep != SMEP_HVM_ONLY )
>
> (i.e. I dislike both the "else" and the hard-coded 1)? Or if you dislike
> this, then at least > 0 instead of == 1 please, or provide a #define
> just like you do for -1.
Sure, I would use `if ( cpu_has_smep && opt_smep != SMEP_HVM_ONLY )` in
next version.
BTW. In v6 patch, I missed `cpu_has_smep` and that's why this patch is
buggy on the machine without smap/smep hardware feature.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-10-11 2:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-09 8:20 [PATCH v7] xen/sm{e, a}p: allow disabling sm{e, a}p for Xen itself He Chen
2016-10-10 12:16 ` Jan Beulich
2016-10-11 2:23 ` He Chen [this message]
2016-10-11 12:43 ` Jan Beulich
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=20161011022317.GA25468@he \
--to=he.chen@linux.intel.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=feng.wu@intel.com \
--cc=paul.c.lai@intel.com \
--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 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).