Re: [PATCH 04/15] KVM: x86 emulator: Add check_perm callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux