Following Pope Francis' comments in his homily on December 20, 2013 that the Blessed Virgin Mary may have felt "cheated", deceived, or weakened in faith when confronted with her Son's crucifixion, there has been a lively interest in the topic of our Blessed Lady's knowledge, particularly when referring to her acceptance of the redemptive death of her Son Jesus. Leaving aside the interpretation of the pope's words in particular for those who are more adept at parsing papal statements, we shall confine ourselves to the question of the knowledge of the Blessed Virgin. What exactly did she know about her Son's mission, and when did she know it? This is an interesting question, one in which we can easily fall into extremes. As always, it is best to begin with Tradition.
What is the traditional understanding of this question? Undoubtedly, as an excellent article on Rorate Caeli points out, the consensus of tradition is that the fiat of the Blessed Virgin was absolute. This means that she affirmed not only God's will for her in bringing forth the Messiah, but also God's will for the Messiah, including His suffering and death, which were foretold to the Blessed Virgin Mary through the words of holy Simeon, who told her "Behold, a sword shall pierce your own heart" (Luke 2:34-35). Mary knew our Lord would suffer, and knew that she would suffer with Him, and she accepted this in accepting her Divine Maternity.
While Rorate is correct in affirming the consensus of the most learned theologians on this question, we must point out that it was not always a universal consensus. There was a minority view in antiquity who presumed that this "piercing" referred to an actual doubt or lack of faith. Origen (Hom. xvii), Titus, Theophylact and other minor Fathers seem to say Mary doubted. Cornelius Lapide, in his commentary on Luke 2, however, notes that this would be counter to the sense of the Church:
"This, however, is an error, for such a feeling were unworthy [of the Blessed Virgin], and that she experienced it is counter to the common sense of the Church. For so the Blessed Virgin would have sinned by unbelief. Indeed, the authors cited are sometimes explained as meaning by “doubt,” admiration, mental perturbation, and inward questionings."
Lapide's last point is important, for while we cannot attribute the sin of unbelief to the Blessed Virgin, it is not unreasonable to think that on a purely human level, she would experience "mental perturbation" at witnessing her Son being put to such a cruel death. Even Christ Himself, in His human nature, did not necessarily like the idea of flogging and crucifixion ("If there be any way, let this cup pass from Me"). It is in this sense that St. John Damascene remarks, “The pains she had escaped in childbirth she bore at the time of His Passion, so that she felt her bosom torn asunder by reason of the depth of her maternal love.”  It is for this reason that the doctors teach that the Blessed Virgin was a martyr, and more than a martyr.
Yes, the Blessed Virgin clearly had knowledge of the destiny of her Son to suffer for the sins of the world. She knew He was the Messiah, the Lamb of God, and that His redemptive death was His destiny, and that she, too, would suffer with Him in some manner. In all this she did not doubt God's goodness, nor her Son's words, nor His mission. This is the consensus of the Church, and really the only possible one if we agree that Mary is sinless.
However, we also need to be precise here. Mary, for all her perfections, was still a pilgrim on this earth, a viator, who walks by faith. Her knowledge was not infused but dependent upon faith. Because she was perfected in grace, we can presume that her act of faith was so perfect, so certain, as to almost approach knowledge. But still, by virtue of her human nature, she remained a viator walking by faith, even though this faith was perfect. We know that Mary never lost faith, that she never doubted - but to say she never doubted is not the same thing as to say that she possessed full knowledge.
For example, Mary knew Jesus would suffer. But did she know from the beginning that the manner of His suffering would be crucifixion? Did she know it would be flogging followed by a torturous mile long walk dragging the cross to the jeering mob? She knew He would suffer death, but did she know that He would be betrayed and condemned by His own people? Did she know His side would be thrust through with a spear? And even if she did know these things, is it unreasonable that she may have been shocked in actually witnessing them? In short, just because we have affirmed that Mary lacked no faith, this is not to say there is not room for an element of surprise or, as Lapide says, "mental perturbation." Mary could have very easily had full knowledge that her Son was to suffer but still be surprised and saddened at the manner of His death, which may have been hidden from her.
This is not to detract from the perfect faith of the Blessed Virgin, but only to make a necessary distinction between the faith of a viator (such as Mary) and the knowledge of a comprehensor (such as Christ, who experienced the Beatific Vision in His earthly life). Everything that was accessible to Mary through Faith, as revealed by Christ, the prophecies of Simeon and the words of the angel, Mary had perfect confidence in. But the knowledge of all the particulars was not necessarily contained in those revelations, thus leaving room for shock, surprise, perturbation and all the other human responses that are part of suffering.
Therefore, while we must certainly affirm that our Blessed Lady could not have felt "deceived" or lost faith at this pivotal moment, we must also refrain from assuming heresy simply because somebody asserts Mary did not have full knowledge of every particular point. Both positions are consonant with tradition and balance each other out.
 St. John Damascene, de Fide, lib. iv. cap. xv.