From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
xen-devel <xen-devel@lists.xenproject.org>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>,
suravee.suthikulpanit@amd.com
Subject: Re: [PATCH 3/4] x86/SVM: don't exceed segment limit when fetching instruction bytes
Date: Wed, 11 Nov 2015 16:01:38 +0000 [thread overview]
Message-ID: <56436662.9020003@citrix.com> (raw)
In-Reply-To: <56423A0202000078000B3861@prv-mh.provo.novell.com>
On 10/11/15 17:40, Jan Beulich wrote:
> Also consistently use the vmcb local variable whenever possible.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> with one trivial fix.
>
> --- a/xen/arch/x86/hvm/svm/emulate.c
> +++ b/xen/arch/x86/hvm/svm/emulate.c
> @@ -47,12 +47,17 @@ static unsigned int is_prefix(u8 opc)
> return 0;
> }
>
> -static unsigned long svm_rip2pointer(struct vcpu *v)
> +static unsigned long svm_rip2pointer(struct vcpu *v, unsigned long *limit)
> {
> struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
> - unsigned long p = vmcb->cs.base + guest_cpu_user_regs()->eip;
> + unsigned long p = vmcb->cs.base + vmcb->rip;
> +
> if ( !(vmcb->cs.attr.fields.l && hvm_long_mode_enabled(v)) )
> + {
> + *limit = vmcb->cs.limit;
> return (u32)p; /* mask to 32 bits */
> + }
> + *limit = ~0UL;
> return p;
> }
>
> @@ -125,11 +130,10 @@ static const u8 *const opc_bytes[INSTR_M
> [INSTR_INVLPGA] = OPCODE_INVLPGA,
> };
>
> -static int fetch(struct vcpu *v, u8 *buf, unsigned long addr, int len)
> +static bool_t fetch(const struct vmcb_struct *vmcb, u8 *buf,
> + unsigned long addr, unsigned int len)
(mis)indentation of addr
~Andrew
next prev parent reply other threads:[~2015-11-11 16:01 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-10 17:35 [PATCH 0/4] x86: XSA-156 follow-ups Jan Beulich
2015-11-10 17:38 ` [PATCH 1/4] x86/HVM: don't inject #DB with error code Jan Beulich
2015-11-10 17:42 ` Andrew Cooper
2015-12-03 7:46 ` Tian, Kevin
2015-12-03 8:14 ` Jan Beulich
2015-12-03 8:38 ` Tian, Kevin
2015-12-03 9:09 ` Jan Beulich
2015-11-10 17:39 ` [PATCH 2/4] x86/HVM: unify and fix #UD intercept Jan Beulich
2015-11-10 17:51 ` Andrew Cooper
2015-12-03 7:49 ` Tian, Kevin
2015-11-10 17:40 ` [PATCH 3/4] x86/SVM: don't exceed segment limit when fetching instruction bytes Jan Beulich
2015-11-10 18:27 ` Boris Ostrovsky
2015-11-11 16:01 ` Andrew Cooper [this message]
2015-11-10 17:40 ` [PATCH 4/4] x86/traps: honor EXT bit in error codes Jan Beulich
2015-11-10 18:20 ` Andrew Cooper
2015-11-11 8:50 ` Jan Beulich
2015-11-11 9:23 ` [PATCH v2 " Jan Beulich
2015-11-11 15:50 ` Andrew Cooper
2015-12-03 9:04 ` Tian, Kevin
2015-11-11 8:33 ` [PATCH RFC 5/4] x86: #PF error code adjustments Jan Beulich
2015-11-11 16:30 ` Andrew Cooper
2015-11-12 10:12 ` Jan Beulich
2015-11-11 8:39 ` [PATCH 6/4] x86/event: correct debug event generation Jan Beulich
2015-11-11 8:47 ` Razvan Cojocaru
2015-11-11 16:09 ` 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=56436662.9020003@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=aravind.gopalakrishnan@amd.com \
--cc=boris.ostrovsky@oracle.com \
--cc=suravee.suthikulpanit@amd.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 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.