xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>, Tim Deegan <tim@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@eu.citrix.com>,
	Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>,
	suravee.suthikulpanit@amd.com,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v4 1/2] SVM: support data breakpoint extension registers
Date: Tue, 22 Apr 2014 10:04:35 -0400	[thread overview]
Message-ID: <535676F3.9000408@oracle.com> (raw)
In-Reply-To: <534EB0EE020000780000996A@nat28.tlf.novell.com>

(Sorry for being late).

On 04/16/2014 10:33 AM, Jan Beulich wrote:
> @@ -1451,6 +1551,8 @@ static int svm_msr_read_intercept(unsign
>   
>       switch ( msr )
>       {
> +        unsigned int ecx;
> +
>       case MSR_IA32_SYSENTER_CS:
>           *msr_content = v->arch.hvm_svm.guest_sysenter_cs;
>           break;
> @@ -1526,6 +1628,21 @@ static int svm_msr_read_intercept(unsign
>           vpmu_do_rdmsr(msr, msr_content);
>           break;
>   
> +    case MSR_AMD64_DR0_ADDRESS_MASK:
> +        hvm_cpuid(0x80000001, NULL, NULL, &ecx, NULL);
> +        if ( !test_bit(X86_FEATURE_DBEXT & 31, &ecx) )
> +            goto gpf;
> +        *msr_content = v->arch.hvm_svm.dr_mask[0];
> +        break;
> +
> +    case MSR_AMD64_DR1_ADDRESS_MASK ... MSR_AMD64_DR3_ADDRESS_MASK:
> +        hvm_cpuid(0x80000001, NULL, NULL, &ecx, NULL);
> +        if ( !test_bit(X86_FEATURE_DBEXT & 31, &ecx) )
> +            goto gpf;
> +        *msr_content =
> +            v->arch.hvm_svm.dr_mask[msr - MSR_AMD64_DR1_ADDRESS_MASK + 1];
> +        break;
> +

Can you merge these two cases (here and in write_intercept)? They are 
doing logically the same thing, the only difference is index calculation 
(and you can have a macro or something similar for that).

-boris

  parent reply	other threads:[~2014-04-22 14:01 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16 14:23 [PATCH v4 0/2] x86/AMD support data breakpoint extension registers Jan Beulich
2014-04-16 14:33 ` [PATCH v4 1/2] SVM: " Jan Beulich
2014-04-16 14:47   ` Aravind Gopalakrishnan
2014-04-22 14:04   ` Boris Ostrovsky [this message]
2014-04-22 14:04     ` Jan Beulich
2014-04-22 14:17       ` Boris Ostrovsky
2014-04-22 14:32         ` Jan Beulich
2014-04-24  8:21   ` Ian Campbell
2014-04-24  8:30     ` Jan Beulich
2014-04-16 14:34 ` [PATCH v4 2/2] x86/PV: " Jan Beulich
2014-04-16 14:48   ` Aravind Gopalakrishnan
2014-04-23 10:23   ` Ian Campbell
2014-04-23 11:52     ` Jan Beulich
2014-04-23 12:23       ` Ian Campbell
2014-04-23 12:35         ` Jan Beulich
2014-04-23 12:39           ` Ian Campbell
2014-04-23 12:50             ` Jan Beulich
2014-04-23 13:03               ` Jan Beulich
2014-04-23 13:35                 ` Ian Campbell
2014-04-16 14:35 ` [PATCH v4 3/2] libxc/PV: save/restore " Jan Beulich
2014-04-22 12:37 ` Ping: [PATCH v4 0/2] x86/AMD support " 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=535676F3.9000408@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=Ian.Campbell@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=aravind.gopalakrishnan@amd.com \
    --cc=keir@xen.org \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=tim@xen.org \
    --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).