All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Joerg Roedel <joerg.roedel@amd.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH 04/15] KVM: x86 emulator: Add check_perm callback
Date: Sun, 03 Apr 2011 15:35:28 +0300	[thread overview]
Message-ID: <4D986990.1090604@redhat.com> (raw)
In-Reply-To: <1301667024-29420-5-git-send-email-joerg.roedel@amd.com>

On 04/01/2011 05:10 PM, Joerg Roedel wrote:
> This patch adds a check_perm callback for each opcode into
> the instruction emulator. This will be used to do all
> necessary permission checks on instructions before checking
> whether they are intercepted or not.
>
>
> @@ -216,6 +216,7 @@ struct decode_cache {
>   	u8 seg_override;
>   	unsigned int d;
>   	int (*execute)(struct x86_emulate_ctxt *ctxt);
> +	int (*check_perm)(struct x86_emulate_ctxt *ctxt);

I originally mean to use a group-like structure to have check_perm only 
when needed, but I guess this is a premature optimization. #define D(_y) 
{ .flags = (_y) }
>   #define DI(_y, _i) { .flags = (_y), .intercept = x86_intercept_##_i }
> +#define DIP(_y, _i) { .flags = (_y), .intercept = x86_intercept_##_i, \
> +		      .check_perm = em_check_perm_##_i }

Sorry, this (and all the #defines which follow) are just obfuscating.  I 
set a bad example here, but the following patches show there is nothing 
gained by the ## games.  Please use the full function name.


-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2011-04-03 12:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-01 14:10 [PATCH 0/15] KVM: Make the instruction emulator aware of Nested Virtualization v4 Joerg Roedel
2011-04-01 14:10 ` [PATCH 01/15] KVM: x86 emulator: add framework for instruction intercepts Joerg Roedel
2011-04-01 14:10 ` [PATCH 02/15] KVM: x86 emulator: add SVM intercepts Joerg Roedel
2011-04-01 14:10 ` [PATCH 03/15] KVM: x86 emulator: Don't write-back cpu-state on X86EMUL_INTERCEPTED Joerg Roedel
2011-04-01 14:10 ` [PATCH 04/15] KVM: x86 emulator: Add check_perm callback Joerg Roedel
2011-04-03 12:35   ` Avi Kivity [this message]
2011-04-04 10:23     ` Roedel, Joerg
2011-04-01 14:10 ` [PATCH 05/15] KVM: x86 emulator: Add flag to check for protected mode instructions Joerg Roedel
2011-04-01 14:10 ` [PATCH 06/15] KVM: x86: Add x86 callback for intercept check Joerg Roedel
2011-04-01 14:10 ` [PATCH 07/15] KVM: SVM: Add intercept check for emulated cr accesses Joerg Roedel
2011-04-01 14:10 ` [PATCH 08/15] KVM: SVM: Add intercept check for accessing dr registers Joerg Roedel
2011-04-01 14:10 ` [PATCH 09/15] KVM: SVM: Add intercept checks for descriptor table accesses Joerg Roedel
2011-04-01 14:10 ` [PATCH 10/15] KVM: SVM: Add intercept checks for SVM instructions Joerg Roedel
2011-04-01 14:10 ` [PATCH 11/15] KVM: SVM: Add intercept checks for remaining group7 instructions Joerg Roedel
2011-04-01 14:10 ` [PATCH 12/15] KVM: SVM: Add intercept checks for remaining twobyte instructions Joerg Roedel
2011-04-01 14:10 ` [PATCH 13/15] KVM: SVM: Add intercept checks for one-byte instructions Joerg Roedel
2011-04-01 14:10 ` [PATCH 14/15] KVM: SVM: Add checks for IO instructions Joerg Roedel
2011-04-01 14:10 ` [PATCH 15/15] KVM: SVM: Remove nested sel_cr0_write handling code Joerg Roedel
2011-04-03 12:42 ` [PATCH 0/15] KVM: Make the instruction emulator aware of Nested Virtualization v4 Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2011-04-04 10:39 [PATCH 0/15] KVM: Make the instruction emulator aware of Nested Virtualization v5 Joerg Roedel
2011-04-04 10:39 ` [PATCH 04/15] KVM: x86 emulator: Add check_perm callback Joerg Roedel

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=4D986990.1090604@redhat.com \
    --to=avi@redhat.com \
    --cc=joerg.roedel@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.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.